From c2a7f19d38d9fd966498c3a54626141710f1c4b0 Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 28 Aug 2017 18:35:31 +0000 Subject: [PATCH] - [XLN] Added Jace, Cunning Castaway. --- .gitattributes | 1 + .../ability/effects/CopyPermanentEffect.java | 21 +++++++++++++++++++ .../upcoming/jace_cunning_castaway.txt | 14 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/jace_cunning_castaway.txt diff --git a/.gitattributes b/.gitattributes index e650633ed45..71287560218 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17214,6 +17214,7 @@ forge-gui/res/cardsfolder/upcoming/carnage_tyrant.txt -text forge-gui/res/cardsfolder/upcoming/emperors_vanguard.txt -text forge-gui/res/cardsfolder/upcoming/gishath_suns_avatar.txt -text forge-gui/res/cardsfolder/upcoming/goring_ceratops.txt -text +forge-gui/res/cardsfolder/upcoming/jace_cunning_castaway.txt -text forge-gui/res/cardsfolder/upcoming/kinjallis_sunwing.txt -text forge-gui/res/cardsfolder/upcoming/priest_of_the_wakening_sun.txt -text forge-gui/res/cardsfolder/upcoming/ripjaw_raptor.txt -text diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index 512409753e4..ed5b921e2a1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -67,6 +67,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect { final List svars = Lists.newArrayList(); final List triggers = Lists.newArrayList(); final List pumpKeywords = Lists.newArrayList(); + boolean asNonLegendary = false; final long timestamp = game.getNextTimestamp(); @@ -84,6 +85,9 @@ public class CopyPermanentEffect extends SpellAbilityEffect { if (sa.hasParam("AddTypes")) { types.addAll(Arrays.asList(sa.getParam("AddTypes").split(" & "))); } + if (sa.hasParam("NonLegendary")) { + asNonLegendary = true; + } if (sa.hasParam("AddSVars")) { svars.addAll(Arrays.asList(sa.getParam("AddSVars").split(" & "))); } @@ -188,6 +192,23 @@ public class CopyPermanentEffect extends SpellAbilityEffect { for (final String kw : keywords) { copy.addIntrinsicKeyword(kw); } + if (asNonLegendary) { + String typeLine = ""; + for (CardType.Supertype st : copy.getType().getSupertypes()) { + if (!st.equals(CardType.Supertype.Legendary)) { + typeLine += st.name() + " "; + } + } + for (CardType.CoreType ct : copy.getType().getCoreTypes()) { + typeLine += ct.name() + " "; + } + for (String subt: copy.getType().getSubtypes()) { + typeLine += subt + " "; + } + + StringBuilder newType = new StringBuilder(typeLine); + copy.setType(CardType.parse(newType.toString())); + } if (sa.hasParam("SetCreatureTypes")) { String typeLine = ""; for (CardType.Supertype st : copy.getType().getSupertypes()) { diff --git a/forge-gui/res/cardsfolder/upcoming/jace_cunning_castaway.txt b/forge-gui/res/cardsfolder/upcoming/jace_cunning_castaway.txt new file mode 100644 index 00000000000..440a6577bd2 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/jace_cunning_castaway.txt @@ -0,0 +1,14 @@ +Name:Jace, Cunning Castaway +ManaCost:1 U U +Types:Legendary Planeswalker Jace +Loyalty:4 +A:AB$ Effect | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | Triggers$ TrigDrawDiscard | SVars$ DBDraw,DBDiscard | Duration$ EndOfTurn | Name$ Jace, Cunning Castaway Effect | SpellDescription$ Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card. +SVar:TrigDrawDiscard:Mode$ CombatDamageDoneOnce | ValidSource$ Creature.YouCtrl | TriggerZones$ Command | ValidTarget$ Player | Execute$ DBDraw | TriggerDescription$ Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card. +SVar:DBDraw:DB$ Draw | NumCards$ 1 | SubAbility$ DBDiscard | SpellDescription$ Draw a card, then discard a card. +SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose +A:AB$ Token | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | TokenAmount$ 1 | TokenName$ Illusion | TokenTypes$ Creature,Illusion | TokenPower$ 2 | TokenToughness$ 2 | TokenOwner$ You | TokenColors$ Blue | TokenImage$ u 2 2 illusion XLN | TokenTriggers$ SacOnSpell | TokenSVars$ DoSac | SpellDescription$ Create a 2/2 blue Illusion token with "When this creature becomes the target of a spell, sacrifice it." +SVar:SacOnSpell:Mode$ BecomesTarget | ValidTarget$ Card.Self | SourceType$ Spell | TriggerZones$ Battlefield | Execute$ DoSac | TriggerDescription$ When CARDNAME becomes the target of a spell, sacrifice it. +SVar:DoSac:DB$ Sacrifice | Defined$ Self +A:AB$ CopyPermanent | Cost$ SubCounter<5/LOYALTY> | Planeswalker$ True | Ultimate$ True | Defined$ Self | NumCopies$ 2 | NonLegendary$ True | SpellDescription$ Create two tokens that are copies of Jace, Cunning Castaway, except they're not legendary. +SVar:Picture:http://www.wizards.com/global/images/magic/general/jace_cunning_castaway.jpg +Oracle:[+1] Whenever one or more creatures you control deal combat damage to a player this turn, draw a card, then discard a card.\n[-2] Create a 2/2 blue Illusion token with "When this creature becomes the target of a spell, sacrifice it."\n[-5] Create two tokens that are copies of Jace, Cunning Castaway, except they're not legendary. \ No newline at end of file