Merge branch 'master_online_hw' into master_test_hw

lvxinran 2020-10-30 16:25:17 +08:00
commit 10011c4027
3 changed files with 17 additions and 16 deletions

View File

@ -2564,18 +2564,18 @@ public class MapLogic {
if(trialInfo.getAddHpCount()>=healing[1]){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{healing[0],1}}, BIReason.TRIAL_ADD_HP_CONSUME, 1);
if(!itemCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
Map<Integer, Integer> propertyMap = heroInfo.get(heroId).getProperty();
int curHp = propertyMap.get(HeroAttributeEnum.CurHP.getPropertyId());
if(curHp==0){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}else{
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{healing[0],1}}, BIReason.TRIAL_ADD_HP_CONSUME, 1);
if(!itemCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
//todo 加血逻辑
int maxHp = propertyMap.get(HeroAttributeEnum.Hp.getPropertyId());
int resultHp = Math.min(curHp+maxHp*5000/10000,maxHp);
int resultHp = Math.min(curHp+maxHp/2,maxHp);
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),resultHp);
trialInfo.getHeroInfo().get(heroId).setProperty(propertyMap);
mapManager.updateTrialAddHpCount(1);

View File

@ -285,6 +285,11 @@ public class ItemLogic {
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_SOULE_CANT);
Jewel jewel = (Jewel)propertyItem;
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId());
if(jewel.getLevel()==0&&jewel.getBuildLevel()==0){
SItem sItem = SItem.getsItemMap().get(propertyItem.getEquipId());
reward = getStringBuilder(reward, 1, sItem.getResolveReward());
continue;
}
if(jewel.getLevel()!=0){
Map<Integer, SJewelRankupConfig> rankupConfigMap = SJewelRankupConfig.rankupMap.get(config.getLevelupPool()).get(1);
for(SJewelRankupConfig value:rankupConfigMap.values()){
@ -321,15 +326,11 @@ public class ItemLogic {
}
}
}
SItem sItem = SItem.getsItemMap().get(propertyItem.getEquipId());
items.add(new int[]{propertyItem.getEquipId(),1});
jewelIdReport.add(propertyItem.getEquipId());
jewelLevelReport.add(propertyItem.getLevel());
jewelQualityReport.add(((Jewel) propertyItem).getBuildLevel());
reward = getStringBuilder(reward, 1, sItem.getResolveReward());
}
for (String jewelId : jewelList) {
user.getEquipManager().remove(jewelId);
}
@ -343,10 +344,11 @@ public class ItemLogic {
Map<Integer,Integer> baseRandomMap = new HashMap<>();
for (int[] ints:items) {
if(baseItemMap.containsKey(ints[0])){
baseItemMap.put(ints[0],baseItemMap.get(ints[0])+ints[1]);
Map<Integer, Integer> mapRe = ItemUtil.getMapRe(ints[0], baseItemMap, baseCardMap, baseEquipMap, baseRandomMap);
if(mapRe.containsKey(ints[0])){
mapRe.put(ints[0],mapRe.get(ints[0])+ints[1]);
}else {
baseItemMap.put(ints[0],ints[1]);
mapRe.put(ints[0],ints[1]);
}
}
ItemUtil.drop(user,drop,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.JEWEL_DECOMPOSE);

View File

@ -309,7 +309,7 @@ public class PlayerLogic {
Set<Integer> fixVipId = new HashSet<>();
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
//如果这个权限是活动 且永久了 那么需要修复
if(vipInfoItem.getValue().getEffectTime()==0&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==5){
if(vipInfoItem.getValue().getEffectTime()==0&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType()==5){
fixVipId.add(vipInfoItem.getKey());
}
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=(TimeUtils.now()/1000)){
@ -317,11 +317,10 @@ public class PlayerLogic {
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
}
removePrivileges.add(vipInfoItem.getKey());
continue;
}
}
if(!fixVipId.isEmpty()){
fixVipId.forEach(n->playerInfoManager.addVipByTime(n,(int)((TimeUtils.now()+TimeUtils.WEEK)/1000)));
fixVipId.forEach(n->playerInfoManager.addVipByTime(n,(int)(TimeUtils.now()/1000)));
}
playerInfoManager.vipFlush(removePrivileges);
//vip刷新后才能发给前端