diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 17a8e4fe4e0..3a75ed3b23b 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -1831,7 +1831,8 @@ public class AbilityUtils { } if (sq[0].startsWith("LastStateBattlefield")) { - final String[] k = l[0].split(" "); + String[] paidparts = l[0].split("\\$", 2); + final String[] k = paidparts[0].split(" "); CardCollectionView list; // this is only for spells that were cast if (sq[0].contains("WithFallback")) { @@ -1851,10 +1852,13 @@ public class AbilityUtils { } } list = CardLists.getValidCards(list, k[1], sa.getActivatingPlayer(), c, sa); - if (k[0].contains("TotalToughness")) { - return doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c, ctb); + int n; + if (paidparts.length > 1) { + n = handlePaid(new CardCollection(list), paidparts[1], c, ctb); + } else { + n = list.size(); } - return doXMath(list.size(), expr, c, ctb); + return doXMath(n, expr, c, ctb); } if (sq[0].startsWith("LastStateGraveyard")) { @@ -2416,16 +2420,6 @@ public class AbilityUtils { return doXMath(cmc, expr, c, ctb); } - if (sq[0].startsWith("ColorsCtrl")) { - final String restriction = l[0].substring(11); - final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb); - byte n = 0; - for (final Card card : list) { - n |= card.getColor().getColor(); - } - return doXMath(ColorSet.fromMask(n).countColors(), expr, c, ctb); - } - // Count$AttackersDeclared if (sq[0].startsWith("AttackersDeclared")) { List attackers = player.getCreaturesAttackedThisTurn(); diff --git a/forge-gui/res/cardsfolder/a/ascendant_acolyte.txt b/forge-gui/res/cardsfolder/a/ascendant_acolyte.txt index a70781183b0..b47d14ebffc 100644 --- a/forge-gui/res/cardsfolder/a/ascendant_acolyte.txt +++ b/forge-gui/res/cardsfolder/a/ascendant_acolyte.txt @@ -5,7 +5,7 @@ PT:1/1 K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each +1/+1 counter among other creatures you control. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDouble | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, double the number of +1/+1 counters on CARDNAME. SVar:TrigDouble:DB$ MultiplyCounter | Defined$ Self | CounterType$ P1P1 -SVar:X:Count$Valid Creature.YouCtrl+Other$CardCounters.P1P1 +SVar:X:Count$LastStateBattlefield Creature.YouCtrl+Other$CardCounters.P1P1 SVar:NeedsToPlay:Creature.YouCtrl+counters_GE1_P1P1 DeckHas:Ability$Counters Oracle:Ascendant Acolyte enters the battlefield with a +1/+1 counter on it for each +1/+1 counter among other creatures you control.\nAt the beginning of your upkeep, double the number of +1/+1 counters on Ascendant Acolyte. diff --git a/forge-gui/res/cardsfolder/t/towering_titan.txt b/forge-gui/res/cardsfolder/t/towering_titan.txt index 03acd23b72e..77e8ef93e19 100644 --- a/forge-gui/res/cardsfolder/t/towering_titan.txt +++ b/forge-gui/res/cardsfolder/t/towering_titan.txt @@ -3,7 +3,7 @@ ManaCost:4 G G Types:Creature Giant PT:0/0 K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with X +1/+1 counters on it, where X is the total toughness of other creatures you control. -SVar:X:Count$LastStateBattlefieldTotalToughness Creature.Other+YouCtrl +SVar:X:Count$LastStateBattlefield Creature.Other+YouCtrl$SumToughness A:AB$ PumpAll | Cost$ Sac<1/Creature.withDefender/creature with defender> | ValidCards$ Creature | KW$ Trample | SpellDescription$ All creatures gain trample until end of turn. SVar:NeedsToPlayVar:Z GE3 SVar:Z:Count$Valid Creature.YouCtrl+toughnessGE2