Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
dd46d9e219
|
@ -27,6 +27,7 @@ import com.ljsd.jieling.logic.activity.event.StoryEvent;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.fight.CheckFight;
|
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.fight.FightType;
|
||||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
@ -358,6 +359,17 @@ public class MapLogic {
|
||||||
LOGGER.info("enterMap() uid=>{} team pos is wrong ", uid, teamId);
|
LOGGER.info("enterMap() uid=>{} team pos is wrong ", uid, teamId);
|
||||||
return "阵容有误";
|
return "阵容有误";
|
||||||
}
|
}
|
||||||
|
if(2 == initType && teamId!=401){
|
||||||
|
Map<Integer, Integer> foodBufferMap = mapManager.getFoodBufferMap();
|
||||||
|
for(Map.Entry<Integer,Integer> item : foodBufferMap.entrySet()){
|
||||||
|
Integer value = item.getValue();
|
||||||
|
if(value<=-1){
|
||||||
|
SFoodsConfig sFoodsConfig = STableManager.getConfig(SFoodsConfig.class).get(item.getKey());
|
||||||
|
CombatLogic.getInstance().updateHeroAttributJustOne(user,teamPosHeroInfos,sFoodsConfig,heroAllAttributeMap,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mapManager.setTeamId(teamId);
|
mapManager.setTeamId(teamId);
|
||||||
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
|
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
|
||||||
return "";
|
return "";
|
||||||
|
@ -534,6 +546,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapManager.setCurXY(curXY);
|
mapManager.setCurXY(curXY);
|
||||||
|
mapManager.updateFoodBufferByStep(cells.size());
|
||||||
}
|
}
|
||||||
MapInfoProto.MapUpdateResponse mapUpdateResponse = MapInfoProto.MapUpdateResponse.newBuilder()
|
MapInfoProto.MapUpdateResponse mapUpdateResponse = MapInfoProto.MapUpdateResponse.newBuilder()
|
||||||
.setLeftTime(getLeftTime(user, true))
|
.setLeftTime(getLeftTime(user, true))
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.ljsd.jieling.logic.store.StoreLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||||
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import com.ljsd.jieling.util.*;
|
import com.ljsd.jieling.util.*;
|
||||||
import config.*;
|
import config.*;
|
||||||
|
@ -62,7 +63,7 @@ public class CombatLogic {
|
||||||
|
|
||||||
public Map<Integer,Integer> bufferOneHeroAttrAfterEat(Map<Integer,Integer> value,int foodId){
|
public Map<Integer,Integer> bufferOneHeroAttrAfterEat(Map<Integer,Integer> value,int foodId){
|
||||||
SFoodsConfig sFoodsConfig = STableManager.getConfig(SFoodsConfig.class).get(foodId);
|
SFoodsConfig sFoodsConfig = STableManager.getConfig(SFoodsConfig.class).get(foodId);
|
||||||
if(value.get(HeroAttributeEnum.CurHP.getPropertyId()) == 0){
|
if(value.get(HeroAttributeEnum.CurHP.getPropertyId()) == 0 || sFoodsConfig.getContiue()!=0){
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
for(int[] effectPara : sFoodsConfig.getEffectPara()){
|
for(int[] effectPara : sFoodsConfig.getEffectPara()){
|
||||||
|
@ -76,15 +77,8 @@ public class CombatLogic {
|
||||||
}else{
|
}else{
|
||||||
if(sPropertyConfig.getTargetPropertyId()!=0){
|
if(sPropertyConfig.getTargetPropertyId()!=0){
|
||||||
effectId = sPropertyConfig.getTargetPropertyId();
|
effectId = sPropertyConfig.getTargetPropertyId();
|
||||||
effectValue = value.get(effectId) + effectValue/10000;
|
effectValue = value.get(effectId) * effectValue/10000;
|
||||||
}else{
|
|
||||||
int baseValue = 0;
|
|
||||||
if(value.containsKey(effectId)){
|
|
||||||
baseValue = value.get(effectId);
|
|
||||||
}
|
}
|
||||||
effectValue = baseValue + effectValue/10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,8 +129,11 @@ public class CombatLogic {
|
||||||
int contiue = sFoodsConfig.getContiue();
|
int contiue = sFoodsConfig.getContiue();
|
||||||
if(contiue==0){
|
if(contiue==0){
|
||||||
contiue=-1;
|
contiue=-1;
|
||||||
int teamId = mapManager.getTeamId();
|
}
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
mapManager.eatFood(foodIdOrEventId,contiue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateHeroAttributJustOne(User user,List<TeamPosHeroInfo> teamPosHeroInfoList,SFoodsConfig sFoodsConfig, Map<String, Map<Integer, Integer>> heroAllAttributeMap,boolean isRecory){
|
||||||
Map<Integer,Integer> foodAddMap = new HashMap<>();
|
Map<Integer,Integer> foodAddMap = new HashMap<>();
|
||||||
getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
|
getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
|
||||||
for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
|
for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
|
||||||
|
@ -144,18 +141,20 @@ public class CombatLogic {
|
||||||
if (hero == null) {
|
if (hero == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
|
Map<Integer, Integer> heroAllAttribute = new HashMap<>();
|
||||||
|
if(isRecory){
|
||||||
|
heroAllAttribute =heroAllAttributeMap.get(hero.getId());
|
||||||
|
}else {
|
||||||
|
heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
|
||||||
if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
|
if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
|
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
|
||||||
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
|
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
|
||||||
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
|
||||||
}
|
}
|
||||||
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
|
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
|
||||||
}
|
|
||||||
mapManager.eatFood(foodIdOrEventId,contiue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer,Integer> attributeByEatFood( User user,int type,int target){
|
public Map<Integer,Integer> attributeByEatFood( User user,int type,int target){
|
||||||
|
@ -944,9 +943,9 @@ public class CombatLogic {
|
||||||
String randomReward = ItemUtil.getReward(randomItemMap, randomCardMap, randomEquipMap, randomRandomMap);
|
String randomReward = ItemUtil.getReward(randomItemMap, randomCardMap, randomEquipMap, randomRandomMap);
|
||||||
if(randomReward.length()!=0){
|
if(randomReward.length()!=0){
|
||||||
reward = reward + "|" + randomReward;
|
reward = reward + "|" + randomReward;
|
||||||
}
|
|
||||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,now, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,now, Global.MAIL_EFFECTIVE_TIME);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mainLevelManager.afterTakeStateReward(true,0);
|
mainLevelManager.afterTakeStateReward(true,0);
|
||||||
myResult = true;
|
myResult = true;
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -1313,9 +1313,10 @@ public class HeroLogic {
|
||||||
if(foodAddMap.isEmpty()){
|
if(foodAddMap.isEmpty()){
|
||||||
return heroAllAttribute;
|
return heroAllAttribute;
|
||||||
}
|
}
|
||||||
combinedAttribute(foodAddMap,heroAllAttribute);
|
Map<Integer, Integer> heroAllAttributeCopy = new HashMap<>(heroAllAttribute);
|
||||||
calInteractAdd(heroAllAttribute);
|
combinedAttribute(foodAddMap,heroAllAttributeCopy);
|
||||||
return heroAllAttribute;
|
calInteractAdd(heroAllAttributeCopy);
|
||||||
|
return heroAllAttributeCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,10 @@ public class PlayerLogic {
|
||||||
}
|
}
|
||||||
if(hadNum<num){
|
if(hadNum<num){
|
||||||
Map<Integer,Integer> itemMap = new HashMap<>(1);
|
Map<Integer,Integer> itemMap = new HashMap<>(1);
|
||||||
|
if(reson == BIReason.VIP_LEVEL_REWARD){
|
||||||
|
Map<Integer, Integer> privilegePreMap = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel - 1).getPrivilegeMap();
|
||||||
|
hadNum = privilegePreMap.get(dailyGift[1]);
|
||||||
|
}
|
||||||
itemMap.put(dailyGift[0],num-hadNum);
|
itemMap.put(dailyGift[0],num-hadNum);
|
||||||
ItemUtil.addItem(user,itemMap,null, reson);
|
ItemUtil.addItem(user,itemMap,null, reson);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue