diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopySpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopySpellAbilityEffect.java index 9c0802697f3..73aa44a4cf0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopySpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopySpellAbilityEffect.java @@ -211,6 +211,10 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect { } controller.getController().orderAndPlaySimultaneousSa(copies); + + if (sa.hasParam("RememberCopies")) { + card.addRemembered(copies); + } } } // end resolve 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 1cdf55623e9..1a359265886 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -2477,6 +2477,26 @@ public class CardFactoryUtil { final Trigger trigger = TriggerHandler.parseTrigger(upkeepTrig, card, intrinsic); trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card)); + inst.addTrigger(trigger); + } else if (keyword.equals("Demonstrate")) { + final String trigScript = "Mode$ SpellCast | ValidCard$ Card.Self | TriggerDescription$ Demonstrate (" + inst.getReminderText() + ")"; + final String youCopyStr = "DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | MayChooseTarget$ True | Optional$ True | RememberCopies$ True"; + final String chooseOppStr = "DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | ConditionCheckSVar$ DemonstrateSVar | ConditionSVarCompare$ GE1"; + final String oppCopyStr = "DB$ CopySpellAbility | Controller$ ChosenPlayer | Defined$ TriggeredSpellAbility | MayChooseTarget$ True | ConditionCheckSVar$ DemonstrateSVar | ConditionSVarCompare$ GE1"; + final String cleanupStr = "DB$ Cleanup | ClearRemembered$ True"; + + final Trigger trigger = TriggerHandler.parseTrigger(trigScript, card, intrinsic); + final SpellAbility youCopy = AbilityFactory.getAbility(youCopyStr, card); + final AbilitySub chooseOpp = (AbilitySub) AbilityFactory.getAbility(chooseOppStr, card); + chooseOpp.setSVar("DemonstrateSVar", "Count$RememberedSize"); + final AbilitySub oppCopy = (AbilitySub) AbilityFactory.getAbility(oppCopyStr, card); + oppCopy.setSVar("DemonstrateSVar", "Count$RememberedSize"); + final AbilitySub cleanup = (AbilitySub) AbilityFactory.getAbility(cleanupStr, card); + oppCopy.setSubAbility(cleanup); + chooseOpp.setSubAbility(oppCopy); + youCopy.setSubAbility(chooseOpp); + trigger.setOverridingAbility(youCopy); + inst.addTrigger(trigger); } else if (keyword.equals("Dethrone")) { final StringBuilder trigScript = new StringBuilder( 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 0325a1b9602..c667e75101e 100644 --- a/forge-game/src/main/java/forge/game/keyword/Keyword.java +++ b/forge-game/src/main/java/forge/game/keyword/Keyword.java @@ -48,6 +48,7 @@ public enum Keyword { DEATHTOUCH("Deathtouch", SimpleKeyword.class, true, "Any amount of damage this deals to a creature is enough to destroy it."), DEFENDER("Defender", SimpleKeyword.class, true, "This creature can't attack."), DELVE("Delve", SimpleKeyword.class, true, "As an additional cost to cast this spell, you may exile any number of cards from your graveyard. Each card exiled this way reduces the cost to cast this spell by {1}."), + DEMONSTRATE("Demonstrate", SimpleKeyword.class, false, "When you cast this spell, you may copy it. If you do, choose an opponent to also copy it. Players may choose new targets for their copies."), DETHRONE("Dethrone", SimpleKeyword.class, false, "Whenever this creature attacks the player with the most life or tied for the most life, put a +1/+1 counter on it."), DEVOUR("Devour", KeywordWithAmount.class, false, "As this creature enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with {%d:+1/+1 counter} on it for each creature sacrificed this way."), DEVOID("Devoid", SimpleKeyword.class, true, "This card has no color."), diff --git a/forge-gui/res/cardsfolder/upcoming/excavation_technique.txt b/forge-gui/res/cardsfolder/upcoming/excavation_technique.txt new file mode 100644 index 00000000000..d42fdd2db2d --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/excavation_technique.txt @@ -0,0 +1,8 @@ +Name:Excavation Technique +ManaCost:3 W +Types:Sorcery +K:Demonstrate +A:SP$ Destroy | Cost$ 3 W | ValidTgts$ Permanent.nonLand | TgtPrompt$ Select target nonland permanent | SubAbility$ DBToken | SpellDescription$ Destroy target nonland permanent. Its controller creates two Treasure tokens. +SVar:DBToken:DB$ Token | TokenAmount$ 2 | TokenScript$ c_a_treasure_sac | TokenOwner$ TargetedController +DeckHas:Ability$Token +Oracle:Demonstrate (When you cast this spell, you may copy it. If you do, choose an opponent to also copy it. Players may choose new targets for their copies.)\nDestroy target nonland permanent. Its controller creates two Treasure tokens.