猎妖之路 通关流程修改
parent
3944abddeb
commit
8b3cb929e2
|
@ -1,24 +1,23 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.SArenaRobotStaticConfig;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.blood.BloodLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.protocols.Expedition;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
|
@ -28,50 +27,31 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description: 热修复玩家信息 分发到玩家线程
|
||||
* //role_gm 10043387
|
||||
* Description: 猎妖之路gm测试 通关指定层
|
||||
* //role_gm 10043822 2
|
||||
* CreateDate: 2019/9/26 11:48
|
||||
*/
|
||||
public class Cmd_role_gm extends GmRoleAbstract {
|
||||
boolean isfirst =false;
|
||||
int thisleve =1;
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
// ExpeditionLogic.getInstance().flushUserdataEveryDay(getUser());
|
||||
|
||||
// boolean check = PlayerLogic.getInstance().check(getUser(), VipPrivilegeType.EXPEDITION_RELIVE, 1);
|
||||
//
|
||||
// System.out.println("c"+check);
|
||||
|
||||
int NODESTATE_CLOSE = 0;//0未开启
|
||||
int NODESTATE_NOT_PASS = 1;//1未通过
|
||||
int NODESTATE_NOT_GET = 2;//2未领取圣物
|
||||
if(args.length==1){
|
||||
thisleve = Integer.valueOf(args[0]);
|
||||
}
|
||||
int NODESTATE_PASS = 3;//已完成
|
||||
int NODESTATE_OVER_PASS = 4;//已完成
|
||||
int NODESTATE_HERO = 5;//招募节点
|
||||
|
||||
int NODETYPE_ADVANCE = 1;//精英节点
|
||||
int NODETYPE_BOSS = 2;//首领节点
|
||||
int NODETYPE_RELIVE = 3;//复活节点
|
||||
int NODETYPE_RECOVER = 4;//回复节点
|
||||
int NODETYPE_NORMAL = 5;//普通节点
|
||||
int NODETYPE_HERO_GET = 7;//招募节点
|
||||
int NODETYPE_SHOP = 8;//商店节点
|
||||
int NODETYPE_TRY = 9;//试炼节点
|
||||
int NODETYPE_GREED= 10;//贪婪节点
|
||||
int NODETYPE_REWARD= 11;//奖励节点
|
||||
|
||||
|
||||
User user = getUser();
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
expeditionManager.setPassTimes(-1);
|
||||
|
||||
|
||||
|
||||
expeditionManager.setExpeditionLeve(2);
|
||||
ExpeditionManager manager = user.getExpeditionManager();
|
||||
manager.setLay(1);
|
||||
manager.setSortid(0);
|
||||
manager.setExpeditionLeve(2);
|
||||
manager.setExpeditionLeve(thisleve);
|
||||
manager.clearRewardBox();
|
||||
manager.clearPropertyItems();
|
||||
manager.getHeroHPWithChange().clear();
|
||||
|
@ -86,8 +66,8 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
manager.clearExpeditionNodeInfos();
|
||||
|
||||
//创建节点束河
|
||||
Set<ExpeditionNodeInfo> nodeSets = createNodeSet(2);
|
||||
|
||||
Set<ExpeditionNodeInfo> nodeSets = createNodeSet(thisleve);
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Expedition.getFunctionType());
|
||||
nodeSets.forEach(nodeInfo -> {
|
||||
int sortId = nodeInfo.getSortId();
|
||||
if(nodeInfo.getState()==NODESTATE_PASS){
|
||||
|
@ -98,11 +78,11 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
|
||||
if(nodeInfo.getType() == NODETYPE_ADVANCE || nodeInfo.getType() == NODETYPE_BOSS || nodeInfo.getType() == NODETYPE_NORMAL){
|
||||
//生成节点boss信息
|
||||
float size = STableManager.getFigureConfig(CommonStaticConfig.class).leve2num.get(2);
|
||||
float size = STableManager.getFigureConfig(CommonStaticConfig.class).leve2num.get(thisleve);
|
||||
//战力基准值=maxforce*0.8+1/15(max-min)*lay)
|
||||
|
||||
int minFoce = sExpeditionSetting.getMatchForce()[2][0];
|
||||
int manFoce = sExpeditionSetting.getMatchForce()[2][1];
|
||||
int minFoce = sExpeditionSetting.getMatchForce()[thisleve][0];
|
||||
int manFoce = sExpeditionSetting.getMatchForce()[thisleve][1];
|
||||
int standerFoce = (int) (user.getPlayerInfoManager().getMaxForce() * ((minFoce / 10000f) + ((float) nodeInfo.getLay()) / size * ((float) (manFoce - minFoce)/10000f)));
|
||||
float randomForce = (standerFoce * ((sExpeditionSetting.getMatchForceRange()[0] + (int) (Math.random() * (sExpeditionSetting.getMatchForceRange()[1] - sExpeditionSetting.getMatchForceRange()[0]))) / 10000f));
|
||||
|
||||
|
@ -114,12 +94,6 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
Set<ZSetOperations.TypedTuple<String>> typedTuples = RedisUtil.getInstence().rangeByScoreWithScores(RedisKey.AREDEF_TEAM_FORCE_RANK, "", 0, randomForce);
|
||||
|
||||
if (typedTuples.size() == 0) {
|
||||
//战力没有获取到 从机器人中选
|
||||
// Set<Integer> set = ArenaLogic.randomRobot(SArenaSetting.getSArenaSetting().getScore(), 1);
|
||||
//// if (set.size() == 0) {
|
||||
//// throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
//// }
|
||||
// int robotId = set.iterator().next();
|
||||
//提前战力排序 支持战力查找机器人
|
||||
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId((int)randomForce);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
|
@ -142,20 +116,31 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
});
|
||||
|
||||
|
||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||
if(sExpeditionSetting == null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
Expedition.GetExpeditionResponse.Builder builder = Expedition.GetExpeditionResponse.newBuilder();
|
||||
|
||||
if (HandlerLogicThread.checkOpen(user,sGlobalSystemConfig)&& OnlineUserManager.getSessionByUid(user.getId())!=null) {
|
||||
builder.addAllLay(manager.getRewardBox());
|
||||
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user));
|
||||
builder.addAllNodeInfo(ExpeditionLogic.getInstance().getNodeInfo(user));
|
||||
builder.addAllEquipIds(ExpeditionLogic.getInstance().getEquipnfo(user));
|
||||
builder.addAllHeroList(new ArrayList<>());
|
||||
builder.addAllEquip(new ArrayList<>());
|
||||
builder.addAllEquip(new ArrayList<>());
|
||||
builder.setStartTime(manager.getFreshTime());
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()), 1, MessageTypeProto.MessageType.ExpeditionResetIndication.getNumber(), builder.build(), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isBattleNode(int type) {
|
||||
int NODETYPE_ADVANCE = 1;//精英节点
|
||||
int NODETYPE_BOSS = 2;//首领节点
|
||||
int NODETYPE_RELIVE = 3;//复活节点
|
||||
int NODETYPE_RECOVER = 4;//回复节点
|
||||
int NODETYPE_NORMAL = 5;//普通节点
|
||||
int NODETYPE_HERO_GET = 7;//招募节点
|
||||
int NODETYPE_SHOP = 8;//商店节点
|
||||
int NODETYPE_TRY = 9;//试炼节点
|
||||
int NODETYPE_GREED= 10;//贪婪节点
|
||||
int NODETYPE_REWARD= 11;//奖励节点
|
||||
return type == NODETYPE_ADVANCE || type == NODETYPE_BOSS || type == NODETYPE_NORMAL;
|
||||
}
|
||||
|
||||
|
@ -270,36 +255,10 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
int i = sExpeditionRecruitConfig.getHeroId();
|
||||
SnapFightInfo fightInfo = new SnapFightInfo();
|
||||
|
||||
fightInfo.setUid(i);
|
||||
int force = MonsterUtil.getMonsterForce(new int[]{i});
|
||||
Map<String, Double> bossHP = new HashMap<>();
|
||||
|
||||
Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>();
|
||||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(i);
|
||||
int[][] groupIds = sMonsterGroup.getContents();
|
||||
|
||||
int[] monsterIds = groupIds[0];
|
||||
|
||||
for (int monsterId : monsterIds) {
|
||||
if(monsterId!=0){
|
||||
bossHP.put(Integer.toString(monsterId), 1d);
|
||||
heroAllAttribute.put(Integer.toString(monsterId), new FamilyHeroInfo());
|
||||
}
|
||||
}
|
||||
|
||||
fightInfo.setHeroAttribute(heroAllAttribute);
|
||||
fightInfo.setForce(force);
|
||||
nodeInfo.setBossHP(bossHP);
|
||||
fightInfo.setPokenmonSkills("");
|
||||
fightInfo.setPassiveSkills("");
|
||||
nodeInfo.setSnapFightInfo(fightInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取节点结构 确定type id state
|
||||
*/
|
||||
|
@ -309,17 +268,9 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
int NODESTATE_NOT_GET = 2;//2未领取圣物
|
||||
int NODESTATE_PASS = 3;//已完成
|
||||
int NODESTATE_OVER_PASS = 4;//已完成
|
||||
int NODESTATE_HERO = 5;//招募节点
|
||||
int NODETYPE_ADVANCE = 1;//精英节点
|
||||
int NODETYPE_BOSS = 2;//首领节点
|
||||
int NODETYPE_RELIVE = 3;//复活节点
|
||||
int NODETYPE_RECOVER = 4;//回复节点
|
||||
int NODETYPE_NORMAL = 5;//普通节点
|
||||
int NODETYPE_HERO_GET = 7;//招募节点
|
||||
int NODETYPE_SHOP = 8;//商店节点
|
||||
int NODETYPE_TRY = 9;//试炼节点
|
||||
int NODETYPE_GREED= 10;//贪婪节点
|
||||
int NODETYPE_REWARD= 11;//奖励节点
|
||||
|
||||
Map<Integer, SExpeditionFloorConfig> config = STableManager.getConfig(SExpeditionFloorConfig.class);
|
||||
int totalIndex = 1;
|
||||
Set<ExpeditionNodeInfo> nodeSets = new HashSet<>();
|
||||
|
|
Loading…
Reference in New Issue