Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
b03071035d
|
|
@ -166,9 +166,12 @@ public class MapManager extends MongoBase {
|
|||
|
||||
|
||||
public void eatFood(int foodId,int remainStep){
|
||||
if(remainStep == 0){
|
||||
remainStep = -1; //表示一次性生效
|
||||
}
|
||||
int finalRemainStep = remainStep;
|
||||
if(this.foodBufferMap.containsKey(foodId)){
|
||||
finalRemainStep = this.foodBufferMap.get(foodId);
|
||||
finalRemainStep += this.foodBufferMap.get(foodId);
|
||||
}
|
||||
this.foodBufferMap.put(foodId,finalRemainStep);
|
||||
updateString( "foodBuffers."+foodId, this.foodBufferMap.get(foodId));
|
||||
|
|
@ -183,6 +186,9 @@ public class MapManager extends MongoBase {
|
|||
for(Map.Entry<Integer, Integer> item : entries){
|
||||
Integer foodId = item.getKey();
|
||||
Integer remainStep = item.getValue();
|
||||
if(remainStep < 0){
|
||||
continue;
|
||||
}
|
||||
int finalRemainStep = remainStep - step;
|
||||
if(finalRemainStep<=0){
|
||||
removeFoodIds.add(foodId);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.ljsd.jieling.logic.hero;
|
||||
|
||||
public enum HeroAttributeEnum {
|
||||
CurHP(0),
|
||||
CurHP(6),
|
||||
Hp(1),
|
||||
Attack(2),
|
||||
PhysicalDefence(3),
|
||||
|
|
|
|||
|
|
@ -725,6 +725,7 @@ public class HeroLogic {
|
|||
//获取英雄所有属性
|
||||
public Map<Integer,Integer> calHeroFinalAttribute(User user, Hero hero){
|
||||
Map<Integer, Integer> heroAllAttribute = calHeroAllAttribute(hero);
|
||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)hero.getCurHp());
|
||||
Collection<String> values = hero.getEquipByPositionMap().values();
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
PokemonManager pokemonManager = user.getPokemonManager();
|
||||
|
|
@ -751,7 +752,6 @@ public class HeroLogic {
|
|||
//食物buffer加成
|
||||
Map<Integer, Integer> foodAddMap = CombatLogic.getInstance().attributeByEatFood(user,GlobalsDef.FOOD_ADDITION_EXPLORE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_TEAM);
|
||||
combinedAttribute(foodAddMap,heroAllAttribute);
|
||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),(int)hero.getCurHp());
|
||||
return heroAllAttribute;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue