From 2b941bcbfbfbcea26c862e8f4545f10eebdcf4db Mon Sep 17 00:00:00 2001 From: Simisays <67333662+Simisays@users.noreply.github.com> Date: Sun, 24 Sep 2023 12:20:20 +0200 Subject: [PATCH] LTC 8 cards (#3803) --- .../java/forge/game/ability/AbilityUtils.java | 14 +++++++++++--- .../StaticAbilityCantGainLosePayLife.java | 5 +++-- .../upcoming/anduril_narsil_reforged.txt | 12 ++++++++++++ .../upcoming/aragorn_hornburg_hero.txt | 10 ++++++++++ .../cardsfolder/upcoming/arboreal_alliance.txt | 11 +++++++++++ .../upcoming/call_forth_the_tempest.txt | 8 ++++++++ .../cardsfolder/upcoming/courageous_resolve.txt | 10 ++++++++++ .../cardsfolder/upcoming/fell_beast_of_mordor.txt | 15 +++++++++++++++ .../cardsfolder/upcoming/fell_beasts_shriek.txt | 11 +++++++++++ .../cardsfolder/upcoming/galadhrim_brigade.txt | 9 +++++++++ 10 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/anduril_narsil_reforged.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/aragorn_hornburg_hero.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/arboreal_alliance.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/call_forth_the_tempest.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/courageous_resolve.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/fell_beast_of_mordor.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/fell_beasts_shriek.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/galadhrim_brigade.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 03aeea78abc..15d9a8c98e8 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -2672,17 +2672,25 @@ public class AbilityUtils { // Count$ThisTurnCast // Count$LastTurnCast if (sq[0].startsWith("ThisTurnCast") || sq[0].startsWith("LastTurnCast")) { - final String[] workingCopy = l[0].split("_"); + String[] paidparts = l[0].split("\\$", 2); + final String[] workingCopy = paidparts[0].split("_"); final String validFilter = workingCopy[1]; - List res = Lists.newArrayList(); + List res; if (workingCopy[0].contains("This")) { res = CardUtil.getThisTurnCast(validFilter, c, ctb, player); } else { res = CardUtil.getLastTurnCast(validFilter, c, ctb, player); } - return doXMath(res.size(), expr, c, ctb); + int num; + if (paidparts.length > 1) { + num = handlePaid(res, paidparts[1], c, ctb); + } else { + num = res.size(); + } + + return doXMath(num, expr, c, ctb); } // Count$ThisTurnEntered [from ] diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantGainLosePayLife.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantGainLosePayLife.java index 6932981cb0f..18b61e12e7f 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantGainLosePayLife.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityCantGainLosePayLife.java @@ -9,6 +9,7 @@ import forge.game.zone.ZoneType; public class StaticAbilityCantGainLosePayLife { static String MODE_CANT_GAIN_LIFE = "CantGainLife"; + static String MODE_CANT_LOSE_LIFE = "CantLoseLife"; static String MODE_CANT_CHANGE_LIFE = "CantChangeLife"; static String MODE_CANT_PAY_LIFE = "CantPayLife"; @@ -36,7 +37,7 @@ public class StaticAbilityCantGainLosePayLife { final Game game = player.getGame(); for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) { for (final StaticAbility stAb : ca.getStaticAbilities()) { - if (!stAb.checkConditions(MODE_CANT_CHANGE_LIFE)) { + if (!(stAb.checkMode(MODE_CANT_LOSE_LIFE) || stAb.checkMode(MODE_CANT_CHANGE_LIFE))) { continue; } @@ -53,7 +54,7 @@ public class StaticAbilityCantGainLosePayLife { final Game game = player.getGame(); for (final Card ca : game.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES)) { for (final StaticAbility stAb : ca.getStaticAbilities()) { - if (!(stAb.checkMode(MODE_CANT_PAY_LIFE) || stAb.checkMode(MODE_CANT_CHANGE_LIFE))) { + if (!(stAb.checkMode(MODE_CANT_PAY_LIFE) || stAb.checkMode(MODE_CANT_LOSE_LIFE) || stAb.checkMode(MODE_CANT_CHANGE_LIFE))) { continue; } diff --git a/forge-gui/res/cardsfolder/upcoming/anduril_narsil_reforged.txt b/forge-gui/res/cardsfolder/upcoming/anduril_narsil_reforged.txt new file mode 100644 index 00000000000..2dadc75eb60 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/anduril_narsil_reforged.txt @@ -0,0 +1,12 @@ +Name:Anduril, Narsil Reforged +ManaCost:2 +Types:Legendary Artifact Equipment +K:Ascend +T:Mode$ Attacks | ValidCard$ Creature.EquippedBy | Execute$ TrigCounter | TriggerDescription$ Whenever equipped creature attacks, put a +1/+1 counter on each creature you control. If you have the city's blessing, put two +1/+1 counters on each creature you control instead. +SVar:TrigCounter:DB$ PutCounterAll | ValidCards$ Creature.YouCtrl | CounterType$ P1P1 | CounterNum$ X +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddSVar$ AE +SVar:X:Count$Blessing.2.1 +K:Equip:3 +SVar:AE:SVar:HasAttackEffect:TRUE +DeckHas:Ability$Counters +Oracle:Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)\nWhenever equipped creature attacks, put a +1/+1 counter on each creature you control. If you have the city's blessing, put two +1/+1 counters on each creature you control instead.\nEquip {3} \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/aragorn_hornburg_hero.txt b/forge-gui/res/cardsfolder/upcoming/aragorn_hornburg_hero.txt new file mode 100644 index 00000000000..c605777c9c4 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/aragorn_hornburg_hero.txt @@ -0,0 +1,10 @@ +Name:Aragorn, Hornburg Hero +ManaCost:1 R G W +Types:Legendary Creature Human Soldier +PT:4/4 +S:Mode$ Continuous | Affected$ Creature.attacking+YouCtrl | AddKeyword$ First Strike & Renown:1 | Description$ Attacking creatures you control have first strike and renown 1. (When a creature with renown 1 deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.) +T:Mode$ DamageDone | ValidSource$ Creature.IsRenowned+YouCtrl | Execute$ TrigDouble | CombatDamage$ True | ValidTarget$ Player | TriggerZones$ Battlefield | TriggerDescription$ Whenever a renowned creature you control deals combat damage to a player, double the number of +1/+1 counters on it. +SVar:TrigDouble:DB$ MultiplyCounter | Defined$ TriggeredSourceLKICopy | CounterType$ P1P1 +DeckHas:Ability$Counters +DeckHints:Ability$Counters +Oracle:Attacking creatures you control have first strike and renown 1. (When a creature with renown 1 deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.)\nWhenever a renowned creature you control deals combat damage to a player, double the number of +1/+1 counters on it. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/arboreal_alliance.txt b/forge-gui/res/cardsfolder/upcoming/arboreal_alliance.txt new file mode 100644 index 00000000000..449ae779037 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/arboreal_alliance.txt @@ -0,0 +1,11 @@ +Name:Arboreal Alliance +ManaCost:X G G +Types:Enchantment +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, create an X/X green Treefolk creature token. +SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ g_x_x_treefolk | TokenPower$ X | TokenToughness$ X +SVar:X:Count$xPaid +T:Mode$ AttackersDeclared | ValidAttackers$ Creature.Elf+YouCtrl | Execute$ TrigPopulate | TriggerZones$ Battlefield | TriggerDescription$ Whenever you attack with one or more Elves, populate. (Create a token that's a copy of a creature token you control.) +SVar:TrigPopulate:DB$ CopyPermanent | Choices$ Creature.token+YouCtrl | Populate$ True +DeckHas:Ability$Token & Type$Treefolk +DeckHints:Type$Elf +Oracle:When Arboreal Alliance enters the battlefield, create an X/X green Treefolk creature token.\nWhenever you attack with one or more Elves, populate. (Create a token that's a copy of a creature token you control.) \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/call_forth_the_tempest.txt b/forge-gui/res/cardsfolder/upcoming/call_forth_the_tempest.txt new file mode 100644 index 00000000000..a924f80286d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/call_forth_the_tempest.txt @@ -0,0 +1,8 @@ +Name:Call Forth the Tempest +ManaCost:5 R R R +Types:Sorcery +K:Cascade +K:Cascade +A:SP$ DamageAll | NumDmg$ X | ValidCards$ Creature.OppCtrl | ValidDescription$ each creature your opponents controls | SpellDescription$ CARDNAME deals damage to each creature your opponents control equal to the total mana value of other spells you've cast this turn. +SVar:X:Count$ThisTurnCast_Card.YouCtrl+Other$SumCMC +Oracle:Cascade, cascade (When you cast this spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom of your library in a random order. Then do it again.)\nCall Forth the Tempest deals damage to each creature your opponents control equal to the total mana value of other spells you've cast this turn. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/courageous_resolve.txt b/forge-gui/res/cardsfolder/upcoming/courageous_resolve.txt new file mode 100644 index 00000000000..959634edac5 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/courageous_resolve.txt @@ -0,0 +1,10 @@ +Name:Courageous Resolve +ManaCost:2 W +Types:Instant +A:SP$ Pump | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select up to one target creature you control | TargetMin$ 0 | TargetMax$ 1 | SubAbility$ DBDraw | KW$ Protection:Card.ControlledBy Player.PlayerUID_ChosenPlayerUID,Emblem.ControlledBy Player.PlayerUID_ChosenPlayerUID:Protection from ChosenPlayerName | DefinedKW$ Opponent | SpellDescription$ Up to one target creature you control gains protection from each of your opponents until end of turn. Draw a card. (It can't be blocked, targeted, dealt damage, enchanted, or equipped by anything controlled by those players.) +SVar:DBDraw:DB$ Draw | SubAbility$ DBEffect +SVar:DBEffect:DB$ Effect | StaticAbilities$ STKeepLife,STCantLose | ConditionCheckSVar$ FatefulHour | ConditionSVarCompare$ LE5 | AILogic$ Fog | SpellDescription$ Fateful hour — If you have 5 or less life, you can't lose life this turn, you can't lose the game this turn, and your opponents can't win the game this turn. +SVar:STKeepLife:Mode$ CantLoseLife | ValidPlayer$ You | Description$ You can't lose life this turn. +SVar:STCantLose:Mode$ Continuous | Affected$ You | AddKeyword$ You can't lose the game. & Your opponents can't win the game. | Description$ You can't lose the game. Your opponents can't win the game. +SVar:FatefulHour:Count$YourLifeTotal +Oracle:Up to one target creature you control gains protection from each of your opponents until end of turn. Draw a card. (It can't be blocked, targeted, dealt damage, enchanted, or equipped by anything controlled by those players.)\nFateful hour — If you have 5 or less life, you can't lose life this turn, you can't lose the game this turn, and your opponents can't win the game this turn. diff --git a/forge-gui/res/cardsfolder/upcoming/fell_beast_of_mordor.txt b/forge-gui/res/cardsfolder/upcoming/fell_beast_of_mordor.txt new file mode 100644 index 00000000000..3bd86ddb45d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/fell_beast_of_mordor.txt @@ -0,0 +1,15 @@ +Name:Fell Beast of Mordor +ManaCost:2 B B +Types:Creature Drake Beast +PT:3/3 +K:Flying +K:Devour:1 +T:Mode$ ChangesZone | ValidCard$ Card.Self | Destination$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, target opponent loses X life and you gain X life, where X is the number of +1/+1 counters on it. +T:Mode$ Attacks | ValidCard$ Card.Self | Secondary$ True | Execute$ TrigLoseLife | TriggerDescription$ Whenever CARDNAME enters the battlefield or attacks, target opponent loses X life and you gain X life, where X is the number of +1/+1 counters on it. +SVar:TrigLoseLife:DB$ LoseLife | LifeAmount$ X | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ DBGainLife +SVar:DBGainLife:DB$ GainLife | LifeAmount$ X | Defined$ You +SVar:X:Count$CardCounters.P1P1 +DeckHas:Ability$Sacrifice|Counters|LifeGain +DeckHints:Ability$Counters +SVar:HasAttackEffect:TRUE +Oracle:Flying\nDevour 1 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with that many +1/+1 counters on it.)\nWhenever Fell Beast of Mordor enters the battlefield or attacks, target opponent loses X life and you gain X life, where X is the number of +1/+1 counters on it. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/fell_beasts_shriek.txt b/forge-gui/res/cardsfolder/upcoming/fell_beasts_shriek.txt new file mode 100644 index 00000000000..887c84c23ae --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/fell_beasts_shriek.txt @@ -0,0 +1,11 @@ +Name:Fell Beast's Shriek +ManaCost:U R +Types:Sorcery +K:Splice:Instant,Sorcery:2 U R +A:SP$ RepeatEach | RepeatPlayers$ Opponent | RepeatSubAbility$ DBChoose | SubAbility$ DBTapAll | SpellDescription$ Each opponent chooses a creature they control. Tap and goad the chosen creatures. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.) +SVar:DBChoose:DB$ ChooseCard | Defined$ Remembered | Amount$ 1 | Choices$ Creature.RememberedPlayerCtrl | Mandatory$ True | RememberChosen$ True +SVar:DBTapAll:DB$ TapAll | ValidCards$ Creature.IsRemembered | SubAbility$ DBGoad +SVar:DBGoad:DB$ Goad | Defined$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +DeckHints:Type$Instant|Sorcery +Oracle:Each opponent chooses a creature they control. Tap and goad the chosen creatures. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)\nSplice onto instant or sorcery {2}{U}{R} (As you cast an instant or sorcery spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/upcoming/galadhrim_brigade.txt b/forge-gui/res/cardsfolder/upcoming/galadhrim_brigade.txt new file mode 100644 index 00000000000..0481e24dfef --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/galadhrim_brigade.txt @@ -0,0 +1,9 @@ +Name:Galadhrim Brigade +ManaCost:2 G +Types:Creature Elf Soldier +PT:2/2 +K:Squad:1 G +S:Mode$ Continuous | Affected$ Elf.Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Elves you control get +1/+1. +DeckHas:Ability$Token +DeckHints:Type$Elf +Oracle:Squad {1}{G} (As an additional cost to cast this spell, you may pay any number of times. When this creature enters the battlefield, create that many tokens that are copies of it.)\nOther Elves you control get +1/+1. \ No newline at end of file