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