礼物回滚
parent
4b840e5750
commit
e1ad8231d1
|
@ -3052,39 +3052,19 @@ public class HeroLogic {
|
|||
|
||||
private void applyGiftEquipAttribute(Map<Integer, Long> heroAllAttribute, Hero hero, User user){
|
||||
// ... 礼物装备 ...
|
||||
HashMap<Integer, Long> giftAttrMap = new HashMap<>();
|
||||
Map<Integer, SEquipConfig> configMap = SEquipConfig.equipConfigMap;
|
||||
int heroGiftUp = 0;
|
||||
|
||||
// 主角属性计算,并计算对英雄礼物加成值
|
||||
Set<Integer> heroGiftEquipList = hero.getHeroGiftEquipList();
|
||||
Set<Integer> playerGiftEquipList = user.getPlayerInfoManager().getPlayerGiftEquipList();
|
||||
for (Integer id : playerGiftEquipList) {
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
set.addAll(heroGiftEquipList);
|
||||
set.addAll(playerGiftEquipList);
|
||||
Map<Integer, SEquipConfig> configMap = SEquipConfig.equipConfigMap;
|
||||
for (Integer id : set) {
|
||||
SEquipConfig config = configMap.get(id);
|
||||
if (config == null){
|
||||
continue;
|
||||
}
|
||||
heroGiftUp += config.getHeroGitUp();
|
||||
if (config.getProperty() != null){
|
||||
for (int[] ints : config.getProperty()) {
|
||||
giftAttrMap.put(ints[0], giftAttrMap.getOrDefault(ints[0],0L)+ints[1]);
|
||||
}
|
||||
}
|
||||
combinedAttribute(config.getProperty(), heroAllAttribute);
|
||||
}
|
||||
|
||||
// 英雄属性计算
|
||||
Set<Integer> heroGiftEquipList = hero.getHeroGiftEquipList();
|
||||
for (Integer id : heroGiftEquipList) {
|
||||
SEquipConfig config = configMap.get(id);
|
||||
if (config == null || config.getProperty() == null){
|
||||
continue;
|
||||
}
|
||||
for (int[] ints : config.getProperty()) {
|
||||
long value = Math.round(ints[1] * (1 + heroGiftUp / 10000d));
|
||||
giftAttrMap.put(ints[0], giftAttrMap.getOrDefault(ints[0],0L)+value);
|
||||
}
|
||||
}
|
||||
|
||||
combinedAttribute(giftAttrMap, heroAllAttribute);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue