From c41d72044f724d657392c066e590febb3021611a Mon Sep 17 00:00:00 2001 From: Tim Mocny Date: Mon, 7 Feb 2022 18:43:40 +0000 Subject: [PATCH] NEO: Mechtitan Core + Mechtitan token and support --- .../src/main/java/forge/card/MagicColor.java | 3 +++ .../java/forge/game/ability/AbilityUtils.java | 24 +++++++++++++++---- .../cardsfolder/upcoming/mechtitan_core.txt | 12 ++++++++++ .../res/tokenscripts/all_2_2_citizen.txt | 2 +- forge-gui/res/tokenscripts/mechtitan.txt | 11 +++++++++ 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/mechtitan_core.txt create mode 100644 forge-gui/res/tokenscripts/mechtitan.txt diff --git a/forge-core/src/main/java/forge/card/MagicColor.java b/forge-core/src/main/java/forge/card/MagicColor.java index 465559faa5a..71ff66741e6 100644 --- a/forge-core/src/main/java/forge/card/MagicColor.java +++ b/forge-core/src/main/java/forge/card/MagicColor.java @@ -38,6 +38,9 @@ public final class MagicColor { if (s == null) { return 0; } + if (s.equals("all")) { + return MagicColor.ALL_COLORS; + } if (s.length() == 2) { //if name is two characters, check for combination of two colors return (byte)(fromName(s.charAt(0)) | fromName(s.charAt(1))); } 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 1b205cda905..b497023ff16 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -1636,34 +1636,48 @@ public class AbilityUtils { } if (sa.hasParam("RememberCostCards") && !sa.getPaidHash().isEmpty()) { + List noList = Lists.newArrayList(); + if (sa.hasParam("RememberCostExcept")) { + noList.addAll(AbilityUtils.getDefinedCards(host, sa.getParam("RememberCostExcept"), sa)); + } if (sa.getParam("Cost").contains("Exile")) { final CardCollection paidListExiled = sa.getPaidList("Exiled"); for (final Card exiledAsCost : paidListExiled) { - host.addRemembered(exiledAsCost); + if (!noList.contains(exiledAsCost)) { + host.addRemembered(exiledAsCost); + } } } else if (sa.getParam("Cost").contains("Sac")) { final CardCollection paidListSacrificed = sa.getPaidList("Sacrificed"); for (final Card sacrificedAsCost : paidListSacrificed) { - host.addRemembered(sacrificedAsCost); + if (!noList.contains(sacrificedAsCost)) { + host.addRemembered(sacrificedAsCost); + } } } else if (sa.getParam("Cost").contains("tapXType")) { final CardCollection paidListTapped = sa.getPaidList("Tapped"); for (final Card tappedAsCost : paidListTapped) { - host.addRemembered(tappedAsCost); + if (!noList.contains(tappedAsCost)) { + host.addRemembered(tappedAsCost); + } } } else if (sa.getParam("Cost").contains("Unattach")) { final CardCollection paidListUnattached = sa.getPaidList("Unattached"); for (final Card unattachedAsCost : paidListUnattached) { - host.addRemembered(unattachedAsCost); + if (!noList.contains(unattachedAsCost)) { + host.addRemembered(unattachedAsCost); + } } } else if (sa.getParam("Cost").contains("Discard")) { final CardCollection paidListDiscarded = sa.getPaidList("Discarded"); for (final Card discardedAsCost : paidListDiscarded) { - host.addRemembered(discardedAsCost); + if (!noList.contains(discardedAsCost)) { + host.addRemembered(discardedAsCost); + } } } } diff --git a/forge-gui/res/cardsfolder/upcoming/mechtitan_core.txt b/forge-gui/res/cardsfolder/upcoming/mechtitan_core.txt new file mode 100644 index 00000000000..c3caa0701b1 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/mechtitan_core.txt @@ -0,0 +1,12 @@ +Name:Mechtitan Core +ManaCost:2 +Types:Artifact Vehicle +PT:2/4 +A:AB$ Token | Cost$ 5 Exile<1/CARDNAME> Exile<4/Artifact.Creature+Other;Vehicle.Other/other artifact creatures and/or Vehicle> | CostDesc$ {5}, Exile CARDNAME and four other artifact creatures and/or Vehicles you control: | TokenScript$ mechtitan | RememberCostCards$ True | RememberCostExcept$ Self | ImprintTokens$ True | SubAbility$ DBEffect | SpellDescription$ Create Mechtitan, a legendary 10/10 Construct artifact creature token with flying, vigilance, trample, lifelink, and haste that's all colors. +SVar:DBEffect:DB$ Effect | Triggers$ TrigLeavesBattlefield | RememberObjects$ RememberedLKI | ForgetObjects$ EffectSource | ForgetOnMoved$ Exile | ImprintCards$ Imprinted | Duration$ Permanent | SubAbility$ DBCleanup | SpellDescription$ When that token leaves the battlefield, return all cards exiled with CARDNAME except CARDNAME to the battlefield tapped under their owners' control. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True +SVar:TrigLeavesBattlefield:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.IsImprinted | Execute$ DBReturn | TriggerZones$ Command | TriggerDescription$ When that token leaves the battlefield, return all cards exiled with EFFECTSOURCE except EFFECTSOURCE to the battlefield tapped under their owners' control. +SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Tapped$ True +K:Crew:2 +DeckHints:Type$Vehicle +Oracle:{5}, Exile Mechtitan Core and four other artifact creatures and/or Vehicles you control: Create Mechtitan, a legendary 10/10 Construct artifact creature token with flying, vigilance, trample, lifelink, and haste that's all colors. When that token leaves the battlefield, return all cards exiled with Mechtitan Core except Mechtitan Core to the battlefield tapped under their owners' control.\nCrew 2 diff --git a/forge-gui/res/tokenscripts/all_2_2_citizen.txt b/forge-gui/res/tokenscripts/all_2_2_citizen.txt index cfbf5945889..0ace737b011 100644 --- a/forge-gui/res/tokenscripts/all_2_2_citizen.txt +++ b/forge-gui/res/tokenscripts/all_2_2_citizen.txt @@ -1,6 +1,6 @@ Name:Citizen Token Types:Creature Citizen +Colors:all ManaCost:no cost PT:2/2 -S:Mode$ Continuous | EffectZone$ All | Affected$ Card.Self | CharacteristicDefining$ True | SetColor$ All | Description$ CARDNAME is all colors. Oracle:This creature is all colors. diff --git a/forge-gui/res/tokenscripts/mechtitan.txt b/forge-gui/res/tokenscripts/mechtitan.txt new file mode 100644 index 00000000000..e817c101127 --- /dev/null +++ b/forge-gui/res/tokenscripts/mechtitan.txt @@ -0,0 +1,11 @@ +Name:Mechtitan +ManaCost:no cost +Colors:all +Types:Legendary Construct Artifact Creature +PT:10/10 +K:Flying +K:Vigilance +K:Trample +K:Lifelink +K:Haste +Oracle:Mechtitan is all colors.\nFlying, vigilance, trample, lifelink, haste