山河社稷成就任务 心魔试炼扫荡

back_recharge
xuexinpeng 2021-05-25 11:40:43 +08:00
parent e74a860a80
commit e74314c6c7
10 changed files with 144 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import com.ljsd.jieling.logic.fight.FightUtil;
import com.ljsd.jieling.logic.hardStage.HardStageChapter;
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
import com.ljsd.jieling.logic.hardStage.HardStageNode;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.FightDataUtil;
import com.ljsd.jieling.util.MessageUtil;
@ -183,6 +184,9 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
fightStartResponse.setStars(node.getState());
}
}
//成就任务
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_STARS,starSum);
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_NODE,hardStageId);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_FIGHT_START_RESPONSE.getNumber(), fightStartResponse.build(), true);
//更新消息
HardStageLogic.sendHardStageIndication(user);

View File

@ -0,0 +1,57 @@
package com.ljsd.jieling.handler.map.mapHandler;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.handler.map.SweepLogic;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.family.GuildFightLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SFloodConfig;
import manager.STableManager;
import org.springframework.stereotype.Component;
import rpc.protocols.CommonProto;
import rpc.protocols.FightInfoProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
@Component
public class SweepBattleRequestHandler extends BaseHandler<FightInfoProto.SweepDemonRequest>{
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.SWEEP_DEMON_REQUEST;
}
@Override
public void processWithProto(ISession iSession, FightInfoProto.SweepDemonRequest proto) throws Exception {
User user = UserManager.getUser(iSession.getUid());
int id =proto.getId();
SFloodConfig sFloodConfig = STableManager.getConfig(SFloodConfig.class).get(id);
if(sFloodConfig == null){
return;
}
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sFloodConfig.getReward(), BIReason.MONSTERATTACK_REWARD);
boolean freeCount = PlayerLogic.getInstance().check(user, 2025, 1);
if(!freeCount){
boolean feeCount = PlayerLogic.getInstance().check(user, 2026, 1);
if(!feeCount){
return;
}else {
user.getPlayerInfoManager().updateVipPrivilage(2026,1);
}
}else {
user.getPlayerInfoManager().updateVipPrivilage(2025,1);
}
FightInfoProto.SweepDemonResponse.Builder res = FightInfoProto.SweepDemonResponse.newBuilder();
res.setDrop(drop);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.SWEEP_DEMON_RESPONSE.getNumber(), res.build(), true);
}
}

View File

@ -173,6 +173,11 @@ public class CumulationData {
// 鸿蒙碑等级
public int hongmeng_tablet_level;
//山河社稷星星数
public int hardstage_stars;
//山河社稷章节数
public int hardstage_node;
public Result updateData(MissionType missionType, Object...parm) throws Exception {
return DataManagerDistributor.updateData(this, missionType,parm);
}
@ -399,4 +404,20 @@ public class CumulationData {
public void setHongmeng_tablet_level(int hongmeng_tablet_level) {
this.hongmeng_tablet_level = hongmeng_tablet_level;
}
public int getHardstage_stars() {
return hardstage_stars;
}
public void setHardstage_stars(int hardstage_stars) {
this.hardstage_stars = hardstage_stars;
}
public int getHardstage_node() {
return hardstage_node;
}
public void setHardstage_node(int hardstage_node) {
this.hardstage_node = hardstage_node;
}
}

View File

@ -111,4 +111,7 @@ public enum GameEvent {
COW_FLY_SKY_REFRESH,//牛气冲天刷新
COW_FLY_SKY_REWEARD,//牛气冲天奖励
HARSTAGE_STARS,//山河社稷图星数
HARSTAGE_NODE,//山河社稷图通关章节
}

View File

@ -926,6 +926,12 @@ public class MissionLoigc {
case EXPEDITION_FLOOR_TIMES:
count = cumulationData.expedition_floor_times.get(missionSubType[0]);
break;
case HARSTAGE_STARS:
count = cumulationData.hardstage_stars;
break;
case HARSTAGE_NODE:
count = cumulationData.hardstage_node;
break;
//100以后类型继承 AbstractDataManager
default:
count = 0;

View File

@ -126,6 +126,9 @@ public enum MissionType {
HONGMENG_RESONANCE_LATTICE(119),//鸿蒙阵共鸣格子
HONGMENG_TABLET_LEVEL(120),// 鸿蒙碑等级
HARSTAGE_STARS(121),//山河社稷图获得总星星数
HARSTAGE_NODE(122),//山河社稷图通关章节
;
private int missionType;

View File

@ -145,6 +145,12 @@ public class DataManagerDistributor {
// 鸿蒙阵
judges.put(MissionType.HONGMENG_RESONANCE_LATTICE, new HongMengResonanceDataManager());
judges.put(MissionType.HONGMENG_TABLET_LEVEL, new HongMengLevelDataManager());
//山河社稷图
judges.put(MissionType.HARSTAGE_STARS, new HardStageStarsDataManager());
judges.put(MissionType.HARSTAGE_NODE, new HardStageNodeDataManager());
}
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {

View File

@ -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 HardStageNodeDataManager implements BaseDataManager {
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
int nums = (int)parm[0];
data.setHardstage_node(nums);
return new CumulationData.Result(missionType);
}
}

View File

@ -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 HardStageStarsDataManager implements BaseDataManager {
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
int nums = (int)parm[0];
data.setHardstage_stars(nums);
return new CumulationData.Result(missionType);
}
}

View File

@ -428,6 +428,18 @@ public class MissionEventDistributor {
eventEnumListMap.put(GameEvent.HONGMENG_TABLET_LEVEL, typeList);
eventProcessor.put(GameEvent.HONGMENG_TABLET_LEVEL, new CumulationDataEventProcessor());
//山河社稷图
typeList = new ArrayList<>();
typeList.add(MissionType.HARSTAGE_STARS);
eventEnumListMap.put(GameEvent.HARSTAGE_STARS, typeList);
eventProcessor.put(GameEvent.HARSTAGE_STARS, new CumulationDataEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.HARSTAGE_NODE);
eventEnumListMap.put(GameEvent.HARSTAGE_NODE, typeList);
eventProcessor.put(GameEvent.HARSTAGE_NODE, new CumulationDataEventProcessor());
}
public static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =