Merge branch 'new-cards-2' into 'master'

Demonstrate keyword and Excavation Technique

See merge request core-developers/forge!4397
This commit is contained in:
Michael Kamensky
2021-04-06 17:08:12 +00:00
4 changed files with 33 additions and 0 deletions

View File

@@ -211,6 +211,10 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
}
controller.getController().orderAndPlaySimultaneousSa(copies);
if (sa.hasParam("RememberCopies")) {
card.addRemembered(copies);
}
}
} // end resolve

View File

@@ -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(

View File

@@ -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."),

View File

@@ -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.