From 61c11b38a023b430cb50968693d6c47197c9af2f Mon Sep 17 00:00:00 2001 From: Renato Filipe Vidal Santos <45150760+dracontes@users.noreply.github.com> Date: Mon, 12 May 2025 08:47:18 +0100 Subject: [PATCH] FIN: 4 Job select cards and support (#7520) * Update CardFactoryUtil.java * Update Card.java * Update Keyword.java * Update white_mages_staff.txt * Update dragoons_lance.txt * Update black_mages_rod.txt * Update summoners_grimoire.txt --------- Co-authored-by: tool4ever --- .../src/main/java/forge/game/card/Card.java | 2 +- .../java/forge/game/card/CardFactoryUtil.java | 23 +++++++++++++++++++ .../main/java/forge/game/keyword/Keyword.java | 1 + .../cardsfolder/upcoming/black_mages_rod.txt | 10 ++++++++ .../cardsfolder/upcoming/dragoons_lance.txt | 9 ++++++++ .../upcoming/summoners_grimoire.txt | 13 +++++++++++ .../upcoming/white_mages_staff.txt | 10 ++++++++ 7 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 forge-gui/res/cardsfolder/upcoming/black_mages_rod.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/dragoons_lance.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/summoners_grimoire.txt create mode 100644 forge-gui/res/cardsfolder/upcoming/white_mages_staff.txt diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index f5fe6f85928..ea8f959ef55 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -2735,7 +2735,7 @@ public class Card extends GameEntity implements Comparable, IHasSVars, ITr || keyword.startsWith("Encore") || keyword.startsWith("Mutate") || keyword.startsWith("Dungeon") || keyword.startsWith("Class") || keyword.startsWith("Blitz") || keyword.startsWith("Specialize") || keyword.equals("Ravenous") - || keyword.equals("For Mirrodin") || keyword.startsWith("Craft") + || keyword.equals("For Mirrodin") || keyword.equals("Job select") || keyword.startsWith("Craft") || keyword.startsWith("Landwalk") || keyword.startsWith("Visit") || keyword.startsWith("Mobilize")) { // keyword parsing takes care of adding a proper description } else if (keyword.equals("Read ahead")) { diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index ac57a232cfe..43d959d422d 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -1409,6 +1409,29 @@ public class CardFactoryUtil { parsedEndTrig.setOverridingAbility(AbilityFactory.getAbility(remove, card)); inst.addTrigger(parsedEndTrig); + } else if (keyword.equals("Job select")) { + final StringBuilder sbTrig = new StringBuilder(); + sbTrig.append("Mode$ ChangesZone | Destination$ Battlefield | "); + sbTrig.append("ValidCard$ Card.Self | TriggerDescription$ "); + sbTrig.append("Job select (").append(inst.getReminderText()).append(")"); + + final String sbHero = "DB$ Token | TokenScript$ c_1_1_hero | TokenOwner$ You | RememberTokens$ True"; + final SpellAbility saHero= AbilityFactory.getAbility(sbHero, card); + + final String sbAttach = "DB$ Attach | Defined$ Remembered"; + final AbilitySub saAttach = (AbilitySub) AbilityFactory.getAbility(sbAttach, card); + saHero.setSubAbility(saAttach); + + final String sbClear = "DB$ Cleanup | ClearRemembered$ True"; + final AbilitySub saClear = (AbilitySub) AbilityFactory.getAbility(sbClear, card); + saAttach.setSubAbility(saClear); + + final Trigger etbTrigger = TriggerHandler.parseTrigger(sbTrig.toString(), card, intrinsic); + + etbTrigger.setOverridingAbility(saHero); + + saHero.setIntrinsic(intrinsic); + inst.addTrigger(etbTrigger); } else if (keyword.equals("Living Weapon")) { final StringBuilder sbTrig = new StringBuilder(); sbTrig.append("Mode$ ChangesZone | Destination$ Battlefield | "); diff --git a/forge-game/src/main/java/forge/game/keyword/Keyword.java b/forge-game/src/main/java/forge/game/keyword/Keyword.java index a2afa5b1459..25340af7025 100644 --- a/forge-game/src/main/java/forge/game/keyword/Keyword.java +++ b/forge-game/src/main/java/forge/game/keyword/Keyword.java @@ -110,6 +110,7 @@ public enum Keyword { INGEST("Ingest", SimpleKeyword.class, false, "Whenever this creature deals combat damage to a player, that player exiles the top card of their library."), INTIMIDATE("Intimidate", SimpleKeyword.class, true, "This creature can't be blocked except by artifact creatures and/or creatures that share a color with it."), KICKER("Kicker", Kicker.class, false, "You may pay an additional %s as you cast this spell."), + JOB_SELECT("Job select", SimpleKeyword.class, false, "When this Equipment enters, create a 1/1 colorless Hero creature token, then attach this to it."), JUMP_START("Jump-start", SimpleKeyword.class, false, "You may cast this card from your graveyard by discarding a card in addition to paying its other costs. Then exile this card."), LANDWALK("Landwalk", KeywordWithType.class, true, "This creature is unblockable as long as defending player controls {1:%s}."), LEVEL_UP("Level up", KeywordWithCost.class, false, "%s: Put a level counter on this. Level up only as a sorcery."), diff --git a/forge-gui/res/cardsfolder/upcoming/black_mages_rod.txt b/forge-gui/res/cardsfolder/upcoming/black_mages_rod.txt new file mode 100644 index 00000000000..a832a946bb9 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/black_mages_rod.txt @@ -0,0 +1,10 @@ +Name:Black Mage's Rod +ManaCost:1 B +Types:Artifact Equipment +K:Job select +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 1 | AddType$ Wizard | AddTrigger$ TrigSpellCast | Description$ Equipped creature gets +1/+0, has "Whenever you cast a noncreature spell, this creature deals 1 damage to each opponent," and is a Wizard in addition to its other types. +SVar:TrigSpellCast:Mode$ SpellCast | ValidCard$ Card.nonCreature | ValidActivatingPlayer$ You | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever you cast a noncreature spell, this creature deals 1 damage to each opponent. +SVar:TrigDamage:DB$ DealDamage | Defined$ Player.Opponent | NumDmg$ 1 +K:Equip:3 +DeckHas:Ability$Token & Type$Wizard +Oracle:Job select (When this Equipment enters, create a 1/1 colorless Hero creature token, then attach this to it.)\nEquipped creature gets +1/+0, has "Whenever you cast a noncreature spell, this creature deals 1 damage to each opponent," and is a Wizard in addition to its other types.\nEquip {3} diff --git a/forge-gui/res/cardsfolder/upcoming/dragoons_lance.txt b/forge-gui/res/cardsfolder/upcoming/dragoons_lance.txt new file mode 100644 index 00000000000..da3189d5140 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/dragoons_lance.txt @@ -0,0 +1,9 @@ +Name:Dragoon's Lance +ManaCost:1 W +Types:Artifact Equipment +K:Job select +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 1 | AddType$ Knight | Description$ Equipped creature gets +1/+0 and is a Knight in addition to its other types. +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddKeyword$ Flying | Condition$ PlayerTurn | Description$ During your turn, equipped creature has flying. +K:Equip:4 +DeckHas:Ability$Token & Type$Knight +Oracle:Job select (When this Equipment enters, create a 1/1 colorless Hero creature token, then attach this to it.)\nEquipped creature gets +1/+0 and is a Knight in addition to its other types.\nDuring your turn, equipped creature has flying.\nGae Bolg — Equip {4} diff --git a/forge-gui/res/cardsfolder/upcoming/summoners_grimoire.txt b/forge-gui/res/cardsfolder/upcoming/summoners_grimoire.txt new file mode 100644 index 00000000000..819f61a58dc --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/summoners_grimoire.txt @@ -0,0 +1,13 @@ +Name:Summoner's Grimoire +ManaCost:3 G +Types:Artifact Equipment +K:Job select +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddType$ Shaman | AddTrigger$ TrigAttack | Description$ Equipped creature is a Shaman in addition to its other types and has "Whenever this creature attacks, you may put a creature card from your hand onto the battlefield. If that card is an enchantment card, it enters tapped and attacking." +SVar:TrigAttack:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigChoose | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever this creature attacks, you may put a creature card from your hand onto the battlefield. If that card is an enchantment card, it enters tapped and attacking. +SVar:TrigChoose:DB$ ChooseCard | Mandatory$ True | ChoiceZone$ Hand | Choices$ Creature.YouOwn | ChoiceTitle$ Choose a creature card in your hand | SubAbility$ DBChangeOne +SVar:DBChangeOne:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | Defined$ ChosenCard | ConditionDefined$ ChosenCard | ConditionPresent$ Card.Enchantment | Tapped$ True | Attacking$ True | SubAbility$ DBChangeTwo +SVar:DBChangeTwo:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | Defined$ ChosenCard | ConditionDefined$ ChosenCard | ConditionPresent$ Card.nonEnchantment | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True +K:Equip:3 +DeckHas:Ability$Token & Type$Shaman +Oracle:Job select\nEquipped creature is a Shaman in addition to its other types and has "Whenever this creature attacks, you may put a creature card from your hand onto the battlefield. If that card is an enchantment card, it enters tapped and attacking."\nAbraxas — Equip {3} diff --git a/forge-gui/res/cardsfolder/upcoming/white_mages_staff.txt b/forge-gui/res/cardsfolder/upcoming/white_mages_staff.txt new file mode 100644 index 00000000000..782a7d4a5db --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/white_mages_staff.txt @@ -0,0 +1,10 @@ +Name:White Mage's Staff +ManaCost:1 W +Types:Artifact Equipment +K:Job select +K:Equip:3 +S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 1 | AddToughness$ 1 | AddTrigger$ TrigAttack | AddType$ Cleric | Description$ Equipped creature gets +1/+1, has "Whenever this creature attacks, you gain 1 life," and is a Cleric in addition to its its other types. +SVar:TrigAttack:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigGainLife | TriggerDescription$ Whenever this creature attacks, you gain 1 life. +SVar:TrigGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 1 +DeckHas:Ability$LifeGain|Token & Type$Cleric +Oracle:Job select (When this Equipment enters, create a 1/1 colorless Hero creature token, then attach this to it.)\nEquipped creature gets +1/+1, has "Whenever this creature attacks, you gain 1 life," and is a Cleric in addition to its its other types.\nEquip {3} ({3}: Attach to target creature you control. Equip only as a sorcery)