From bb52a6b2bb1567f42c1d17c4aae1ad819e2308a3 Mon Sep 17 00:00:00 2001 From: Northmoc <103371817+Northmoc@users.noreply.github.com> Date: Sun, 21 Aug 2022 09:20:21 -0400 Subject: [PATCH] DMC: Jared Carthalion and support (#1368) * add text to all color tokens * all_3_3_kavu_trample.txt * ColorSet.isAllColors boolean * ForgeScript.cardStateHasProperty "AllColors" * CountersPutEffect.resolvePerType "CounterNumPerDefined" * jared_carthalion.txt --- forge-core/src/main/java/forge/card/ColorSet.java | 9 +++++++++ .../src/main/java/forge/game/ForgeScript.java | 5 +++++ .../game/ability/effects/CountersPutEffect.java | 3 +++ .../res/cardsfolder/upcoming/jared_carthalion.txt | 15 +++++++++++++++ forge-gui/res/tokenscripts/all_2_2_citizen.txt | 1 + .../res/tokenscripts/all_3_3_kavu_trample.txt | 8 ++++++++ forge-gui/res/tokenscripts/mechtitan.txt | 1 + 7 files changed, 42 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/jared_carthalion.txt create mode 100644 forge-gui/res/tokenscripts/all_3_3_kavu_trample.txt diff --git a/forge-core/src/main/java/forge/card/ColorSet.java b/forge-core/src/main/java/forge/card/ColorSet.java index 30a6c5d6571..d7aa9933d7b 100644 --- a/forge-core/src/main/java/forge/card/ColorSet.java +++ b/forge-core/src/main/java/forge/card/ColorSet.java @@ -190,6 +190,15 @@ public final class ColorSet implements Comparable, Iterable, Ser return this.countColors() > 1; } + /** + * Checks if is all colors. + * + * @return true, if is all colors + */ + public boolean isAllColors() { + return this == ALL_COLORS; + } + /** * Checks if is mono color. * diff --git a/forge-game/src/main/java/forge/game/ForgeScript.java b/forge-game/src/main/java/forge/game/ForgeScript.java index 3568ca5e9ac..93897c40050 100644 --- a/forge-game/src/main/java/forge/game/ForgeScript.java +++ b/forge-game/src/main/java/forge/game/ForgeScript.java @@ -59,6 +59,11 @@ public class ForgeScript { return false; return property.startsWith("non") != colors.isMulticolor(); + } else if (property.contains("AllColors")) { + if (property.endsWith("Source") && isColorlessSource) + return false; + return property.startsWith("non") != colors.isAllColors(); + } else if (property.contains("MonoColor")) { // ... Card is monocolored if (property.endsWith("Source") && isColorlessSource) return false; diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java index fa835122984..f41b7cbdcd0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java @@ -439,6 +439,9 @@ public class CountersPutEffect extends SpellAbilityEffect { } if (obj instanceof Card) { + if (sa.hasParam("CounterNumPerDefined")) { + counterAmount = AbilityUtils.calculateAmount(gameCard, sa.getParam("CounterNumPerDefined"), sa); + } counterAmount = sa.usesTargeting() && sa.isDividedAsYouChoose() ? sa.getDividedValue(gameCard) : counterAmount; if (!sa.usesTargeting() || gameCard.canBeTargetedBy(sa)) { diff --git a/forge-gui/res/cardsfolder/upcoming/jared_carthalion.txt b/forge-gui/res/cardsfolder/upcoming/jared_carthalion.txt new file mode 100644 index 00000000000..8f05352e686 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/jared_carthalion.txt @@ -0,0 +1,15 @@ +Name:Jared Carthalion +ManaCost:W U B R G +Types:Legendary Planeswalker Jared +Loyalty:5 +A:AB$ Token | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | TokenScript$ all_3_3_kavu_trample | SpellDescription$ Create a 3/3 Kavu creature token with trample that's all colors. +A:AB$ PutCounter | Cost$ SubCounter<3/LOYALTY> | Planeswalker$ True | Defined$ Targeted | CounterType$ P1P1 | CounterNumPerDefined$ X | ValidTgts$ Creature | TargetMin$ 0 | TargetMax$ 2 | TgtPrompt$ Choose up to two target creatures | StackDescription$ For each of {c:Targeted}, put a number of +1/+1 counters on it equal to the number of colors it is. | SpellDescription$ Choose up to two target creatures. For each of them, put a number of +1/+1 counters on it equal to the number of colors it is. +SVar:X:Count$CardNumColors +A:AB$ ChangeZone | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target multicolored card in your graveyard | ValidTgts$ Card.MultiColor+YouOwn | RememberChanged$ True | SubAbility$ DBDraw | SpellDescription$ Return target multicolored card from your graveyard to your hand. +SVar:DBDraw:DB$ Draw | ConditionDefined$ Remembered | ConditionPresent$ Card.AllColors | SubAbility$ DBTreasure | StackDescription$ If that card was all colors, {p:You} draws a card and creates two Treasure tokens. | SpellDescription$ If that card was all colors, draw a card and create two Treasure tokens. +SVar:DBTreasure:DB$ Token | ConditionDefined$ Remembered | ConditionPresent$ Card.AllColors | TokenAmount$ 2 | TokenScript$ c_a_treasure_sac | SubAbility$ DBCleanup | StackDescription$ None +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +Text:CARDNAME can be your commander. +DeckHas:Ability$Token|Counters|Sacrifice|Graveyard & Type$Kavu|Artifact|Treasure +AI:RemoveDeck:Random +Oracle:[+1]: Create a 3/3 Kavu creature token with trample that's all colors.\n[−3]: Choose up to two target creatures. For each of them, put a number of +1/+1 counters on it equal to the number of colors it is.\n[−6]: Return target multicolored card from your graveyard to your hand. If that card was all colors, draw a card and create two Treasure tokens.\nJared Carthalion can be your commander. diff --git a/forge-gui/res/tokenscripts/all_2_2_citizen.txt b/forge-gui/res/tokenscripts/all_2_2_citizen.txt index c0087a12203..c3381cb8227 100644 --- a/forge-gui/res/tokenscripts/all_2_2_citizen.txt +++ b/forge-gui/res/tokenscripts/all_2_2_citizen.txt @@ -3,4 +3,5 @@ ManaCost:no cost Colors:all Types:Creature Citizen PT:2/2 +Text:This creature is all colors. Oracle:This creature is all colors. diff --git a/forge-gui/res/tokenscripts/all_3_3_kavu_trample.txt b/forge-gui/res/tokenscripts/all_3_3_kavu_trample.txt new file mode 100644 index 00000000000..035e863d8e9 --- /dev/null +++ b/forge-gui/res/tokenscripts/all_3_3_kavu_trample.txt @@ -0,0 +1,8 @@ +Name:Kavu Token +ManaCost:no cost +Colors:all +Types:Creature Kavu +PT:3/3 +K:Trample +Text:This creature is all colors. +Oracle:Trample\nThis creature is all colors. diff --git a/forge-gui/res/tokenscripts/mechtitan.txt b/forge-gui/res/tokenscripts/mechtitan.txt index a7ce4651601..696a15a9a26 100644 --- a/forge-gui/res/tokenscripts/mechtitan.txt +++ b/forge-gui/res/tokenscripts/mechtitan.txt @@ -8,4 +8,5 @@ K:Vigilance K:Trample K:Lifelink K:Haste +Text:CARDNAME is all colors. Oracle:Mechtitan is all colors.\nFlying, vigilance, trample, lifelink, haste