法宝任务

PC-202302260912\Administrator 2023-07-21 17:42:21 +08:00
parent d88201a933
commit 1470230ee4
10 changed files with 59 additions and 50 deletions

View File

@ -365,6 +365,9 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
@Override @Override
public void onActivityEndDealReward(User user) throws Exception { public void onActivityEndDealReward(User user) throws Exception {
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId()); ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
if (sessionByUid == null){
return;
}
takeAllReward(sessionByUid); takeAllReward(sessionByUid);
} }

View File

@ -14,6 +14,7 @@ public class CumulationData {
// private Map<Integer,Integer> randomCountMap = new HashMap<>(); // 抽卡次数统计 // private Map<Integer,Integer> randomCountMap = new HashMap<>(); // 抽卡次数统计
private int recruitmentRands; //群英征募 群英招募次数 private int recruitmentRands; //群英征募 群英招募次数
private int fabaoDrawNum;
public int elementRands; //群英征募 群英招募次数 public int elementRands; //群英征募 群英招募次数
/** /**
@ -383,6 +384,14 @@ public class CumulationData {
this.killInvasionbossCount = killInvasionbossCount; this.killInvasionbossCount = killInvasionbossCount;
} }
public int getFabaoDrawNum() {
return fabaoDrawNum;
}
public void setFabaoDrawNum(int fabaoDrawNum) {
this.fabaoDrawNum = fabaoDrawNum;
}
public Map<Integer, Integer> getHeroLevleCountMap() { public Map<Integer, Integer> getHeroLevleCountMap() {
return heroLevleCountMap; return heroLevleCountMap;
} }

View File

@ -749,15 +749,16 @@ public class ExpeditionLogic {
* 使 * 使
* *
*/ */
public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) { public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
ExpeditionManager expeditionManager = user.getExpeditionManager();
user.getTeamPosManager().setCurTeamPosId(teamId); user.getTeamPosManager().setCurTeamPosId(teamId);
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>(); List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId); List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) { for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
Hero hero; Hero hero;
if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()&&user.getExpeditionManager().getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){ if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId() && expeditionManager.getHeroMap().containsKey(teamPosHeroInfo.getHeroId())){
hero =user.getExpeditionManager().getHeroMap().get(teamPosHeroInfo.getHeroId()); hero = expeditionManager.getHeroMap().get(teamPosHeroInfo.getHeroId());
}else { }else {
hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId()); hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
} }
@ -775,11 +776,10 @@ public class ExpeditionLogic {
disposeWithHeroHoly(user,hero,skillSb); disposeWithHeroHoly(user,hero,skillSb);
if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()){ if(teamId==TeamEnum.EXPEDITION_TEAM.getTeamId()){
ExpeditionManager expeditionManager = user.getExpeditionManager(); Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager);
Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager); for (SExpeditionHolyConfig expeditionHolyConfig : expeditionHolyConfigs) {
for (SExpeditionHolyConfig expeditionHolyConfig:expeditionHolyConfigs) {
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(expeditionHolyConfig.getPassiveSkillId()); SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(expeditionHolyConfig.getPassiveSkillId());
if(config!=null &&config.getEffectiveRange()==1){ if(config!=null && config.getEffectiveRange()==1){
skillSb.append(expeditionHolyConfig.getPassiveSkillId()).append("#"); skillSb.append(expeditionHolyConfig.getPassiveSkillId()).append("#");
} }
} }

View File

@ -87,11 +87,10 @@ public enum GameEvent {
CARD_RANDWM,// 使用普通召唤num次 (十连抽num计10 CARD_RANDWM,// 使用普通召唤num次 (十连抽num计10
GUILD_GIVE,//使用level级别0不限、1普通、2钻石小、3钻石大的公会捐献num次 GUILD_GIVE,//使用level级别0不限、1普通、2钻石小、3钻石大的公会捐献num次
TEN_CHALLENGE,//挑战十绝阵num次 //TODO TEN_CHALLENGE,//挑战十绝阵num次
// SIX_RANDOM,//使用6灵阁召唤num次
EXPEDITION_FINISH,//猎妖之路通过第floor层的首领节点每层最多一个num次 EXPEDITION_FINISH,//猎妖之路通过第floor层的首领节点每层最多一个num次
DESPOSE_HERO,//分解英雄 DESPOSE_HERO,//分解英雄
DEATH_PATH,//击杀过关十绝阵num次//TODO DEATH_PATH,//击杀过关十绝阵num次
DAILY_TASK_TYPE,//日常任务 // DAILY_TASK_TYPE,//日常任务 //
GUID_HELP,//公会援助他人次数达到num GUID_HELP,//公会援助他人次数达到num

View File

@ -956,8 +956,8 @@ public class MissionLoigc {
count = user.getPlayerInfoManager().getMaxForce(); count = user.getPlayerInfoManager().getMaxForce();
break; break;
case USER_CONSUMER_GEM: case USER_CONSUMER_GEM:
Long consumeGem = cumulationData.getConsumeGem(); long consumeGem = cumulationData.getConsumeGem();
count = consumeGem.intValue(); count = (int) consumeGem;
break; break;
case USER_WORKSHOP_LEVEL: case USER_WORKSHOP_LEVEL:
count =user.getWorkShopController().getWorkShopLevel(); count =user.getWorkShopController().getWorkShopLevel();
@ -1022,20 +1022,6 @@ public class MissionLoigc {
case SECRETBOX_TIMES: case SECRETBOX_TIMES:
count = cumulationData.getSecretRandomCount(); count = cumulationData.getSecretRandomCount();
break; break;
case EQUIP_FORCE_NUMS:
// Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
// for(PropertyItem equip : equipMap.values()){
// Equip tempEquip=null;
// if(equip instanceof Equip){
// tempEquip = (Equip)equip;
// }else{
// continue;
// }
// if(HeroLogic.getInstance().calEquipForce(tempEquip)>missionSubType[0]){
// count++;
// }
// }
break;
case BUY_GOLD_TIMES: case BUY_GOLD_TIMES:
count=cumulationData.buyGoldTimes; count=cumulationData.buyGoldTimes;
break; break;
@ -1129,19 +1115,13 @@ public class MissionLoigc {
count= cumulationData.differentHeros.size(); count= cumulationData.differentHeros.size();
break; break;
case ONE_HERO_UP_STAR_TIMES: case ONE_HERO_UP_STAR_TIMES:
Integer num= cumulationData.heroUpStarTimesMap.get(missionSubType[0]); count = cumulationData.heroUpStarTimesMap.getOrDefault(missionSubType[0], 0);
if(num!=null){
count = num;
}
break; break;
case HERO_IN_TEAM_NUMS: case HERO_IN_TEAM_NUMS:
count = cumulationData.heroInTeamNums; count = cumulationData.heroInTeamNums;
break; break;
case BUY_GROCERY_TIMES: case BUY_GROCERY_TIMES:
num = cumulationData.buyStoreTimes.get(missionSubType[0]); count = cumulationData.buyStoreTimes.getOrDefault(missionSubType[0], 0);
if(num!=null){
count = num;
}
break; break;
case FRIEND_NUMS: case FRIEND_NUMS:
count = cumulationData.friendNums; count = cumulationData.friendNums;
@ -1150,10 +1130,7 @@ public class MissionLoigc {
count = cumulationData.givePresents; count = cumulationData.givePresents;
break; break;
case HERO_UP_SOME_STAR_TIMES: case HERO_UP_SOME_STAR_TIMES:
num = cumulationData.heroUpSomeStarTimesMap.get(missionSubType[0]); count = cumulationData.heroUpSomeStarTimesMap.getOrDefault(missionSubType[0],0);
if(num!=null){
count = num;
}
break; break;
case JOIN_MONSTER_ATTACK_TIMES: case JOIN_MONSTER_ATTACK_TIMES:
count = cumulationData.monsterAttackTimes; count = cumulationData.monsterAttackTimes;
@ -1255,7 +1232,6 @@ public class MissionLoigc {
count = cumulationData.hardstage_participation; count = cumulationData.hardstage_participation;
break; break;
//100以后类型继承 AbstractDataManager //100以后类型继承 AbstractDataManager
case LIMIT_TIME_CHOICE_CARD: case LIMIT_TIME_CHOICE_CARD:
//限时招募 //限时招募
count = cumulationData.limit_time_choice_card_count; count = cumulationData.limit_time_choice_card_count;
@ -1309,7 +1285,6 @@ public class MissionLoigc {
default: default:
count = 0; count = 0;
break; break;
} }
if(count == null){ if(count == null){
count =0; count =0;

View File

@ -182,7 +182,7 @@ public enum MissionType {
SHIJUE_INSTANCE_ZONES_NUM(162),//十绝挑战num次 SHIJUE_INSTANCE_ZONES_NUM(162),//十绝挑战num次
QIJIE_INSTANCE_ZONES_NUM(163),//进行num次七界试炼 QIJIE_INSTANCE_ZONES_NUM(163),//进行num次七界试炼
XIAOYAOYOU_CONSUME_NUM(164),//逍遥游消耗云游值num点 XIAOYAOYOU_CONSUME_NUM(164),//逍遥游消耗云游值num点
FABAO_DRAW_NUM(165),//法宝抽卡次数
; ;
private int missionType; private int missionType;

View File

@ -15,6 +15,7 @@ public class DataManagerDistributor {
public static void init(){ public static void init(){
judges.put(MissionType.RECRUITMENT_RANDOM_HEROES,new RandomHeroDataManager()); judges.put(MissionType.RECRUITMENT_RANDOM_HEROES,new RandomHeroDataManager());
judges.put(MissionType.FABAO_DRAW_NUM,new FabaoDrawTaskManager());
judges.put(MissionType.ELEMENT_RANDOM_TIMES,new RandomHeroDataManager()); judges.put(MissionType.ELEMENT_RANDOM_TIMES,new RandomHeroDataManager());
judges.put(MissionType.COLLECT_QUALITY_HERO,new GetHeroManager()); judges.put(MissionType.COLLECT_QUALITY_HERO,new GetHeroManager());
judges.put(MissionType.COLLECT_DIFFERENT_HEROS,new GetHeroManager()); judges.put(MissionType.COLLECT_DIFFERENT_HEROS,new GetHeroManager());

View File

@ -0,0 +1,23 @@
package com.ljsd.jieling.logic.mission.data;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.MissionType;
/**
* @author lvxinran
* @date 2021/6/8
* @discribe
*/
public class FabaoDrawTaskManager extends AbstractDataManager{
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
data.setFabaoDrawNum(data.getFabaoDrawNum()+1);
return new CumulationData.Result(missionType);
}
@Override
public int getProcess(User user, CumulationData data, int[] missionSubType) {
return data.getFabaoDrawNum();
}
}

View File

@ -13,13 +13,12 @@ public class DailyRefreshEventProcess implements BaseGameEventProcessor {
@Override @Override
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception { public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> misionTypeListMap, GameEvent event, Object... parm) throws Exception {
user.getUserMissionManager().openMission(user,event,misionTypeListMap, parm); user.getUserMissionManager().openMission(user,event,misionTypeListMap, parm);
if(event == GameEvent.MISSING_ROOM_REFRESH){ List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event);
List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event); if(event != GameEvent.MISSING_ROOM_REFRESH || typeList == null){
if(typeList!=null){ return;
for (MissionType type : typeList) { }
user.getUserMissionManager().calCumulationDataResult(user,type,misionTypeListMap,parm); for (MissionType type : typeList) {
} user.getUserMissionManager().calCumulationDataResult(user,type,misionTypeListMap,parm);
}
} }
} }
} }

View File

@ -84,6 +84,7 @@ public class MissionEventDistributor {
typeList = new ArrayList<>(); typeList = new ArrayList<>();
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES); typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
typeList.add(MissionType.FABAO_DRAW_NUM);
typeList.add(MissionType.ELEMENT_RANDOM_TIMES); typeList.add(MissionType.ELEMENT_RANDOM_TIMES);
typeList.add(MissionType.CARD_RANDOM_TYPE); typeList.add(MissionType.CARD_RANDOM_TYPE);
typeList.add(MissionType.RANDOM_All_TIMES); typeList.add(MissionType.RANDOM_All_TIMES);
@ -104,7 +105,6 @@ public class MissionEventDistributor {
eventProcessor.put(GameEvent.GET_HERO,new CumulationDataEventProcessor()); eventProcessor.put(GameEvent.GET_HERO,new CumulationDataEventProcessor());
typeList = new ArrayList<>(); typeList = new ArrayList<>();
typeList.add(MissionType.HERO_LEVLE_COUNT); typeList.add(MissionType.HERO_LEVLE_COUNT);
typeList.add(MissionType.HERO_LEVLE_TIMES); typeList.add(MissionType.HERO_LEVLE_TIMES);
@ -806,7 +806,7 @@ public class MissionEventDistributor {
missionTypeEnumListMap = new HashMap<>(1); missionTypeEnumListMap = new HashMap<>(1);
} }
processor.onGameEvent(user, missionTypeEnumListMap,event,parm); processor.onGameEvent(user,missionTypeEnumListMap,event,parm);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
LOGGER.error(e.toString()); LOGGER.error(e.toString());