战力修改,山河试炼改为开服时间校验
parent
f45cb1507d
commit
0d5bb21157
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version":"6",
|
"version":"5",
|
||||||
"tables":"RewardGroup|RewardItemConfig"
|
"tables":""
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.handler.hardStage;
|
package com.ljsd.jieling.handler.hardStage;
|
||||||
|
|
||||||
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.fight.ArenaRecord;
|
import com.ljsd.fight.ArenaRecord;
|
||||||
import com.ljsd.fight.CheckFight;
|
import com.ljsd.fight.CheckFight;
|
||||||
import com.ljsd.fight.FightType;
|
import com.ljsd.fight.FightType;
|
||||||
|
@ -63,8 +64,8 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
||||||
List<Integer> dropList = new ArrayList<>();
|
List<Integer> dropList = new ArrayList<>();
|
||||||
SHardStage nodeConfig = SHardStage.getConfigMap().get(nodeId);
|
SHardStage nodeConfig = SHardStage.getConfigMap().get(nodeId);
|
||||||
|
|
||||||
long createTime = user.getPlayerInfoManager().getCreateTime();
|
long openTime = GameApplication.serverConfig.getCacheOpenTime();
|
||||||
int days = TimeUtils.getSoFarWentDays(createTime, TimeUtils.now());
|
int days = TimeUtils.getSoFarWentDays(openTime, TimeUtils.now());
|
||||||
if (days < nodeConfig.getOpenTime()){
|
if (days < nodeConfig.getOpenTime()){
|
||||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE, "关卡未开启");
|
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE, "关卡未开启");
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,12 +41,13 @@ public class SweepBattleRequestHandler extends BaseHandler<FightInfoProto.SweepD
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int privilageType = SSpecialConfig.getIntegerValue(SSpecialConfig.SWEEP_ONEKEY);
|
int privilageType = SSpecialConfig.getIntegerValue(SSpecialConfig.SWEEP_ONEKEY);
|
||||||
|
int[][] configReward = sFloodConfig.getReward();
|
||||||
if(isOnekey){
|
if(isOnekey){
|
||||||
int times = PlayerLogic.getInstance().checkAndConsumeAllPrivilegeTimes(user,privilageType);
|
int times = PlayerLogic.getInstance().checkAndConsumeAllPrivilegeTimes(user,privilageType);
|
||||||
if(times>0){
|
if(times>0){
|
||||||
int[][] reward = new int[times*sFloodConfig.getReward().length][2];
|
int[][] reward = new int[times * configReward.length][2];
|
||||||
for(int i =0;i<reward.length;){
|
for(int i =0;i<reward.length;){
|
||||||
for (int [] a :sFloodConfig.getReward()) {
|
for (int [] a : configReward) {
|
||||||
reward[i] = a;
|
reward[i] = a;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +59,7 @@ public class SweepBattleRequestHandler extends BaseHandler<FightInfoProto.SweepD
|
||||||
//扫荡一次
|
//扫荡一次
|
||||||
boolean isSuccess = PlayerLogic.getInstance().checkAndUpdate(user,privilageType,1);
|
boolean isSuccess = PlayerLogic.getInstance().checkAndUpdate(user,privilageType,1);
|
||||||
if(isSuccess){
|
if(isSuccess){
|
||||||
drop = ItemUtil.drop(user, sFloodConfig.getReward(), BIReason.MONSTERATTACK_REWARD);
|
drop = ItemUtil.drop(user, configReward, BIReason.MONSTERATTACK_REWARD);
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.JOIN_MONSTER_ATTACK_TIMES,1);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME,MissionType.JOIN_MONSTER_ATTACK_TIMES,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -749,15 +749,15 @@ public class CombatLogic {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Integer> passiveskillEffect(User user,Hero targetHero,int teamId){
|
public Set<Integer> passiveskillEffect(User user,Hero targetHero,int teamId){
|
||||||
Set<Integer> passiveskillEffect = new HashSet<>();
|
Set<Integer> passiveskillEffect = new HashSet<>();
|
||||||
List<Integer> heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, targetHero);
|
List<Integer> heroSkillList = HeroLogic.getInstance().getHeroSkillList(user, targetHero);
|
||||||
heroSkillList.forEach(skill->{
|
for (Integer skill : heroSkillList) {
|
||||||
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
if(config!=null &&config.getEffectiveRange()!=1 && config.getType()!=94 && PassiveskillCalEnum.contains(config.getType())){
|
if(config!=null && config.getEffectiveRange()!=1 && config.getType()!=94 && PassiveskillCalEnum.contains(config.getType())){
|
||||||
passiveskillEffect.add(config.getId());
|
passiveskillEffect.add(config.getId());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
if(teamId!=0){
|
if(teamId!=0){
|
||||||
List<Integer> result = user.getTeamPosManager().getCachePassskill().get(teamId);
|
List<Integer> result = user.getTeamPosManager().getCachePassskill().get(teamId);
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
|
@ -791,22 +791,22 @@ public class CombatLogic {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<Integer> heroSkillListTmp = HeroLogic.getInstance().getHeroSkillList(user, hero);
|
List<Integer> heroSkillListTmp = HeroLogic.getInstance().getHeroSkillList(user, hero);
|
||||||
heroSkillListTmp.forEach(skill->{
|
for (Integer skill : heroSkillListTmp) {
|
||||||
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
if(config!=null &&config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
if(config!=null &&config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
||||||
passiveTeamskillEffect.add(config.getId());
|
passiveTeamskillEffect.add(config.getId());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
user.getTeamPosManager().updatePassSkillTeamPos(teamId,passiveTeamskillEffect);
|
user.getTeamPosManager().updatePassSkillTeamPos(teamId,passiveTeamskillEffect);
|
||||||
passiveskillEffect.addAll(passiveTeamskillEffect);
|
passiveskillEffect.addAll(passiveTeamskillEffect);
|
||||||
}else{
|
}else{
|
||||||
heroSkillList.forEach(skill->{
|
for (Integer skill : heroSkillList) {
|
||||||
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
SPassiveSkillLogicConfig config = SPassiveSkillLogicConfig.getConfig(skill);
|
||||||
if(config!=null &&config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
if(config!=null &&config.getEffectiveRange()==3 && PassiveskillCalEnum.contains(config.getType())){
|
||||||
passiveskillEffect.add(config.getId());
|
passiveskillEffect.add(config.getId());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return passiveskillEffect;
|
return passiveskillEffect;
|
||||||
|
|
|
@ -19,8 +19,8 @@ public enum PassiveskillCalEnum {
|
||||||
int optCode = (int) value[2];
|
int optCode = (int) value[2];
|
||||||
//转换
|
//转换
|
||||||
float parm = value[1];
|
float parm = value[1];
|
||||||
if(optCode%2==0){
|
if(optCode%2 == 0){
|
||||||
if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){
|
if(sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){
|
||||||
sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId());
|
sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId());
|
||||||
}
|
}
|
||||||
parm = value[1]*10000;
|
parm = value[1]*10000;
|
||||||
|
|
|
@ -5,22 +5,21 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.activity.event.HardStageExerciseEvent;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
|
||||||
import com.ljsd.jieling.logic.dao.HardStageManager;
|
import com.ljsd.jieling.logic.dao.HardStageManager;
|
||||||
import com.ljsd.jieling.logic.dao.Hero;
|
import com.ljsd.jieling.logic.dao.Hero;
|
||||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.*;
|
import config.SHardStage;
|
||||||
|
import config.SHardStageBuff;
|
||||||
|
import config.SHardStageReward;
|
||||||
|
import config.SSpecialConfig;
|
||||||
import org.assertj.core.util.Lists;
|
import org.assertj.core.util.Lists;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -55,13 +54,13 @@ public class HardStageLogic {
|
||||||
OptionalInt maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max();
|
OptionalInt maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max();
|
||||||
if(maxChapter.isPresent()){
|
if(maxChapter.isPresent()){
|
||||||
if(map.containsKey(maxChapter.getAsInt())){
|
if(map.containsKey(maxChapter.getAsInt())){
|
||||||
int maxId = map.get(maxChapter.getAsInt()).getNodeList().stream().mapToInt(n->n.getId()).max().getAsInt();
|
int maxId = map.get(maxChapter.getAsInt()).getNodeList().stream().mapToInt(HardStageNode::getId).max().getAsInt();
|
||||||
|
|
||||||
if(map.get(maxChapter.getAsInt()).getNodeList().stream().filter(n -> n.getId()== maxId&& n.isHasPass()==true).collect(Collectors.toList()).size()>0){
|
if(map.get(maxChapter.getAsInt()).getNodeList().stream().filter(n -> n.getId() == maxId && n.isHasPass()).count() >0){
|
||||||
SHardStage config = SHardStage.getConfigMap().get(maxId);
|
SHardStage config = SHardStage.getConfigMap().get(maxId);
|
||||||
if(config != null){
|
if(config != null){
|
||||||
if (SHardStage.getPreList(config.getId()) != null) {
|
if (SHardStage.getPreList(config.getId()) != null) {
|
||||||
SHardStage.getPreList(config.getId()).stream().forEach(n -> {
|
SHardStage.getPreList(config.getId()).forEach(n -> {
|
||||||
if (n != null) {
|
if (n != null) {
|
||||||
if(user.getHardStageManager().openNewNode(user.getPlayerInfoManager().getLevel(), n)){
|
if(user.getHardStageManager().openNewNode(user.getPlayerInfoManager().getLevel(), n)){
|
||||||
user.getHardStageManager().updateString("chapterMap." + maxChapter.getAsInt(), map.get(maxChapter.getAsInt()));
|
user.getHardStageManager().updateString("chapterMap." + maxChapter.getAsInt(), map.get(maxChapter.getAsInt()));
|
||||||
|
|
|
@ -2667,6 +2667,7 @@ public class HeroLogic {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算队伍战力
|
* 计算队伍战力
|
||||||
|
* @param isForce true:展示 false:战斗
|
||||||
*/
|
*/
|
||||||
public Map<Integer, Long> calHeroNotBufferAttribute(User user, Hero hero, boolean isForce, int teamId) {
|
public Map<Integer, Long> calHeroNotBufferAttribute(User user, Hero hero, boolean isForce, int teamId) {
|
||||||
// ... 总属性计算 ...
|
// ... 总属性计算 ...
|
||||||
|
@ -2704,6 +2705,12 @@ public class HeroLogic {
|
||||||
// 被动技能
|
// 被动技能
|
||||||
applyPassiveSkillAttribute(heroAllAttribute, hero, teamId, user);
|
applyPassiveSkillAttribute(heroAllAttribute, hero, teamId, user);
|
||||||
|
|
||||||
|
//pvp队伍加成特殊处理,必须放在最后
|
||||||
|
if (!isForce && !TeamEnum.isPvpTeam(teamId)) {
|
||||||
|
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId());
|
||||||
|
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId());
|
||||||
|
}
|
||||||
|
|
||||||
// 总计算
|
// 总计算
|
||||||
calInteractAdd(heroAllAttribute, isForce);
|
calInteractAdd(heroAllAttribute, isForce);
|
||||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||||
|
@ -3189,7 +3196,7 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyTeamAttribute(Map<Integer, Long> heroAllAttribute, boolean isForce, int teamId, User user){
|
private void applyTeamAttribute(Map<Integer, Long> heroAllAttribute, boolean isForce, int teamId, User user){
|
||||||
// ... 阵营光环,大闹天宫,pvp属性 ...
|
// ... 阵营光环,大闹天宫 ...
|
||||||
if (teamId != 0) {
|
if (teamId != 0) {
|
||||||
// 阵营光环加成
|
// 阵营光环加成
|
||||||
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user, teamId);
|
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user, teamId);
|
||||||
|
@ -3203,17 +3210,12 @@ public class HeroLogic {
|
||||||
int[] onceArrayValue = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SKILL_EFFECT_TGMB);
|
int[] onceArrayValue = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SKILL_EFFECT_TGMB);
|
||||||
combinedAttribute(new int[][]{onceArrayValue}, heroAllAttribute);
|
combinedAttribute(new int[][]{onceArrayValue}, heroAllAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pvp队伍加成
|
|
||||||
if (!isForce && !TeamEnum.isPvpTeam(teamId)) {
|
|
||||||
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageBocusFactor.getPropertyId());
|
|
||||||
heroAllAttribute.remove(HeroAttributeEnum.PVPDamageReduceFactor.getPropertyId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyPassiveSkillAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, int teamId, User user){
|
private void applyPassiveSkillAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, int teamId, User user){
|
||||||
// ...被动技能处理...
|
// ...被动技能处理...
|
||||||
Set<Integer> heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero, teamId);
|
Set<Integer> heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero, teamId);
|
||||||
|
LOGGER.info("战力技能============={}",heroSkillList);
|
||||||
|
|
||||||
// 大闹天宫队伍特殊处理
|
// 大闹天宫队伍特殊处理
|
||||||
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
if (teamId == TeamEnum.EXPEDITION_TEAM.getTeamId()) {
|
||||||
|
@ -3401,6 +3403,7 @@ public class HeroLogic {
|
||||||
public int calForce(Map<Integer, Long> heroAllAttribute) {
|
public int calForce(Map<Integer, Long> heroAllAttribute) {
|
||||||
float forceNum = 0;//基础值
|
float forceNum = 0;//基础值
|
||||||
float forceAdd = 0;//加成值
|
float forceAdd = 0;//加成值
|
||||||
|
LOGGER.info("战力基础属性=================={}",heroAllAttribute);
|
||||||
//战力计算
|
//战力计算
|
||||||
for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
|
for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
|
||||||
Integer propertyId = item.getKey();
|
Integer propertyId = item.getKey();
|
||||||
|
@ -3414,13 +3417,14 @@ public class HeroLogic {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
|
if(sPropertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
|
||||||
LOGGER.info("result1 ================> {},{}" , item, sPropertyConfig.getScore());
|
|
||||||
forceAdd += propertyValue * sPropertyConfig.getScore() / 10000;
|
forceAdd += propertyValue * sPropertyConfig.getScore() / 10000;
|
||||||
|
LOGGER.info("战力加成值 ================> {},{}" , propertyId, propertyValue * sPropertyConfig.getScore() / 10000);
|
||||||
}else{
|
}else{
|
||||||
forceNum += propertyValue * sPropertyConfig.getScore();
|
forceNum += propertyValue * sPropertyConfig.getScore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float result = (forceAdd + 1) * forceNum;
|
float result = (forceAdd + 1) * forceNum;
|
||||||
|
LOGGER.info("战力总结果==============={},{},{}",forceNum,forceAdd,result);
|
||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,16 +140,15 @@ public class SCHero implements BaseConfig{
|
||||||
|
|
||||||
int[][] rankupConsumeMaterial = scHero.getRankupConsumeMaterial();
|
int[][] rankupConsumeMaterial = scHero.getRankupConsumeMaterial();
|
||||||
|
|
||||||
for(int j=0;j<rankupConsumeMaterial.length;j++){
|
for (int[] ints : rankupConsumeMaterial) {
|
||||||
int[] ints = rankupConsumeMaterial[j];
|
|
||||||
int star = ints[0];
|
int star = ints[0];
|
||||||
int position = ints[1];
|
int position = ints[1];
|
||||||
int groupID = ints[2];
|
int groupID = ints[2];
|
||||||
int nums = ints[3];
|
int nums = ints[3];
|
||||||
if(!consumeMaterialInfoByStarTmp.containsKey(star)){
|
if (!consumeMaterialInfoByStarTmp.containsKey(star)) {
|
||||||
consumeMaterialInfoByStarTmp.put(star,new HashMap<>());
|
consumeMaterialInfoByStarTmp.put(star, new HashMap<>());
|
||||||
}
|
}
|
||||||
consumeMaterialInfoByStarTmp.get(star).put(position,new ConsumeMaterialInfo(groupID,nums));
|
consumeMaterialInfoByStarTmp.get(star).put(position, new ConsumeMaterialInfo(groupID, nums));
|
||||||
}
|
}
|
||||||
scHero.setConsumeMaterialInfoOfPositionByStar(consumeMaterialInfoByStarTmp);
|
scHero.setConsumeMaterialInfoOfPositionByStar(consumeMaterialInfoByStarTmp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue