mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
added another fix for Chandra's Incinerator
This commit is contained in:
parent
ba0e9af5fd
commit
44394cf016
1 changed files with 4 additions and 9 deletions
|
@ -76,7 +76,7 @@ class ChandrasIncineratorCostReductionEffect extends CostModificationEffectImpl
|
||||||
if (watcher == null) {
|
if (watcher == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int reductionAmount = watcher.getDamage(source.getControllerId(), game);
|
int reductionAmount = watcher.getDamage(source.getControllerId());
|
||||||
CardUtil.reduceCost(abilityToModify, Math.max(0, reductionAmount));
|
CardUtil.reduceCost(abilityToModify, Math.max(0, reductionAmount));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ class ChandrasIncineratorWatcher extends Watcher {
|
||||||
|| ((DamagedPlayerEvent) event).isCombatDamage()) {
|
|| ((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (UUID playerId : game.getOpponents(event.getPlayerId())) {
|
for (UUID playerId : game.getOpponents(event.getTargetId())) {
|
||||||
damageMap.compute(playerId, ((u, i) -> i == null ? event.getAmount() : Integer.sum(i, event.getAmount())));
|
damageMap.compute(playerId, ((u, i) -> i == null ? event.getAmount() : Integer.sum(i, event.getAmount())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,13 +119,8 @@ class ChandrasIncineratorWatcher extends Watcher {
|
||||||
super.reset();
|
super.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
int getDamage(UUID playerId, Game game) {
|
int getDamage(UUID playerId) {
|
||||||
return game
|
return damageMap.getOrDefault(playerId, 0);
|
||||||
.getOpponents(playerId)
|
|
||||||
.stream()
|
|
||||||
.filter(damageMap::containsKey)
|
|
||||||
.mapToInt(damageMap::get)
|
|
||||||
.sum();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue