新增消耗道具任务类型
parent
c015b1ea18
commit
fd7e47ff65
|
@ -136,6 +136,8 @@ public class CumulationData {
|
|||
public int ten_challenge_time;// 挑战十绝阵num次
|
||||
// public Map<Integer,Integer> finisin_daily_challenge_times;//完成type(0不限、1金币、2武将经验、3武将碎片、4兵魂、5谋略)的日常副本num次
|
||||
public Map<Integer,Integer> expedition_floor_times= new HashMap<>();//猎妖之路通过floor层num次
|
||||
public Map<Integer,Integer> itemUse = new HashMap<>(); //货币道具消耗
|
||||
|
||||
|
||||
public int decompose_times;//献祭武将次数
|
||||
public int death_path_times;// 击杀过关十绝阵num次
|
||||
|
|
|
@ -113,6 +113,7 @@ public enum MissionType {
|
|||
CAR_PLAY_TIMES(105),//参与车迟斗法num次
|
||||
CAR_PLAY_LOOT_TIME(106),//于车迟斗法中抢夺其他玩家积分num次
|
||||
RANDOM_All_TIMES(107),//使用募英殿内(即包含魂晶、友情、普通三种方式)任意类型招募武将num次
|
||||
ITEMUSE(108),//消耗代币(道具类型为1特殊类)itemid的数量达到num
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
@ -133,6 +133,8 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.CAR_PLAY_TIMES,new CarPlayManager());
|
||||
judges.put(MissionType.CAR_PLAY_LOOT_TIME,new CarPlayLootManager());
|
||||
judges.put(MissionType.RANDOM_All_TIMES,new RandomAllTypeTimes());
|
||||
judges.put(MissionType.ITEMUSE,new ItemUseDataManager());
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
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;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: 货币类道具使用
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/6/10 7:08
|
||||
*/
|
||||
public class ItemUseDataManager extends AbstractDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
if(parm.length==1&&parm[0] instanceof Map){
|
||||
((Map)parm[0]).forEach((o, o2) -> {
|
||||
int type =(int)o;
|
||||
int count =(int)o2;
|
||||
data.itemUse.merge(type,count,Integer::sum);
|
||||
});
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinish(User user, CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
Integer orDefault = data.itemUse.getOrDefault(cfgValue[0][0], 0);
|
||||
return orDefault>=cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
return data.itemUse.getOrDefault(missionSubType[0], 0);
|
||||
}
|
||||
}
|
|
@ -112,6 +112,7 @@ public class MissionEventDistributor {
|
|||
typeList.add(MissionType.USER_CONSUMER_GEM);
|
||||
typeList.add(MissionType.USER_CONSUMER_STAMINA);
|
||||
typeList.add(MissionType.ENDLESS_CONSUME_ACTION);
|
||||
typeList.add(MissionType.ITEMUSE);
|
||||
eventEnumListMap.put(GameEvent.CONSUMER_MATERIAL,typeList);
|
||||
eventProcessor.put(GameEvent.CONSUMER_MATERIAL,new CumulationDataEventProcessor());
|
||||
|
||||
|
|
Loading…
Reference in New Issue