Task【ID1005460】【玩法需求】猎妖之路
parent
f3e27888ee
commit
95b9eb58d5
|
@ -7,12 +7,10 @@ import manager.AbstractClassStaticConfig;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import manager.Table;
|
import manager.Table;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class SArenaRobotStaticConfig extends AbstractClassStaticConfig {
|
public class SArenaRobotStaticConfig extends AbstractClassStaticConfig {
|
||||||
|
private static TreeMap<Integer, Integer> force2robotId;
|
||||||
@Override
|
@Override
|
||||||
public void registConfigs(Set<String> registConfigs) {
|
public void registConfigs(Set<String> registConfigs) {
|
||||||
registConfigs.add(SArenaRobotConfig.class.getAnnotation(Table.class).name());
|
registConfigs.add(SArenaRobotConfig.class.getAnnotation(Table.class).name());
|
||||||
|
@ -20,6 +18,7 @@ public class SArenaRobotStaticConfig extends AbstractClassStaticConfig {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void figureConfigs() {
|
public void figureConfigs() {
|
||||||
|
force2robotId = new TreeMap<>();
|
||||||
Map<Integer, SArenaRobotConfig> integerSArenaRobotConfigMap = SArenaRobotConfig.getsArenaRobotConfigMap();
|
Map<Integer, SArenaRobotConfig> integerSArenaRobotConfigMap = SArenaRobotConfig.getsArenaRobotConfigMap();
|
||||||
for(SArenaRobotConfig sArenaRobotConfig : integerSArenaRobotConfigMap.values()){
|
for(SArenaRobotConfig sArenaRobotConfig : integerSArenaRobotConfigMap.values()){
|
||||||
List<Integer> heroList = sArenaRobotConfig.getHeroList();
|
List<Integer> heroList = sArenaRobotConfig.getHeroList();
|
||||||
|
@ -30,7 +29,9 @@ public class SArenaRobotStaticConfig extends AbstractClassStaticConfig {
|
||||||
sArenaRobotConfig.setBreakId(heroBreakId);
|
sArenaRobotConfig.setBreakId(heroBreakId);
|
||||||
sArenaRobotConfig.setStarOfHeroMap(starHeroMap);
|
sArenaRobotConfig.setStarOfHeroMap(starHeroMap);
|
||||||
}
|
}
|
||||||
sArenaRobotConfig.setTotalForce(HeroLogic.getInstance().calRobotTotalForce(sArenaRobotConfig));
|
int totleForce = HeroLogic.getInstance().calRobotTotalForce(sArenaRobotConfig);
|
||||||
|
sArenaRobotConfig.setTotalForce(totleForce);
|
||||||
|
force2robotId.put(totleForce,sArenaRobotConfig.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
int[][] returnMaterials = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getReturnMaterials();
|
int[][] returnMaterials = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getReturnMaterials();
|
||||||
|
@ -44,4 +45,13 @@ public class SArenaRobotStaticConfig extends AbstractClassStaticConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Integer getFloorForce2robotId(int force) {
|
||||||
|
|
||||||
|
Map.Entry<Integer,Integer> entry = force2robotId.ceilingEntry(force);
|
||||||
|
if(null==entry){
|
||||||
|
return force2robotId.firstEntry().getValue();
|
||||||
|
}
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,7 @@ public class UserManager {
|
||||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
|
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
|
||||||
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
|
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
|
||||||
playerManager.setRideLevel(1);
|
playerManager.setRideLevel(1);
|
||||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, 1, true);
|
|
||||||
playerManager.setMaxForce(force);
|
|
||||||
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
PlayerLogic.getInstance().vipflushEveryDay(user,null);
|
||||||
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
|
||||||
PlayerLogic.getInstance().playerInfoUpdate(user);
|
PlayerLogic.getInstance().playerInfoUpdate(user);
|
||||||
|
@ -109,6 +108,9 @@ public class UserManager {
|
||||||
List<Hero> teamHeros = new ArrayList<>(1);
|
List<Hero> teamHeros = new ArrayList<>(1);
|
||||||
teamHeros.add(heroMap.values().iterator().next());
|
teamHeros.add(heroMap.values().iterator().next());
|
||||||
teamPosManager.addTeamOfInitPlayer(teamHeros);
|
teamPosManager.addTeamOfInitPlayer(teamHeros);
|
||||||
|
int force = HeroLogic.getInstance().calTeamTotalForce(user, 1, true);
|
||||||
|
playerManager.setMaxForce(force);
|
||||||
|
user.getExpeditionManager().setForceSnap(force);
|
||||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.expedition;
|
||||||
|
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.PlayStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.PlayStaticConfig;
|
||||||
|
import com.ljsd.jieling.config.clazzStaticCfg.SArenaRobotStaticConfig;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
|
@ -71,8 +72,6 @@ public class ExpeditionLogic {
|
||||||
manager.clearPropertyItems();
|
manager.clearPropertyItems();
|
||||||
manager.getHeroHPWithChange().clear();
|
manager.getHeroHPWithChange().clear();
|
||||||
reSetNode(user);
|
reSetNode(user);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void takeAllReward(User user)throws Exception {
|
private void takeAllReward(User user)throws Exception {
|
||||||
|
@ -190,8 +189,15 @@ public class ExpeditionLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加节点战力数据 匹配的战力数值= 每层的基准战力+random战力+ 类型加成战力
|
||||||
|
* 优先从战力排行榜中向下匹配真人数据 ,没有从机器人中匹配
|
||||||
|
* @param user
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
private void reSetNode(User user) throws Exception {
|
private void reSetNode(User user) throws Exception {
|
||||||
|
|
||||||
|
//创建节点数据
|
||||||
Set<ExpeditionNodeInfo> nodeSets = createNodeSet();
|
Set<ExpeditionNodeInfo> nodeSets = createNodeSet();
|
||||||
|
|
||||||
//存储并设置英雄快照
|
//存储并设置英雄快照
|
||||||
|
@ -199,7 +205,7 @@ public class ExpeditionLogic {
|
||||||
int sortId = nodeInfo.getSortId();
|
int sortId = nodeInfo.getSortId();
|
||||||
try {
|
try {
|
||||||
//生成节点boss信息
|
//生成节点boss信息
|
||||||
int size = STableManager.getConfig(SExpeditionFloorConfig.class).size();
|
float size = (float)STableManager.getConfig(SExpeditionFloorConfig.class).size();
|
||||||
//战力基准值=maxforce*0.8+1/15(max-min)*lay)
|
//战力基准值=maxforce*0.8+1/15(max-min)*lay)
|
||||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||||
if (sExpeditionSetting == null) {
|
if (sExpeditionSetting == null) {
|
||||||
|
@ -207,7 +213,7 @@ public class ExpeditionLogic {
|
||||||
}
|
}
|
||||||
int minFoce = sExpeditionSetting.getMatchForce()[0];
|
int minFoce = sExpeditionSetting.getMatchForce()[0];
|
||||||
int manFoce = sExpeditionSetting.getMatchForce()[1];
|
int manFoce = sExpeditionSetting.getMatchForce()[1];
|
||||||
int standerFoce = (int) (user.getExpeditionManager().getForceSnap() * (minFoce / 10000f) + nodeInfo.getLay() / size * (manFoce - minFoce) / 10000f);
|
int standerFoce = (int) (user.getExpeditionManager().getForceSnap() * (minFoce / 10000f) + nodeInfo.getLay() / size * (manFoce - minFoce));
|
||||||
int randomForce = (int) (standerFoce * ((sExpeditionSetting.getMatchForceRange()[0] + (int) (Math.random() * (sExpeditionSetting.getMatchForceRange()[1] - sExpeditionSetting.getMatchForceRange()[0]))) / 10000f));
|
int randomForce = (int) (standerFoce * ((sExpeditionSetting.getMatchForceRange()[0] + (int) (Math.random() * (sExpeditionSetting.getMatchForceRange()[1] - sExpeditionSetting.getMatchForceRange()[0]))) / 10000f));
|
||||||
|
|
||||||
//TODO 战斗节点 不同类型 额外战力加成 走配置
|
//TODO 战斗节点 不同类型 额外战力加成 走配置
|
||||||
|
@ -220,12 +226,13 @@ public class ExpeditionLogic {
|
||||||
|
|
||||||
if (typedTuples.size() == 0) {
|
if (typedTuples.size() == 0) {
|
||||||
//战力没有获取到 从机器人中选
|
//战力没有获取到 从机器人中选
|
||||||
Set<Integer> set = ArenaLogic.randomRobot(SArenaSetting.getSArenaSetting().getScore(), 1);
|
// Set<Integer> set = ArenaLogic.randomRobot(SArenaSetting.getSArenaSetting().getScore(), 1);
|
||||||
if (set.size() == 0) {
|
//// if (set.size() == 0) {
|
||||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
//// throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||||
}
|
//// }
|
||||||
int robotId = set.iterator().next();
|
// int robotId = set.iterator().next();
|
||||||
|
//提前战力排序 支持战力查找机器人
|
||||||
|
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId(randomForce);
|
||||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||||
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue