探索事件
parent
f588bc7c36
commit
738ef9c1e2
|
@ -29,6 +29,8 @@ public enum FightType {
|
|||
QIJIE_FIGHT(23), //七界试炼
|
||||
CrossYuxulundaoFight(24),//玉虚论道
|
||||
CrossLingMaiSecretFight(25),//灵脉秘境
|
||||
ExploreShouChao(26),//兽潮来袭
|
||||
ExploreXinMo(27),//心魔试炼
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
|
|
@ -391,6 +391,13 @@ public class RedisKey {
|
|||
*/
|
||||
public final static String POWER_RICE_RANK = "POWER_RICE_RANK";
|
||||
|
||||
/**
|
||||
* 探索排行榜
|
||||
* key:
|
||||
*/
|
||||
public final static String EXPLORE_RANK = "EXPLORE_RANK";
|
||||
|
||||
|
||||
/**
|
||||
* 四灵挑战数据转移到mongo记录
|
||||
*/
|
||||
|
|
|
@ -391,4 +391,7 @@ public interface BIReason {
|
|||
int ARCHITECTURE_EARNINGS =1236;//浮生门建筑收益
|
||||
int ARCHITECTURE_RANK_UP_LEVEL =1237;//浮生门建筑突破消耗
|
||||
|
||||
int EXPLORE_EVENT_BOX =1238;//探索试炼宝箱
|
||||
int EXPLORE_EVENT_MONSTER =1239;//探索兽潮
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package com.ljsd.jieling.handler.explorerMap;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.fight.FightType;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.gtw.GetWorldArenaChallengeRequestHandler;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.dao.KeyVal;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightDispatcher;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SArenaSetting;
|
||||
import config.SExploreEvent;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.ExplorerMapEventRequest> {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.ExplorerMapEventRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession session, PlayerInfoProto.ExplorerMapEventRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
PlayerInfoProto.ExplorerMapEventResponse.Builder builder = PlayerInfoProto.ExplorerMapEventResponse.newBuilder();
|
||||
int id = proto.getId();
|
||||
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
|
||||
if(!exploreEventConfig.containsKey(id)){
|
||||
return;
|
||||
}
|
||||
List<KeyVal> eventList = user.getPlayerInfoManager().getExploreEvent();
|
||||
int index = 0;
|
||||
for(int i =0;i<eventList.size();i++){
|
||||
if(index == 0 && eventList.get(i).getKey() == id){
|
||||
index = i;
|
||||
}
|
||||
if(index != 0 && eventList.get(i).getKey() == id){
|
||||
if(eventList.get(i).getVal()<eventList.get(index).getVal()){
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 1兽潮
|
||||
2心魔
|
||||
3宝箱*/
|
||||
if(exploreEventConfig.get(id).getType() == 1){
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 20, "",
|
||||
GameFightType.ExploreShouChaoFight, exploreEventConfig.get(id).getMonsterGroup(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
.setFightSeed(fightResult.getSeed())
|
||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
||||
.addAllMonsterList(fightResult.getMonsterTeamList())
|
||||
.setFightType(FightType.CrossLingMaiSecretFight.getType())
|
||||
.setFightId(FightUtil.getFightId(user.getId(), FightType.CrossLingMaiSecretFight.getType()))
|
||||
.build();
|
||||
builder.setFightData(fightData);
|
||||
builder.setFightResult(fightResult.getResult());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_MONSTER);
|
||||
builder.setDrop(drop);
|
||||
}else if(exploreEventConfig.get(id).getType() == 2){
|
||||
int defUid = user.getPlayerInfoManager().getExploreEventMatchDefUid();
|
||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(defUid);
|
||||
if (csPlayer == null){
|
||||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||
}
|
||||
CrossArenaManager crossArenaManager = null;
|
||||
if(GameApplication.serverId != csPlayer.getServerId()){
|
||||
crossArenaManager = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
|
||||
}
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user,TeamEnum.FORMATION_NORMAL.getTeamId(), null, null);
|
||||
//对手 修行等级 区服名称 战斗类行 积分变化情况
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, TeamEnum.FORMATION_NORMAL.getTeamId(), null, crossArenaManager);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid,
|
||||
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce< csPlayer.getMainLineForce(),FightType.ExploreXinMo);
|
||||
int seed = fightResult.getSeed();
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime())
|
||||
.setFightSeed(seed)
|
||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
||||
.addMonsterList(fightResult.getDefFightTeamInfo())
|
||||
.setFightType(FightType.ExploreXinMo.getType())
|
||||
.setFightId(FightUtil.getFightId(uid, FightType.ExploreXinMo.getType()))
|
||||
.build();
|
||||
builder.setFightData(fightData);
|
||||
builder.setFightResult( (int) fightResult.getCheckResult()[0]);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_MONSTER);
|
||||
builder.setDrop(drop);
|
||||
}else if(exploreEventConfig.get(id).getType() == 3){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_BOX);
|
||||
builder.setDrop(drop);
|
||||
}
|
||||
eventList.remove(index);
|
||||
user.getPlayerInfoManager().setExploreEvent(eventList);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.ljsd.jieling.handler.explorerMap;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerInfoProto.ExplorerXMEventChallengeBeforeRequest> {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.ExplorerXMEventChallengeBeforeRequest;
|
||||
}
|
||||
@Override
|
||||
public void processWithProto(ISession session, PlayerInfoProto.ExplorerXMEventChallengeBeforeRequest proto) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.Builder builder = PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.newBuilder();
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.FORCE_CURR_RANK,String.valueOf(crossGroup),false);
|
||||
Set<ZSetOperations.TypedTuple<String>> forceZetSort = RedisUtil.getInstence().getAllZsetRange(key);
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
final int forcelimit = force+force*500/10000;
|
||||
int matchUid = forceZetSort.stream().filter(n -> n.getScore() >= forcelimit).map(v -> Integer.parseInt(v.getValue())).findAny().orElse(0);
|
||||
if(matchUid == 0){
|
||||
List<ZSetOperations.TypedTuple<String>> lst = new ArrayList<ZSetOperations.TypedTuple<String>>(forceZetSort); //
|
||||
if(lst.size()>0){
|
||||
matchUid = Integer.parseInt(lst.get(0).getValue());
|
||||
}
|
||||
}
|
||||
//TODO
|
||||
user.getPlayerInfoManager().setExploreEventMatchDefUid(matchUid);
|
||||
builder.setDefTeamInfo( PlayerLogic.getInstance().getCrossYxldOneTeamInfo(matchUid, new ArrayList<Integer>(TeamEnum.FORMATION_NORMAL.getTeamId())));
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.CrossYuXuLunDaoChallengeBeforeResponse.getNumber(), builder.build(), true);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package com.ljsd.jieling.handler.explorerMap;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
|
||||
import com.ljsd.jieling.logic.dao.ExplorerInfo;
|
||||
import com.ljsd.jieling.logic.dao.KeyVal;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -44,6 +46,11 @@ public class ExplorerMapInfoHandler extends BaseHandler<PlayerInfoProto.Explorer
|
|||
}
|
||||
builder.addExploreInfo(record);
|
||||
}
|
||||
|
||||
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
|
||||
for(KeyVal keyVal:event){
|
||||
builder.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).build());
|
||||
}
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapInfoResponse.getNumber(), builder.build(), true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import com.ljsd.jieling.logic.dao.ExplorerInfo;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
@ -66,6 +68,9 @@ public class ExplorerMapSendHandler extends BaseHandler<PlayerInfoProto.Explorer
|
|||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapSendResponse.getNumber(), builder.build(), true);
|
||||
return;
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_FOOD_NUM,
|
||||
map.values().stream().mapToInt(Integer::intValue).sum());
|
||||
|
||||
for (CommonProto.ExplorerMapSendInfo info : reqInfo) {
|
||||
int mapId = info.getMapId();
|
||||
int teamId = info.getTeamId();
|
||||
|
|
|
@ -239,6 +239,35 @@ public class CumulationData {
|
|||
public Map<Integer, Integer> activate_treasure_skill_num = new HashMap<>();
|
||||
|
||||
|
||||
//探索
|
||||
/**
|
||||
* 探索食物消耗总量达到num
|
||||
*/
|
||||
public int exploreFood_num;
|
||||
/**
|
||||
* 探索击败敌人数量达到num个
|
||||
*/
|
||||
public int exploreEnemy_num;
|
||||
/**
|
||||
* 击退兽潮来袭num次
|
||||
*/
|
||||
public int exploreRepelMonster_num;
|
||||
/**
|
||||
* 击败心魔镜像num次
|
||||
*/
|
||||
public int exploreRepelXinmo_num;
|
||||
|
||||
/**
|
||||
* 拾取云梦礼num次
|
||||
*/
|
||||
public int explorePickYm_num;
|
||||
/**
|
||||
* 探索杀敌排行历史最高名次达到num
|
||||
*/
|
||||
public int exploreKillerHistoryHigh_num;
|
||||
|
||||
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
}
|
||||
|
@ -535,4 +564,53 @@ public class CumulationData {
|
|||
public void setActivate_treasure_skill_num(Map<Integer, Integer> activate_treasure_skill_num) {
|
||||
this.activate_treasure_skill_num = activate_treasure_skill_num;
|
||||
}
|
||||
|
||||
|
||||
public int getExploreFood_num() {
|
||||
return exploreFood_num;
|
||||
}
|
||||
|
||||
public void setExploreFood_num(int exploreFood_num) {
|
||||
this.exploreFood_num = exploreFood_num;
|
||||
}
|
||||
|
||||
public int getExploreEnemy_num() {
|
||||
return exploreEnemy_num;
|
||||
}
|
||||
|
||||
public void setExploreEnemy_num(int exploreEnemy_num) {
|
||||
this.exploreEnemy_num = exploreEnemy_num;
|
||||
}
|
||||
|
||||
public int getExploreRepelMonster_num() {
|
||||
return exploreRepelMonster_num;
|
||||
}
|
||||
|
||||
public void setExploreRepelMonster_num(int exploreRepelMonster_num) {
|
||||
this.exploreRepelMonster_num = exploreRepelMonster_num;
|
||||
}
|
||||
|
||||
public int getExploreRepelXinmo_num() {
|
||||
return exploreRepelXinmo_num;
|
||||
}
|
||||
|
||||
public void setExploreRepelXinmo_num(int exploreRepelXinmo_num) {
|
||||
this.exploreRepelXinmo_num = exploreRepelXinmo_num;
|
||||
}
|
||||
|
||||
public int getExplorePickYm_num() {
|
||||
return explorePickYm_num;
|
||||
}
|
||||
|
||||
public void setExplorePickYm_num(int explorePickYm_num) {
|
||||
this.explorePickYm_num = explorePickYm_num;
|
||||
}
|
||||
|
||||
public int getExploreKillerHistoryHigh_num() {
|
||||
return exploreKillerHistoryHigh_num;
|
||||
}
|
||||
|
||||
public void setExploreKillerHistoryHigh_num(int exploreKillerHistoryHigh_num) {
|
||||
this.exploreKillerHistoryHigh_num = exploreKillerHistoryHigh_num;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ public class ExplorerInfo extends MongoBase {
|
|||
|
||||
private Map<Integer,Integer> dropMap = new HashMap<>();//掉落
|
||||
|
||||
private List <KeyVal> randomEvent = new ArrayList<KeyVal>();//随机事件
|
||||
|
||||
public ExplorerInfo() {
|
||||
|
||||
}
|
||||
|
@ -142,4 +144,13 @@ public class ExplorerInfo extends MongoBase {
|
|||
updateString("deathNum", deathNum);
|
||||
this.deathNum = deathNum;
|
||||
}
|
||||
|
||||
public List<KeyVal> getRandomEvent() {
|
||||
return randomEvent;
|
||||
}
|
||||
|
||||
public void addRandomEvent(KeyVal keyValEvent) {
|
||||
this.randomEvent.add(keyValEvent) ;
|
||||
updateString("randomEvent", randomEvent);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
public class KeyVal {
|
||||
|
||||
private int key;
|
||||
private int val;
|
||||
|
||||
public KeyVal(int key, int val) {
|
||||
this.key = key;
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(int key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public int getVal() {
|
||||
return val;
|
||||
}
|
||||
|
||||
public void setVal(int val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
|
@ -200,6 +200,8 @@ public class PlayerManager extends MongoBase {
|
|||
private int getFiveStarHeroNum;
|
||||
//探索
|
||||
private Map<Integer,ExplorerInfo> explorer = new HashMap<>(); //<teamId,队伍数据>
|
||||
private List<KeyVal> exploreEvent = new ArrayList<>();//随机事件
|
||||
private int exploreEventMatchDefUid;//探索事件 镜像心魔 匹配对手uid
|
||||
/**
|
||||
* 浮生阁建筑列表
|
||||
*/
|
||||
|
@ -1402,4 +1404,25 @@ public class PlayerManager extends MongoBase {
|
|||
this.explorer = explorer;
|
||||
updateString("explorer",explorer);
|
||||
}
|
||||
|
||||
public List<KeyVal> getExploreEvent() {
|
||||
return exploreEvent;
|
||||
}
|
||||
public void addExploreEvent(KeyVal keyVal) {
|
||||
this.exploreEvent.add(keyVal);
|
||||
updateString("exploreEvent",exploreEvent);
|
||||
}
|
||||
public void setExploreEvent(List<KeyVal> exploreEvent) {
|
||||
this.exploreEvent = exploreEvent;
|
||||
updateString("exploreEvent",exploreEvent);
|
||||
}
|
||||
|
||||
public int getExploreEventMatchDefUid() {
|
||||
return exploreEventMatchDefUid;
|
||||
}
|
||||
|
||||
public void setExploreEventMatchDefUid(int exploreEventMatchDefUid) {
|
||||
this.exploreEventMatchDefUid = exploreEventMatchDefUid;
|
||||
updateString("exploreEventMatchDefUid",exploreEventMatchDefUid);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ public class UserMissionManager extends MongoBase {
|
|||
private MistyTripMissionType mistyTripMissionType = new MistyTripMissionType();//缥缈之旅
|
||||
private HomeMissionType homeMissionType = new HomeMissionType();//家园任务
|
||||
private DonghaiXunxianMissionType donghaiXunxianMission = new DonghaiXunxianMissionType();//东海寻仙
|
||||
private ExploreMissionType exploreMissionType = new ExploreMissionType();//探索
|
||||
|
||||
//数据累加项
|
||||
private CumulationData cumulationData = new CumulationData();
|
||||
|
@ -677,6 +678,10 @@ public class UserMissionManager extends MongoBase {
|
|||
// 家园任务
|
||||
homeMissionType.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.HOME_MISSION),cumulationData);
|
||||
updateString("homeMissionType",homeMissionType);
|
||||
//探索
|
||||
exploreMissionType.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.EXPLORE),cumulationData);
|
||||
updateString("exploreMissionType",exploreMissionType);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -959,4 +964,12 @@ public class UserMissionManager extends MongoBase {
|
|||
public void setDonghaiXunxianData(CumulationData donghaiXunxianData) {
|
||||
this.donghaiXunxianData = donghaiXunxianData;
|
||||
}
|
||||
|
||||
public ExploreMissionType getExploreMissionType() {
|
||||
return exploreMissionType;
|
||||
}
|
||||
|
||||
public void setExploreMissionType(ExploreMissionType exploreMissionType) {
|
||||
this.exploreMissionType = exploreMissionType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,22 +14,19 @@ import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
|||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.ExplorerInfo;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SExplore;
|
||||
import config.SExploreFight;
|
||||
import config.SSpecialConfig;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -41,6 +38,7 @@ import util.StringUtil;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ExplorerMapLogic {
|
||||
|
||||
|
@ -181,6 +179,9 @@ public class ExplorerMapLogic {
|
|||
explorerInfo.setEnemyReliveTime(time + exploreConfig.getBattleInterval());
|
||||
}
|
||||
LOGGER.info("{}怪物死亡=》重生时间{}", user.getId(), explorerInfo.getEnemyReliveTime());
|
||||
RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).addRank(user.getId(),"",1);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMY_NUM);
|
||||
|
||||
}
|
||||
|
||||
if (time == 0) {
|
||||
|
@ -395,6 +396,12 @@ public class ExplorerMapLogic {
|
|||
if (delayId.size() > 0) {
|
||||
user.getPlayerInfoManager().setExplorer(explorer);
|
||||
}
|
||||
//整点刷出随机事件
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
if(minute == 0){
|
||||
sendRandomEvent(user);
|
||||
}
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -402,6 +409,20 @@ public class ExplorerMapLogic {
|
|||
}
|
||||
}
|
||||
|
||||
public static void sendRandomEvent(User user){
|
||||
//map
|
||||
Map<Integer, SExplore> config = STableManager.getConfig(SExplore.class);
|
||||
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
|
||||
List<SExplore> limitConfig = config.values().stream().filter(n->n.getLevel()>= user.getPlayerInfoManager().getLevel()).collect(Collectors.toList());
|
||||
Random random = new Random();
|
||||
int ranomMapId = random.nextInt(limitConfig.size());
|
||||
SExplore rankExplore = limitConfig.get(ranomMapId);
|
||||
user.getPlayerInfoManager().getExploreEvent();
|
||||
|
||||
int rankEventId = random.nextInt(rankExplore.getEventList().length);
|
||||
int eventId = rankExplore.getEventList()[rankEventId];
|
||||
user.getPlayerInfoManager().getExploreEvent().add(new KeyVal(eventId,TimeUtils.nowInt()+exploreEventConfig.get(eventId).getTime()));
|
||||
}
|
||||
public static class Instance {
|
||||
public final static ExplorerMapLogic instance = new ExplorerMapLogic();
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ public enum GameFightType {
|
|||
FourChallenge(FightType.FourChallenge,new DefaultWithoutHandFightHandler(),null),
|
||||
SevenWorld(FightType.QIJIE_FIGHT,new SevenWorldFightHandler(),null),
|
||||
CrossLingMaiSecretFight(FightType.CrossLingMaiSecretFight,new DefaultWithoutHandFightHandler(),null),
|
||||
;
|
||||
ExploreShouChaoFight(FightType.ExploreShouChao,new DefaultWithoutHandFightHandler(),null),;
|
||||
|
||||
|
||||
|
||||
private FightType fightType;
|
||||
|
|
|
@ -147,4 +147,6 @@ public enum GameEvent {
|
|||
DONGHAIXUNXIAN_UPDATE,//东海寻仙,任务进度更新
|
||||
DONGHAIXUNXIAN_REWARD,//东海寻仙,任务奖励
|
||||
|
||||
EXPLORE,//探索
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public enum GameMisionType {
|
|||
MISTY_TRIP_MISSION(13),//缥缈之旅
|
||||
HOME_MISSION(14),//家园任务
|
||||
DONGHAIXUNXIAN_MISSION(15),//东海寻仙
|
||||
EXPLORE(16),//探索
|
||||
;
|
||||
private int type;
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ public class MissionLoigc {
|
|||
getMistyTripMission(user,missionList);
|
||||
getHomeMission(user,missionList);
|
||||
getDonghaiXunxianMission(user,missionList);
|
||||
getExploreMission(user,missionList);
|
||||
// 此方法必须放在最后,对所有获取到的任务进行处理
|
||||
// checkMissionTime(missionList);
|
||||
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
|
||||
|
@ -596,6 +597,29 @@ public class MissionLoigc {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void getExploreMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
ExploreMissionType dailyMissionIdsType = userMissionManager.getExploreMissionType();
|
||||
CumulationData dailyCumulationData = userMissionManager.getCumulationData();
|
||||
Set<Integer> doingMissionIds = dailyMissionIdsType.getDoingMissionIds();
|
||||
Set<Integer> finishMissionIds = dailyMissionIdsType.getFinishMissionIds();
|
||||
Map<Integer, SExploreTask> config = STableManager.getConfig(SExploreTask.class);
|
||||
int type = GameMisionType.EXPLORE.getType();
|
||||
for(SExploreTask exploreTask:config.values()){
|
||||
int state = 2;
|
||||
int missionId = exploreTask.getId();
|
||||
int progrss = exploreTask.getValues()[1][0];
|
||||
if(doingMissionIds.contains(missionId)){
|
||||
state = 0;
|
||||
progrss = getDoingProgress(user,dailyCumulationData,exploreTask.getType(),exploreTask.getValues()[0]);
|
||||
}else if(finishMissionIds.contains(missionId)){
|
||||
state = 1;
|
||||
}
|
||||
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(type).setProgress(progrss).build());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取天宫寻宝任务列表
|
||||
* @param user
|
||||
|
@ -1255,6 +1279,24 @@ public class MissionLoigc {
|
|||
//副本挑战次数
|
||||
count = cumulationData.daily_challenge_count;
|
||||
break;
|
||||
case EXPLORE_FOOD_NUM: //探索食物消耗总量达到num
|
||||
count = cumulationData.exploreFood_num;
|
||||
break;
|
||||
case EXPLORE_ENEMY_NUM: //探索击败敌人数量达到num个
|
||||
count = cumulationData.exploreEnemy_num;
|
||||
break;
|
||||
case EXPLORE_REPELMONSTER_NUM://击退兽潮来袭num次
|
||||
count = cumulationData.exploreRepelMonster_num;
|
||||
break;
|
||||
case EXPLORE_REPELXINMO_NUM: //击败心魔镜像num次
|
||||
count = cumulationData.exploreRepelXinmo_num;
|
||||
break;
|
||||
case EXPLORE_PICKYM_NUM://拾取云梦礼num次
|
||||
count = cumulationData.explorePickYm_num;
|
||||
break;
|
||||
case EXPLORE_ENEMYHISTORYHIGH_NUM://探索杀敌排行历史最高名次达到num
|
||||
count = cumulationData.exploreKillerHistoryHigh_num;
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
|
|
|
@ -161,6 +161,15 @@ public enum MissionType {
|
|||
HOME_ARCHITECTURE_TOTAL_LV(151),//家园建筑总等级
|
||||
|
||||
HAVE_ID_STAR_LV_POKEMON_NUM(152),//拥有指定ID的star星级level等级的灵兽num个
|
||||
|
||||
//探索
|
||||
EXPLORE_FOOD_NUM(153), //探索食物消耗总量达到num
|
||||
EXPLORE_ENEMY_NUM(154), //探索击败敌人数量达到num个
|
||||
EXPLORE_REPELMONSTER_NUM(155),//击退兽潮来袭num次
|
||||
EXPLORE_REPELXINMO_NUM(156), //击败心魔镜像num次
|
||||
EXPLORE_PICKYM_NUM(157),//拾取云梦礼num次
|
||||
EXPLORE_ENEMYHISTORYHIGH_NUM(158),//探索杀敌排行历史最高名次达到num
|
||||
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
@ -185,6 +185,18 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.GET_TRANSFIGURATION_CARD_NUM,new TransfigurationCardNumManager());//获取quality品质的变身卡num张
|
||||
judges.put(MissionType.GET_TREASURE_SKILL_NUM,new TreasureSkillNumManager());//激活quality品质的法宝聚灵技能num个
|
||||
judges.put(MissionType.HAVE_ID_STAR_LV_POKEMON_NUM,new IdStarLvPokemonNumManager());//拥有指定ID的star星级level等级的灵兽num个
|
||||
|
||||
//探索
|
||||
judges.put(MissionType.EXPLORE_FOOD_NUM,new ExploreFoodManager());
|
||||
judges.put(MissionType.EXPLORE_ENEMY_NUM,new ExploreEnemyManager());
|
||||
judges.put(MissionType.EXPLORE_REPELMONSTER_NUM,new ExploreRepelMonsterManager());
|
||||
judges.put(MissionType.EXPLORE_REPELXINMO_NUM,new ExploreRepelXinmoManager());
|
||||
judges.put(MissionType.EXPLORE_PICKYM_NUM,new ExplorePickYmManager());
|
||||
judges.put(MissionType.EXPLORE_ENEMYHISTORYHIGH_NUM,new ExploreEnemyHistoryHighManager());
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExploreEnemyHistoryHighManager implements BaseDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.exploreKillerHistoryHigh_num++;
|
||||
}
|
||||
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExploreEnemyManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.exploreEnemy_num++;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExploreFoodManager implements BaseDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.exploreFood_num+=(int)parm[1];
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExplorePickYmManager implements BaseDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.explorePickYm_num++;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExploreRepelMonsterManager implements BaseDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.exploreRepelMonster_num++;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class ExploreRepelXinmoManager implements BaseDataManager{
|
||||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm){
|
||||
|
||||
MissionType type = (MissionType) parm[0];
|
||||
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
|
||||
data.exploreRepelXinmo_num++;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -228,6 +228,18 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.MISTY_TRIP,typeList);
|
||||
eventProcessor.put(GameEvent.MISTY_TRIP,new MistyTripEventProcessor());
|
||||
|
||||
//探索
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.EXPLORE_FOOD_NUM);
|
||||
typeList.add(MissionType.EXPLORE_ENEMY_NUM);
|
||||
typeList.add(MissionType.EXPLORE_REPELMONSTER_NUM);
|
||||
typeList.add(MissionType.EXPLORE_REPELXINMO_NUM);
|
||||
typeList.add(MissionType.EXPLORE_PICKYM_NUM);
|
||||
typeList.add(MissionType.EXPLORE_ENEMYHISTORYHIGH_NUM);
|
||||
eventEnumListMap.put(GameEvent.EXPLORE,typeList);
|
||||
eventProcessor.put(GameEvent.EXPLORE,new CumulationDataEventProcessor());
|
||||
|
||||
|
||||
// 领取奖励
|
||||
eventProcessor.put(GameEvent.VIP_MISSION_REWARD,new RewardEventProcessor());
|
||||
eventProcessor.put(GameEvent.DAILY_MISSION_REWARD,new RewardEventProcessor());
|
||||
|
@ -609,6 +621,7 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.put(GameMisionType.MISTY_TRIP_MISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.HOME_MISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.DONGHAIXUNXIAN_MISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.EXPLORE, new ArrayList<>());
|
||||
} else {
|
||||
missionTypeEnumListMap.get(GameMisionType.VIPMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.DAILYMISSION).clear();
|
||||
|
@ -625,6 +638,7 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.get(GameMisionType.MISTY_TRIP_MISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.HOME_MISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.DONGHAIXUNXIAN_MISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.EXPLORE).clear();
|
||||
}
|
||||
threadMissionChangeList.set(missionTypeEnumListMap);
|
||||
}
|
||||
|
@ -704,6 +718,11 @@ public class MissionEventDistributor {
|
|||
SThemeActivityTaskConfig config = SThemeActivityTaskConfig.idTaskConfig.get(missionStateChangeInfo.getMissionId());
|
||||
progress = MissionLoigc.getDoingProgress(user,user.getUserMissionManager().getDonghaiXunxianData(), config.getTaskType(), config.getTaskValue()[0]);
|
||||
}
|
||||
//TODO
|
||||
if (gameMisionType == GameMisionType.EXPLORE){
|
||||
SExploreTask exploreTask = STableManager.getConfig(SExploreTask.class).get(missionStateChangeInfo.getMissionId());
|
||||
progress = MissionLoigc.getDoingProgress(user,user.getUserMissionManager().getDonghaiXunxianData(), exploreTask.getType(), exploreTask.getValues()[0]);
|
||||
}
|
||||
}
|
||||
// 已完成或者已领取的任务
|
||||
if(missionState == MissionState.FINISH || missionState == MissionState.REWARD){
|
||||
|
@ -735,6 +754,10 @@ public class MissionEventDistributor {
|
|||
SThemeActivityTaskConfig config = SThemeActivityTaskConfig.idTaskConfig.get(missionStateChangeInfo.getMissionId());
|
||||
progress = config.getTaskValue()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.EXPLORE){
|
||||
SExploreTask exploreTask = STableManager.getConfig(SExploreTask.class).get(missionStateChangeInfo.getMissionId());
|
||||
progress = exploreTask.getValues()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.SEVENMISSION){
|
||||
STreasureTaskConfig sTreasureTaskConfig = STreasureTaskConfig.sTreasureTaskConfigMap.get(missionStateChangeInfo.getMissionId());
|
||||
if(sTreasureTaskConfig.getTaskType() != MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
package com.ljsd.jieling.logic.mission.main;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.MistyTripEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
||||
import com.ljsd.jieling.logic.mission.MissionState;
|
||||
import com.ljsd.jieling.logic.mission.data.AbstractDataManager;
|
||||
import com.ljsd.jieling.logic.mission.data.BaseDataManager;
|
||||
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
||||
import config.SExploreTask;
|
||||
import config.SJourneyWithWind;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ExploreMissionType extends AbstractMissionType {
|
||||
|
||||
@Override
|
||||
public void openMission(User user, int missionId, List<MissionStateChangeInfo> missionTypeEnumList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] reward(int missionId) {
|
||||
return new int[0][];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) throws Exception {
|
||||
|
||||
List<SExploreTask> sTaskConfigs = SExploreTask.getsTaskConfigByTypeMap(result.subType.getMissionTypeValue());
|
||||
if (sTaskConfigs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Integer> doingMissionIds = getDoingMissionIds();
|
||||
for (SExploreTask sTaskConfig : sTaskConfigs){
|
||||
int missionId = sTaskConfig.getId();
|
||||
if (!doingMissionIds.contains(missionId)) {
|
||||
continue;
|
||||
}
|
||||
boolean isFinish;
|
||||
int doingProgress = 0 ;
|
||||
BaseDataManager missTypeData = DataManagerDistributor.getMissTypeData(result.subType);
|
||||
if(missTypeData instanceof AbstractDataManager){
|
||||
isFinish=((AbstractDataManager) missTypeData).isFinish(user,cumulationData, sTaskConfig.getValues());
|
||||
}else {
|
||||
//完成
|
||||
doingProgress = MissionLoigc.getDoingProgress(user, cumulationData, sTaskConfig.getType(), sTaskConfig.getValues()[0]);
|
||||
isFinish = doingProgress >= sTaskConfig.getValues()[1][0];
|
||||
}
|
||||
|
||||
if (!isFinish) {
|
||||
MissionStateChangeInfo doingInfo = new MissionStateChangeInfo(missionId,
|
||||
MissionState.DOING, doingProgress);
|
||||
boolean flag = false;
|
||||
if(missionStateChangeInfos!=null){
|
||||
for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
|
||||
if (missionStateChangeInfo.getMissionId() == missionId) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
missionStateChangeInfos.add(doingInfo);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
MissionStateChangeInfo finishInfo = new MissionStateChangeInfo(missionId,
|
||||
MissionState.FINISH, null);
|
||||
Iterator<MissionStateChangeInfo> iterator = missionStateChangeInfos.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MissionStateChangeInfo next = iterator.next();
|
||||
if (next.getMissionId() == missionId) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if(doingMissionIds.contains(missionId) && !getFinishMissionIds().contains(missionId)){
|
||||
//更新活动完成进度
|
||||
// 事件分发
|
||||
int rewardId = SJourneyWithWind.config.get(missionId).getRewardId();
|
||||
if(rewardId != 0){
|
||||
//TODO
|
||||
//Poster.getPoster().dispatchEvent(new MistyTripEvent(user.getId(),rewardId,1));
|
||||
}
|
||||
|
||||
}
|
||||
missionStateChangeInfos.add(finishInfo);
|
||||
doingMissionIds.remove(missionId);
|
||||
getFinishMissionIds().add(missionId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rewardMission(int missionId, List<MissionStateChangeInfo> missionTypeEnumListMap) {
|
||||
super.rewardMission(missionId, missionTypeEnumListMap);
|
||||
}
|
||||
}
|
|
@ -49,6 +49,7 @@ public enum RankEnum {
|
|||
|
||||
FOUR_CHALLENGE_TIER_RANK(38,RedisKey.FOUR_CHALLENGE_TIER_RANK,SituationRank::new,false),//四灵试炼排行榜,param1:层数 param2:无 param3:无
|
||||
POWER_RICE_RANK(42,RedisKey.POWER_RICE_RANK,PowerRiceRank::new,false),//战力冲刺排行榜
|
||||
EXPLORE_RANK(43,RedisKey.EXPLORE_RANK,ExploreRank::new,false),//探索排行榜
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.activity.*;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import config.SActivityRankingReward;
|
||||
import config.SGlobalActivity;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ExploreRank extends AbstractRank implements IEventHandler {
|
||||
|
||||
public ExploreRank(int type, String redisKey) {
|
||||
super(type, redisKey);
|
||||
//Poster.getPoster().listenEvent(this, UserMainTeamForceEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long[] getDataByScore(Double score) {
|
||||
return new long[]{score.longValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -35,6 +35,7 @@ import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
|||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.question.QuestionLogic;
|
||||
import com.ljsd.jieling.logic.rank.CrossRankManager;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.ridingSward.RidingSwardLogic;
|
||||
import com.ljsd.jieling.logic.sevenworld.SevenWorldLogic;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
|
@ -242,6 +243,9 @@ public class MinuteTask extends Thread {
|
|||
RedisUtil.getInstence().remove(RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO,crossGroup + RedisKey.Delimiter_colon + 1,true));
|
||||
RedisUtil.getInstence().remove(RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO,crossGroup + RedisKey.Delimiter_colon + 2,true));
|
||||
}
|
||||
//探索排行每日重置
|
||||
RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).removeAllRank("");
|
||||
|
||||
// 公会信息处理
|
||||
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
|
||||
for(Map.Entry<Integer,GuildInfo> guildInfoEntry:guildInfoMap.entrySet()){
|
||||
|
|
|
@ -26,6 +26,7 @@ public class SExplore implements BaseConfig {
|
|||
|
||||
private int monsterForce;
|
||||
|
||||
private int[] eventList;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -69,5 +70,7 @@ public class SExplore implements BaseConfig {
|
|||
return monsterForce;
|
||||
}
|
||||
|
||||
|
||||
public int[] getEventList() {
|
||||
return eventList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="ExploreEvent")
|
||||
public class SExploreEvent implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int time;
|
||||
|
||||
private int monsterGroup;
|
||||
|
||||
private int forceRange;
|
||||
|
||||
private int rewardGroup;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public int getMonsterGroup() {
|
||||
return monsterGroup;
|
||||
}
|
||||
|
||||
public int getForceRange() {
|
||||
return forceRange;
|
||||
}
|
||||
|
||||
public int getRewardGroup() {
|
||||
return rewardGroup;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="ExploreTask")
|
||||
public class SExploreTask implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int[][] values;
|
||||
|
||||
private int[][] reward;
|
||||
|
||||
public static Map<Integer, List<SExploreTask>> sTaskConfigByTypeMap;//<任务类型,data>
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
Map<Integer, SExploreTask> configTmp = STableManager.getConfig( SExploreTask.class);
|
||||
Map<Integer, List<SExploreTask>> configListTmp = new HashMap<>();
|
||||
for(SExploreTask sExploreTask : configTmp.values()){
|
||||
int taskType = sExploreTask.getType();
|
||||
if(!configListTmp.containsKey(taskType)){
|
||||
configListTmp.put(taskType,new ArrayList<>());
|
||||
}
|
||||
configListTmp.get(taskType).add(sExploreTask);
|
||||
}
|
||||
sTaskConfigByTypeMap = configListTmp;
|
||||
|
||||
}
|
||||
|
||||
public static List<SExploreTask> getsTaskConfigByTypeMap(int missionType) {
|
||||
return sTaskConfigByTypeMap.get(missionType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int[][] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue