Fix Reverse Polarity

This commit is contained in:
tool4EvEr
2023-02-28 23:57:43 +01:00
committed by tool4ever
parent 29522de5ae
commit 9c90b19c82
2 changed files with 5 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.google.common.base.Functions;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import forge.card.CardStateName; import forge.card.CardStateName;
@@ -2404,8 +2405,10 @@ public class AbilityUtils {
List<Integer> dmgInstances = game.getDamageDoneThisTurn(isCombat, false, props[1], props[2], c, player, ctb); List<Integer> dmgInstances = game.getDamageDoneThisTurn(isCombat, false, props[1], props[2], c, player, ctb);
if (!dmgInstances.isEmpty() && sq[0].contains("Max")) { if (!dmgInstances.isEmpty() && sq[0].contains("Max")) {
num = Collections.max(dmgInstances); num = Collections.max(dmgInstances);
} else { } else if (sq[0].startsWith("Num")) {
num = dmgInstances.size(); num = dmgInstances.size();
} else {
num = Aggregates.sum(dmgInstances, Functions.identity());
} }
return doXMath(num, expr, c, ctb); return doXMath(num, expr, c, ctb);
} }

View File

@@ -2,7 +2,7 @@ Name:Reverse Polarity
ManaCost:W W ManaCost:W W
Types:Instant Types:Instant
A:SP$ GainLife | Cost$ W W | Defined$ You | LifeAmount$ X | SpellDescription$ You gain X life, where X is twice the damage dealt to you so far this turn by artifacts. A:SP$ GainLife | Cost$ W W | Defined$ You | LifeAmount$ X | SpellDescription$ You gain X life, where X is twice the damage dealt to you so far this turn by artifacts.
SVar:X:Count$YourTypeDamageThisTurn Artifact/Times.2 SVar:X:Count$DamageThisTurn Artifact You/Times.2
AI:RemoveDeck:Random AI:RemoveDeck:Random
DeckHas:Ability$LifeGain DeckHas:Ability$LifeGain
Oracle:You gain X life, where X is twice the damage dealt to you so far this turn by artifacts. Oracle:You gain X life, where X is twice the damage dealt to you so far this turn by artifacts.