恭送英雄返还神印
parent
639a6e92f6
commit
8cd5a70b94
|
@ -145,7 +145,6 @@ public class HeroLogic {
|
||||||
pokemonTemplate.add(HeroAttributeEnum.CureFacter.getPropertyId()); // 受治疗
|
pokemonTemplate.add(HeroAttributeEnum.CureFacter.getPropertyId()); // 受治疗
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String VERTICAL = "|";
|
|
||||||
public static final String DIVISION = "#";
|
public static final String DIVISION = "#";
|
||||||
|
|
||||||
public static final int HERO_MAX_STAR = 10; // 英雄最大星级,大于10星为觉醒
|
public static final int HERO_MAX_STAR = 10; // 英雄最大星级,大于10星为觉醒
|
||||||
|
@ -4381,15 +4380,17 @@ public class HeroLogic {
|
||||||
Hero hero = user.getHeroManager().getHero(heroId);
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
//如果是进阶把装备、宝物返还
|
//如果是进阶把装备、宝物返还
|
||||||
if (reason == BIReason.UPHERO_DECOMPOS_HERO_REWARD) {
|
if (reason == BIReason.UPHERO_DECOMPOS_HERO_REWARD) {
|
||||||
|
// 装备
|
||||||
Map<Integer, Integer> equipByPositionMap = hero.getEquipByPositionMap();
|
Map<Integer, Integer> equipByPositionMap = hero.getEquipByPositionMap();
|
||||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
|
||||||
if (equipByPositionMap != null && equipByPositionMap.size() > 0) {
|
if (equipByPositionMap != null && equipByPositionMap.size() > 0) {
|
||||||
equipByPositionMap.forEach((k, v) -> returnItemMap.put(v, returnItemMap.getOrDefault(v, 0) + 1));
|
equipByPositionMap.forEach((k, v) -> returnItemMap.put(v, returnItemMap.getOrDefault(v, 0) + 1));
|
||||||
}
|
}
|
||||||
|
// 魂印
|
||||||
|
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||||
if (soulEquipByPositionMap != null && soulEquipByPositionMap.size() > 0) {
|
if (soulEquipByPositionMap != null && soulEquipByPositionMap.size() > 0) {
|
||||||
soulEquipByPositionMap.forEach((k, v) -> returnItemMap.put(v, returnItemMap.getOrDefault(v, 0) + 1));
|
soulEquipByPositionMap.forEach((k, v) -> returnItemMap.put(v, returnItemMap.getOrDefault(v, 0) + 1));
|
||||||
}
|
}
|
||||||
|
// 宝器
|
||||||
Set<String> jewelInfo = new HashSet<>(hero.getJewelInfo());
|
Set<String> jewelInfo = new HashSet<>(hero.getJewelInfo());
|
||||||
for (String equipId : jewelInfo) {
|
for (String equipId : jewelInfo) {
|
||||||
if (!equipMap.containsKey(equipId)) {
|
if (!equipMap.containsKey(equipId)) {
|
||||||
|
@ -4398,6 +4399,13 @@ public class HeroLogic {
|
||||||
equipMap.get(equipId).setHeroId("");
|
equipMap.get(equipId).setHeroId("");
|
||||||
hero.removeJewel(equipId);
|
hero.removeJewel(equipId);
|
||||||
}
|
}
|
||||||
|
// 神印
|
||||||
|
Map<Integer, Integer> godSealByPositionMap = hero.getGodSealByPositionMap();
|
||||||
|
if (godSealByPositionMap != null && !godSealByPositionMap.isEmpty()){
|
||||||
|
for (Integer integer : godSealByPositionMap.values()) {
|
||||||
|
returnItemMap.put(integer,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int breakId = hero.getBreakId();
|
int breakId = hero.getBreakId();
|
||||||
int templateId = hero.getTemplateId();
|
int templateId = hero.getTemplateId();
|
||||||
|
@ -4409,11 +4417,11 @@ public class HeroLogic {
|
||||||
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getOriginalLevel());
|
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getOriginalLevel());
|
||||||
int[][] levelReturn = ItemLogic.getInstance().itemReturnPercent(sHeroLevlConfig.getSumConsume(), returnPercent);
|
int[][] levelReturn = ItemLogic.getInstance().itemReturnPercent(sHeroLevlConfig.getSumConsume(), returnPercent);
|
||||||
//进阶材料返还乘万分比
|
//进阶材料返还乘万分比
|
||||||
for (int i = 0; i < returnMaterials.length; i++) {
|
for (int[] returnMaterial : returnMaterials) {
|
||||||
returnItemMap.put(returnMaterials[i][0], returnItemMap.getOrDefault(returnMaterials[i][0], 0) + (int) (returnMaterials[i][1] / 10000d * returnPercent));
|
returnItemMap.put(returnMaterial[0], returnItemMap.getOrDefault(returnMaterial[0], 0) + (int) (returnMaterial[1] / 10000d * returnPercent));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < levelReturn.length; i++) {
|
for (int[] ints : levelReturn) {
|
||||||
returnItemMap.put(levelReturn[i][0], returnItemMap.getOrDefault(levelReturn[i][0], 0) + levelReturn[i][1]);
|
returnItemMap.put(ints[0], returnItemMap.getOrDefault(ints[0], 0) + ints[1]);
|
||||||
}
|
}
|
||||||
if (!isAddEspecial) {
|
if (!isAddEspecial) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -4432,9 +4440,7 @@ public class HeroLogic {
|
||||||
resultDrop[index] = new int[]{entry.getKey(), entry.getValue()};
|
resultDrop[index] = new int[]{entry.getKey(), entry.getValue()};
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, resultDrop, reason);
|
return ItemUtil.drop(user, resultDrop, reason);
|
||||||
return drop;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeHeroLockState(ISession session, String heroId, int lockState) throws Exception {
|
public void changeHeroLockState(ISession session, String heroId, int lockState) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue