From 24d2c8dc2f7a8296702d45c38cabadfcfd2f3958 Mon Sep 17 00:00:00 2001 From: swordshine Date: Sun, 28 Jun 2020 14:06:42 +0800 Subject: [PATCH] Add Towering Titan --- .../src/main/java/forge/game/ability/AbilityUtils.java | 7 ++++++- forge-gui/res/cardsfolder/d/diregraf_colossus.txt | 2 +- forge-gui/res/cardsfolder/g/golgari_grave_troll.txt | 2 +- forge-gui/res/cardsfolder/u/ulasht_the_hate_seed.txt | 2 +- forge-gui/res/cardsfolder/u/unbreathing_horde.txt | 2 +- .../res/cardsfolder/upcoming/JMP/towering_titan.txt | 10 ++++++++++ 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/JMP/towering_titan.txt 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 239175f7a3d..ba1f8cfdc51 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -29,6 +29,7 @@ import forge.game.spellability.*; import forge.game.trigger.Trigger; import forge.game.trigger.TriggerType; import forge.game.zone.ZoneType; +import forge.util.Aggregates; import forge.util.Expressions; import forge.util.TextUtil; import forge.util.collect.FCollection; @@ -1729,7 +1730,11 @@ public class AbilityUtils { return CardFactoryUtil.doXMath(0, expr, c); } list = CardLists.getValidCards(list, k[1].split(","), sa.getActivatingPlayer(), c, sa); - return CardFactoryUtil.doXMath(list.size(), expr, c); + if (k[0].contains("TotalToughness")) { + return CardFactoryUtil.doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c); + } else { + return CardFactoryUtil.doXMath(list.size(), expr, c); + } } if (l[0].startsWith("LastStateGraveyard")) { diff --git a/forge-gui/res/cardsfolder/d/diregraf_colossus.txt b/forge-gui/res/cardsfolder/d/diregraf_colossus.txt index 2aca2db8371..96546080e30 100644 --- a/forge-gui/res/cardsfolder/d/diregraf_colossus.txt +++ b/forge-gui/res/cardsfolder/d/diregraf_colossus.txt @@ -2,7 +2,7 @@ Name:Diregraf Colossus ManaCost:2 B Types:Creature Zombie Giant PT:2/2 -K:etbCounter:P1P1:X:no Condition:Diregraf Colossus enters the battlefield with a +1/+1 counter on it for each Zombie card in your graveyard. +K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each Zombie card in your graveyard. SVar:X:Count$LastStateGraveyard Zombie.YouCtrl T:Mode$ SpellCast | ValidCard$ Zombie | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ Whenever you cast a Zombie spell, create a tapped 2/2 black Zombie creature token. SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ b_2_2_zombie | LegacyImage$ b 2 2 zombie soi | TokenTapped$ True | TokenOwner$ You diff --git a/forge-gui/res/cardsfolder/g/golgari_grave_troll.txt b/forge-gui/res/cardsfolder/g/golgari_grave_troll.txt index 00e73319c47..322671d3e5e 100644 --- a/forge-gui/res/cardsfolder/g/golgari_grave_troll.txt +++ b/forge-gui/res/cardsfolder/g/golgari_grave_troll.txt @@ -2,7 +2,7 @@ Name:Golgari Grave-Troll ManaCost:4 G Types:Creature Troll Skeleton PT:0/0 -K:etbCounter:P1P1:X:no Condition:Golgari Grave-Troll enters the battlefield with a +1/+1 counter on it for each creature card in your graveyard. +K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each creature card in your graveyard. A:AB$ Regenerate | Cost$ 1 SubCounter<1/P1P1> | SpellDescription$ Regenerate CARDNAME. K:Dredge:6 SVar:X:Count$LastStateGraveyard Creature.YouCtrl diff --git a/forge-gui/res/cardsfolder/u/ulasht_the_hate_seed.txt b/forge-gui/res/cardsfolder/u/ulasht_the_hate_seed.txt index 6ecc82b8232..78e105cf965 100644 --- a/forge-gui/res/cardsfolder/u/ulasht_the_hate_seed.txt +++ b/forge-gui/res/cardsfolder/u/ulasht_the_hate_seed.txt @@ -2,7 +2,7 @@ Name:Ulasht, the Hate Seed ManaCost:2 R G Types:Legendary Creature Hellion Hydra PT:0/0 -K:etbCounter:P1P1:X:no Condition:Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. +K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. A:AB$ DealDamage | Cost$ 1 SubCounter<1/P1P1> | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ 1 | SpellDescription$ Ulasht deals 1 damage to target creature. A:AB$ Token | Cost$ 1 SubCounter<1/P1P1> | TokenAmount$ 1 | TokenScript$ g_1_1_saproling | LegacyImage$ g 1 1 saproling gpt | TokenOwner$ You | SpellDescription$ Create a 1/1 green Saproling creature token. SVar:X:Count$LastStateBattlefield Creature.YouCtrl+Red+Other/Plus.B diff --git a/forge-gui/res/cardsfolder/u/unbreathing_horde.txt b/forge-gui/res/cardsfolder/u/unbreathing_horde.txt index 8eea45743b5..395c7faa26f 100644 --- a/forge-gui/res/cardsfolder/u/unbreathing_horde.txt +++ b/forge-gui/res/cardsfolder/u/unbreathing_horde.txt @@ -2,7 +2,7 @@ Name:Unbreathing Horde ManaCost:2 B Types:Creature Zombie PT:0/0 -K:etbCounter:P1P1:X:no Condition:Unbreathing Horde enters the battlefield with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard. +K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each other Zombie you control and each Zombie card in your graveyard. R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ DBRemoveCounters | PreventionEffect$ True | Description$ If damage would be dealt to CARDNAME, prevent that damage. Remove a +1/+1 counter from CARDNAME. SVar:DBRemoveCounters:DB$ RemoveCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 SVar:X:Count$LastStateBattlefield Zombie.YouCtrl/Plus.Y diff --git a/forge-gui/res/cardsfolder/upcoming/JMP/towering_titan.txt b/forge-gui/res/cardsfolder/upcoming/JMP/towering_titan.txt new file mode 100644 index 00000000000..dabde8891f1 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/JMP/towering_titan.txt @@ -0,0 +1,10 @@ +Name:Towering Titan +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 +A:SP$ 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 +Oracle:Towering Titan enters the battlefield with X +1/+1 counters on it, where X is the total toughness of other creatures you control.\nSacrifice a creature with defender: All creatures gain trample until end of turn.