From 31ffa233f1fb9287415d911e14af4a2fe5c8e29a Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 12:07:15 +0800 Subject: [PATCH 01/13] fix pokenmon --- .../src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 0afad01bb..df7671b16 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -946,6 +946,9 @@ public class HeroLogic { pokenSkillResult.append(sDifferDemonsStageConfig.getPassiveSkillString()).append("|"); } String s = pokenSkillResult.toString(); + if(StringUtil.isEmpty(s)){ + return ""; + } return s.substring( 0,(s.length()-1)); } From 2db0ac3d10ec9446abb3d89c538e85abd251cd41 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 13:37:54 +0800 Subject: [PATCH 02/13] delete log --- .../java/com/ljsd/jieling/logic/hero/HeroLogic.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index df7671b16..154e552a8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -972,7 +972,6 @@ public class HeroLogic { SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId()); int profession = scHero.getProfession(); Map pokemonMap = pokemonManager.getPokemonMap(); - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); for(Map.Entry item : pokemonMap.entrySet()){ Pokemon pokemon = item.getValue(); Map comonpentsLevelMap = pokemon.getComonpentsLevelMap(); @@ -989,7 +988,6 @@ public class HeroLogic { combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(),heroAllAttribute); } } - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); //装备总战力评分 int equipForce=0; boolean needRemove = false; @@ -1037,7 +1035,6 @@ public class HeroLogic { HandlerLogicThread handlerThread = instance.handlerThreads[user.getId() % instance.HANDLER_THREAD_NUM]; handlerThread.addAyyncWorker(ayyncWorker); } - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); //天赋异妖加成 Map ringFireMap = pokemonManager.getRingFireMap(); for(Map.Entry item : ringFireMap.entrySet()){ @@ -1066,12 +1063,10 @@ public class HeroLogic { SRingFireMaterialConfig sRingFireMaterialConfig = SRingFireMaterialConfig.config.get(comonpentId); int[][] comonpentIdProperty = sRingFireMaterialConfig.getProperty(); combinedAttribute(comonpentIdProperty,heroAllAttribute); - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); } } - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); //工坊科技树加成 - /* Map techProfressionMap = user.getWorkShopController().getTechnologyMap().get(scHero.getProfession()); + Map techProfressionMap = user.getWorkShopController().getTechnologyMap().get(scHero.getProfession()); if(techProfressionMap!=null){ for(Map.Entry item : techProfressionMap.entrySet()){ SWorkShopTechnology sWorkShopTechnology = SWorkShopTechnology.getsWorkTechMapByTechIdAndLevel(item.getKey(), item.getValue()); @@ -1084,7 +1079,7 @@ public class HeroLogic { } } - }*/ + } //阵营光环加成 if(!isForce){ if(teamId!=0){ @@ -1100,7 +1095,6 @@ public class HeroLogic { heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE)); //装备战力保存 heroAllAttribute.put(HeroAttributeEnum.EquipForce.getPropertyId(),equipForce); - LOGGER.info("cal herotid = {},hero51value = {},end",hero.getTemplateId(),heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())); return heroAllAttribute; } From 31bbc0a27c9b627435cd108182302a2891a73cb0 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 14:04:53 +0800 Subject: [PATCH 03/13] fix fight data --- .../src/main/java/com/ljsd/jieling/util/FightDataUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java index 35267efdb..ba8f8634e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java @@ -102,6 +102,7 @@ public class FightDataUtil { enemyData.rawset(i+1, unitData); } enemyData.set("teamSkill", getTeamSkill(data.getTeamSkillList().trim())); + enemyData.set("teamPassive", new LuaTable()); return enemyData; } From 3ee89d5862193cc0f5849b8a13d32b72ffca717b Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 14:17:54 +0800 Subject: [PATCH 04/13] add bloody --- .../ljsd/jieling/battle/BattleManager.java | 80 +++++++++++++++++++ .../ljsd/jieling/battle/actor/BufferType.java | 19 +++++ .../ljsd/jieling/battle/actor/Creature.java | 44 ++++++---- .../jieling/battle/actor/EffectBuffer.java | 4 + .../ljsd/jieling/battle/actor/EventType.java | 2 + .../com/ljsd/jieling/battle/actor/Life.java | 3 + .../com/ljsd/jieling/battle/actor/Scene.java | 61 +++++++++++++- .../ljsd/jieling/battle/actor/SceneActor.java | 71 +++++++++++++--- .../ljsd/jieling/battle/actor/StateType.java | 2 + .../ljsd/jieling/battle/room/BeanToProto.java | 6 ++ .../jieling/battle/room/SceneManager.java | 45 +++++++++-- .../jieling/config/SBloodyBattleSetting.java | 34 ++++++++ .../ljsd/jieling/config/SEquipTalismana.java | 67 ++++++++++++++++ .../jieling/config/SEquipTalismanaRankup.java | 43 ++++++++++ .../ljsd/jieling/logic/fight/CombatLogic.java | 2 +- .../jieling/logic/hero/HeroAttributeEnum.java | 1 + .../java/com/ljsd/jieling/util/MathUtils.java | 16 ++++ 17 files changed, 464 insertions(+), 36 deletions(-) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/actor/BufferType.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java index 4a1ebecd9..4abaeae8a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java @@ -8,6 +8,9 @@ import com.ljsd.jieling.battle.actor.Life; import com.ljsd.jieling.battle.actor.SceneMonster; import com.ljsd.jieling.config.SArenaSetting; import com.ljsd.jieling.config.SBloodyBattleSetting; +import com.ljsd.jieling.config.SFoodsConfig; +import com.ljsd.jieling.config.SPropertyConfig; +import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.globals.Global; import com.ljsd.jieling.handler.map.behavior.BehaviorUtil; import com.ljsd.jieling.logic.blood.BloodLogic; @@ -16,6 +19,7 @@ import com.ljsd.jieling.logic.dao.Hero; import com.ljsd.jieling.logic.dao.TeamPosHeroInfo; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.fight.CheckFight; +import com.ljsd.jieling.logic.fight.CombatLogic; import com.ljsd.jieling.logic.fight.FightType; import com.ljsd.jieling.logic.hero.HeroAttributeEnum; import com.ljsd.jieling.logic.hero.HeroLogic; @@ -175,4 +179,80 @@ public class BattleManager { .build(); } + + /** + * result :1 血量变化 + * @param uid + * @param foodId + */ + public static Map eatBuffer(int uid,int foodId,int optionalParm){ + SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; + Map debuffMap = sBloodyBattleSetting.getDebuffMap(); + SFoodsConfig sFoodsConfig = SFoodsConfig.getsFoodsConfigByFoodId(foodId); + int target = sFoodsConfig.getTarget(); + Map result = new HashMap<>(1); + if(target == 1){ + UserBloodySnpInfo redUserBloodySnpInfo = bloodMyHeroInfoMap.get(uid); + int limmitValue = debuffMap.get(foodId)[1]; + int resultValue = 0; + Map foddAddResult = new HashMap<>(); + CombatLogic.getInstance().getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON,foddAddResult,sFoodsConfig); + Map heroAllAttributes = redUserBloodySnpInfo.getHeroAllAttributes(); + for(FamilyHeroInfo familyHeroInfo : heroAllAttributes.values()){ + Map attribute = familyHeroInfo.getAttribute(); + int maxHp = attribute.get(HeroAttributeEnum.Hp.getPropertyId()); // 我的最大生命值 + int curHp = attribute.get(HeroAttributeEnum.CurHP.getPropertyId()); // 我的生命值 + int minCurHp =(int)( maxHp*(limmitValue/10000F)); + if(curHp<=0){ + continue; + } + if(curHp<=minCurHp){ + resultValue+=curHp; + continue; + } + + if(foddAddResult.containsKey(HeroAttributeEnum.CurHpSpecialExtra.getPropertyId())){ + Integer specailValue = foddAddResult.get(HeroAttributeEnum.CurHpSpecialExtra.getPropertyId()); + SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.CurHpSpecialExtra.getPropertyId()); + int style = sPropertyConfig.getStyle(); + if(style == GlobalsDef.PERCENT_TYPE){ + curHp =(int)( maxHp/10000F*specailValue); + }else{ + curHp +=specailValue; + } + } + boolean needResetHp=false; + if(curHpplayerMaxSpeed){ + temp=playerMaxSpeed; + }else if(temp excludeAttackState = new HashSet<>(2); + static { + excludeAttackState.add(StateType.FROZEN); + excludeAttackState.add(StateType.INVINCIBLE); + } + public Creature(){ setStateType(StateType.MOVEABLE); } - public void setMineral(int mineral) { - this.mineral = mineral; + public void costMineral(int mineral) { + this.mineral -= mineral; } public void tick(){ @@ -141,6 +147,12 @@ public abstract class Creature extends SceneActor{ setPos(path.remove(0)); if(getType() == ActorType.Monster){ cachePath.push(getPos()); + }else{ + Integer pathMieral = getScene().getPathMieral(getPos()); + if(pathMieral!=null){ + this.addMineral(pathMieral); + getScene().processEventUpdate(EventType.SCENEACTORE_UPDATE,getId()); + } } if(checkEventTrigger(timestamp)){ break; @@ -156,7 +168,10 @@ public abstract class Creature extends SceneActor{ public boolean canMoveNext(int nextPath,boolean update){ for(SceneActor sceneActor : getScene().getSceneActorMap().values()){ - if(sceneActor == this) { + if(sceneActor == this ) { + continue; + } + if(sceneActor.getType() == ActorType.Player && sceneActor.getStateType() == StateType.INVINCIBLE){ continue; } if(sceneActor.getType()!=ActorType.Mineral && sceneActor.getPos() == nextPath){ @@ -177,8 +192,6 @@ public abstract class Creature extends SceneActor{ //打断自己行使路线 广播自己状态 位置信息 this.preMoveTimestamp = timestamp; if(this.getType() != ActorType.Monster){ - /*Collections.reverse(path); - cachePath.addAll(path);*/ this.path.clear(); } @@ -208,35 +221,36 @@ public abstract class Creature extends SceneActor{ int curPos = getPos(); boolean result= false; ActorType type = sceneActor.getType(); - int triggerEvent = 0; + //int triggerEvent = 0; + int triggerBuffer = 0; if(type == ActorType.Npc){ if(curPos == sceneActor.getPos()){ - triggerEvent=1; + triggerBuffer=1; } } if(type == ActorType.Mineral && this.getType() == ActorType.Player){ if(curPos == sceneActor.getPos()){ - triggerEvent=2; + triggerBuffer=BufferType.DIGGER.getType(); setStateType(StateType.DIGGER); } } if(type == ActorType.Monster || type == ActorType.Player){ - if(getStateType()!=StateType.FROZEN &&sceneActor.getStateType()!= StateType.FROZEN&& xySet.contains(sceneActor.getPos())){ - triggerEvent=3; + if(!excludeAttackState.contains(getStateType()) && !excludeAttackState.contains(sceneActor.getStateType()) && xySet.contains(sceneActor.getPos()) ){ + triggerBuffer=BufferType.BATTLE.getType(); setStateType(StateType.FROZEN); //异步计算战斗结果 getScene().execASync(new BattleRequest(timestamp,this,sceneActor,sceneActor.getType())); LOGGER.info("the attackUid={},the battleId={}",this.getId(),sceneActor.getId()); } } - if(triggerEvent!=0){ - if(triggerEvent == 3 || this.getType() == ActorType.Player){ - EffectBuffer effectBuffer = new EffectBuffer(getScene().getBufferId(),triggerEvent, timestamp, -1,getId(), sceneActor.getId(), -1); + if(triggerBuffer!=0){ + if(triggerBuffer == 3 || this.getType() == ActorType.Player){ + EffectBuffer effectBuffer = new EffectBuffer(getScene().getBufferId(),triggerBuffer, timestamp, -1,getId(), sceneActor.getId(), -1); whenTriggerEvent(effectBuffer,timestamp); result = true; } - if(triggerEvent == 3 ){ - EffectBuffer othereffectBuffer = new EffectBuffer(getScene().getBufferId(),triggerEvent, timestamp, -1,sceneActor.getId(),getId(), -1); + if(triggerBuffer == 3 ){ + EffectBuffer othereffectBuffer = new EffectBuffer(getScene().getBufferId(),triggerBuffer, timestamp, -1,sceneActor.getId(),getId(), -1); sceneActor.whenTriggerEvent(othereffectBuffer,timestamp); result = true; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EffectBuffer.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EffectBuffer.java index f72fca8ef..ef7fc3c31 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EffectBuffer.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EffectBuffer.java @@ -27,6 +27,10 @@ public class EffectBuffer { this.values.add(value); } + public void updateEffectValue(int index,int value){ + this.values.set(index,value); + } + public int getId() { return id; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EventType.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EventType.java index 44c60d125..cf5aaf9bd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EventType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/EventType.java @@ -5,5 +5,7 @@ public enum EventType { BUFFER_UPDATE, BUFFER_REMOVE, SCENEACTORE_REMOVE, + POSMINERAL_UPDATE, + POSMINERAL_REMOVE, } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Life.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Life.java index 14c0aeace..e42e4303d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Life.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Life.java @@ -27,6 +27,9 @@ public class Life { return changeValue; } + public void setCurHp(int curHp) { + this.curHp = curHp; + } public int getCurHp() { return curHp; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java index a290f8925..68c92aa60 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java @@ -15,6 +15,7 @@ import com.ljsd.jieling.logic.OnlineUserManager; import com.ljsd.jieling.logic.dao.UserManager; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.protocols.SceneFight; import com.ljsd.jieling.util.MathUtils; @@ -40,9 +41,51 @@ public class Scene implements Runnable{ private BlockingUniqueQueue commandBlockingUniqueQueue = new BlockingUniqueQueue<>(); private Map minealForPosMap = new HashMap<>(); + public Map getMinealForPosMap() { + return minealForPosMap; + } + + public Integer getPathMieral(int pos){ + return minealForPosMap.remove(pos); + } + + + public void randomMineralOfUserDeath(Creature creature,int totalMineal){ + if(totalMineal <=0){ + return; + } + int maxPoss = SBloodyBattleSetting.sBloodyBattleSetting.getMonsterDrop()[1]; + Set possiblePosSet = SceneManager.selectForPlayerMineal(this, creature.getPos()); + int size = possiblePosSet.size(); + int reallyPos = maxPoss>size?size:maxPoss; + reallyPos = reallyPos>totalMineal?totalMineal:reallyPos; + int a = totalMineal/reallyPos; + int b = totalMineal%reallyPos; + Iterator iterator = possiblePosSet.iterator(); + int nums = 0; + while (iterator.hasNext()){ + int extra = nums0){ + processEventUpdate(EventType.SCENEACTORE_UPDATE,sceneActor.getId()); + } } public void addCommand(Command command){ @@ -124,6 +167,12 @@ public class Scene implements Runnable{ int deadId = (int) parm; builder.addRemoveActorId(deadId); break; + case POSMINERAL_REMOVE: + builder.addRemovePosMineralId( (int) parm); + break; + case POSMINERAL_UPDATE: + builder.addPosMineral((CommonProto.PosMineral)parm); + break; } } @@ -139,6 +188,7 @@ public class Scene implements Runnable{ break; } tick++; + sysTick(); tick(); if(tick/20 == 1 && tick%20==0){ startAllRunning(); @@ -174,7 +224,7 @@ public class Scene implements Runnable{ if(nums == null){ nums = 0; } - mineralNums.put(size,nums); + mineralNums.put(size,nums+1); } } for(int[] mineralCeilingSingle :mineralCeiling){ @@ -189,8 +239,13 @@ public class Scene implements Runnable{ existNums = 0; } //新增矿点 - if(maxNums > existNums){ - + int needAdd = maxNums -existNums; + if(needAdd>0){ + if(needAdd>flushNums){ + needAdd = flushNums; + } + SceneManager.createMinear(this,size,needAdd); + System.out.println("创建矿...."); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java index 6e86fbf10..5c574ceb0 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java @@ -2,6 +2,7 @@ package com.ljsd.jieling.battle.actor; +import com.ljsd.jieling.battle.BattleManager; import com.ljsd.jieling.battle.room.SceneManager; import com.ljsd.jieling.config.SBloodyBattleSetting; @@ -30,16 +31,20 @@ public abstract class SceneActor{ } public void addOrUpdateBuffer(EffectBuffer effectBuffer){ - bufferMap.put(effectBuffer.getId(),effectBuffer); + System.out.println(effectBuffer); - if(effectBuffer.getType() == 3){ + if(effectBuffer.getType() == BufferType.BATTLE.getType()){ stateType = StateType.FROZEN; scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,this.getId()); + //停止挖矿 + checkUpdateBuffer(effectBuffer.getStartTime(),true); System.out.println("the actor" + id + "is frozen"); } - if(effectBuffer.getType() == 2){ + if(effectBuffer.getType() == BufferType.DIGGER.getType()){ + effectBuffer.updateEffectValue(0,0); scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,this.getId()); } + bufferMap.put(effectBuffer.getId(),effectBuffer); scene.processEventUpdate(EventType.BUFFER_UPDATE,effectBuffer); } @@ -53,12 +58,12 @@ public abstract class SceneActor{ while (iterator.hasNext()){ Map.Entry next = iterator.next(); EffectBuffer value = next.getValue(); - if(value.getType() ==3 && value.getEndTime() == -1){ + if(value.getType() == BufferType.BATTLE.getType() && value.getEndTime() == -1){ continue; } - if(value.getType() == 2){ //挖矿 + if(value.getType() == BufferType.DIGGER.getType()){ //挖矿 int intervalMs = SBloodyBattleSetting.sBloodyBattleSetting.getCollectingInterval() * 1000; - int willDgger = (int)((now - value.getStartTime()) / intervalMs); + int willDgger = (int)((now - value.getStartTime()) / intervalMs)-value.getValues().get(0); Creature creature = (Creature) this; Creature mineral =(Creature) scene.getSceneActorMap().get(value.getCaster()); if(willDgger>0&&mineral.getLife().getCurHp()>0) { @@ -68,14 +73,46 @@ public abstract class SceneActor{ if(mineral.getLife().getCurHp()>0){ scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,mineral.getId()); } - value.setStartTime(value.getStartTime() + reallyDigger*intervalMs); + value.updateEffectValue(0,reallyDigger + value.getValues().get(0)); } + int[][] debuffs = SBloodyBattleSetting.sBloodyBattleSetting.getDebuff(); + for(int i=0;ivalue.getValues().get(i+1); + if(willEat){ + Map resultMap = BattleManager.eatBuffer(id, bufferId, creature.getSpeed()); + if(resultMap.containsKey(1)){ + //更新血量 + Integer totalCurHp = resultMap.get(1); + creature.getLife().setCurHp(totalCurHp); + scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,value.getId()); + }else{ + Integer speedTemp = resultMap.get(2); + if(creature.getSpeed()!=speedTemp){ + creature.setSpeed(speedTemp); + scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,value.getId()); + } + } + value.updateEffectValue(0,value.getValues().get(i+1) +1); + } + + } + if(needRemoveDigger || mineral.getLife().getCurHp()<=0 ){ iterator.remove(); if(mineral.getLife().getCurHp()<=0){ scene.processEventUpdate(EventType.SCENEACTORE_REMOVE,value.getCaster()); } System.out.println("remove the digger buffer" + getId()); + int[][] debuff = SBloodyBattleSetting.sBloodyBattleSetting.getDebuff(); + for(int[] debuffItem : debuff){ + int duration = debuffItem[3]; + if(duration>0){ + addOrUpdateBuffer(new EffectBuffer(scene.getBufferId(),BufferType.REMOVEBUFFER.getType(),now,now + duration*1000,id,id,0)); + } + } scene.processEventUpdate(EventType.BUFFER_REMOVE,value.getId()); } continue; @@ -95,7 +132,7 @@ public abstract class SceneActor{ public void whenBufferRemove(EffectBuffer value,long now){ int type = value.getType(); - if(type == 3){ + if(type == BufferType.BATTLE.getType()){ int effectValue = value.getValues().get(0); if(effectValue == 0){ //战斗失败 if(getType() == ActorType.Monster){ @@ -115,25 +152,37 @@ public abstract class SceneActor{ int mineral = creature.getMineral(); if(mineral>1){ int gainMineral=mineral/2 + mineral%2; - creature.setMineral(mineral -gainMineral); + creature.costMineral(mineral -gainMineral); scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,creature.getId()); if(this.getType() == ActorType.Player){ ((Creature)this).addMineral(gainMineral); }else{ - //todo 随机散落 + scene.randomMineralOfUserDeath(creature,gainMineral); } } } stateType = StateType.MOVEABLE; + ((Creature)this).setPreMoveTimestamp(now); scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,this.getId()); } - }else if(type == 4){ + }else if(type == BufferType.REBIRTH.getType()){ if(getType() == ActorType.Monster){ Creature creature = (Creature) this; creature.setPreMoveTimestamp(now); } stateType = StateType.MOVEABLE; + if(getType() == ActorType.Player){ + //如果是玩家获得无敌buffer + addOrUpdateBuffer(new EffectBuffer(scene.getBufferId(),BufferType.INVINCIBLE.getType(),now,now+SBloodyBattleSetting.sBloodyBattleSetting.getInvincible(),id,id,-1)); + stateType=StateType.INVINCIBLE; + } + scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,this.getId()); + }else if(type == BufferType.INVINCIBLE.getType() ){ + stateType=StateType.MOVEABLE; + } else if(type == BufferType.REMOVEBUFFER.getType() ){ + Creature creature = (Creature) this; + creature.setSpeed(SBloodyBattleSetting.sBloodyBattleSetting.getPlayerSpeed()); scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,this.getId()); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/StateType.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/StateType.java index a535dc019..8a3237e7a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/StateType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/StateType.java @@ -7,6 +7,8 @@ public enum StateType { FROZEN(4), //不可移动 MOVEABLE(5), //可移动 DIGGER(5), //可移动 + INVINCIBLE(5), //无敌 + ; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/BeanToProto.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/BeanToProto.java index 3e690b088..3fea038b1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/BeanToProto.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/BeanToProto.java @@ -80,6 +80,12 @@ public class BeanToProto { builder.addActorEffectBufferInfo(getActorEffectBufferInfo(next.getValue())); } } + Map minealForPosMap = scene.getMinealForPosMap(); + for(Map.Entry item : minealForPosMap.entrySet()){ + Integer key = item.getKey(); + Integer value = item.getValue(); + builder.addPosMineral(CommonProto.PosMineral.newBuilder().setPos(key).setNums(value).build()); + } builder.addAllBarrierPoint(SceneManager.bloodyMap.getBarrierPoints()); return builder.build(); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java index 4d73ecf71..23fae70c1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java @@ -49,14 +49,16 @@ public class SceneManager { } } int[][] mineralCeiling = SBloodyBattleSetting.sBloodyBattleSetting.getMineralCeiling(); - int min =999999999; - for(int[] mineralCeilingSingle : mineralCeiling){ - int minRound = mineralCeilingSingle[1]; - if(min < minRound){ - min = minRound; + int max =mineralCeiling[0][1]; + for(int i=1;i selectForPlayerMineal(Scene scene,int deathPos){ + SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(bloodyMap.getMapId()); + int[] size = sChallengeMapConfig.getSize(); + int maxX = size[0]; + int maxY = size[1]; + SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; + int selectNums = sBloodyBattleSetting.getMonsterDrop()[1]; + int[] xy = CellUtil.pos2XY(deathPos); + Set cache = new HashSet<>(); + CellUtil.calSurPos(xy[0],xy[1],sBloodyBattleSetting.getMonsterDrop()[0],maxX,maxY,cache); + List excludePosList = new ArrayList<>(); + Map sceneActorMap = scene.getSceneActorMap(); + for(SceneActor sceneActor : sceneActorMap.values()){ + int pos = sceneActor.getPos(); + excludePosList.add(pos); + } + cache.removeAll(excludePosList); + cache.removeAll(bloodyMap.getBarrierPoints()); + if(cache.isEmpty()){ + cache.add(deathPos); + } + return cache; + + } + + //玩家阵亡选择出生点 public static int selectForPlayerRebirth(Scene scene){ List excludePosList = new ArrayList<>(); Map sceneActorMap = scene.getSceneActorMap(); @@ -347,6 +377,9 @@ public class SceneManager { } } + + + public static void main(String[] args) throws InterruptedException { createScene(); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java index 4c8ae2a11..d54c5bd93 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java @@ -67,6 +67,14 @@ public class SBloodyBattleSetting implements BaseConfig { private int[] fightTime; + private int[] monsterDrop; + + private int playerMaxSpeed; + + private int playerMinSpeed; + + private Map debuffMap; + @Override public void init() throws Exception { @@ -94,6 +102,11 @@ public class SBloodyBattleSetting implements BaseConfig { for(int[] mineralCeilingSingle : sBloodyBattleSettingTmp.getMineralCeiling()){ mineralCeilingMapTmp.put(mineralCeilingSingle[0],mineralCeilingSingle); } + Map debuffMapTmp = new HashMap<>(); + for(int[] debuffItem : sBloodyBattleSettingTmp.getDebuff()){ + debuffMapTmp.put(debuffItem[0],debuffItem); + } + sBloodyBattleSettingTmp.setDebuffMap(debuffMapTmp); sBloodyBattleSettingTmp.setMonsterPotrolPaths(monsterPotrolPaths); sBloodyBattleSettingTmp.setInitializeMineMap(initializeMineMapTmp); sBloodyBattleSettingTmp.setMineralCeilingMap(mineralCeilingMapTmp); @@ -224,4 +237,25 @@ public class SBloodyBattleSetting implements BaseConfig { public int[] getFightTime() { return fightTime; } + + public int[] getMonsterDrop() { + return monsterDrop; + } + + + public Map getDebuffMap() { + return debuffMap; + } + + public void setDebuffMap(Map debuffMap) { + this.debuffMap = debuffMap; + } + + public int getPlayerMaxSpeed() { + return playerMaxSpeed; + } + + public int getPlayerMinSpeed() { + return playerMinSpeed; + } } \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java new file mode 100644 index 000000000..1876e53c7 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java @@ -0,0 +1,67 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="EquipTalismana") +public class SEquipTalismana implements BaseConfig { + + private int id; + + private int talismanaId; + + private int level; + + private int[][] rankupBasicMaterial; + + private int[][] rankupConsumeMaterial; + + private int[][] property; + + private int[][] specialProperty; + + private int openSkillRules; + + + @Override + public void init() throws Exception { + + } + + + public int getId() { + return id; + } + + public int getTalismanaId() { + return talismanaId; + } + + public int getLevel() { + return level; + } + + public int[][] getRankupBasicMaterial() { + return rankupBasicMaterial; + } + + public int[][] getRankupConsumeMaterial() { + return rankupConsumeMaterial; + } + + public int[][] getProperty() { + return property; + } + + public int[][] getSpecialProperty() { + return specialProperty; + } + + public int getOpenSkillRules() { + return openSkillRules; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java new file mode 100644 index 000000000..037216581 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java @@ -0,0 +1,43 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="EquipTalismanaRankup") +public class SEquipTalismanaRankup implements BaseConfig { + + private int id; + + private int issame; + + private int starLimit; + + private int isId; + + + @Override + public void init() throws Exception { + + } + + + public int getId() { + return id; + } + + public int getIssame() { + return issame; + } + + public int getStarLimit() { + return starLimit; + } + + public int getIsId() { + return isId; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java index 21efdd77c..5966ac95d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java @@ -163,7 +163,7 @@ public class CombatLogic { return foddAddResult; } - private void getFoodAttributeAdd(int type, int target, Map foddAddResult, SFoodsConfig sFoodsConfig) { + public void getFoodAttributeAdd(int type, int target, Map foddAddResult, SFoodsConfig sFoodsConfig) { int typeTmp = sFoodsConfig.getType(); int targetTmp = sFoodsConfig.getTarget(); if( typeTmp==type && targetTmp==target ){ diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroAttributeEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroAttributeEnum.java index aa01ae02d..3376cf621 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroAttributeEnum.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroAttributeEnum.java @@ -19,6 +19,7 @@ public enum HeroAttributeEnum { AntiCritDamageFactor(60), DifferDemonsBocusFactor(66), CurHpExtra(67), + CurHpSpecialExtra(68), FireDamageBonusFactor(101), WindDamageBonusFactor(102), WaterDamageBonusFactor(103), diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java b/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java index eacddca3e..b16d6d710 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java @@ -273,4 +273,20 @@ public class MathUtils { return randomIndex; } + //计算最大公约数 + public static int getGCD(int a,int b){ + if(a<0 || b<0){ + return -1; + } + if(b==0){ + return a; + } + while (a%b!=0){ + int temp = a % b; + a = b; + b = temp; + } + return b; + } + } From 7b8f7e8f7e52fa75e7cf124ea4f2f23fd4d0fcc4 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 14:26:21 +0800 Subject: [PATCH 05/13] fix check fight data --- .../src/main/java/com/ljsd/jieling/util/FightDataUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java index ba8f8634e..723b222cf 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java @@ -185,6 +185,9 @@ public class FightDataUtil { for (int j = 0; j < skills.length; j++) { if (skills[j].length()>0){ String[] unitSkill = skills[j].split("#"); + if(unitSkill.length==0){ + continue; + } LuaValue passivityDataPer= new LuaTable(); for(int i=0;i Date: Mon, 2 Sep 2019 15:05:21 +0800 Subject: [PATCH 06/13] fix fight --- .../src/main/java/com/ljsd/jieling/util/FightDataUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java index 723b222cf..e25d91818 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java @@ -191,6 +191,9 @@ public class FightDataUtil { LuaValue passivityDataPer= new LuaTable(); for(int i=0;i Date: Mon, 2 Sep 2019 16:12:16 +0800 Subject: [PATCH 07/13] fix differdemon null --- .../src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 154e552a8..68f7c1867 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -943,6 +943,9 @@ public class HeroLogic { int pokemonId = teamPosForPokenInfo.getPokenId(); Pokemon pokemon = pokemonMap.get(pokemonId); SDifferDemonsStageConfig sDifferDemonsStageConfig = SDifferDemonsStageConfig.getsDifferDemonsStageConfigMap(pokemonId*100 + pokemon.getAllStage()); + if(StringUtil.isEmpty(sDifferDemonsStageConfig.getPassiveSkillString())){ + continue; + } pokenSkillResult.append(sDifferDemonsStageConfig.getPassiveSkillString()).append("|"); } String s = pokenSkillResult.toString(); From e8d68d89729f0fcc368bf27f1eed25f4b52a9b4b Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 16:32:32 +0800 Subject: [PATCH 08/13] luafight --- .../Modules/Battle/Logic/Base/Passivity.lua | 57 +++++++++++++++++++ luafight/Modules/Battle/Logic/Base/Skill.lua | 12 +++- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 1 + luafight/Modules/Battle/Logic/RoleLogic.lua | 3 +- 4 files changed, 69 insertions(+), 4 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Passivity.lua b/luafight/Modules/Battle/Logic/Base/Passivity.lua index e784b363a..96742ff02 100644 --- a/luafight/Modules/Battle/Logic/Base/Passivity.lua +++ b/luafight/Modules/Battle/Logic/Base/Passivity.lua @@ -887,5 +887,62 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd) end, + + --战斗中,每[a]秒增加[b]%的异妖能量 + --a[int],b[float] + [50] = function(role, args) + local f1 = args[1] + local f2 = args[2] + + local auraBuff = Buff.Create(role, BuffName.Aura, 0, function (r) + BattleLogic.AddMP(role.camp, f2 * 100) + end) + auraBuff.interval = f1 + BattleLogic.BuffMgr:AddBuff(role, auraBuff) + end, + + --战斗中,初始拥有[a]%的异妖能量 + --a[float] + [51] = function(role, args) + local f1 = args[1] + BattleLogic.AddMP(role.camp, f1 * 100) + end, + + --战斗中,队伍每损失[a]%的生命值,增加[b]%的异妖能量 + --a[float],b[float] + [52] = function(role, args) + local f1 = args[1] + local f2 = args[2] + + local maxHp = 0 + local curHp = 0 + if f1 == 0 then + return + end + local curHpGears = 0 + local arr = BattleUtil.ChooseTarget(role, 10000) + for i=1, #arr do + curHp = curHp + arr[i]:GetRoleData(RoleDataName.Hp) + maxHp = maxHp + arr[i]:GetRoleData(RoleDataName.MaxHp) + end + + local auraBuff = Buff.Create(role, BuffName.Aura, 0, function (r) + local hp = 0 + for i=1, #arr do + hp = hp + arr[i]:GetRoleData(RoleDataName.Hp) + end + + if hp < curHp then + local gears = floor((maxHp - hp) / (f1 * maxHp)) + if gears > curHpGears then + BattleLogic.AddMP(role.camp, f2 * (gears - curHpGears) * 100) + curHpGears = gears + end + curHp = hp + end + end) + auraBuff.interval = 0 + BattleLogic.BuffMgr:AddBuff(role, auraBuff) + end, } return passivityList \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 81e45bbb8..d3c18517a 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -146,7 +146,11 @@ function Skill:Cast() if self.owner.superSkill == self then self.sp = 0 self.spPass = floor(self.cd * BattleLogic.GameFrameRate) - BattleLogic.AddMP(self.owner.camp, 10) + if BattleLogic.Type == 4 then --秘境boss的能量特殊处理 + BattleLogic.AddMP(self.owner.camp, 20) + else + BattleLogic.AddMP(self.owner.camp, 10) + end if self.owner.skill then local skill = self.owner.skill skill.sp = 0 @@ -155,7 +159,11 @@ function Skill:Cast() else self.sp = 0 self.spPass = floor(time * BattleLogic.GameFrameRate) - BattleLogic.AddMP(self.owner.camp, 5) + if BattleLogic.Type == 4 then --秘境boss的能量特殊处理 + BattleLogic.AddMP(self.owner.camp, 20) + else + BattleLogic.AddMP(self.owner.camp, 5) + end end self.owner.Event:DispatchEvent(BattleEventName.SkillCast, self) else diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index 61848666f..6bacb5a91 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -6,6 +6,7 @@ local min = math.min --local Random = Random --local RoleDataName = RoleDataName --local BattleEventName = BattleEventName +BattleUtil.Passivity = require("Modules/Battle/Logic/Base/Passivity") local function clamp(v, minValue, maxValue) if v < minValue then diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index e40e0cbc6..9126d5e34 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -7,7 +7,6 @@ local Random = Random local floor = math.floor local max = math.max local min = math.min -local Passivity = require("Modules/Battle/Logic/Base/Passivity") local aiList = { [0] = function(skill, superSkill) --默认75%释放点击技、25%释放上滑技 @@ -85,7 +84,7 @@ function RoleLogic:Init(uid, data) for j = 2, #v do args[j-1] = v[j] end - Passivity[id](self, args) + BattleUtil.Passivity[id](self, args) end end From c4a79520754af1ed068dc72b2e56a288e8d8d591 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 16:54:14 +0800 Subject: [PATCH 09/13] recovery --- .../main/java/com/ljsd/jieling/logic/item/WorkShopLogic.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/item/WorkShopLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/item/WorkShopLogic.java index 97508aa6f..0409a7a29 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/item/WorkShopLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/item/WorkShopLogic.java @@ -306,8 +306,7 @@ public class WorkShopLogic { CommonProto.Equip equipProto = CBean2Proto.getEquipProto(unDetermined); builder.setUnDetermined(equipProto); } - // builder.addAllTechnologyInfo(CBean2Proto.getTechInfo(workShopController.getTechnologyMap().values())); - builder.addAllTechnologyInfo(new ArrayList<>()); + builder.addAllTechnologyInfo(CBean2Proto.getTechInfo(workShopController.getTechnologyMap().values())); MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_WORKSHOP_INFO_RESPONSE_VALUE,builder.build(),true); } From e8b835207bf667b32af3b99cabf9f08931874e51 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 19:51:20 +0800 Subject: [PATCH 10/13] walk --- .../ljsd/jieling/battle/BattleManager.java | 20 ++++++------ .../ljsd/jieling/battle/actor/Creature.java | 8 ++++- .../com/ljsd/jieling/battle/actor/Scene.java | 32 +++++++++++++++---- .../ljsd/jieling/battle/actor/SceneActor.java | 18 ++++++++--- .../ljsd/jieling/battle/actor/SceneNpc.java | 1 - .../jieling/battle/room/SceneManager.java | 28 +++++++++++----- .../jieling/config/SBloodyBattleSetting.java | 19 +++++++++++ 7 files changed, 94 insertions(+), 32 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java index 4abaeae8a..e7f63a395 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java @@ -216,20 +216,18 @@ public class BattleManager { SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.CurHpSpecialExtra.getPropertyId()); int style = sPropertyConfig.getStyle(); if(style == GlobalsDef.PERCENT_TYPE){ - curHp =(int)( maxHp/10000F*specailValue); + curHp =curHp+(int)( maxHp/10000F*specailValue); }else{ curHp +=specailValue; } } - boolean needResetHp=false; if(curHpplayerMaxSpeed){ - temp=playerMaxSpeed; - }else if(tempplayerMinSpeed){ temp=playerMinSpeed; + }else if(temp xySet = CellUtil.getSurroundPos(15,20,curPos); + SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(SceneManager.bloodyMap.getMapId()); + int[] size = sChallengeMapConfig.getSize(); + int maxX = size[0]; + int maxY = size[1]; + Set xySet = CellUtil.getSurroundPos(maxX,maxY,curPos); Map sceneActorMap = scene.getSceneActorMap(); for(SceneActor sceneActor : sceneActorMap.values()){ if(sceneActor == this) { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java index 68c92aa60..c3ab65757 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java @@ -18,7 +18,6 @@ import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.protocols.SceneFight; -import com.ljsd.jieling.util.MathUtils; import com.ljsd.jieling.util.MessageUtil; import java.util.*; @@ -104,8 +103,31 @@ public class Scene implements Runnable{ private boolean isEnd; + private Map monsterRecoryMap = new HashMap<>(); + public void monsterReflush(){ + Iterator> iterator = monsterRecoryMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry next = iterator.next(); + Integer value = next.getValue(); + if(tick>value){ + Integer monsterIndex = next.getKey(); + System.out.println("the actor siz=" + sceneActorMap.size()); + SceneManager.createMonster(this,monsterIndex); + processEventUpdate(EventType.SCENEACTORE_UPDATE,monsterIndex); + iterator.remove(); + System.out.println("the actor after siz=" + sceneActorMap.size()); + System.out.println("the monsterid={}" + monsterIndex + "recovery"); + } + } + } + + public void whenMonsterDead(int deadId){ + System.out.println("the monster deadID="+deadId); + SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; + int[] monsterItem = sBloodyBattleSetting.getMonsterIndexMap().get(deadId); + monsterRecoryMap.put(deadId,monsterItem[1]*20 + tick); } @@ -210,6 +232,7 @@ public class Scene implements Runnable{ } public void sysTick(){ + monsterReflush(); int round = SceneManager.bloodyMap.getRound(); if( tick % round != 0){ return; @@ -293,14 +316,12 @@ public class Scene implements Runnable{ defActor = attackActor; attackActor = temp; } - /* if(defActor.getType() == ActorType.Monster || attackActor.getType() == ActorType.Monster){ + if(defActor.getType() == ActorType.Monster || attackActor.getType() == ActorType.Monster){ checkResult = BattleManager.battleOfP2M((Creature) attackActor, (SceneMonster) defActor); }else{ checkResult = BattleManager.battleOfP2P((Creature) attackActor, (Creature) defActor); - }*/ + } int[] fightTime = SBloodyBattleSetting.sBloodyBattleSetting.getFightTime(); - //todo - checkResult = new int[]{0,1000,200,0,0,0,0}; int displayTime = checkResult[1] / fightTime[0]; if(displayTime>fightTime[2]){ displayTime = fightTime[2]; @@ -308,7 +329,6 @@ public class Scene implements Runnable{ if(displayTime bufferMap = attackActor.getBufferMap(); for(EffectBuffer effectBuffer : bufferMap.values()){ if(effectBuffer.getType() == 3 && effectBuffer.getTarget() == attackActor.getId() && effectBuffer.getCaster() == defActor.getId()){ diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java index 5c574ceb0..7f7ae2431 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneActor.java @@ -42,6 +42,10 @@ public abstract class SceneActor{ } if(effectBuffer.getType() == BufferType.DIGGER.getType()){ effectBuffer.updateEffectValue(0,0); + int[][] debuff = SBloodyBattleSetting.sBloodyBattleSetting.getDebuff(); + for(int i=0;ivalue.getValues().get(i+1); + boolean willEat = ((now - value.getStartTime()) / duration/1000)>value.getValues().get(i+1); if(willEat){ Map resultMap = BattleManager.eatBuffer(id, bufferId, creature.getSpeed()); if(resultMap.containsKey(1)){ //更新血量 Integer totalCurHp = resultMap.get(1); - creature.getLife().setCurHp(totalCurHp); - scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,value.getId()); + if(totalCurHp!=creature.getLife().getCurHp()){ + creature.getLife().setCurHp(totalCurHp); + scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,value.getId()); + } }else{ Integer speedTemp = resultMap.get(2); if(creature.getSpeed()!=speedTemp){ @@ -95,7 +101,8 @@ public abstract class SceneActor{ scene.processEventUpdate(EventType.SCENEACTORE_UPDATE,value.getId()); } } - value.updateEffectValue(0,value.getValues().get(i+1) +1); + value.updateEffectValue(i+1,value.getValues().get(i+1) +1); + } } @@ -136,6 +143,7 @@ public abstract class SceneActor{ int effectValue = value.getValues().get(0); if(effectValue == 0){ //战斗失败 if(getType() == ActorType.Monster){ + scene.whenMonsterDead(id); scene.processEventUpdate(EventType.SCENEACTORE_REMOVE,this.getId()); return; } @@ -147,7 +155,7 @@ public abstract class SceneActor{ }else{ Creature creature = (Creature) scene.getSceneActorMap().get(value.getCaster()); if(creature.getType() == ActorType.Monster){ - ((Creature)this).addMineral(SBloodyBattleSetting.sBloodyBattleSetting.getMonster()[creature.getId()][2]); + ((Creature)this).addMineral(SBloodyBattleSetting.sBloodyBattleSetting.getMonster()[creature.getId()-1][2]); }else{ int mineral = creature.getMineral(); if(mineral>1){ diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneNpc.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneNpc.java index 61c320505..e9e9f1b7a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneNpc.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/SceneNpc.java @@ -1,6 +1,5 @@ package com.ljsd.jieling.battle.actor; -import java.util.List; public class SceneNpc extends Creature{ @Override diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java index 23fae70c1..b2251d7eb 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/room/SceneManager.java @@ -95,13 +95,28 @@ public class SceneManager { } //创建矿点 createMinear(scene,-1,1); - //创建怪物 + createMonster(scene,-1); + + sceneMap.put(room.getId(),scene); + + //todo 发送到redis,房间服务器去这里拿数据 + + MessageUtil.sendRoomMatchSuccessIndication(scene); + } + + public static void createMonster(Scene scene, int target) { + //创建怪物 + SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; int[][] monster = sBloodyBattleSetting.getMonster(); int[][][] monsterPatrol = sBloodyBattleSetting.getMonsterPatrol(); Map> monsterPotrolPaths = sBloodyBattleSetting.getMonsterPotrolPaths(); int monsterIndex = 0; for(int[] monsterSingle : monster){ + if(target!=-1 && target != monsterIndex +1){ + monsterIndex++; + continue; + } SceneMonster sceneMonster = new SceneMonster(); sceneMonster.setScene(scene); sceneMonster.setId(monsterIndex+1); @@ -129,17 +144,15 @@ public class SceneManager { scene.addCommand(commandC); scene.addScenActor(sceneMonster); monsterIndex++; + if(target!=-1){ + System.out.println("find and break... " + monsterIndex); + break; + } break; } - sceneMap.put(room.getId(),scene); - - //todo 发送到redis,房间服务器去这里拿数据 - - MessageUtil.sendRoomMatchSuccessIndication(scene); } - public static void createMinear(Scene scene,int target,int nums){ //创建矿点 SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; @@ -337,7 +350,6 @@ public class SceneManager { int maxX = size[0]; int maxY = size[1]; SBloodyBattleSetting sBloodyBattleSetting = SBloodyBattleSetting.sBloodyBattleSetting; - int selectNums = sBloodyBattleSetting.getMonsterDrop()[1]; int[] xy = CellUtil.pos2XY(deathPos); Set cache = new HashSet<>(); CellUtil.calSurPos(xy[0],xy[1],sBloodyBattleSetting.getMonsterDrop()[0],maxX,maxY,cache); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java index d54c5bd93..9ac552bf2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyBattleSetting.java @@ -73,7 +73,10 @@ public class SBloodyBattleSetting implements BaseConfig { private int playerMinSpeed; + private int[][] mineralId; + private Map debuffMap; + private Map monsterIndexMap; @Override @@ -106,6 +109,13 @@ public class SBloodyBattleSetting implements BaseConfig { for(int[] debuffItem : sBloodyBattleSettingTmp.getDebuff()){ debuffMapTmp.put(debuffItem[0],debuffItem); } + + Map monsterIndexMapTmp = new HashMap<>(); + int i=1; + for(int[] monsterItem : sBloodyBattleSettingTmp.getMonster()){ + monsterIndexMapTmp.put(i++,monsterItem); + } + sBloodyBattleSettingTmp.setMonsterIndexMap(monsterIndexMapTmp); sBloodyBattleSettingTmp.setDebuffMap(debuffMapTmp); sBloodyBattleSettingTmp.setMonsterPotrolPaths(monsterPotrolPaths); sBloodyBattleSettingTmp.setInitializeMineMap(initializeMineMapTmp); @@ -258,4 +268,13 @@ public class SBloodyBattleSetting implements BaseConfig { public int getPlayerMinSpeed() { return playerMinSpeed; } + + + public Map getMonsterIndexMap() { + return monsterIndexMap; + } + + public void setMonsterIndexMap(Map monsterIndexMap) { + this.monsterIndexMap = monsterIndexMap; + } } \ No newline at end of file From 1b7fd4fb567abe3498af147aca3de01eac295109 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 2 Sep 2019 20:05:33 +0800 Subject: [PATCH 11/13] monster hp --- .../java/com/ljsd/jieling/battle/BattleManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java index e7f63a395..99e1d955c 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/BattleManager.java @@ -116,18 +116,22 @@ public class BattleManager { return checkResult; } rebirth(redUserBloodySnpInfo); - creature.setLife(new Life(creature.getLife().getMaxMp(),creature.getLife().getMaxMp())); - updateMonsterHp(checkResult,sceneMonster); + int resultCurHps = updateMonsterHp(checkResult, sceneMonster); + sceneMonster.getLife().setCurHp(resultCurHps); return checkResult; } - public static void updateMonsterHp(int[] checkResult,SceneMonster sceneMonster){ + public static int updateMonsterHp(int[] checkResult,SceneMonster sceneMonster){ + int resultCurHps = 0; List oldRemainHp = sceneMonster.getRemainHps(); List result =new ArrayList<>(5); for(int i=2;i<=oldRemainHp.size()+1;i++){ result.add(checkResult[i]); + resultCurHps+=checkResult[i]; } sceneMonster.setRemainHps(result); + return resultCurHps; + } From 2ed3864e168370f68c80a0d5b5a6297cb52cc3a3 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Tue, 3 Sep 2019 10:23:51 +0800 Subject: [PATCH 12/13] store --- .../com/ljsd/jieling/battle/actor/Scene.java | 7 +++ .../jieling/battle/statics/AnalysisData.java | 30 ++++++++++++ .../battle/statics/AnalysisEventType.java | 8 +++ .../battle/statics/AnalysisProcessor.java | 8 +++ .../battle/statics/AnalysisSourceData.java | 27 ++++++++++ .../statics/BattleAnalysisProcessor.java | 16 ++++++ .../statics/DiggerAnalysisProcessor.java | 12 +++++ .../battle/statics/MessageBoxUtils.java | 18 +++++++ .../jieling/config/SBloodyMessagesConfig.java | 49 +++++++++++++++++++ .../ljsd/jieling/logic/store/StoreLogic.java | 7 +-- 10 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisData.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisEventType.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisProcessor.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisSourceData.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/BattleAnalysisProcessor.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/DiggerAnalysisProcessor.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/battle/statics/MessageBoxUtils.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyMessagesConfig.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java index c3ab65757..e38399619 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/actor/Scene.java @@ -9,6 +9,7 @@ import com.ljsd.jieling.battle.match.MatchServerice; import com.ljsd.jieling.battle.room.BeanToProto; import com.ljsd.jieling.battle.room.Command; import com.ljsd.jieling.battle.room.SceneManager; +import com.ljsd.jieling.battle.statics.AnalysisData; import com.ljsd.jieling.config.SBloodyBattleSetting; import com.ljsd.jieling.db.mongo.MongoUtil; import com.ljsd.jieling.logic.OnlineUserManager; @@ -48,6 +49,8 @@ public class Scene implements Runnable{ return minealForPosMap.remove(pos); } + private Map analysisDataMap = new HashMap<>(); + public void randomMineralOfUserDeath(Creature creature,int totalMineal){ if(totalMineal <=0){ @@ -391,4 +394,8 @@ public class Scene implements Runnable{ public void setStartTime(long startTime) { this.startTime = startTime; } + + public Map getAnalysisDataMap() { + return analysisDataMap; + } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisData.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisData.java new file mode 100644 index 000000000..7fab4687f --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisData.java @@ -0,0 +1,30 @@ +package com.ljsd.jieling.battle.statics; + +public class AnalysisData { + private int id; + private int killNums; // 杀敌次数 + private int deadNums; //死亡次数 + private int diggerTimes; // 连续挖矿次数 + private int continuousKillNums;//连续杀敌次数 + private int continuousDeadNums;//连续死亡次数 + + public AnalysisData(int id) { + this.id = id; + } + + public void win(){ + killNums++; + continuousKillNums++; + continuousDeadNums=0; + } + + public void fail(){ + deadNums++; + continuousKillNums=0; + continuousDeadNums=0; + } + + public void digger(){ + diggerTimes++; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisEventType.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisEventType.java new file mode 100644 index 000000000..671780cb4 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisEventType.java @@ -0,0 +1,8 @@ +package com.ljsd.jieling.battle.statics; + +public enum AnalysisEventType { + BATTLE, + DIGGER, + + +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisProcessor.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisProcessor.java new file mode 100644 index 000000000..90d48b8cb --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisProcessor.java @@ -0,0 +1,8 @@ +package com.ljsd.jieling.battle.statics; + +import com.ljsd.jieling.battle.actor.Scene; + +public interface AnalysisProcessor { + + void process(Scene scene,AnalysisSourceData analysisSourceData); +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisSourceData.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisSourceData.java new file mode 100644 index 000000000..e85b5bf42 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/AnalysisSourceData.java @@ -0,0 +1,27 @@ +package com.ljsd.jieling.battle.statics; + +public class AnalysisSourceData { + + private int targetId; + private int caster; + + private int value; //参数 + + public AnalysisSourceData(int targetId, int caster, int value) { + this.targetId = targetId; + this.caster = caster; + this.value = value; + } + + public int getTargetId() { + return targetId; + } + + public int getCaster() { + return caster; + } + + public int getValue() { + return value; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/BattleAnalysisProcessor.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/BattleAnalysisProcessor.java new file mode 100644 index 000000000..12f0623eb --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/BattleAnalysisProcessor.java @@ -0,0 +1,16 @@ +package com.ljsd.jieling.battle.statics; + +import com.ljsd.jieling.battle.actor.Scene; + +public class BattleAnalysisProcessor implements AnalysisProcessor{ + @Override + public void process(Scene scene, AnalysisSourceData analysisSourceData){ + AnalysisData analysisData = scene.getAnalysisDataMap().get(analysisSourceData.getTargetId()); + if(analysisSourceData.getValue() == 1){ + analysisData.win(); + }else{ + analysisData.fail(); + } + + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/DiggerAnalysisProcessor.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/DiggerAnalysisProcessor.java new file mode 100644 index 000000000..c76876aed --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/DiggerAnalysisProcessor.java @@ -0,0 +1,12 @@ +package com.ljsd.jieling.battle.statics; + +import com.ljsd.jieling.battle.actor.Scene; + +public class DiggerAnalysisProcessor implements AnalysisProcessor{ + + @Override + public void process(Scene scene, AnalysisSourceData analysisSourceData) { + AnalysisData analysisData = scene.getAnalysisDataMap().get(analysisSourceData.getTargetId()); + analysisData.digger(); + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/MessageBoxUtils.java b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/MessageBoxUtils.java new file mode 100644 index 000000000..529d98dd7 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/battle/statics/MessageBoxUtils.java @@ -0,0 +1,18 @@ +package com.ljsd.jieling.battle.statics; + +import java.util.HashMap; +import java.util.Map; + +public class MessageBoxUtils { + private static Map analysisEventTypeIntegerMap = new HashMap<>(); + static { + //更新统计数据 数据汇总聚合 + analysisEventTypeIntegerMap.put(AnalysisEventType.BATTLE,new BattleAnalysisProcessor()); + analysisEventTypeIntegerMap.put(AnalysisEventType.DIGGER,new DiggerAnalysisProcessor()); + } + + + public static void onGameEvent(AnalysisEventType type){ + AnalysisProcessor analysisProcessor = analysisEventTypeIntegerMap.get(type); + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyMessagesConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyMessagesConfig.java new file mode 100644 index 000000000..dedd4cdc1 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SBloodyMessagesConfig.java @@ -0,0 +1,49 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="BloodyMessagesConfig") +public class SBloodyMessagesConfig implements BaseConfig { + + private int id; + + private String name; + + private int type; + + private int count; + + private String message; + + + @Override + public void init() throws Exception { + + } + + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public int getType() { + return type; + } + + public int getCount() { + return count; + } + + public String getMessage() { + return message; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/StoreLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/StoreLogic.java index 19028e01d..e4ac7617e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/StoreLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/StoreLogic.java @@ -87,9 +87,7 @@ public class StoreLogic { int uid = iSession.getUid(); User user = UserManager.getUser(uid); StoreManager storeManager = user.getStoreManager(); - if (storeManager.getStoreInfoMap().size() == 0){ - initStoreInfo(user,storeManager); - } + initStoreInfo(user,storeManager); PlayerInfoProto.GetStoreInfosResponse.Builder builder = PlayerInfoProto.GetStoreInfosResponse.newBuilder(); Map storeInfoMap = storeManager.getStoreInfoMap(); checkStoreRefresh(user,storeInfoMap); @@ -223,6 +221,9 @@ public class StoreLogic { Map sstoreTypeConfigMap = SStoreTypeConfig.getsStoreTypeConfigMap(); for ( Map.Entry entry :sstoreTypeConfigMap.entrySet()){ SStoreTypeConfig sStoreTypeConfig = entry.getValue(); + if(storeManager.getStoreInfoMap().containsKey(sStoreTypeConfig.getId())){ + continue; + } if (sStoreTypeConfig.getStoreOpenRule() == 1 && sStoreTypeConfig.getId() !=8){ //固定商店 Map itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user); long startTime = 0; From 61cfce258f6c4466bbf1346d8e1154a647c19f71 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Tue, 3 Sep 2019 10:24:04 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E6=97=A0=E5=B0=BD=E5=89=AF=E6=9C=AC?= =?UTF-8?q?=E3=80=81=E6=B3=95=E5=AE=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/config/SEndlessMapConfig.java | 4 + .../ljsd/jieling/config/SEquipTalismana.java | 68 +++++++++ .../jieling/config/SEquipTalismanaRankup.java | 44 ++++++ .../com/ljsd/jieling/globals/BIReason.java | 1 + .../ljsd/jieling/globals/GlobalItemType.java | 1 + .../handler/EquipUnLoadOptHandler.java | 3 +- .../jieling/handler/EquipWearHandler.java | 2 +- .../jieling/handler/GetAllEquipHandler.java | 3 +- .../jieling/handler/GetPlayerInfoHandler.java | 6 +- .../ljsd/jieling/handler/map/MapLogic.java | 81 +++++++--- .../handler/map/behavior/BehaviorUtil.java | 1 + .../jieling/logic/GlobalDataManaager.java | 13 +- .../java/com/ljsd/jieling/logic/UpStar.java | 5 + .../jieling/logic/activity/ActivityLogic.java | 2 +- .../com/ljsd/jieling/logic/dao/Equip.java | 140 ++++-------------- .../ljsd/jieling/logic/dao/EquipManager.java | 12 ++ .../ljsd/jieling/logic/dao/EspecialEquip.java | 30 ++++ .../java/com/ljsd/jieling/logic/dao/Hero.java | 15 ++ .../ljsd/jieling/logic/dao/PropertyItem.java | 123 +++++++++++++++ .../ljsd/jieling/logic/hero/HeroLogic.java | 107 +++++++++---- .../com/ljsd/jieling/util/CBean2Proto.java | 25 ++-- .../java/com/ljsd/jieling/util/ItemUtil.java | 24 ++- .../com/ljsd/jieling/util/MonsterUtil.java | 23 +++ .../java/com/ljsd/jieling/util/UUIDEnum.java | 1 + 24 files changed, 542 insertions(+), 192 deletions(-) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/logic/UpStar.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EspecialEquip.java create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PropertyItem.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SEndlessMapConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SEndlessMapConfig.java index 38bea05f0..4924a6cd5 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SEndlessMapConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SEndlessMapConfig.java @@ -53,4 +53,8 @@ public class SEndlessMapConfig implements BaseConfig { public int[][] getEndlessPoint() { return endlessPoint; } + + public int[] getMapItem() { + return mapItem; + } } \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java new file mode 100644 index 000000000..75eb813f6 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismana.java @@ -0,0 +1,68 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="EquipTalismana") +public class SEquipTalismana implements BaseConfig { + + private int id; + + private int talismanaId; + + private int level; + + private int[][] rankupBasicMaterial; + + private int[][] rankupConsumeMaterial; + + private int[][] property; + + private int[][] specialProperty; + + private int[] openSkillRules; + + public static Map equipTalismanaMap ; + + @Override + public void init() throws Exception { + equipTalismanaMap = STableManager.getConfig(SEquipTalismana.class); + } + + + public int getId() { + return id; + } + + public int getTalismanaId() { + return talismanaId; + } + + public int getLevel() { + return level; + } + + public int[][] getRankupBasicMaterial() { + return rankupBasicMaterial; + } + + public int[][] getRankupConsumeMaterial() { + return rankupConsumeMaterial; + } + + public int[][] getProperty() { + return property; + } + + public int[][] getSpecialProperty() { + return specialProperty; + } + + public int[] getOpenSkillRules() { + return openSkillRules; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java new file mode 100644 index 000000000..3f7427a6b --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SEquipTalismanaRankup.java @@ -0,0 +1,44 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="EquipTalismanaRankup") +public class SEquipTalismanaRankup implements BaseConfig { + + private int id; + + private int issame; + + private int starLimit; + + private int isId; + + public static Map equipTalismanaRankupMap ; + + @Override + public void init() throws Exception { + equipTalismanaRankupMap = STableManager.getConfig(SEquipTalismanaRankup.class); + } + + + public int getId() { + return id; + } + + public int getIssame() { + return issame; + } + + public int getStarLimit() { + return starLimit; + } + + public int getIsId() { + return isId; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java index b15f9895f..d5c84007f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java @@ -79,6 +79,7 @@ public interface BIReason { int GM_CHANGENAME = 48; // gm改名赠送 int BIND_PHONE = 49; // 修改手机号 + int ENDLESS_REASON_CHANGE = 50;//无尽副本赛季更换 //道具消耗原因 1000开头 int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级 int SECRETBOX_CONSUME = 1001; //秘盒抽卡 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java b/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java index 5c2eb1354..181d11947 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java @@ -21,6 +21,7 @@ public interface GlobalItemType { int SecretBox=10; // 宝箱 int HEAD_FRAME = 11;//头像框 int CHANGE_NAME_CARD = 12;//改名道具卡 + int ESPECIAL_EQUIP = 14;//法宝 //物品使用类型 int NO_USE = 0 ; //不使用 int RANDOM_USE = 1; // 随机使用 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipUnLoadOptHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipUnLoadOptHandler.java index c2d8066c8..9b8aa8f24 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipUnLoadOptHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipUnLoadOptHandler.java @@ -21,6 +21,7 @@ public class EquipUnLoadOptHandler extends BaseHandler { HeroInfoProto.EquipUnLoadOptRequest equipUnLoadOptRequest = HeroInfoProto.EquipUnLoadOptRequest.parseFrom(netData.parseClientProtoNetData()); List equipIdsList = equipUnLoadOptRequest.getEquipIdsList(); String heroId = equipUnLoadOptRequest.getHeroId(); - HeroLogic.getInstance().unloadEquipOpt(iSession,heroId,equipIdsList); + int type = equipUnLoadOptRequest.getType(); + HeroLogic.getInstance().unloadEquipOpt(iSession,heroId,equipIdsList,type); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipWearHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipWearHandler.java index 0992bc9d7..cf4c9a576 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipWearHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/EquipWearHandler.java @@ -17,7 +17,7 @@ public class EquipWearHandler extends BaseHandler{ @Override public void process(ISession iSession, PacketNetData netData) throws Exception { HeroInfoProto.EquipWearRequest equipWearRequest = HeroInfoProto.EquipWearRequest.parseFrom(netData.parseClientProtoNetData()); - HeroLogic.getInstance().wearEquipOpt(iSession,equipWearRequest.getHeroId(),equipWearRequest.getEquipIdList()); + HeroLogic.getInstance().wearEquipOpt(iSession,equipWearRequest.getHeroId(),equipWearRequest.getEquipIdList(),equipWearRequest.getType()); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetAllEquipHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetAllEquipHandler.java index fccaf20df..cf07c4efa 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetAllEquipHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetAllEquipHandler.java @@ -20,6 +20,7 @@ public class GetAllEquipHandler extends BaseHandler{ HeroInfoProto.GetAllEquipRequest getAllEquipRequest = HeroInfoProto.GetAllEquipRequest.parseFrom(message); int index = getAllEquipRequest.getIndex(); - HeroLogic.getInstance().getAllEquipInfo(iSession,index); + int type = getAllEquipRequest.getType(); + HeroLogic.getInstance().getAllEquipInfo(iSession,index,type); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java index e1a274478..3e67c2094 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.java @@ -93,9 +93,9 @@ public class GetPlayerInfoHandler extends BaseHandler{ .setHadTakeDailyBox(playerInfoManager.getHadTakeDailyBoxVip()) .setHadTakeLevelBox(playerInfoManager.getHadTakeLevelBoxVip()) .setVipLevel(playerInfoManager.getVipLevel()).build(); - CommonProto.PlayerBindPhone playerBindPhone = CommonProto.PlayerBindPhone.newBuilder() - .setPhoneNum(user.getPlayerInfoManager().getPhoneBindInfo().getPhoneNum()) - .setState(user.getPlayerInfoManager().getPhoneBindInfo().getState()).build(); + CommonProto.PlayerBindPhone playerBindPhone = CommonProto.PlayerBindPhone.newBuilder().build(); +// .setPhoneNum(user.getPlayerInfoManager().getPhoneBindInfo().getPhoneNum()) +// .setState(user.getPlayerInfoManager().getPhoneBindInfo().getState()).build(); RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo(); Map totalCountMap = user.getHeroManager().getTotalCount(); int alreadyCount =0; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index 8831cfa31..b7d9ec88e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -1,6 +1,7 @@ package com.ljsd.jieling.handler.map; import com.googlecode.protobuf.format.JsonFormat; +import com.ljsd.jieling.battle.actor.Monster; import com.ljsd.jieling.config.*; import com.ljsd.jieling.core.VipPrivilegeType; import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType; @@ -211,21 +212,21 @@ public class MapLogic { mapManager.addEndlessHero(teamPosForHero.get(i).getHeroId(),maxHp); } EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo(); -// if(endlessMapInfo.getSeason()!=endlessSeason){ -// mapManager.updateEndlessSeason(endlessSeason); -// mapManager.updateEndlessMapId(0); -// mapManager.endlessWalkCellSave(new HashSet<>()); -// mapManager.endlessMapInfoSave(new HashMap<>()); -// }else{ -// Map endlessMapCellInfo = mapManager.getEndlessMapInfo().getMapInfo(); -// if(endlessMapCellInfo !=null&&endlessMapCellInfo.size()>0){ -// mapManager.setMapInfo(endlessMapCellInfo); -// } -// Set walkCell = mapManager.getEndlessMapInfo().getWalkCell(); -// if(walkCell!=null&&walkCell.size()>0){ -// mapManager.setWalkCells(walkCell); -// } -// } + if(endlessMapInfo.getSeason()!=endlessSeason){ + mapManager.updateEndlessSeason(endlessSeason); + mapManager.updateEndlessMapId(0); + mapManager.endlessWalkCellSave(new HashSet<>()); + mapManager.endlessMapInfoSave(new HashMap<>()); + }else{ + Map endlessMapCellInfo = mapManager.getEndlessMapInfo().getMapInfo(); + if(endlessMapCellInfo !=null&&endlessMapCellInfo.size()>0){ + mapManager.setMapInfo(endlessMapCellInfo); + } + Set walkCell = mapManager.getEndlessMapInfo().getWalkCell(); + if(walkCell!=null&&walkCell.size()>0){ + mapManager.setWalkCells(walkCell); + } + } mapManager.updateEndlessMapId(mapId); for(Map.Entry> entry :endlessMapInfo.getMapSign().entrySet()){ int curMapId = entry.getKey(); @@ -419,12 +420,12 @@ public class MapLogic { continue; } Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId()); - if(mapPointConfig.getIsShowFightAbility()!=null&&mapPointConfig.getIsShowFightAbility().length>0){ - int force = 0; - for(int i = 0 ; i 0){ + if(isShowFightAbility[0]!=0){ + int force = MonsterUtil.getMonsterForce(isShowFightAbility); + cellValue.setForce(force); } - cellValue.setForce(force); } newMap.put(xy, cellValue); } @@ -1509,6 +1510,13 @@ public class MapLogic { fightEndResponse.addAllRemainHpList(remainHp); fightEndResponse.build(); + if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){ + Cell cell = mapManager.getMapInfo().get(triggerXY); + MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(cell.getPointId()); + if(mapPointConfig.getStyle()==1){ + BehaviorUtil.destoryApointXY(user, triggerXY); + } + } if (sOptionConfig != null) { int behaviorType = sOptionConfig.getBehaviorType(); int[][] behaviorTypeValues = sOptionConfig.getBehaviorTypeValues(); @@ -3217,7 +3225,8 @@ public class MapLogic { mapManager.updateEndlessConsumeExecution(mapManager.getEndlessMapInfo().getConsumeExecution()+costNum); int [] cost1 = new int[]{costId,costNum}; cost[0] = cost1; - if(!ItemUtil.itemCost(user,cost,BIReason.ENDLESS_CONSUME_EXECUTION,1)) { + boolean costResult = ItemUtil.itemCost(user, cost, BIReason.ENDLESS_CONSUME_EXECUTION, 1); + if(!costResult) { costNum = user.getItemManager().getItem(costId).getItemNum(); cost1[1]= costNum; cost[0] = cost1; @@ -3280,4 +3289,34 @@ public class MapLogic { } MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true); } + + /** + * 无尽副本赛季更换,用户信息清除 + * @throws Exception + */ + public void resetEndlessInfo() throws Exception { + Map onlineUserMap = OnlineUserManager.sessionMap; + SEndlessMapConfig config = SEndlessMapConfig.sEndlessMapConfigMap.get(MapLogic.getEndlessMapId()); + int[] mapItem = config.getMapItem(); + for(Map.Entry entry:onlineUserMap.entrySet()){ + User user = UserManager.getUser(entry.getValue().getUid()); + MapManager mapManager = user.getMapManager(); + mapManager.setEndlessMapInfo(new EndlessMapInfo()); + if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){ + resetMapInfo(user,false); + MessageUtil.sendIndicationMessage(entry.getValue(),1,MessageTypeProto.MessageType.MAP_OUT_INDICATION_VALUE,null,true); + } + ItemManager itemManager = user.getItemManager(); + int [][] costItem = new int[mapItem.length][2]; + for(int i = 0 ; i propertyValueByIdMap; //主属性 key 对应PropertyConfig id - - private Map secondValueByIdMap; //副属性 - - private int createTime; - - private int skill; - - private int isLocked; - public Equip() { this.setRootCollection(User._COLLECTION_NAME); } public Equip(int uid, int equipTid) { + super(); this.setRootCollection(User._COLLECTION_NAME); - this.id = KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP, uid); - this.equipId = equipTid; - this.propertyValueByIdMap = new HashMap<>(); + super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP, uid)); + super.setEquipId(equipTid); + Map propertyValueByIdMap = new HashMap<>(); SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipTid); SWorkShopSetting sWorkShopSetting = SWorkShopSetting.getsWorkShopSettingByLevel(sEquipConfig.getInitialLevel()); Map promoteMap = new HashMap<>(); @@ -60,24 +41,25 @@ public class Equip extends MongoBase implements Cloneable{ propertyPromote = 0; } int finalProperValue = MathUtils.random(properMinNum * (100 + propertyPromote) / 100, properMaxNum* (100 + propertyPromote) / 100); - this.propertyValueByIdMap.put(properTyId, finalProperValue); + propertyValueByIdMap.put(properTyId, finalProperValue); + super.setPropertyValueByIdMap(propertyValueByIdMap); int secondNumMin = sEquipConfig.getSecondNumMin(); int secondNumMax = sEquipConfig.getSecondNumMax(); int secondValue = MathUtils.random(secondNumMin, secondNumMax); - this.secondValueByIdMap = getSecondValue(sEquipConfig.getPool(), secondValue,promoteMap); - this.createTime = (int)(TimeUtils.now()/1000); + Map secondValueByIdMap = getSecondValue(sEquipConfig.getPool(), secondValue,promoteMap); + super.setSecondValueByIdMap(secondValueByIdMap); + super.setCreateTime((int)(TimeUtils.now()/1000)); //skill库随机 - this.skill = getRandomSkill(sEquipConfig.getSkillPoolId()); - + super.setSkill(getRandomSkill(sEquipConfig.getSkillPoolId())); } //锻造 public Equip(int uid, int equipTid,int workShopLevle,List runneIds) { this.setRootCollection(User._COLLECTION_NAME); - this.id =KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP,uid); - this.equipId = equipTid; - this.propertyValueByIdMap = new HashMap<>(); - this.secondValueByIdMap = new HashMap<>(); + super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP,uid)); + super.setEquipId(equipTid); + Map propertyValueByIdMap = new HashMap<>(); + Map secondValueByIdMap = new HashMap<>(); SWorkShopSetting sWorkShopSetting = SWorkShopSetting.getsWorkShopSettingByLevel(workShopLevle); Map promoteMap = new HashMap<>(); if( sWorkShopSetting != null && sWorkShopSetting.getPromoteMap()!=null){ @@ -92,10 +74,12 @@ public class Equip extends MongoBase implements Cloneable{ int properMinNum = sEquipConfig.getPropertyMin()[1]; int properMaxNum = sEquipConfig.getPropertyMax()[1]; int finalProperValue = MathUtils.random(properMinNum * (100 + propertyPromote) / 100, properMaxNum* (100 + propertyPromote) / 100); - this.propertyValueByIdMap.put(properTyId,finalProperValue); + propertyValueByIdMap.put(properTyId,finalProperValue); + super.setPropertyValueByIdMap(propertyValueByIdMap); + super.setSecondValueByIdMap(secondValueByIdMap); setForRunnes(runneIds,promoteMap); - this.createTime = (int)(TimeUtils.now()/1000); - this.skill = getRandomSkill(sEquipConfig.getSkillPoolId()); + super.setCreateTime((int)(TimeUtils.now()/1000)); + super.setSkill(getRandomSkill(sEquipConfig.getSkillPoolId())); } @@ -118,7 +102,7 @@ public class Equip extends MongoBase implements Cloneable{ } } - secondValueByIdMap = result; + super.setSecondValueByIdMap(result); } private void randomForRunne(int poolId,int nums,Map secondValueByIdMap,Map promoteMap){ @@ -162,7 +146,7 @@ public class Equip extends MongoBase implements Cloneable{ sEquipPropertyPoolList.addAll(SEquipPropertyPool.getSEquipPropertyPool(pid)); } if(sEquipPropertyPoolList.size() promoteMap = null; @@ -242,7 +226,7 @@ public class Equip extends MongoBase implements Cloneable{ int properMinNum = sEquipConfig.getPropertyMin()[1]; int properMaxNum = sEquipConfig.getPropertyMax()[1]; int finalProperValue = MathUtils.random(properMinNum * (100 + propertyPromote) / 100, properMaxNum* (100 + propertyPromote) / 100); - this.propertyValueByIdMap.put(properTyId,finalProperValue); + super.getPropertyValueByIdMap().put(properTyId,finalProperValue); } List sEquipPropertyPoolList = new ArrayList<>(); for(Integer equipPool:sEquipConfig.getPool()){ @@ -250,7 +234,7 @@ public class Equip extends MongoBase implements Cloneable{ } for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){ int secondPropertyId = sEquipPropertyPool.getPropertyId(); - if(!secondValueByIdMap.containsKey(secondPropertyId)){ + if(!super.getSecondValueByIdMap().containsKey(secondPropertyId)){ continue; } SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(secondPropertyId); @@ -266,94 +250,26 @@ public class Equip extends MongoBase implements Cloneable{ } int value = MathUtils.random(sEquipPropertyPool.getMin() * (100 + secondPropertyPromote) / 100, sEquipPropertyPool.getMax()* (100 + secondPropertyPromote) / 100); - secondValueByIdMap.put(secondPropertyId,value); + super.getSecondValueByIdMap().put(secondPropertyId,value); } setRebuildLevel(workShopLevle); - setSecondValueByIdMap(secondValueByIdMap); - setPropertyValueByIdMap(propertyValueByIdMap); - } - - - public String getId() { - return id; - } - - public int getEquipId() { - return equipId; - } - - public void setEquipId(int equipId) throws Exception { - updateString("equipId",equipId); - this.equipId = equipId; - } - - public int getLevel() { - return level; - } - - public void setLevel(int level) throws Exception { - updateString("level",level); - this.level = level; + super.setSecondValueByIdMap(super.getSecondValueByIdMap()); + super.setPropertyValueByIdMap(super.getSecondValueByIdMap()); } public int getRebuildLevel() { return rebuildLevel; } - public String getHeroId() { - return heroId; - } - - public void setHeroId(String heroId) throws Exception { - updateString("heroId",heroId); - this.heroId = heroId; - } - - public Map getPropertyValueByIdMap() { - return propertyValueByIdMap; - } - - public Map getSecondValueByIdMap() { - return secondValueByIdMap; - } - public void setRebuildLevel(int rebuildLevel) { updateString("rebuildLevel",rebuildLevel); this.rebuildLevel = rebuildLevel; } - public void setPropertyValueByIdMap(Map propertyValueByIdMap) { - updateString("propertyValueByIdMap",propertyValueByIdMap); - this.propertyValueByIdMap = propertyValueByIdMap; - } - - public void setSecondValueByIdMap(Map secondValueByIdMap) { - updateString("secondValueByIdMap",secondValueByIdMap); - this.secondValueByIdMap = secondValueByIdMap; - } - @Override public Object clone() throws CloneNotSupportedException { return (Equip) super.clone(); } - - public int getCreateTime() { - return createTime; - } - - - public int getSkill() { - return skill; - } - - public int getIsLocked() { - return isLocked; - } - - public void updateIsLocked(int isLocked) { - updateString("isLocked",isLocked); - this.isLocked = isLocked; - } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EquipManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EquipManager.java index e5c92e157..f9abea113 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EquipManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EquipManager.java @@ -15,6 +15,8 @@ public class EquipManager extends MongoBase { private Map equipMap; + private Map especialEquipMap; + private Equip unDetermined; private Map equipHandBook; @@ -23,6 +25,7 @@ public class EquipManager extends MongoBase { this.equipHandBook = new HashMap<>(); this.equipMap = new HashMap<>(); + this.especialEquipMap = new HashMap<>(); this.setRootCollection(User._COLLECTION_NAME); } @@ -34,6 +37,11 @@ public class EquipManager extends MongoBase { Poster.getPoster().dispatchEvent(new EquipEvent(user.getId(),equip.getEquipId())); } + public void addEspecialEquip(User user,EspecialEquip especialEquip){ + updateString("especialEquipMap." + especialEquip.getId(), especialEquip); + especialEquipMap.put(especialEquip.getId(), especialEquip); + } + public void remove(String equipId){ if (equipMap.containsKey(equipId)){ removeString(getMongoKey()+".equipMap." + equipId); @@ -45,6 +53,10 @@ public class EquipManager extends MongoBase { return equipMap; } + public Map getEspecialEquipMap() { + return especialEquipMap; + } + public Equip getUnDetermined() { return unDetermined; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EspecialEquip.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EspecialEquip.java new file mode 100644 index 000000000..66abf057d --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/EspecialEquip.java @@ -0,0 +1,30 @@ +package com.ljsd.jieling.logic.dao; + +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.util.KeyGenUtils; +import com.ljsd.jieling.util.UUIDEnum; + +public class EspecialEquip extends PropertyItem { + + private int star; + + public EspecialEquip(int uid,int equipTid) { + super(); + super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ESPECIAL_EQUIP, uid)); + super.setEquipId(equipTid); + this.star = 1; + } + public EspecialEquip() { + this.setRootCollection(User._COLLECTION_NAME); + } + + + public int getStar() { + return star; + } + + public void setStar(int star) { + updateString("star",star); + this.star = star; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java index 360c83374..b11c0d263 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java @@ -42,6 +42,8 @@ public class Hero extends MongoBase { private int speed; + private String especialEquip; + public Hero(){ //绑定关系 this.setRootCollection(User._COLLECTION_NAME); @@ -57,6 +59,7 @@ public class Hero extends MongoBase { this.star = initStar; this.skillList = new ArrayList<>(); this.equipByPositionMap = new HashMap<>(); + this.especialEquip = ""; List skillIds = scHero.getSkillListByStar().get(star); if(skillIds!=null && !skillIds.isEmpty()){ this.skillList.addAll(skillIds); @@ -201,4 +204,16 @@ public class Hero extends MongoBase { updateString("starBreakId",starBreakId); this.starBreakId = starBreakId; } + public void updateEspecial(String especialEquip){ + this.especialEquip = especialEquip; + updateString("especialEquip",especialEquip); + } + public void removeEspecial() { + removeString(getMongoKey()+".especialEquip"); + especialEquip=""; + } + + public String getEspecialEquip() { + return especialEquip; + } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PropertyItem.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PropertyItem.java new file mode 100644 index 000000000..ce76c0e13 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PropertyItem.java @@ -0,0 +1,123 @@ +package com.ljsd.jieling.logic.dao; + +import com.ljsd.common.mogodb.MongoBase; + +import java.util.Map; + +public class PropertyItem extends MongoBase { + private String id; + + private int equipId; + + private int level; + + private String heroId; + + private Map propertyValueByIdMap; //主属性 key 对应PropertyConfig id + + private Map secondValueByIdMap; //副属性 + + private int createTime; + + private int skill; + + private int isLocked; + + public PropertyItem(String id, int equipId, int level, String heroId, Map propertyValueByIdMap, Map secondValueByIdMap, int createTime, int skill, int isLocked) { + this.id = id; + this.equipId = equipId; + this.level = level; + this.heroId = heroId; + this.propertyValueByIdMap = propertyValueByIdMap; + this.secondValueByIdMap = secondValueByIdMap; + this.createTime = createTime; + this.skill = skill; + this.isLocked = isLocked; + } + + public String getId() { + return id; + } + + public void setId(String id) { + updateString("id",equipId); + this.id = id; + } + + public int getEquipId() { + return equipId; + } + + public void setEquipId(int equipId){ + updateString("equipId",equipId); + this.equipId = equipId; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level){ + updateString("level",level); + this.level = level; + } + + public PropertyItem() { + } + + public String getHeroId() { + return heroId; + } + + public void setHeroId(String heroId){ + updateString("heroId",heroId); + this.heroId = heroId; + } + + public Map getPropertyValueByIdMap() { + return propertyValueByIdMap; + } + + public Map getSecondValueByIdMap() { + return secondValueByIdMap; + } + + + public void setPropertyValueByIdMap(Map propertyValueByIdMap) { + updateString("propertyValueByIdMap",propertyValueByIdMap); + this.propertyValueByIdMap = propertyValueByIdMap; + } + + public void setSecondValueByIdMap(Map secondValueByIdMap) { + updateString("secondValueByIdMap",secondValueByIdMap); + this.secondValueByIdMap = secondValueByIdMap; + } + + public int getCreateTime() { + return createTime; + } + + public void setCreateTime(int createTime) { + updateString("createTime", createTime); + this.createTime = createTime; + } + + public int getSkill() { + return skill; + } + + public void setSkill(int skill) { + updateString("skill", skill); + + this.skill = skill; + } + + public int getIsLocked() { + return isLocked; + } + + public void updateIsLocked(int isLocked) { + updateString("isLocked", isLocked); + this.isLocked = isLocked; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java index 012e70b05..8f0a381fc 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java @@ -93,16 +93,30 @@ public class HeroLogic { private static final String VERTICAL = "|"; private static final String DIVISION = "#"; - public void getAllEquipInfo(ISession iSession,int index) throws Exception { + /** + * 获取装备、法宝信息 + * @param iSession + * @param index + * @param type + * @throws Exception + */ + public void getAllEquipInfo(ISession iSession,int index,int type) throws Exception { int uid = iSession.getUid(); User user = UserManager.getUser(uid); - Map equipMap = user.getEquipManager().getEquipMap(); List equipList = new ArrayList<>(); - for(Equip equipInfo: equipMap.values()){ - equipList.add(CBean2Proto.getEquipProto(equipInfo)); + if(type==1){ + Map equipMap = user.getEquipManager().getEquipMap(); + for(Equip equipInfo: equipMap.values()){ + equipList.add(CBean2Proto.getEquipProto(equipInfo)); + } + }else{ + Map especialEquipMap = user.getEquipManager().getEspecialEquipMap(); + for(EspecialEquip especialEquipInfo: especialEquipMap.values()){ + equipList.add(CBean2Proto.getEquipProto(especialEquipInfo)); + } } boolean isSendFinish = false; - int endIndex = index + Global.SEND_EQUIP_COUNT ; + int endIndex = index + Global.SEND_EQUIP_COUNT; if (index < equipList.size()) { if (endIndex >= equipList.size()) { endIndex = equipList.size(); @@ -531,6 +545,13 @@ public class HeroLogic { } + /** + * 妖灵师进阶 + * @param session + * @param heroId + * @param consumeMaterialsList + * @throws Exception + */ public void upHeroStar(ISession session, String heroId, List consumeMaterialsList) throws Exception { int uid = session.getUid(); User user = UserManager.getUser(uid); @@ -1033,6 +1054,23 @@ public class HeroLogic { } } + //法宝加成 + String especialEquip = hero.getEspecialEquip(); + Map especialEquipMap = user.getEquipManager().getEspecialEquipMap(); + + int equipTempId = especialEquipMap.get(especialEquip).getEquipId(); + int tempStar = especialEquipMap.get(especialEquip).getStar(); + Map equipTalismanaMap = SEquipTalismana.equipTalismanaMap; + for(Map.Entry entry:equipTalismanaMap.entrySet()){ + if(entry.getValue().getTalismanaId()!=equipTempId){ + continue; + } + if(entry.getValue().getLevel()!=tempStar){ + continue; + } + + } + //阵营光环加成 if(!isForce){ if(teamId!=0){ @@ -1224,18 +1262,25 @@ public class HeroLogic { // equip TODO 装备会导致英雄属性发生变化 - public void wearEquipOpt(ISession session,String heroId,List equipIds) throws Exception { + public void wearEquipOpt(ISession session,String heroId,List equipIds,int type) throws Exception { int uid = session.getUid(); User user = UserManager.getUser(uid); Hero hero = user.getHeroManager().getHeroMap().get(heroId); - Map equipInfoTmp = new HashMap<>(6); - if(!checkEquipForWear(hero,user.getEquipManager(),equipIds,equipInfoTmp)){ - MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,"equip.wrong"); - return; + if(type==1){ + Map equipInfoTmp = new HashMap<>(6); + if(!checkEquipForWear(hero,user.getEquipManager(),equipIds,equipInfoTmp)){ + MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE_VALUE,"equip.wrong"); + return; + } + hero.updateMutliEquipPositionMap(equipInfoTmp); + user.getUserMissionManager().onGameEvent(user,GameEvent.WEAR_EQUIP,equipInfoTmp.size()); + }else if(type ==2){ + if(equipIds.size()!=1){ + MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"法宝智能穿戴一个"); + }else{ + hero.updateEspecial(equipIds.get(0)); + } } - - hero.updateMutliEquipPositionMap(equipInfoTmp); - user.getUserMissionManager().onGameEvent(user,GameEvent.WEAR_EQUIP,equipInfoTmp.size()); // Map heroNotBufferAttribute = calHeroNotBufferAttribute(user, hero); // int force = calForce(heroNotBufferAttribute) + heroNotBufferAttribute.get(HeroAttributeEnum.EquipForce.getPropertyId()); // LOGGER.info("the heroTid={},the force={}",hero.getTemplateId(),force); @@ -1246,29 +1291,33 @@ public class HeroLogic { } - public void unloadEquipOpt(ISession session,String heroId,List equipIds) throws Exception { + public void unloadEquipOpt(ISession session,String heroId,List equipIds,int type) throws Exception { int uid = session.getUid(); User user = UserManager.getUser(uid); Hero hero = user.getHeroManager().getHero(heroId); - if( hero == null || equipIds.isEmpty()){ - MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_UNLOAD_OPT_RESPONSE_VALUE,""); - return; - } - List positions = new ArrayList<>(); - for(String equipId : equipIds){ - Equip equip = user.getEquipManager().getEquipMap().get(equipId); - if(null == equip || !StringUtil.isEmpty(equip.getHeroId())){ + if(type==1){ + if( hero == null || equipIds.isEmpty()){ MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_UNLOAD_OPT_RESPONSE_VALUE,""); return; } - int equipIdTid = equip.getEquipId(); - SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipIdTid); - int position = sEquipConfig.getPosition(); - positions.add(position); - } + List positions = new ArrayList<>(); + for(String equipId : equipIds){ + Equip equip = user.getEquipManager().getEquipMap().get(equipId); + if(null == equip || !StringUtil.isEmpty(equip.getHeroId())){ + MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_UNLOAD_OPT_RESPONSE_VALUE,""); + return; + } + int equipIdTid = equip.getEquipId(); + SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipIdTid); + int position = sEquipConfig.getPosition(); + positions.add(position); + } - for(Integer position : positions){ - hero.removeEquip(position); + for(Integer position : positions){ + hero.removeEquip(position); + } + }else if(type==2){ + hero.removeEspecial(); } //发送成功消息 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java b/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java index 7109f01d7..df5a6fb96 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java @@ -83,6 +83,7 @@ public class CBean2Proto { .setCreateTime(hero.getCreateTime()) .addAllSkillIdList(hero.getSkillList()) .addAllEquipIdList(equipList) + .addEspecialEquip(hero.getEspecialEquip()) .build(); } @@ -103,20 +104,26 @@ public class CBean2Proto { } - public static CommonProto.Equip getEquipProto(Equip equip){ + public static CommonProto.Equip getEquipProto(PropertyItem equip){ Map propertyValueByIdMap = equip.getPropertyValueByIdMap(); Map secondValueByIdMap = equip.getSecondValueByIdMap(); - CommonProto.Equip equipProto =CommonProto.Equip.newBuilder() + CommonProto.Equip.Builder equipProto =CommonProto.Equip.newBuilder() .setEquipId(equip.getEquipId()) .setId(equip.getId()) - .setMainAttribute(parseFromMap(propertyValueByIdMap).get(0)) - .addAllSecondAttribute(parseFromMap(secondValueByIdMap)) - .setRebuildLevel(equip.getRebuildLevel()) .setCreateTime(equip.getCreateTime()) - .setSkillId(equip.getSkill()) - .setIsLocked(equip.getIsLocked()) - .build(); - return equipProto; + .setIsLocked(equip.getIsLocked()); + if(equip instanceof Equip){ + Equip tempEquip =(Equip)equip; + equipProto.setMainAttribute(parseFromMap(propertyValueByIdMap).get(0)) + .addAllSecondAttribute(parseFromMap(secondValueByIdMap)) + .setRebuildLevel(tempEquip.getRebuildLevel()) + .setSkillId(tempEquip.getSkill()); + } + if(equip instanceof EspecialEquip){ + EspecialEquip tempEquip =(EspecialEquip)equip; + equipProto.setRebuildLevel(tempEquip.getStar()); + } + return equipProto.build(); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java index 81e620dab..b2abf0426 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java @@ -385,6 +385,7 @@ public class ItemUtil { putcountMap(itemId, itemNum, cardMap); break; case GlobalItemType.EQUIP: + case GlobalItemType.ESPECIAL_EQUIP: putcountMap(itemId, itemNum, equipMap); break; case GlobalItemType.RANDOM_ITME: @@ -771,15 +772,22 @@ public class ItemUtil { private static void addEquip(User user,int equipId ,List equipList) throws Exception { EquipManager equipManager = user.getEquipManager(); - Equip equip = new Equip(user.getId(),equipId); - equipManager.addEquip(user,equip); - equipList.add(CBean2Proto.getEquipProto(equip)); - SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipId); - if (sEquipConfig.getQuality() >= 5) { - String nickName = user.getPlayerInfoManager().getNickName(); - String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{nickName, equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equipId).getName()}); - ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0); + int itemType = SItem.getsItemMap().get(equipId).getItemType(); + if(itemType==GlobalItemType.EQUIP){ + Equip equip = new Equip(user.getId(),equipId); + equipManager.addEquip(user,equip); + equipList.add(CBean2Proto.getEquipProto(equip)); + SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipId); + if (sEquipConfig.getQuality() >= 5) { + String nickName = user.getPlayerInfoManager().getNickName(); + String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{nickName, equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equipId).getName()}); + ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0); + } + }else if(itemType==GlobalItemType.ESPECIAL_EQUIP){ + EspecialEquip especialEquip = new EspecialEquip(user.getId(),equipId); + equipManager.addEspecialEquip(user,especialEquip); } + } /** diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java index c1edf5575..bf4bf20e8 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/MonsterUtil.java @@ -71,6 +71,29 @@ public class MonsterUtil { return hps; } + + + public static int getMonsterForce(int[] groupIds){ + Map integerSMonsterGroupMap = SMonsterGroup.getsMonsterGroupMap(); + Map integerSMonsterConfigMap = SMonsterConfig.getsMonsterConfigMap(); + int maxForce = 0; + for(int i = 0 ; i < groupIds.length;i++){ + SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]); + int[][] contents = sMonsterGroup.getContents(); + int totalMonsterForce = 0; + for(int j = 0; jmaxForce){ + maxForce = totalMonsterForce; + } + } + return (int)(maxForce*(0.8+groupIds.length*0.2)); + } public static String getMonsterSkillById(int monsterId){ CommonProto.FightUnitInfo monster = SMonsterConfig.getMonsterMap().get(monsterId); return monster.getUnitSkillIds(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/UUIDEnum.java b/serverlogic/src/main/java/com/ljsd/jieling/util/UUIDEnum.java index 340a175b6..cc93da7cc 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/UUIDEnum.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/UUIDEnum.java @@ -7,6 +7,7 @@ public enum UUIDEnum { ARENARECORD(3), ADVENTUREBOSS(4), GUILDLOG(5), + ESPECIAL_EQUIP(6) ; private int value;