From 2f342f1929030e14c83acb64a6395b3543c24f32 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 27 May 2012 05:31:03 +0000 Subject: [PATCH 01/29] creating branch for fixing clone cards From 1a2457f4e295fe0b5a94309c4fb6e08a91fa399e Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 27 May 2012 05:38:33 +0000 Subject: [PATCH 02/29] added Clone AF and first steps in moving SVars to CardCharacteristics class --- .gitattributes | 1 + .gitignore | 1 + src/main/java/forge/Card.java | 25 +- .../java/forge/card/CardCharacteristics.java | 61 ++ .../card/abilityfactory/AbilityFactory.java | 6 + .../abilityfactory/AbilityFactoryClone.java | 576 ++++++++++++++++++ 6 files changed, 654 insertions(+), 16 deletions(-) create mode 100644 src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java diff --git a/.gitattributes b/.gitattributes index cdde395f346..00418685b70 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11684,6 +11684,7 @@ src/main/java/forge/card/abilityfactory/AbilityFactoryCharm.java svneol=native#t src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java svneol=native#text/plain src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java svneol=native#text/plain src/main/java/forge/card/abilityfactory/AbilityFactoryCleanup.java svneol=native#text/plain +src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java -text src/main/java/forge/card/abilityfactory/AbilityFactoryCombat.java svneol=native#text/plain src/main/java/forge/card/abilityfactory/AbilityFactoryCopy.java svneol=native#text/plain src/main/java/forge/card/abilityfactory/AbilityFactoryCounterMagic.java svneol=native#text/plain diff --git a/.gitignore b/.gitignore index ab8f4a04869..ba7cad25d6d 100644 --- a/.gitignore +++ b/.gitignore @@ -357,6 +357,7 @@ res/pics/WWK res/pics/ZEN res/pics/booster res/pics/icons +res/pics/tokens res/pics_product/*.jpg res/preferences res/preferences/forge.preferences diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 91d2f04301f..8f28571062d 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -221,7 +221,7 @@ public class Card extends GameEntity implements Comparable { private final ArrayList hauntedBy = new ArrayList(); private Card haunting = null; - private Map sVars = new TreeMap(); + //private Map sVars = new TreeMap(); // hacky code below, used to limit the number of times an ability // can be used per turn like Vampire Bats @@ -1458,11 +1458,7 @@ public class Card extends GameEntity implements Comparable { * @return a {@link java.lang.String} object. */ public final String getSVar(final String var) { - if (this.sVars.containsKey(var)) { - return this.sVars.get(var); - } else { - return ""; - } + return this.getCharacteristics().getSVar(var); } /** @@ -1476,11 +1472,7 @@ public class Card extends GameEntity implements Comparable { * a {@link java.lang.String} object. */ public final void setSVar(final String var, final String str) { - if (this.sVars.containsKey(var)) { - this.sVars.remove(var); - } - - this.sVars.put(var, str); + this.getCharacteristics().setSVar(var, str); } /** @@ -1491,7 +1483,7 @@ public class Card extends GameEntity implements Comparable { * @return a Map object. */ public final Map getSVars() { - return this.sVars; + return this.getCharacteristics().getSVars(); } /** @@ -1503,7 +1495,7 @@ public class Card extends GameEntity implements Comparable { * a Map object. */ public final void setSVars(final Map newSVars) { - this.sVars = newSVars; + this.getCharacteristics().setSVars(newSVars); } /** @@ -8403,8 +8395,9 @@ public class Card extends GameEntity implements Comparable { * @return an int */ public final int getFoil() { - if (this.sVars.containsKey("Foil")) { - return Integer.parseInt(this.sVars.get("Foil")); + final String foil = this.getCharacteristics().getSVar("Foil"); + if (!foil.isEmpty()) { + return Integer.parseInt(foil); } return 0; } @@ -8417,7 +8410,7 @@ public class Card extends GameEntity implements Comparable { * an int */ public final void setFoil(final int f) { - this.sVars.put("Foil", Integer.toString(f)); + this.getCharacteristics().setSVar("Foil", Integer.toString(f)); } /** diff --git a/src/main/java/forge/card/CardCharacteristics.java b/src/main/java/forge/card/CardCharacteristics.java index 81776108a15..a84fa7e5dbd 100644 --- a/src/main/java/forge/card/CardCharacteristics.java +++ b/src/main/java/forge/card/CardCharacteristics.java @@ -19,6 +19,8 @@ package forge.card; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.TreeMap; import forge.CardColor; import forge.card.replacement.ReplacementEffect; @@ -50,6 +52,7 @@ public class CardCharacteristics { private String imageFilename = ""; private String imageName = ""; private ArrayList sets = new ArrayList(); + private Map sVars = new TreeMap(); /** * Gets the name. @@ -388,4 +391,62 @@ public class CardCharacteristics { public void setReplacementEffects(ArrayList replacementEffects0) { this.replacementEffects = replacementEffects0; } + + /** + *

+ * getSVar. + *

+ * + * @param var + * a {@link java.lang.String} object. + * @return a {@link java.lang.String} object. + */ + public final String getSVar(final String var) { + if (this.sVars.containsKey(var)) { + return this.sVars.get(var); + } else { + return ""; + } + } + + /** + *

+ * setSVar. + *

+ * + * @param var + * a {@link java.lang.String} object. + * @param str + * a {@link java.lang.String} object. + */ + public final void setSVar(final String var, final String str) { + if (this.sVars.containsKey(var)) { + this.sVars.remove(var); + } + + this.sVars.put(var, str); + } + + /** + *

+ * getSVars. + *

+ * + * @return a Map object. + */ + public final Map getSVars() { + return this.sVars; + } + + /** + *

+ * setSVars. + *

+ * + * @param newSVars + * a Map object. + */ + public final void setSVars(final Map newSVars) { + this.sVars = newSVars; + } } diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index 801d50cb660..19c05013c2f 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -562,6 +562,12 @@ public class AbilityFactory { } } + else if (this.api.equals("Clone")) { + if (this.isDb) { + spellAbility = AbilityFactoryClone.createDrawbackClone(this); + } + } + else if (this.api.equals("CopyPermanent")) { if (this.isAb) { spellAbility = AbilityFactoryCopy.createAbilityCopyPermanent(this); diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java new file mode 100644 index 00000000000..dacf48a29be --- /dev/null +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -0,0 +1,576 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2011 Forge Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package forge.card.abilityfactory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import forge.AllZone; +import forge.Card; +import forge.CardCharactersticName; +import forge.CardUtil; +import forge.Singletons; +import forge.card.cardfactory.AbstractCardFactory; +import forge.card.cardfactory.CardFactoryUtil; +import forge.card.spellability.AbilityActivated; +import forge.card.spellability.AbilitySub; +import forge.card.spellability.Spell; +import forge.card.spellability.SpellAbility; +import forge.card.spellability.Target; +import forge.card.trigger.TriggerType; +import forge.game.phase.PhaseType; +import forge.game.player.ComputerUtil; + +/** + *

+ * AbilityFactoryClone class. + *

+ * + * @author Forge + * @version $Id: AbilityFactoryClone.java 15541 2012-05-14 11:47:16Z Sloth $ + */ +public final class AbilityFactoryClone { + + private AbilityFactoryClone() { + throw new AssertionError(); + } + + // ************************************************************** + // *************************** Clone **************************** + // ************************************************************** + + /** + *

+ * createAbilityClone. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @return a {@link forge.card.spellability.SpellAbility} object. + */ + public static SpellAbility createAbilityClone(final AbilityFactory af) { + final SpellAbility abClone = new AbilityActivated(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { + private static final long serialVersionUID = 1938171749867734123L; + + @Override + public boolean canPlayAI() { + return AbilityFactoryClone.cloneCanPlayAI(af, this); + } + + @Override + public void resolve() { + AbilityFactoryClone.cloneResolve(af, this); + } + + @Override + public String getStackDescription() { + return AbilityFactoryClone.cloneStackDescription(af, this); + } + + @Override + public boolean doTrigger(final boolean mandatory) { + return AbilityFactoryClone.cloneTriggerAI(af, this, mandatory); + } + }; + return abClone; + } + + /** + *

+ * createSpellClone. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @return a {@link forge.card.spellability.SpellAbility} object. + */ + public static SpellAbility createSpellClone(final AbilityFactory af) { + final SpellAbility spClone = new Spell(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { + private static final long serialVersionUID = -4047747186919390520L; + + @Override + public boolean canPlayAI() { + return AbilityFactoryClone.cloneCanPlayAI(af, this); + } + + @Override + public void resolve() { + AbilityFactoryClone.cloneResolve(af, this); + } + + @Override + public String getStackDescription() { + return AbilityFactoryClone.cloneStackDescription(af, this); + } + }; + return spClone; + } + + /** + *

+ * createDrawbackClone. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @return a {@link forge.card.spellability.SpellAbility} object. + */ + public static SpellAbility createDrawbackClone(final AbilityFactory af) { + final SpellAbility dbClone = new AbilitySub(af.getHostCard(), af.getAbTgt()) { + private static final long serialVersionUID = -8659938411435528741L; + + @Override + public void resolve() { + AbilityFactoryClone.cloneResolve(af, this); + } + + @Override + public boolean chkAIDrawback() { + return AbilityFactoryClone.clonePlayDrawbackAI(af, this); + } + + @Override + public String getStackDescription() { + return AbilityFactoryClone.cloneStackDescription(af, this); + } + + @Override + public boolean doTrigger(final boolean mandatory) { + return AbilityFactoryClone.cloneTriggerAI(af, this, mandatory); + } + }; + return dbClone; + } + + /** + *

+ * cloneStackDescription. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + * @return a {@link java.lang.String} object. + */ + private static String cloneStackDescription(final AbilityFactory af, final SpellAbility sa) { + final HashMap params = af.getMapParams(); + final Card host = sa.getSourceCard(); + final Map svars = host.getSVars(); + + int power = -1; + if (params.containsKey("Power")) { + power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); + } + int toughness = -1; + if (params.containsKey("Toughness")) { + toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); + } + + final boolean permanent = params.containsKey("Permanent"); + final ArrayList types = new ArrayList(); + if (params.containsKey("Types")) { + types.addAll(Arrays.asList(params.get("Types").split(","))); + } + final ArrayList keywords = new ArrayList(); + if (params.containsKey("Keywords")) { + keywords.addAll(Arrays.asList(params.get("Keywords").split(" & "))); + } + // allow SVar substitution for keywords + for (int i = 0; i < keywords.size(); i++) { + final String k = keywords.get(i); + if (svars.containsKey(k)) { + keywords.add("\"" + k + "\""); + keywords.remove(k); + } + } + final ArrayList colors = new ArrayList(); + if (params.containsKey("Colors")) { + colors.addAll(Arrays.asList(params.get("Colors").split(","))); + } + + final StringBuilder sb = new StringBuilder(); + + if (sa instanceof AbilitySub) { + sb.append(" "); + } else { + sb.append(sa.getSourceCard().getName()).append(" - "); + } + + final Target tgt = sa.getTarget(); + ArrayList tgts; + if (tgt != null) { + tgts = tgt.getTargetCards(); + } else { + tgts = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa); + } + + for (final Card c : tgts) { + sb.append(c).append(" "); + } + sb.append("become"); + if (tgts.size() == 1) { + sb.append("s a"); + } + // if power is -1, we'll assume it's not just setting toughness + if (power != -1) { + sb.append(" ").append(power).append("/").append(toughness); + } + + if (colors.size() > 0) { + sb.append(" "); + } + if (colors.contains("ChosenColor")) { + sb.append("color of that player's choice"); + } else { + for (int i = 0; i < colors.size(); i++) { + sb.append(colors.get(i)); + if (i < (colors.size() - 1)) { + sb.append(" and "); + } + } + } + sb.append(" "); + if (types.contains("ChosenType")) { + sb.append("type of player's choice "); + } else { + for (int i = types.size() - 1; i >= 0; i--) { + sb.append(types.get(i)); + sb.append(" "); + } + } + if (keywords.size() > 0) { + sb.append("with "); + } + for (int i = 0; i < keywords.size(); i++) { + sb.append(keywords.get(i)); + if (i < (keywords.size() - 1)) { + sb.append(" and "); + } + } + // sb.append(abilities) + // sb.append(triggers) + if (!permanent) { + if (params.containsKey("UntilEndOfCombat")) { + sb.append(" until end of combat."); + } else if (params.containsKey("UntilHostLeavesPlay")) { + sb.append(" until ").append(host).append(" leaves the battlefield."); + } else if (params.containsKey("UntilYourNextUpkeep")) { + sb.append(" until your next upkeep."); + } else if (params.containsKey("UntilControllerNextUntap")) { + sb.append(" until its controller's next untap step."); + } else { + sb.append(" until end of turn."); + } + } else { + sb.append("."); + } + + final AbilitySub abSub = sa.getSubAbility(); + if (abSub != null) { + sb.append(abSub.getStackDescription()); + } + + return sb.toString(); + } // end cloneStackDescription() + + /** + *

+ * cloneCanPlayAI. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + * @return a boolean. + */ + private static boolean cloneCanPlayAI(final AbilityFactory af, final SpellAbility sa) { + + final HashMap params = af.getMapParams(); + final Target tgt = sa.getTarget(); + final Card source = sa.getSourceCard(); + + boolean useAbility = true; + +// if (card.getController().isComputer()) { +// final CardList creatures = AllZoneUtil.getCreaturesInPlay(); +// if (!creatures.isEmpty()) { +// cardToCopy = CardFactoryUtil.getBestCreatureAI(creatures); +// } +// } + + // TODO - add some kind of check to answer + // "Am I going to attack with this?" + // TODO - add some kind of check for during human turn to answer + // "Can I use this to block something?" + + // don't use instant speed clone abilities outside computers + // Combat_Begin step + if (!Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.COMBAT_BEGIN) + && Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getComputerPlayer()) && !AbilityFactory.isSorcerySpeed(sa) + && !params.containsKey("ActivationPhases") && !params.containsKey("Permanent")) { + return false; + } + + // don't use instant speed clone abilities outside humans + // Combat_Declare_Attackers_InstantAbility step + if ((!Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_ATTACKERS_INSTANT_ABILITY) || (AllZone.getCombat() + .getAttackers().isEmpty())) && Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getHumanPlayer())) { + return false; + } + + // don't activate during main2 unless this effect is permanent + if (Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.MAIN2) && !params.containsKey("Permanent")) { + return false; + } + + if (null == tgt) { + final ArrayList defined = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa); + + boolean bFlag = false; + for (final Card c : defined) { + bFlag |= (!c.isCreature() && !c.isTapped() && !(c.getTurnInZone() == Singletons.getModel().getGameState().getPhaseHandler().getTurn())); + + // for creatures that could be improved (like Figure of Destiny) + if (c.isCreature() && (params.containsKey("Permanent") || (!c.isTapped() && !c.isSick()))) { + int power = -5; + if (params.containsKey("Power")) { + power = AbilityFactory.calculateAmount(source, params.get("Power"), sa); + } + int toughness = -5; + if (params.containsKey("Toughness")) { + toughness = AbilityFactory.calculateAmount(source, params.get("Toughness"), sa); + } + if ((power + toughness) > (c.getCurrentPower() + c.getCurrentToughness())) { + bFlag = true; + } + } + + } + + if (!bFlag) { // All of the defined stuff is cloned, not very + // useful + return false; + } + } else { + tgt.resetTargets(); + useAbility &= AbilityFactoryClone.cloneTgtAI(af, sa); + } + + final AbilitySub subAb = sa.getSubAbility(); + if (subAb != null) { + useAbility &= subAb.chkAIDrawback(); + } + + return useAbility; + } // end cloneCanPlayAI() + + /** + *

+ * clonePlayDrawbackAI. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + * @return a boolean. + */ + private static boolean clonePlayDrawbackAI(final AbilityFactory af, final SpellAbility sa) { + // AI should only activate this during Human's turn + boolean chance = true; + + if (sa.getTarget() != null) { + chance = AbilityFactoryClone.cloneTgtAI(af, sa); + } + + final AbilitySub subAb = sa.getSubAbility(); + if (subAb != null) { + chance &= subAb.chkAIDrawback(); + } + + return chance; + } + + /** + *

+ * cloneTriggerAI. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + * @param mandatory + * a boolean. + * @return a boolean. + */ + private static boolean cloneTriggerAI(final AbilityFactory af, final SpellAbility sa, final boolean mandatory) { + if (!ComputerUtil.canPayCost(sa)) { // If there is a cost payment + return false; + } + + boolean chance = true; + + if (sa.getTarget() != null) { + chance = AbilityFactoryClone.cloneTgtAI(af, sa); + } + + // Improve AI for triggers. If source is a creature with: + // When ETB, sacrifice a creature. Check to see if the AI has something + // to sacrifice + + // Eventually, we can call the trigger of ETB abilities with + // not mandatory as part of the checks to cast something + + final AbilitySub subAb = sa.getSubAbility(); + if (subAb != null) { + chance &= subAb.chkAIDrawback(); + } + + return chance || mandatory; + } + + /** + *

+ * cloneTgtAI. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + * @return a boolean. + */ + private static boolean cloneTgtAI(final AbilityFactory af, final SpellAbility sa) { + // This is reasonable for now. Kamahl, Fist of Krosa and a sorcery or + // two are the only things + // that clone a target. Those can just use SVar:RemAIDeck:True until + // this can do a reasonably + // good job of picking a good target + return false; + } + + /** + *

+ * cloneResolve. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + */ + private static void cloneResolve(final AbilityFactory af, final SpellAbility sa) { + final HashMap params = af.getMapParams(); + Card tgtCard; + final Card host = sa.getSourceCard(); + + + // find target of cloning + final Target tgt = sa.getTarget(); + if (tgt != null) { + tgtCard = tgt.getTargetCards().get(0); + } + else if (params.containsKey("Defined")) { + tgtCard = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa).get(0); + } + else { + tgtCard = host; + } + + // find cloning source i.e. thing to be copied + Card cardToCopy = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa).get(0); + if (cardToCopy == null) { + return; + } + + String imageFileName = host.getImageFilename(); + + Card cloned; + + AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); + + if (cardToCopy.isToken()) { + cloned = CardFactoryUtil.copyStats(cardToCopy); + + cloned.setName(cardToCopy.getName()); + cloned.setImageName(cardToCopy.getImageName()); + + cloned.setOwner(sa.getActivatingPlayer()); + cloned.addController(sa.getActivatingPlayer()); + + cloned.setManaCost(cardToCopy.getManaCost()); + cloned.setColor(cardToCopy.getColor()); + cloned.setToken(true); + + cloned.setType(cardToCopy.getType()); + + cloned.setBaseAttack(cardToCopy.getBaseAttack()); + cloned.setBaseDefense(cardToCopy.getBaseDefense()); + } + else { + Card origin = cardToCopy; + // TODO: transform back before copying + cloned = AbstractCardFactory.getCard2(origin, tgtCard.getOwner()); + // TODO: transform origin back to how it was (if needed) + } + tgtCard.addAlternateState(CardCharactersticName.Cloner); + tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); + tgtCard.setState(CardCharactersticName.Original); + + if (cardToCopy.getCurState() == CardCharactersticName.Transformed && cardToCopy.isDoubleFaced()) { + cloned.setState(CardCharactersticName.Transformed); + } + + CardFactoryUtil.copyCharacteristics(cloned, tgtCard); + CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); + for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { + tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); + } + + // If target is a flipped card, also copy the flipped + // state. + if (cardToCopy.isFlip()) { + cloned.setState(CardCharactersticName.Flipped); + cloned.setImageFilename(CardUtil.buildFilename(cloned)); + tgtCard.addAlternateState(CardCharactersticName.Flipped); + tgtCard.setState(CardCharactersticName.Flipped); + CardFactoryUtil.copyCharacteristics(cloned, tgtCard); + CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); + for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { + tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); + } + + tgtCard.setFlip(true); + + tgtCard.setState(CardCharactersticName.Original); + } else { + tgtCard.setFlip(false); + } + + AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); + + //keep the Clone card image for the cloned card + tgtCard.setImageFilename(imageFileName); + } // cloneResolve + + } // end class AbilityFactoryClone From e2702244c32332efffd705a716ac3c5bf0da4961 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 27 May 2012 06:17:21 +0000 Subject: [PATCH 03/29] updated LQ picture downloader to handle flip/DFC states --- .../gui/download/GuiDownloadPicturesLQ.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main/java/forge/gui/download/GuiDownloadPicturesLQ.java b/src/main/java/forge/gui/download/GuiDownloadPicturesLQ.java index 2f469e2d053..26578748a80 100644 --- a/src/main/java/forge/gui/download/GuiDownloadPicturesLQ.java +++ b/src/main/java/forge/gui/download/GuiDownloadPicturesLQ.java @@ -25,6 +25,8 @@ import javax.swing.JFrame; import forge.AllZone; import forge.Card; +import forge.CardCharactersticName; +import forge.card.CardCharacteristics; import forge.gui.GuiDisplayUtil; import forge.properties.ForgeProps; import forge.properties.NewConstants; @@ -93,22 +95,19 @@ public class GuiDownloadPicturesLQ extends GuiDownloader { private List createDLObjects(final Card c, final String base) { final ArrayList ret = new ArrayList(); - for (final String sVar : c.getSVars().keySet()) { + for (final CardCharactersticName state : c.getStates()) { + CardCharacteristics stateCharacteristics = c.getState(state); + final String url = stateCharacteristics.getSVar("Picture"); + if (!url.isEmpty()) { + final String[] urls = url.split("\\\\"); - if (!sVar.startsWith("Picture")) { - continue; + final String iName = GuiDisplayUtil.cleanString(stateCharacteristics.getImageName()); + ret.add(new DownloadObject(urls[0], new File(base, iName + ".jpg"))); + + for (int j = 1; j < urls.length; j++) { + ret.add(new DownloadObject(urls[j], new File(base, iName + j + ".jpg"))); + } } - - final String url = c.getSVar(sVar); - final String[] urls = url.split("\\\\"); - - final String iName = GuiDisplayUtil.cleanString(c.getImageName()); - ret.add(new DownloadObject(urls[0], new File(base, iName + ".jpg"))); - - for (int j = 1; j < urls.length; j++) { - ret.add(new DownloadObject(urls[j], new File(base, iName + j + ".jpg"))); - } - } return ret; From f82edd5ff2c4c0142aa6ae56270ebd9aa162fd8d Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Tue, 29 May 2012 19:18:17 +0000 Subject: [PATCH 04/29] updated SVars on flip/DFC/licid cards --- .../a/afflicted_deserter_werewolf_ransacker.txt | 7 +++---- .../a/akki_lavarunner_tok_tok_volcano_born.txt | 2 +- res/cardsfolder/b/bloodline_keeper_lord_of_lineage.txt | 2 +- .../b/budoka_gardener_dokai_weaver_of_life.txt | 8 ++++---- .../b/budoka_pupil_ichiga_who_topples_oaks.txt | 2 +- .../b/bushi_tenderfoot_kenzo_the_hardhearted.txt | 2 +- res/cardsfolder/c/callow_jushi_jaraku_the_interloper.txt | 2 +- res/cardsfolder/c/calming_licid.txt | 8 +++++--- res/cardsfolder/c/chalice_of_life_chalice_of_death.txt | 2 +- res/cardsfolder/c/chosen_of_markov_markovs_servant.txt | 2 +- res/cardsfolder/c/civilized_scholar_homicidal_brute.txt | 2 +- res/cardsfolder/c/cloistered_youth_unholy_fiend.txt | 2 +- res/cardsfolder/c/convulsing_licid.txt | 8 +++++--- res/cardsfolder/c/corrupting_licid.txt | 8 +++++--- .../c/cunning_bandit_azamuki_treachery_incarnate.txt | 2 +- res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt | 7 +++---- .../d/delver_of_secrets_insectile_aberration.txt | 2 +- res/cardsfolder/d/dominating_licid.txt | 8 +++++--- .../e/elbrus_the_binding_blade_withengar_unbound.txt | 2 +- res/cardsfolder/e/enraging_licid.txt | 8 +++++--- .../e/erayo_soratami_ascendant_erayos_essence.txt | 2 +- .../f/faithful_squire_kaiso_memory_of_loyalty.txt | 2 +- .../g/garruk_relentless_garruk_the_veil_cursed.txt | 2 +- res/cardsfolder/g/gatstaf_shepherd_gatstaf_howler.txt | 7 +++---- res/cardsfolder/g/gliding_licid.txt | 8 +++++--- .../g/grizzled_outcasts_krallenhorde_wantons.txt | 7 +++---- res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt | 7 +++---- .../h/hinterland_hermit_hinterland_scourge.txt | 7 +++---- res/cardsfolder/h/hired_muscle_scarmaker.txt | 2 +- .../h/homura_human_ascendant_homuras_essence.txt | 2 +- .../h/huntmaster_of_the_fells_ravager_of_the_fells.txt | 7 +++---- res/cardsfolder/i/initiate_of_blood_goka_the_unjust.txt | 2 +- res/cardsfolder/i/instigator_gang_wildblood_pack.txt | 7 +++---- .../j/jushi_apprentice_tomoya_the_revealer.txt | 2 +- res/cardsfolder/k/kruin_outlaw_terror_of_kruin_pass.txt | 7 +++---- res/cardsfolder/k/kuon_ogre_ascendant_kuons_essence.txt | 2 +- res/cardsfolder/l/lambholt_elder_silverpelt_werewolf.txt | 7 +++---- res/cardsfolder/l/leeching_licid.txt | 8 +++++--- res/cardsfolder/l/loyal_cathar_unhallowed_cathar.txt | 2 +- res/cardsfolder/m/mayor_of_avabruck_howlpack_alpha.txt | 7 +++---- .../m/mondronen_shaman_tovolars_magehunter.txt | 7 +++---- .../n/nezumi_graverobber_nighteyes_the_desecrator.txt | 2 +- .../n/nezumi_shortfang_stabwhisker_the_odious.txt | 2 +- res/cardsfolder/n/nurturing_licid.txt | 8 +++++--- .../o/orochi_eggwatcher_shidako_broodmistress.txt | 2 +- res/cardsfolder/q/quickening_licid.txt | 8 +++++--- res/cardsfolder/r/ravenous_demon_archdemon_of_greed.txt | 2 +- res/cardsfolder/r/reckless_waif_merciless_predator.txt | 7 +++---- .../r/rune_tail_kitsune_ascendant_rune_tails_essence.txt | 2 +- .../s/scorned_villager_moonscarred_werewolf.txt | 7 +++---- res/cardsfolder/s/screeching_bat_stalking_vampire.txt | 7 +++---- res/cardsfolder/s/soul_seizer_ghastly_haunting.txt | 2 +- res/cardsfolder/s/stinging_licid.txt | 8 +++++--- .../s/student_of_elements_tobita_master_of_winds.txt | 2 +- res/cardsfolder/t/tempting_licid.txt | 8 +++++--- res/cardsfolder/t/thraben_sentry_thraben_militia.txt | 2 +- res/cardsfolder/t/tormented_pariah_rampaging_werewolf.txt | 7 +++---- res/cardsfolder/t/transmogrifying_licid.txt | 8 +++++--- .../u/ulvenwald_mystics_ulvenwald_primordials.txt | 7 +++---- res/cardsfolder/v/village_ironsmith_ironfang.txt | 7 +++---- .../v/villagers_of_estwald_howlpack_of_estwald.txt | 7 +++---- .../w/wolfbitten_captive_krallenhorde_killer.txt | 7 +++---- 62 files changed, 153 insertions(+), 149 deletions(-) diff --git a/res/cardsfolder/a/afflicted_deserter_werewolf_ransacker.txt b/res/cardsfolder/a/afflicted_deserter_werewolf_ransacker.txt index fb592c782e9..78bfd897fc9 100644 --- a/res/cardsfolder/a/afflicted_deserter_werewolf_ransacker.txt +++ b/res/cardsfolder/a/afflicted_deserter_werewolf_ransacker.txt @@ -5,13 +5,11 @@ Text:no text PT:3/2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. SVar:Picture:http://www.wizards.com/global/images/magic/general/afflicted_deserter.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/81a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Afflicted Deserter. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Werewolf Ransacker @@ -26,7 +24,8 @@ SVar:DBDamage:DB$DealDamage | Cost$ 0 | Defined$ TargetedController | NumDmg$ 3 SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True SVar:IsDestroyed:Count$ThisTurnEntered_Graveyard_from_Battlefield_Artifact.IsRemembered T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/werewolf_ransacker.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/werewolf_ransacker.jpg SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/81b.jpg Oracle:Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf Ransacker. End \ No newline at end of file diff --git a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt index 4ba47040400..452381eb7d2 100644 --- a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt +++ b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt @@ -25,7 +25,7 @@ R:Event$ DamageDone | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ SVar:DmgPlus1:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X SVar:DmgPlus1:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X SVar:X:ReplaceCount$DamageAmount/Plus.1 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/tok_tok_volcano_born.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/tok_tok_volcano_born.jpg SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/313.jpg Oracle:Protection from red\nIf a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. End \ No newline at end of file diff --git a/res/cardsfolder/b/bloodline_keeper_lord_of_lineage.txt b/res/cardsfolder/b/bloodline_keeper_lord_of_lineage.txt index 1ed5876f793..8dc892cdbf0 100644 --- a/res/cardsfolder/b/bloodline_keeper_lord_of_lineage.txt +++ b/res/cardsfolder/b/bloodline_keeper_lord_of_lineage.txt @@ -23,7 +23,7 @@ PT:5/5 K:Flying S:Mode$ Continuous | Affected$ Creature.Vampire+Other+YouCtrl | AddPower$ 2 | AddToughness$ 2 | Description$ Other Vampire creatures you control get +2/+2. A:AB$Token | Cost$ T | TokenAmount$ 1 | TokenOwner$ You | TokenName$ Vampire | TokenColors$ Black | TokenImage$ B 2 2 Vampire | TokenTypes$ Creature,Vampire | TokenPower$ 2 | TokenToughness$ 2 | TokenKeywords$ Flying | SpellDescription$ Put a 2/2 black Vampire creature token with flying onto the battlefield. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/lord_of_lineage.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/lord_of_lineage.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/90b.jpg Oracle:Other Vampire creatures you control get +2/+2.\n{T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. diff --git a/res/cardsfolder/b/budoka_gardener_dokai_weaver_of_life.txt b/res/cardsfolder/b/budoka_gardener_dokai_weaver_of_life.txt index 0ed6e859fe6..8d7d88ca209 100644 --- a/res/cardsfolder/b/budoka_gardener_dokai_weaver_of_life.txt +++ b/res/cardsfolder/b/budoka_gardener_dokai_weaver_of_life.txt @@ -5,14 +5,13 @@ Text:no text PT:2/1 A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | ChangeNum$ 1 | OptionalDecider$ You | SubAbility$ DBFlip | SpellDescription$ You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip CARDNAME. SVar:DBFlip:DB$SetState | Defined$ Self | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | Mode$ Flip +SVar:X:Count$Valid Land.YouCtrl AlternateMode:Flip SVar:Picture:http://www.wizards.com/global/images/magic/general/budoka_gardener.jpg + SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/202.jpg Oracle:{T}: You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip Budoka Gardener. -# Shared -SVar:X:Count$Valid Land.YouCtrl - ALTERNATE Name:Dokai, Weaver of Life @@ -22,7 +21,8 @@ Types:Legendary Creature Human Monk Text:no text PT:3/3 A:AB$Token | Cost$ 4 G G T | TokenAmount$ 1 | TokenName$ Elemental | TokenColors$ Green | TokenTypes$ Creature,Elemental | TokenPower$ X | TokenToughness$ X | TokenOwner$ You | SpellDescription$ Put an X/X green Elemental creature token onto the battlefield, where X is the number of lands you control. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/dokai_weaver_of_life.jpg +SVar:X:Count$Valid Land.YouCtrl +SVar:Picture:http://www.wizards.com/global/images/magic/general/dokai_weaver_of_life.jpg SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/315.jpg Oracle:{4}{G}{G}, {T}: Put an X/X green Elemental creature token onto the battlefield, where X is the number of lands you control. End \ No newline at end of file diff --git a/res/cardsfolder/b/budoka_pupil_ichiga_who_topples_oaks.txt b/res/cardsfolder/b/budoka_pupil_ichiga_who_topples_oaks.txt index 15f507bd7a4..d698f0ddec4 100644 --- a/res/cardsfolder/b/budoka_pupil_ichiga_who_topples_oaks.txt +++ b/res/cardsfolder/b/budoka_pupil_ichiga_who_topples_oaks.txt @@ -22,7 +22,7 @@ Text:no text PT:4/3 K:Trample A:AB$ Pump | Cost$ SubCounter<1/KI> | Tgt$ TgtC | NumAtt$ 2 | NumDef$ 2 | SpellDescription$ Target creature gets +2/+2 until end of turn. -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/ichiga_who_topples_oaks.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/ichiga_who_topples_oaks.jpg # This link may be a temporary solution and could change in the near future. Oracle:Trample\nRemove a ki counter from Ichiga, Who Topples Oaks: Target creature gets +2/+2 until end of turn. SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/170.jpg diff --git a/res/cardsfolder/b/bushi_tenderfoot_kenzo_the_hardhearted.txt b/res/cardsfolder/b/bushi_tenderfoot_kenzo_the_hardhearted.txt index 2fe00e24f5d..41dfbe9045d 100644 --- a/res/cardsfolder/b/bushi_tenderfoot_kenzo_the_hardhearted.txt +++ b/res/cardsfolder/b/bushi_tenderfoot_kenzo_the_hardhearted.txt @@ -20,7 +20,7 @@ Text:no text PT:3/4 K:Double Strike K:Bushido 2 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/kenzo_the_hardhearted.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/kenzo_the_hardhearted.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/307.jpg Oracle:Double strike; bushido 2 (When this blocks or becomes blocked, it gets +2/+2 until end of turn.) diff --git a/res/cardsfolder/c/callow_jushi_jaraku_the_interloper.txt b/res/cardsfolder/c/callow_jushi_jaraku_the_interloper.txt index 67f1eca8cca..08b3893581d 100644 --- a/res/cardsfolder/c/callow_jushi_jaraku_the_interloper.txt +++ b/res/cardsfolder/c/callow_jushi_jaraku_the_interloper.txt @@ -21,7 +21,7 @@ Types:Legendary Creature Spirit Text:no text PT:3/4 A:AB$ Counter | Cost$ SubCounter<1/KI> | TargetType$ Spell | ValidTgts$ Card | TgtPrompt$ Select target spell. | Destination$ Graveyard | UnlessCost$ 2 | UnlessPayer$ TargetedController | SpellDescription$ Counter target spell unless its controller pays 2. -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/jaraku_the_interloper.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/jaraku_the_interloper.jpg # This link may be a temporary solution and could change in the near future. SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/167.jpg Oracle:Remove a ki counter from Jaraku the Interloper: Counter target spell unless its controller pays {2}. diff --git a/res/cardsfolder/c/calming_licid.txt b/res/cardsfolder/c/calming_licid.txt index 14a5ad81fe3..77543beaeb2 100644 --- a/res/cardsfolder/c/calming_licid.txt +++ b/res/cardsfolder/c/calming_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ W T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/calming_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Enchanted creature can't attack. A:AB$ SetState | Cost$ W | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/calming_licid.jpg +SetInfo:STH|Uncommon|http://magiccards.info/scans/en/sh/102.jpg +Oracle:{W}, {T}: Calming Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.\nEnchanted creature can't attack. End \ No newline at end of file diff --git a/res/cardsfolder/c/chalice_of_life_chalice_of_death.txt b/res/cardsfolder/c/chalice_of_life_chalice_of_death.txt index 51edf8640a8..4cca3291164 100644 --- a/res/cardsfolder/c/chalice_of_life_chalice_of_death.txt +++ b/res/cardsfolder/c/chalice_of_life_chalice_of_death.txt @@ -18,7 +18,7 @@ ManaCost:no cost Types:Artifact Text:no text A:AB$ LoseLife | Cost$ T | ValidTgts$ Player | TgtPrompt$Target a player to lose 5 life | LifeAmount$ 5 | SpellDescription$ Target player loses 5 life. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/chalice_of_death.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/chalice_of_death.jpg SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/146b.jpg Oracle:{T}: Target player loses 5 life. End \ No newline at end of file diff --git a/res/cardsfolder/c/chosen_of_markov_markovs_servant.txt b/res/cardsfolder/c/chosen_of_markov_markovs_servant.txt index 88c0a1bb302..49fa0abf9eb 100644 --- a/res/cardsfolder/c/chosen_of_markov_markovs_servant.txt +++ b/res/cardsfolder/c/chosen_of_markov_markovs_servant.txt @@ -17,7 +17,7 @@ Colors:black Types:Creature Vampire Text:no text PT:4/4 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/markovs_servant.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/markovs_servant.jpg SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/55b.jpg Oracle: End \ No newline at end of file diff --git a/res/cardsfolder/c/civilized_scholar_homicidal_brute.txt b/res/cardsfolder/c/civilized_scholar_homicidal_brute.txt index 159c83f21f4..007eaac9938 100644 --- a/res/cardsfolder/c/civilized_scholar_homicidal_brute.txt +++ b/res/cardsfolder/c/civilized_scholar_homicidal_brute.txt @@ -25,7 +25,7 @@ PT:5/1 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTap | IsPresent$ Card.notAttackedThisTurn+Self | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, tap CARDNAME, then transform it. SVar:TrigTap:AB$ Tap | Cost$ 0 | Defined$ Self | SubAbility$ DBTransform2 SVar:DBTransform2:DB$ SetState | Cost$ 0 | Defined$ Self | Mode$ Transform -SVar:Picture1:http://www.wizards.com/global/images/magic/general/homicidal_brute.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/homicidal_brute.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/47b.jpg Oracle:At the beginning of your end step, if Homicidal Brute didn't attack this turn, tap Homicidal Brute, then transform it. End diff --git a/res/cardsfolder/c/cloistered_youth_unholy_fiend.txt b/res/cardsfolder/c/cloistered_youth_unholy_fiend.txt index aaa8675463b..c36f6cf3b00 100644 --- a/res/cardsfolder/c/cloistered_youth_unholy_fiend.txt +++ b/res/cardsfolder/c/cloistered_youth_unholy_fiend.txt @@ -20,7 +20,7 @@ Text:no text PT:3/3 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ At the beginning of your end step, you lose 1 life. SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/unholy_fiend.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/unholy_fiend.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/8b.jpg Oracle:Creature - Horror\n3/3\nAt the beginning of your end step, you lose 1 life. diff --git a/res/cardsfolder/c/convulsing_licid.txt b/res/cardsfolder/c/convulsing_licid.txt index 065b72ff97d..53be325386d 100644 --- a/res/cardsfolder/c/convulsing_licid.txt +++ b/res/cardsfolder/c/convulsing_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ R T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/convulsing_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Enchanted creature can't block. A:AB$ SetState | Cost$ R | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/convulsing_licid.jpg +SetInfo:STH|Uncommon|http://magiccards.info/scans/en/sh/77.jpg +Oracle:{R}, {T}: Convulsing Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect.\nEnchanted creature can't attack. End \ No newline at end of file diff --git a/res/cardsfolder/c/corrupting_licid.txt b/res/cardsfolder/c/corrupting_licid.txt index d049d363fe9..2d7041e9c8f 100644 --- a/res/cardsfolder/c/corrupting_licid.txt +++ b/res/cardsfolder/c/corrupting_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ B T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/corrupting_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Fear | Description$ Enchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.) A:AB$ SetState | Cost$ B | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/corrupting_licid.jpg +SetInfo:STH|Uncommon|http://magiccards.info/scans/en/sh/4.jpg +Oracle:{B}, {T}: Corrupting Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {B} to end this effect.\nEnchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.) End \ No newline at end of file diff --git a/res/cardsfolder/c/cunning_bandit_azamuki_treachery_incarnate.txt b/res/cardsfolder/c/cunning_bandit_azamuki_treachery_incarnate.txt index fb69a8fbb93..5e6302b6fa7 100644 --- a/res/cardsfolder/c/cunning_bandit_azamuki_treachery_incarnate.txt +++ b/res/cardsfolder/c/cunning_bandit_azamuki_treachery_incarnate.txt @@ -21,7 +21,7 @@ Types:Legendary Creature Spirit Text:no text PT:5/2 A:AB$ GainControl | Cost$ SubCounter<1/KI> | Tgt$ TgtC | SpellDescription$ Gain control of target creature until end of turn. -SVar:Picture1:www.marc-fowler-design.com/cardforge/flippedcards/BOK/azamuki_treachery_incarnate.jpg +SVar:Picture:www.marc-fowler-design.com/cardforge/flippedcards/BOK/azamuki_treachery_incarnate.jpg # This link may be a temporary solution and could change in the near future. SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/169.jpg Oracle:Remove a ki counter from Azamuki, Treachery Incarnate: Gain control of target creature until end of turn. diff --git a/res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt b/res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt index fb5328cd650..9d28f4cd2f6 100644 --- a/res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt +++ b/res/cardsfolder/d/daybreak_ranger_nightfall_predator.txt @@ -5,14 +5,12 @@ Text:no text PT:2/2 A:AB$DealDamage | Cost$ T | ValidTgts$ Creature.withFlying | TgtPrompt$ Select target creature with flying. | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to target creature with flying. T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/daybreak_ranger.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/176a.jpg Oracle:{T}: Daybreak Ranger deals 2 damage to target creature with flying.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Daybreak Ranger. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Nightfall Predator @@ -23,7 +21,8 @@ Text:no text PT:4/4 A:AB$ Fight | Cost$ R T | Defined$ Self | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ CARDNAME fights target creature. (Each deals damage equal to its power to the other.) T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/nightfall_predator.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/nightfall_predator.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/176b.jpg Oracle:{R}, {T}: Nightfall Predator fights target creature. (Each deals damage equal to its power to the other.)\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Nightfall Predator. End \ No newline at end of file diff --git a/res/cardsfolder/d/delver_of_secrets_insectile_aberration.txt b/res/cardsfolder/d/delver_of_secrets_insectile_aberration.txt index 3883ee6e253..491ec033373 100644 --- a/res/cardsfolder/d/delver_of_secrets_insectile_aberration.txt +++ b/res/cardsfolder/d/delver_of_secrets_insectile_aberration.txt @@ -21,7 +21,7 @@ Types:Creature Human Insect Text:no text PT:3/2 K:Flying -SVar:Picture1:http://www.wizards.com/global/images/magic/general/insectile_aberration.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/insectile_aberration.jpg Oracle:Flying SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/51b.jpg End \ No newline at end of file diff --git a/res/cardsfolder/d/dominating_licid.txt b/res/cardsfolder/d/dominating_licid.txt index c18be3366c0..3a6837d748c 100644 --- a/res/cardsfolder/d/dominating_licid.txt +++ b/res/cardsfolder/d/dominating_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ 1 U U T | Defined$ Self | NewState$ Alternate | SubAbilit SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/dominating_licid.jpg @@ -25,5 +23,9 @@ Text:You control enchanted creature. K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl A:AB$ SetState | Cost$ U | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/dominating_licid.jpg +SetInfo:EXO|Rare|http://magiccards.info/scans/en/ex/30.jpg +Oracle:{1}{U}{U}, {T}: Dominating Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay to end this effect.\nYou control enchanted creature. End \ No newline at end of file diff --git a/res/cardsfolder/e/elbrus_the_binding_blade_withengar_unbound.txt b/res/cardsfolder/e/elbrus_the_binding_blade_withengar_unbound.txt index f259ff91158..a701f71f107 100644 --- a/res/cardsfolder/e/elbrus_the_binding_blade_withengar_unbound.txt +++ b/res/cardsfolder/e/elbrus_the_binding_blade_withengar_unbound.txt @@ -22,7 +22,7 @@ K:Flying K:Trample K:Intimidate # Whenever a player loses the game, put thirteen +1/+1 counters on Withengar Unbound. (not implemented) -SVar:Picture1:http://www.wizards.com/global/images/magic/general/withengar_unbound.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/withengar_unbound.jpg SetInfo:DKA|Mythic|http://magiccards.info/scans/en/dka/147b.jpg Oracle:Flying, intimidate, trample\nWhenever a player loses the game, put thirteen +1/+1 counters on Withengar Unbound. End \ No newline at end of file diff --git a/res/cardsfolder/e/enraging_licid.txt b/res/cardsfolder/e/enraging_licid.txt index 1218a7dfd36..7cc685e2d23 100644 --- a/res/cardsfolder/e/enraging_licid.txt +++ b/res/cardsfolder/e/enraging_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ R T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/enraging_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Haste | Description$ Enchanted creature has haste. A:AB$ SetState | Cost$ R | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/enraging_licid.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/171.jpg +Oracle:{R}, {T}: Enraging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect.\nEnchanted creature has haste. End \ No newline at end of file diff --git a/res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt b/res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt index 9109e023cc0..7e3ae40d795 100644 --- a/res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt +++ b/res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt @@ -22,7 +22,7 @@ Text:no text T:Mode$ SpellCast | ValidActivatingPlayer$ Opponent | CheckSVar$ NumOppCast | SVarCompare$ EQ1 | Execute$ TrigCounter | TriggerZones$ Battlefield | TriggerDescription$ Whenever an opponent casts a spell for the first time in a turn, counter that spell. SVar:TrigCounter:AB$Counter | Cost$ 0 | Defined$ TriggeredSpellAbility | Destination$ Graveyard SVar:NumOppCast:Count$ThisTurnCast_Card.YouDontCtrl -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/erayos_essence.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/erayos_essence.jpg # This link may be a temporary solution and could change in the near future. SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/167.jpg Oracle:Whenever an opponent casts a spell for the first time in a turn, counter that spell. diff --git a/res/cardsfolder/f/faithful_squire_kaiso_memory_of_loyalty.txt b/res/cardsfolder/f/faithful_squire_kaiso_memory_of_loyalty.txt index 0dffc73fc2b..1902353e5b0 100644 --- a/res/cardsfolder/f/faithful_squire_kaiso_memory_of_loyalty.txt +++ b/res/cardsfolder/f/faithful_squire_kaiso_memory_of_loyalty.txt @@ -21,7 +21,7 @@ Types:Legendary Creature Spirit Text:no text PT:3/4 A:AB$ Pump | Cost$ SubCounter<1/KI> | KW$ HIDDEN Prevent all damage that would be dealt to CARDNAME. | Tgt$ TgtC | SpellDescription$ Prevent all damage that would be dealt to target creature this turn. -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/kaiso_memory_of_loyalty.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/kaiso_memory_of_loyalty.jpg # This link may be a temporary solution and could change in the near future. SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/166.jpg Oracle:Remove a ki counter from Kaiso, Memory of Loyalty: Prevent all damage that would be dealt to target creature this turn. diff --git a/res/cardsfolder/g/garruk_relentless_garruk_the_veil_cursed.txt b/res/cardsfolder/g/garruk_relentless_garruk_the_veil_cursed.txt index 5dab76c7b08..3250a59092e 100644 --- a/res/cardsfolder/g/garruk_relentless_garruk_the_veil_cursed.txt +++ b/res/cardsfolder/g/garruk_relentless_garruk_the_veil_cursed.txt @@ -27,7 +27,7 @@ A:AB$ Sacrifice | Cost$ SubCounter<1/LOYALTY> | Defined$ You | SacValid$ Creatur A:AB$ PumpAll | Cost$ SubCounter<3/LOYALTY> | ValidCards$ Creature.YouCtrl | KW$ Trample | NumAtt$ X | NumDef$ X | Planeswalker$ True | Ultimate$ True | SpellDescription$ Creatures you control gain trample and get +X/+X until end of turn, where X is the number of creature cards in your graveyard. SVar:X:Count$TypeInYourYard.Creature SVar:DBSearch:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Creature | ChangeNum$ 1 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/garruk_the_veil_cursed.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/garruk_the_veil_cursed.jpg SetInfo:ISD|Mythic|http://magiccards.info/scans/en/isd/181b.jpg Oracle:[+1] Put a 1/1 black Wolf creature token with deathtouch onto the battlefield.\n[-1] Sacrifice a creature. If you do, search your library for a creature card, reveal it, put it into your hand, then shuffle your library.\n[-3] Creatures you control gain trample and get +X/+X until end of turn, where X is the number of creature cards in your graveyard. End \ No newline at end of file diff --git a/res/cardsfolder/g/gatstaf_shepherd_gatstaf_howler.txt b/res/cardsfolder/g/gatstaf_shepherd_gatstaf_howler.txt index 11a2995afe8..fa6fe631155 100644 --- a/res/cardsfolder/g/gatstaf_shepherd_gatstaf_howler.txt +++ b/res/cardsfolder/g/gatstaf_shepherd_gatstaf_howler.txt @@ -4,14 +4,12 @@ Types:Creature Human Werewolf Text:no text PT:2/2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/gatstaf_shepherd.jpg AlternateMode:DoubleFaced SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/182a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Gatstaf Shepherd. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Gatstaf Howler @@ -22,7 +20,8 @@ Text:no text PT:3/3 K:Intimidate T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/gatstaf_howler.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/gatstaf_howler.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/182b.jpg Oracle:Intimidate (This creature can't be blocked except by artifact creatures and/or creatures that share a color with it.)\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Gatstaf Howler. End \ No newline at end of file diff --git a/res/cardsfolder/g/gliding_licid.txt b/res/cardsfolder/g/gliding_licid.txt index c4a727936cf..a2d996f2544 100644 --- a/res/cardsfolder/g/gliding_licid.txt +++ b/res/cardsfolder/g/gliding_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ U T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/gliding_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Flying | Description$ Enchanted creature has flying. A:AB$ SetState | Cost$ U | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/gliding_licid.jpg +SetInfo:STH|Uncommon|http://magiccards.info/scans/en/sh/31.jpg +Oracle:{U}, {T}: Glidinging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {U} to end this effect.\nEnchanted creature has flying. End \ No newline at end of file diff --git a/res/cardsfolder/g/grizzled_outcasts_krallenhorde_wantons.txt b/res/cardsfolder/g/grizzled_outcasts_krallenhorde_wantons.txt index 8f273c75cb9..4614735f4dd 100644 --- a/res/cardsfolder/g/grizzled_outcasts_krallenhorde_wantons.txt +++ b/res/cardsfolder/g/grizzled_outcasts_krallenhorde_wantons.txt @@ -4,15 +4,13 @@ Types:Creature Human Werewolf Text:no text PT:4/4 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Rarity:Common AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/grizzled_outcasts.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/185a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Grizzled Outcasts. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Krallenhorde Wantons @@ -22,8 +20,9 @@ Types:Creature Werewolf Text:no text PT:7/7 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Rarity:Common -SVar:Picture1:http://www.wizards.com/global/images/magic/general/krallenhorde_wantons.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/krallenhorde_wantons.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/185b.jpg Oracle:At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Wantons. End \ No newline at end of file diff --git a/res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt b/res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt index 15dc5cbabc7..500bd3efb33 100644 --- a/res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt +++ b/res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt @@ -5,14 +5,12 @@ Text:no text PT:1/5 K:Defender T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/hanweir_watchkeep.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/145a.jpg Oracle:Defender\nAt the beginning of each upkeep, if no spells were cast last turn, transform Hanweir Watchkeep. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Bane of Hanweir @@ -23,7 +21,8 @@ Text:no text PT:5/5 K:CARDNAME attacks each turn if able. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/bane_of_hanweir.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/bane_of_hanweir.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/145b.jpg Oracle:Bane of Hanweir attacks each turn if able.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Bane of Hanweir. End \ No newline at end of file diff --git a/res/cardsfolder/h/hinterland_hermit_hinterland_scourge.txt b/res/cardsfolder/h/hinterland_hermit_hinterland_scourge.txt index 70b91036811..72b015dda22 100644 --- a/res/cardsfolder/h/hinterland_hermit_hinterland_scourge.txt +++ b/res/cardsfolder/h/hinterland_hermit_hinterland_scourge.txt @@ -4,14 +4,12 @@ Types:Creature Human Werewolf Text:no text PT:2/1 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/hinterland_hermit.jpg AlternateMode:DoubleFaced SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/94a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Hinterland Hermit. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Hinterland Scourge @@ -22,7 +20,8 @@ Text:no text PT:3/2 K:CARDNAME must be blocked if able. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/hinterland_scourge.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/hinterland_scourge.jpg SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/94b.jpg Oracle:Hinterland Scourge must be blocked if able.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Hinterland Scourge. End \ No newline at end of file diff --git a/res/cardsfolder/h/hired_muscle_scarmaker.txt b/res/cardsfolder/h/hired_muscle_scarmaker.txt index c3524e0ff5e..6d34874d18d 100644 --- a/res/cardsfolder/h/hired_muscle_scarmaker.txt +++ b/res/cardsfolder/h/hired_muscle_scarmaker.txt @@ -21,7 +21,7 @@ Types:Legendary Creature Spirit Text:no text PT:4/4 A:AB$ Pump | Cost$ SubCounter<1/KI> | KW$ Fear | Tgt$ TgtC | SpellDescription$ Target creature gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/scarmaker.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/BOK/scarmaker.jpg # This link may be a temporary solution and could change in the near future. SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/168.jpg Oracle:Remove a ki counter from Scarmaker: Target creature gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) diff --git a/res/cardsfolder/h/homura_human_ascendant_homuras_essence.txt b/res/cardsfolder/h/homura_human_ascendant_homuras_essence.txt index 09fc79187ba..42a5853ba17 100644 --- a/res/cardsfolder/h/homura_human_ascendant_homuras_essence.txt +++ b/res/cardsfolder/h/homura_human_ascendant_homuras_essence.txt @@ -21,7 +21,7 @@ Types:Legendary Enchantment Text:no text S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Flying | AddAbility$ ABPump | Description$ Creatures you control get +2/+2 and have flying and "R: This creature gets +1/+0 until end of turn." SVar:ABPump:AB$Pump | Cost$ R | Defined$ Self | NumAtt$ 1 | SpellDescription$ This creature gets +1/+0 until end of turn. -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/homuras_essence.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/homuras_essence.jpg # This link may be a temporary solution and could change in the near future. SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/169.jpg Oracle:Creatures you control get +2/+2 and have flying and "{R}: This creature gets +1/+0 until end of turn." diff --git a/res/cardsfolder/h/huntmaster_of_the_fells_ravager_of_the_fells.txt b/res/cardsfolder/h/huntmaster_of_the_fells_ravager_of_the_fells.txt index 63891f12bd4..0dccb86a37d 100644 --- a/res/cardsfolder/h/huntmaster_of_the_fells_ravager_of_the_fells.txt +++ b/res/cardsfolder/h/huntmaster_of_the_fells_ravager_of_the_fells.txt @@ -8,14 +8,12 @@ T:Mode$ Transformed | ValidCard$ Card.Self | Execute$ TokenAndLife | Secondary$ SVar:TokenAndLife:AB$ Token | Cost$ 0 | TokenOwner$ You | TokenName$ Wolf | TokenColors$ Green | TokenTypes$ Creature,Wolf | TokenPower$ 2 | TokenToughness$ 2 | TokenAmount$ 1 | SubAbility$ Life SVar:Life:DB$ GainLife | Defined$ You | LifeAmount$ 2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/huntmaster_of_the_fells.jpg SetInfo:DKA|Mythic|http://magiccards.info/scans/en/dka/140a.jpg Oracle:Whenever this creature enters the battlefield or transforms into Huntmaster of the Fells, put a 2/2 green Wolf creature token onto the battlefield and you gain 2 life.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Huntmaster of the Fells. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Ravager of the Fells @@ -29,7 +27,8 @@ T:Mode$ Transformed | ValidCard$ Card.Self | Execute$ DamageAndMoreDamage | Trig SVar:DamageAndMoreDamage:AB$ DealDamage | Cost$ 0 | ValidTgts$ Opponent | NumDmg$ 2 | SubAbility$ MoreDamage SVar:MoreDamage:DB$ DealDamage | ValidTgts$ Creature.YouDontCtrl | NumDmg$ 2 | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target creature opponent controls T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/ravager_of_the_fells.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/ravager_of_the_fells.jpg SetInfo:DKA|Mythic|http://magiccards.info/scans/en/dka/140b.jpg Oracle:Trample\nWhenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent and 2 damage to up to one target creature that player controls.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Ravager of the Fells. End \ No newline at end of file diff --git a/res/cardsfolder/i/initiate_of_blood_goka_the_unjust.txt b/res/cardsfolder/i/initiate_of_blood_goka_the_unjust.txt index cac6995febb..3b975c8b639 100644 --- a/res/cardsfolder/i/initiate_of_blood_goka_the_unjust.txt +++ b/res/cardsfolder/i/initiate_of_blood_goka_the_unjust.txt @@ -22,7 +22,7 @@ Types:Legendary Creature Ogre Shaman Text:no text PT:4/4 A:AB$DealDamage | Cost$ T | ValidTgts$ Creature.wasDealtDamageThisTurn | TgtPrompt$ Select target creature that was dealt damage this turn. | NumDmg$ 4 | SpellDescription$ CARDNAME deals 4 damage to target creature that was dealt damage this turn. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/goka_the_unjust.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/goka_the_unjust.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/314.jpg Oracle:{T}: Goka the Unjust deals 4 damage to target creature that was dealt damage this turn. diff --git a/res/cardsfolder/i/instigator_gang_wildblood_pack.txt b/res/cardsfolder/i/instigator_gang_wildblood_pack.txt index 3486eb49d7e..7ad51a6713b 100644 --- a/res/cardsfolder/i/instigator_gang_wildblood_pack.txt +++ b/res/cardsfolder/i/instigator_gang_wildblood_pack.txt @@ -5,14 +5,12 @@ Text:no text PT:2/3 S:Mode$ Continuous | Affected$ Creature.attacking+YouCtrl | AddPower$ 1 | Description$ Attacking creatures you control get +1/+0. T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/instigator_gang.jpg AlternateMode:DoubleFaced SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/149a.jpg Oracle:Attacking creatures you control get +1/+0.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Instigator Gang. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Wildblood Pack @@ -24,7 +22,8 @@ PT:5/5 K:Trample S:Mode$ Continuous | Affected$ Creature.attacking+YouCtrl | AddPower$ 3 | Description$ Attacking creatures you control get +3/+0. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/wildblood_pack.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/wildblood_pack.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/149b.jpg Oracle:Attacking creatures you control get +3/+0.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Wildblood Pack. End \ No newline at end of file diff --git a/res/cardsfolder/j/jushi_apprentice_tomoya_the_revealer.txt b/res/cardsfolder/j/jushi_apprentice_tomoya_the_revealer.txt index 0a77e3ee70e..339826acbd7 100644 --- a/res/cardsfolder/j/jushi_apprentice_tomoya_the_revealer.txt +++ b/res/cardsfolder/j/jushi_apprentice_tomoya_the_revealer.txt @@ -21,7 +21,7 @@ Text:no text PT:2/3 A:AB$Draw | Cost$ 3 U U T | ValidTgts$ Player | NumCards$ X | SpellDescription$ Target player draws X cards, where X is the number of cards in your hand. SVar:X:Count$InYourHand -SVar:Picture1:http://www.wizards.com/global/images/magic/general/tomoya_the_revealer.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/tomoya_the_revealer.jpg SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/309.jpg Oracle:{3}{U}{U}, {T}: Target player draws X cards, where X is the number of cards in your hand. End \ No newline at end of file diff --git a/res/cardsfolder/k/kruin_outlaw_terror_of_kruin_pass.txt b/res/cardsfolder/k/kruin_outlaw_terror_of_kruin_pass.txt index e94a4b9a98d..afc0804f5fa 100644 --- a/res/cardsfolder/k/kruin_outlaw_terror_of_kruin_pass.txt +++ b/res/cardsfolder/k/kruin_outlaw_terror_of_kruin_pass.txt @@ -5,14 +5,12 @@ Text:no text PT:2/2 K:First Strike T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/kruin_outlaw.jpg AlternateMode:DoubleFaced SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/152a.jpg Oracle:First Strike\nAt the beginning of each upkeep, if no spells were cast last turn, transform Kruin Outlaw. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Terror of Kruin Pass @@ -24,7 +22,8 @@ PT:3/3 K:Double Strike S:Mode$ Continuous | Affected$ Werewolf.YouCtrl | AddHiddenKeyword$ HIDDEN CARDNAME can't be blocked except by two or more creatures. | Description$ Each Werewolf you control can't be blocked except by two or more creatures. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/terror_of_kruin_pass.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/terror_of_kruin_pass.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/152b.jpg Oracle:Double Strike\nEach Werewolf you control can't be blocked except by two or more creatures.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Terror of Kruin Pass. End \ No newline at end of file diff --git a/res/cardsfolder/k/kuon_ogre_ascendant_kuons_essence.txt b/res/cardsfolder/k/kuon_ogre_ascendant_kuons_essence.txt index 12901448e37..8b2a0a37126 100644 --- a/res/cardsfolder/k/kuon_ogre_ascendant_kuons_essence.txt +++ b/res/cardsfolder/k/kuon_ogre_ascendant_kuons_essence.txt @@ -22,7 +22,7 @@ Text:no text T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's upkeep, that player sacrifices a creature. SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ TriggeredPlayer | SacValid$ Creature SVar:Rarity:Rare -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/kuons_essence.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/kuons_essence.jpg # This link may be a temporary solution and could change in the near future. SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/168.jpg Oracle:At the beginning of each player's upkeep, that player sacrifices a creature. diff --git a/res/cardsfolder/l/lambholt_elder_silverpelt_werewolf.txt b/res/cardsfolder/l/lambholt_elder_silverpelt_werewolf.txt index 945335c6b54..beeabba0966 100644 --- a/res/cardsfolder/l/lambholt_elder_silverpelt_werewolf.txt +++ b/res/cardsfolder/l/lambholt_elder_silverpelt_werewolf.txt @@ -4,14 +4,12 @@ Types:Creature Human Werewolf Text:no text PT:1/2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/lambholt_elder.jpg SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/122a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Lambholt Elder. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Silverpelt Werewolf @@ -23,7 +21,8 @@ PT:4/5 T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigDraw | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, draw a card. SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/silverpelt_werewolf.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/silverpelt_werewolf.jpg SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/122b.jpg Oracle:Whenever Silverpelt Werewolf deals combat damage to a player, draw a card.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Silverpelt Werewolf. End \ No newline at end of file diff --git a/res/cardsfolder/l/leeching_licid.txt b/res/cardsfolder/l/leeching_licid.txt index 84885e4ea4e..0e4d3235815 100644 --- a/res/cardsfolder/l/leeching_licid.txt +++ b/res/cardsfolder/l/leeching_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ B T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/leeching_licid.jpg @@ -27,5 +25,9 @@ A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ EnchantedController | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ At the beginning of the upkeep of enchanted creature's controller, CARDNAME deals 1 damage to that player. SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ EnchantedController | NumDmg$ 1 A:AB$ SetState | Cost$ B | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/leeching_licid.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/35.jpg +Oracle:{B}, {T}: Leeching Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {B} to end this effect.\nAt the beginning of the upkeep of enchanted creature's controller, Leeching Licid deals 1 damage to that player. End \ No newline at end of file diff --git a/res/cardsfolder/l/loyal_cathar_unhallowed_cathar.txt b/res/cardsfolder/l/loyal_cathar_unhallowed_cathar.txt index 14f9704f212..da1c19aa05b 100644 --- a/res/cardsfolder/l/loyal_cathar_unhallowed_cathar.txt +++ b/res/cardsfolder/l/loyal_cathar_unhallowed_cathar.txt @@ -22,7 +22,7 @@ Types:Creature Zombie Soldier Text:no text PT:2/1 K:CARDNAME can't block. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/unhallowed_cathar.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/unhallowed_cathar.jpg SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/13b.jpg Oracle:Unhallowed Cathar can't block. End \ No newline at end of file diff --git a/res/cardsfolder/m/mayor_of_avabruck_howlpack_alpha.txt b/res/cardsfolder/m/mayor_of_avabruck_howlpack_alpha.txt index f61fb1c2cc8..96bfe5efd36 100644 --- a/res/cardsfolder/m/mayor_of_avabruck_howlpack_alpha.txt +++ b/res/cardsfolder/m/mayor_of_avabruck_howlpack_alpha.txt @@ -5,14 +5,12 @@ Text:no text PT:1/1 S:Mode$ Continuous | Affected$ Creature.Human+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Human creatures you control get +1/+1. T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/mayor_of_avabruck.jpg AlternateMode:DoubleFaced SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/193a.jpg Oracle:Other Human creatures you control get +1/+1.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Howlpack Alpha @@ -24,8 +22,9 @@ PT:3/3 S:Mode$ Continuous | Affected$ Creature.Werewolf+Other+YouCtrl,Creature.Wolf+Other+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Other Werewolf and Wolf creatures you control get +1/+1. T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ At the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:TrigToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Wolf | TokenColors$ Green | TokenTypes$ Creature,Wolf | TokenOwner$ You | TokenPower$ 2 | TokenToughness$ 2 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/howlpack_alpha.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/howlpack_alpha.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/193b.jpg Oracle:Other Werewolf and Wolf creatures you control get +1/+1.\nAt the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack Alpha. End \ No newline at end of file diff --git a/res/cardsfolder/m/mondronen_shaman_tovolars_magehunter.txt b/res/cardsfolder/m/mondronen_shaman_tovolars_magehunter.txt index 5eff3194c02..fdcab8e279a 100644 --- a/res/cardsfolder/m/mondronen_shaman_tovolars_magehunter.txt +++ b/res/cardsfolder/m/mondronen_shaman_tovolars_magehunter.txt @@ -4,14 +4,12 @@ Types:Creature Human Werewolf Shaman Text:no text PT:3/2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/mondronen_shaman.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/98a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Mondronen Shaman. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Tovolar's Magehunter @@ -23,7 +21,8 @@ PT:5/5 T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever an opponent casts a spell, CARDNAME deals 2 damage to that player. SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ 2 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/tovolars_magehunter.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/tovolars_magehunter.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/98b.jpg Oracle:Whenever an opponent casts a spell, Tovolar's Magehunter deals 2 damage to that player.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Tovolar's Magehunter. End \ No newline at end of file diff --git a/res/cardsfolder/n/nezumi_graverobber_nighteyes_the_desecrator.txt b/res/cardsfolder/n/nezumi_graverobber_nighteyes_the_desecrator.txt index aedec20b668..75b19e55d24 100644 --- a/res/cardsfolder/n/nezumi_graverobber_nighteyes_the_desecrator.txt +++ b/res/cardsfolder/n/nezumi_graverobber_nighteyes_the_desecrator.txt @@ -22,7 +22,7 @@ Types:Legendary Creature Rat Wizard Text:no text PT:4/2 A:AB$ ChangeZone | Cost$ 4 B | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature. | SpellDescription$ Put target creature card from a graveyard onto the battlefield under your control. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/nighteyes_the_desecrator.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/nighteyes_the_desecrator.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/311.jpg #SetInfo:COM|Uncommon|http://magiccards.info/scans/en/cmd/92.jpg Oracle:{4}{B}: Put target creature card from a graveyard onto the battlefield under your control. diff --git a/res/cardsfolder/n/nezumi_shortfang_stabwhisker_the_odious.txt b/res/cardsfolder/n/nezumi_shortfang_stabwhisker_the_odious.txt index 03cf9859016..3b8cc52528e 100644 --- a/res/cardsfolder/n/nezumi_shortfang_stabwhisker_the_odious.txt +++ b/res/cardsfolder/n/nezumi_shortfang_stabwhisker_the_odious.txt @@ -24,7 +24,7 @@ SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ TriggeredPlayer | LifeAmount$ SVar:X:SVar$Z/Minus.Y SVar:Y:Count$InOppHand SVar:Z:Number$3 -SVar:Picture1:http://www.wizards.com/global/images/magic/general/stabwhisker_the_odious.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/stabwhisker_the_odious.jpg SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/312.jpg Oracle:At the beginning of each opponent's upkeep, that player loses 1 life for each card fewer than three in his or her hand. End \ No newline at end of file diff --git a/res/cardsfolder/n/nurturing_licid.txt b/res/cardsfolder/n/nurturing_licid.txt index 978607617c9..616e306dca7 100644 --- a/res/cardsfolder/n/nurturing_licid.txt +++ b/res/cardsfolder/n/nurturing_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ G T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/nurturing_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump A:AB$ Regenerate | Cost$ G | Defined$ Enchanted | SpellDescription$ Regenerate enchanted creature. A:AB$ SetState | Cost$ G | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/nurturing_licid.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/136.jpg +Oracle:{G}, {T}: Nurturing Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {G} to end this effect./n{G}: Regenerate enchanted creature. End \ No newline at end of file diff --git a/res/cardsfolder/o/orochi_eggwatcher_shidako_broodmistress.txt b/res/cardsfolder/o/orochi_eggwatcher_shidako_broodmistress.txt index d30f694bd5e..861f409439b 100644 --- a/res/cardsfolder/o/orochi_eggwatcher_shidako_broodmistress.txt +++ b/res/cardsfolder/o/orochi_eggwatcher_shidako_broodmistress.txt @@ -21,7 +21,7 @@ Text:no text PT:3/3 A:AB$Pump | Cost$ G Sac<1/Creature> | Tgt$ TgtC | NumAtt$ 3 | NumDef$ 3 | SpellDescription$ Target creature gets +3/+3 until end of turn. SVar:Rarity:Rare -SVar:Picture1:http://www.wizards.com/global/images/magic/general/shidako_broodmistress.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/shidako_broodmistress.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/316.jpg Oracle:{G}, Sacrifice a creature: Target creature gets +3/+3 until end of turn. End \ No newline at end of file diff --git a/res/cardsfolder/q/quickening_licid.txt b/res/cardsfolder/q/quickening_licid.txt index 1d7e58adb67..47de74ce8ad 100644 --- a/res/cardsfolder/q/quickening_licid.txt +++ b/res/cardsfolder/q/quickening_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ 1 W T | Defined$ Self | NewState$ Alternate | SubAbility$ SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/quickening_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ First Strike | Description$ Enchanted creature has first strike. A:AB$ SetState | Cost$ W | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/quickening_licid.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/248.jpg +Oracle:{1}{W}, {T}: Quickening Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect.\nEnchanted creature has first strike. End \ No newline at end of file diff --git a/res/cardsfolder/r/ravenous_demon_archdemon_of_greed.txt b/res/cardsfolder/r/ravenous_demon_archdemon_of_greed.txt index 4edff240074..de18ada2093 100644 --- a/res/cardsfolder/r/ravenous_demon_archdemon_of_greed.txt +++ b/res/cardsfolder/r/ravenous_demon_archdemon_of_greed.txt @@ -25,7 +25,7 @@ SVar:DBTap:DB$ Tap | Cost$ 0 | Defined$ Self | ConditionCheckSVar$ X | Condition SVar:DBDamage:DB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 9 | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1 | SubAbility$ DBCleanup SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True SVar:X:Remembered$Amount -SVar:Picture1:http://www.wizards.com/global/images/magic/general/archdemon_of_greed.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/archdemon_of_greed.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/71b.jpg Oracle:At the beginning of your upkeep, sacrifice a Human. If you can't, tap Archdemon of Greed and it deals 9 damage to you. End \ No newline at end of file diff --git a/res/cardsfolder/r/reckless_waif_merciless_predator.txt b/res/cardsfolder/r/reckless_waif_merciless_predator.txt index 64b96b5292c..4d469ea1a8b 100644 --- a/res/cardsfolder/r/reckless_waif_merciless_predator.txt +++ b/res/cardsfolder/r/reckless_waif_merciless_predator.txt @@ -4,14 +4,12 @@ Types:Creature Human Rogue Werewolf Text:no text PT:1/1 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/reckless_waif.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/159a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Reckless Waif. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Merciless Predator @@ -21,7 +19,8 @@ Types:Creature Werewolf Text:no text PT:3/2 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/merciless_predator.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/merciless_predator.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/159b.jpg Oracle:At the beginning of each upkeep, if a player cast two or more spells last turn, transform Merciless Predator. End \ No newline at end of file diff --git a/res/cardsfolder/r/rune_tail_kitsune_ascendant_rune_tails_essence.txt b/res/cardsfolder/r/rune_tail_kitsune_ascendant_rune_tails_essence.txt index bc03920b761..8453bf215b3 100644 --- a/res/cardsfolder/r/rune_tail_kitsune_ascendant_rune_tails_essence.txt +++ b/res/cardsfolder/r/rune_tail_kitsune_ascendant_rune_tails_essence.txt @@ -18,7 +18,7 @@ Colors:white Types:Legendary Enchantment Text:no text S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Prevent all damage that would be dealt to CARDNAME. | Description$ Prevent all damage that would be dealt to creatures you control. -SVar:Picture1:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/rune_tails_essence.jpg +SVar:Picture:http://www.marc-fowler-design.com/cardforge/flippedcards/SOK/rune_tails_essence.jpg # This link may be a temporary solution and could change in the near future. SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/166.jpg Oracle:Prevent all damage that would be dealt to creatures you control. diff --git a/res/cardsfolder/s/scorned_villager_moonscarred_werewolf.txt b/res/cardsfolder/s/scorned_villager_moonscarred_werewolf.txt index 7c420c65a67..c2acdc72f5f 100644 --- a/res/cardsfolder/s/scorned_villager_moonscarred_werewolf.txt +++ b/res/cardsfolder/s/scorned_villager_moonscarred_werewolf.txt @@ -5,14 +5,12 @@ Text:no text PT:1/1 A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add G to your mana pool. T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/scorned_villager.jpg SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/125a.jpg Oracle:{T}: Add {G} to your mana pool.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Scorned Villager. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Moonscarred Werewolf @@ -24,7 +22,8 @@ PT:2/2 K:Vigilance A:AB$ Mana | Cost$ T | Produced$ G | Amount$ 2 | SpellDescription$ Add G G to your mana pool. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/moonscarred_werewolf.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/moonscarred_werewolf.jpg SetInfo:DKA|Common|http://magiccards.info/scans/en/dka/125b.jpg Oracle:Vigilance\n{T}: Add {G}{G} to your mana pool.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Moonscarred Werewolf. End \ No newline at end of file diff --git a/res/cardsfolder/s/screeching_bat_stalking_vampire.txt b/res/cardsfolder/s/screeching_bat_stalking_vampire.txt index 7c7f34d855b..985914c9cb0 100644 --- a/res/cardsfolder/s/screeching_bat_stalking_vampire.txt +++ b/res/cardsfolder/s/screeching_bat_stalking_vampire.txt @@ -5,14 +5,12 @@ Text:no text PT:2/2 K:Flying T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may pay 2 B B. If you do, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 2 B B | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/screeching_bat.jpg Oracle:Flying\nAt the beginning of your upkeep, you may pay {2}{B}{B}. If you do, transform Screeching Bat.\n----\nStalking Vampire\n(Black)\nCreature - Vampire\n5/5\nAt the beginning of your upkeep, you may pay {2}{B}{B}. If you do, transform Stalking Vampire. SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/114a.jpg -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 2 B B | Defined$ Self | Mode$ Transform - ALTERNATE Name:Stalking Vampire @@ -22,7 +20,8 @@ Types:Creature Vampire Text:no text PT:5/5 T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may pay 2 B B. If you do, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/stalking_vampire.jpg +SVar:TrigTransform:AB$SetState | Cost$ 2 B B | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/stalking_vampire.jpg Oracle:Creature - Vampire\n5/5\nAt the beginning of your upkeep, you may pay {2}{B}{B}. If you do, transform Stalking Vampire. SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/114b.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/soul_seizer_ghastly_haunting.txt b/res/cardsfolder/s/soul_seizer_ghastly_haunting.txt index 74fb2d50bea..47958e74c12 100644 --- a/res/cardsfolder/s/soul_seizer_ghastly_haunting.txt +++ b/res/cardsfolder/s/soul_seizer_ghastly_haunting.txt @@ -22,7 +22,7 @@ Text:You control enchanted creature. K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ GainControl SVar:RemAIDeck:True -SVar:Picture1:http://www.wizards.com/global/images/magic/general/ghastly_haunting.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/ghastly_haunting.jpg SetInfo:DKA|Uncommon|http://magiccards.info/scans/en/dka/50b.jpg Oracle:Enchant creature\nYou control enchanted creature. End \ No newline at end of file diff --git a/res/cardsfolder/s/stinging_licid.txt b/res/cardsfolder/s/stinging_licid.txt index 58a627e74b6..cb35f0bd7fd 100644 --- a/res/cardsfolder/s/stinging_licid.txt +++ b/res/cardsfolder/s/stinging_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ 1 U T | Defined$ Self | NewState$ Alternate | SubAbility$ SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/stinging_licid.jpg @@ -27,5 +25,9 @@ A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Curse T:Mode$ Taps | ValidCard$ Card.AttachedBy | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever enchanted creature becomes tapped, CARDNAME deals 2 damage to that creature's controller. SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredCardController | NumDmg$ 2 A:AB$ SetState | Cost$ U | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/stinging_licid.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/91.jpg +Oracle:{1}{U}, {T}: Stinging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {U} to end this effect.\nWhenever enchanted creature becomes tapped, Stinging Licid deals 2 damage to that creature's controller. End \ No newline at end of file diff --git a/res/cardsfolder/s/student_of_elements_tobita_master_of_winds.txt b/res/cardsfolder/s/student_of_elements_tobita_master_of_winds.txt index 54100abff7f..a76d98ad20c 100644 --- a/res/cardsfolder/s/student_of_elements_tobita_master_of_winds.txt +++ b/res/cardsfolder/s/student_of_elements_tobita_master_of_winds.txt @@ -19,7 +19,7 @@ Types:Legendary Creature Human Wizard Text:no text PT:3/3 S:Mode$Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Flying | Description$ Creatures you control have flying. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/tobita_master_of_winds.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/tobita_master_of_winds.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/310.jpg Oracle:Creatures you control have flying. diff --git a/res/cardsfolder/t/tempting_licid.txt b/res/cardsfolder/t/tempting_licid.txt index 054a8d0fad3..50ba2dbc3c1 100644 --- a/res/cardsfolder/t/tempting_licid.txt +++ b/res/cardsfolder/t/tempting_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ G T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/tempting_licid.jpg @@ -26,5 +24,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ HIDDEN All creatures able to block CARDNAME do so. | Description$ All creatures able to block enchanted creature do so. A:AB$ SetState | Cost$ G | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/tempting_licid.jpg +SetInfo:STH|Uncommon|http://magiccards.info/scans/en/sh/72.jpg +Oracle:{G}, {T}: CARDNAME loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {G} to end this effect.\nAll creatures able to block enchanted creature do so. End \ No newline at end of file diff --git a/res/cardsfolder/t/thraben_sentry_thraben_militia.txt b/res/cardsfolder/t/thraben_sentry_thraben_militia.txt index c524d7b6dd6..4b46e3e46c9 100644 --- a/res/cardsfolder/t/thraben_sentry_thraben_militia.txt +++ b/res/cardsfolder/t/thraben_sentry_thraben_militia.txt @@ -20,7 +20,7 @@ Types:Creature Human Soldier Text:no text PT:5/4 K:Trample -SVar:Picture1:http://www.wizards.com/global/images/magic/general/thraben_militia.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/thraben_militia.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/38b.jpg Oracle:Trample End \ No newline at end of file diff --git a/res/cardsfolder/t/tormented_pariah_rampaging_werewolf.txt b/res/cardsfolder/t/tormented_pariah_rampaging_werewolf.txt index b30c006f6a4..65beba840a1 100644 --- a/res/cardsfolder/t/tormented_pariah_rampaging_werewolf.txt +++ b/res/cardsfolder/t/tormented_pariah_rampaging_werewolf.txt @@ -4,14 +4,12 @@ Types:Creature Human Warrior Werewolf Text:no text PT:3/2 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/tormented_pariah.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/165a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Tormented Pariah. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Rampaging Werewolf @@ -21,7 +19,8 @@ Types:Creature Werewolf Text:no text PT:6/4 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/rampaging_werewolf.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/rampaging_werewolf.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/165b.jpg Oracle:At the beginning of each upkeep, if a player cast two or more spells last turn, transform Rampaging Werewolf. End \ No newline at end of file diff --git a/res/cardsfolder/t/transmogrifying_licid.txt b/res/cardsfolder/t/transmogrifying_licid.txt index 7e4a395447d..103b0de3ced 100644 --- a/res/cardsfolder/t/transmogrifying_licid.txt +++ b/res/cardsfolder/t/transmogrifying_licid.txt @@ -7,8 +7,6 @@ A:AB$ SetState | Cost$ 1 T | Defined$ Self | NewState$ Alternate | SubAbility$ D SVar:DBAttach:DB$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump #If the value of AlternateMode isn't Flip or DoubleFaced, it will be the name of the state defined below, so you can switch to it with SetState+NewState$.The name of the first state defined is always "Original". AlternateMode:Alternate - -#Shared SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/transmogrifying_licid.jpg @@ -25,5 +23,9 @@ K:Enchant creature A:SP$ Attach | Cost$ 0 | ValidTgts$ Creature | AILogic$ Pump S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddPower$ 1 | AddToughness$ 1 | AddType$ Artifact | Description$ Enchanted creature gets +1/+1 and is an artifact in addition to its other types. A:AB$ SetState | Cost$ 1 | Defined$ Self | NewState$ Original | SpellDescription$ End this effect. - +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/transmogrifying_licid.jpg +SetInfo:EXO|Uncommon|http://magiccards.info/scans/en/ex/141.jpg +Oracle:{1}, {T}: Transmogrifying Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {1} to end this effect.\nEnchanted creature gets +1/+1 and is an artifact in addition to its other types. End \ No newline at end of file diff --git a/res/cardsfolder/u/ulvenwald_mystics_ulvenwald_primordials.txt b/res/cardsfolder/u/ulvenwald_mystics_ulvenwald_primordials.txt index 412cf342dbf..90b590d88f4 100644 --- a/res/cardsfolder/u/ulvenwald_mystics_ulvenwald_primordials.txt +++ b/res/cardsfolder/u/ulvenwald_mystics_ulvenwald_primordials.txt @@ -4,14 +4,12 @@ Types:Creature Human Shaman Werewolf Text:no text PT:3/3 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform SVar:Picture:http://www.wizards.com/global/images/magic/general/ulvenwald_mystics.jpg AlternateMode:DoubleFaced SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/208a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Ulvenwald Mystics. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Ulvenwald Primordials @@ -22,7 +20,8 @@ Text:no text PT:5/5 A:AB$ Regenerate | Cost$ G | SpellDescription$ Regenerate CARDNAME. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/ulvenwald_primordials.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/ulvenwald_primordials.jpg SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/208b.jpg Oracle:{G}: Regenerate Ulvenwald Primordials.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Ulvenwald Primordials. End \ No newline at end of file diff --git a/res/cardsfolder/v/village_ironsmith_ironfang.txt b/res/cardsfolder/v/village_ironsmith_ironfang.txt index 0653aef41f4..850129b649d 100644 --- a/res/cardsfolder/v/village_ironsmith_ironfang.txt +++ b/res/cardsfolder/v/village_ironsmith_ironfang.txt @@ -5,14 +5,12 @@ Text:no text PT:1/1 K:First Strike T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/village_ironsmith.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/168a.jpg Oracle:First Strike\nAt the beginning of each upkeep, if no spells were cast last turn, transform Village Ironsmith. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Ironfang @@ -23,7 +21,8 @@ Text:no text PT:3/1 K:First Strike T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/ironfang.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/ironfang.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/168b.jpg Oracle:First Strike\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Ironfang. End \ No newline at end of file diff --git a/res/cardsfolder/v/villagers_of_estwald_howlpack_of_estwald.txt b/res/cardsfolder/v/villagers_of_estwald_howlpack_of_estwald.txt index 81f774b7194..d6d93a7891f 100644 --- a/res/cardsfolder/v/villagers_of_estwald_howlpack_of_estwald.txt +++ b/res/cardsfolder/v/villagers_of_estwald_howlpack_of_estwald.txt @@ -4,14 +4,12 @@ Types:Creature Human Werewolf Text:no text PT:2/3 T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/villagers_of_estwald.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/209a.jpg Oracle:At the beginning of each upkeep, if no spells were cast last turn, transform Villagers of Estwald. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Howlpack of Estwald @@ -21,7 +19,8 @@ Types:Creature Werewolf Text:no text PT:4/6 T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/howlpack_of_estwald.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/howlpack_of_estwald.jpg SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/209b.jpg Oracle:At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack of Estwald. End \ No newline at end of file diff --git a/res/cardsfolder/w/wolfbitten_captive_krallenhorde_killer.txt b/res/cardsfolder/w/wolfbitten_captive_krallenhorde_killer.txt index dc025b0bc47..c77a98dea45 100644 --- a/res/cardsfolder/w/wolfbitten_captive_krallenhorde_killer.txt +++ b/res/cardsfolder/w/wolfbitten_captive_krallenhorde_killer.txt @@ -5,14 +5,12 @@ Text:no text PT:1/1 A:AB$ Pump | Cost$ 1 G | NumAtt$ +2 | NumDef$ +2 | ActivationLimit$ 1 | SpellDescription$ CARDNAME gets +2/+2 until end of turn. Activate this ability only once each turn. T:Mode$Phase | Phase$ Upkeep | WerewolfTransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAME. +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform AlternateMode:DoubleFaced SVar:Picture:http://www.wizards.com/global/images/magic/general/wolfbitten_captive.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/133a.jpg Oracle:{1}{G}: Wolfbitten Captive gets +2/+2 until end of turn. Activate this ability only once each turn.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Wolfbitten Captive. -#Shared -SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform - ALTERNATE Name:Krallenhorde Killer @@ -23,7 +21,8 @@ Text:no text PT:2/2 A:AB$ Pump | Cost$ 3 G | NumAtt$ +4 | NumDef$ +4 | ActivationLimit$ 1 | SpellDescription$ CARDNAME gets +4/+4 until end of turn. Activate this ability only once each turn. T:Mode$Phase | Phase$ Upkeep | WerewolfUntransformCondition$ True | TriggerZones$ Battlefield | Execute$ TrigTransform | TriggerDescription$ At the beginning of each upkeep, if a player cast two or more spells last turn, transform CARDNAME. -SVar:Picture1:http://www.wizards.com/global/images/magic/general/krallenhorde_killer.jpg +SVar:TrigTransform:AB$SetState | Cost$ 0 | Defined$ Self | Mode$ Transform +SVar:Picture:http://www.wizards.com/global/images/magic/general/krallenhorde_killer.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/133b.jpg Oracle:{3}{G}: Krallenhorde Killer gets +4/+4 until end of turn. Activate this ability only once each turn.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Killer. End \ No newline at end of file From 1698b9b1cb94762ae17a2cd7ab8065b59ef47a60 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Fri, 1 Jun 2012 04:30:58 +0000 Subject: [PATCH 05/29] Updated Animate AF to handle cards with multiple states. --- src/main/java/forge/Card.java | 80 ++++ .../abilityfactory/AbilityFactoryAnimate.java | 394 ++++++------------ 2 files changed, 207 insertions(+), 267 deletions(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 8f28571062d..a128a7f8ffb 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -664,6 +664,27 @@ public class Card extends GameEntity implements Comparable { return newtrig; } + /** + *

+ * addTrigger. + *

+ * + * @param t + * a {@link forge.card.trigger.Trigger} object. + * + * @param state + * a {@link forge.CardCharactersticName} object. + * + * @return a {@link forge.card.trigger.Trigger} object. + */ + public final Trigger addTrigger(final Trigger t, final CardCharactersticName state) { + final Trigger newtrig = t.getCopy(); + newtrig.setHostCard(this); + CardCharacteristics stateCharacteristics = this.getState(state); + stateCharacteristics.getTriggers().add(newtrig); + return newtrig; + } + /** * * moveTrigger. @@ -690,6 +711,22 @@ public class Card extends GameEntity implements Comparable { this.getCharacteristics().getTriggers().remove(t); } + /** + *

+ * removeTrigger. + *

+ * + * @param t + * a {@link forge.card.trigger.Trigger} object. + * + * @param state + * a {@link forge.CardCharactersticName} object. + */ + public final void removeTrigger(final Trigger t, final CardCharactersticName state) { + CardCharacteristics stateCharacteristics = this.getState(state); + stateCharacteristics.getTriggers().remove(t); + } + /** *

* Getter for the field triggers. @@ -2754,6 +2791,27 @@ public class Card extends GameEntity implements Comparable { } } + /** + *

+ * addSpellAbility. + *

+ * + * @param a + * a {@link forge.card.spellability.SpellAbility} object. + * + * @param state + * a {@link forge.CardCharactersticName} object. + */ + public final void addSpellAbility(final SpellAbility a, final CardCharactersticName state) { + a.setSourceCard(this); + CardCharacteristics stateCharacteristics = this.getState(state); + if (a instanceof AbilityMana) { + stateCharacteristics.getManaAbility().add((AbilityMana) a); + } else { + stateCharacteristics.getSpellAbility().add(a); + } + } + /** *

* removeSpellAbility. @@ -2772,6 +2830,28 @@ public class Card extends GameEntity implements Comparable { } } + /** + *

+ * removeSpellAbility. + *

+ * + * @param a + * a {@link forge.card.spellability.SpellAbility} object. + * + * @param state + * a {@link forge.CardCharactersticName} object. + */ + public final void removeSpellAbility(final SpellAbility a, final CardCharactersticName state) { + CardCharacteristics stateCharacteristics = this.getState(state); + if (a instanceof AbilityMana) { + // if (a.isExtrinsic()) //never remove intrinsic mana abilities, is + // this the way to go?? + stateCharacteristics.getManaAbility().remove(a); + } else { + stateCharacteristics.getSpellAbility().remove(a); + } + } + /** *

* removeAllExtrinsicManaAbilities. diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java index 72d164c45b3..ac2fe5537c7 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java @@ -26,6 +26,7 @@ import java.util.Map; import forge.AllZone; import forge.AllZoneUtil; import forge.Card; +import forge.CardCharactersticName; import forge.CardList; import forge.CardUtil; import forge.Command; @@ -481,14 +482,38 @@ public final class AbilityFactoryAnimate { private static void animateResolve(final AbilityFactory af, final SpellAbility sa) { final HashMap params = af.getMapParams(); final Card source = sa.getSourceCard(); - final Card host = sa.getSourceCard(); - final Map svars = host.getSVars(); + final Target tgt = sa.getTarget(); + ArrayList tgts; + if (tgt != null) { + tgts = tgt.getTargetCards(); + } else { + tgts = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa); + } + + animateList(af, sa, tgts.toArray()); + + } // animateResolve + + /** + *

+ * animateList. + *

+ * + * @param af + * a {@link forge.card.abilityfactory.AbilityFactory} object. + * @param sa + * a {@link forge.card.spellability.SpellAbility} object. + */ + private static void animateList(final AbilityFactory af, final SpellAbility sa, final Object[] tgts) { + final HashMap params = af.getMapParams(); + final Card source = sa.getSourceCard(); + final Map svars = source.getSVars(); long timest = -1; String animateRemembered = null; //if host is not on the battlefield don't apply if (params.containsKey("UntilHostLeavesPlay") - && !AllZoneUtil.isCardInPlay(sa.getSourceCard())) { + && !AllZoneUtil.isCardInPlay(source)) { return; } @@ -500,11 +525,11 @@ public final class AbilityFactoryAnimate { // AF specific params int power = -1; if (params.containsKey("Power")) { - power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); + power = AbilityFactory.calculateAmount(source, params.get("Power"), sa); } int toughness = -1; if (params.containsKey("Toughness")) { - toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); + toughness = AbilityFactory.calculateAmount(source, params.get("Toughness"), sa); } // Every Animate event needs a unique time stamp @@ -527,7 +552,7 @@ public final class AbilityFactoryAnimate { // allow ChosenType - overrides anything else specified if (types.contains("ChosenType")) { types.clear(); - types.add(host.getChosenType()); + types.add(source.getChosenType()); } final ArrayList keywords = new ArrayList(); @@ -559,7 +584,7 @@ public final class AbilityFactoryAnimate { final String colors = params.get("Colors"); if (colors.equals("ChosenColor")) { - tmpDesc = CardUtil.getShortColorsString(host.getChosenColor()); + tmpDesc = CardUtil.getShortColorsString(source.getChosenColor()); } else { tmpDesc = CardUtil.getShortColorsString(new ArrayList(Arrays.asList(colors.split(",")))); } @@ -590,102 +615,121 @@ public final class AbilityFactoryAnimate { sVars.addAll(Arrays.asList(params.get("sVars").split(","))); } - final Target tgt = sa.getTarget(); - ArrayList tgts; - if (tgt != null) { - tgts = tgt.getTargetCards(); - } else { - tgts = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa); - } + for (final Object obj : tgts) { - for (final Card c : tgts) { + if (!(obj instanceof Card)) { + continue; + } + + final Card c = (Card) obj; final long colorTimestamp = AbilityFactoryAnimate.doAnimate(c, af, power, toughness, types, removeTypes, finalDesc, keywords, removeKeywords, hiddenKeywords, timestamp); + // remove abilities + final Map> removedAbilities = + new HashMap>(); + if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { + for (final CardCharactersticName state : c.getStates()) { + ArrayList removed = new ArrayList(); + for (final SpellAbility ab : c.getState(state).getSpellAbility()) { + removed.add(ab); + } + c.getState(state).getSpellAbility().clear(); + for (final SpellAbility ab : c.getState(state).getManaAbility()) { + removed.add(ab); + } + c.getState(state).getManaAbility().clear(); + removedAbilities.put(state, removed); + } + } + // give abilities final ArrayList addedAbilities = new ArrayList(); if (abilities.size() > 0) { for (final String s : abilities) { final AbilityFactory newAF = new AbilityFactory(); - final String actualAbility = host.getSVar(s); + final String actualAbility = source.getSVar(s); final SpellAbility grantedAbility = newAF.getAbility(actualAbility, c); addedAbilities.add(grantedAbility); - c.addSpellAbility(grantedAbility); - } - } - - // remove abilities - final ArrayList removedAbilities = new ArrayList(); - if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { - for (final SpellAbility ab : c.getSpellAbilities()) { - if (ab.isAbility()) { - c.removeSpellAbility(ab); - removedAbilities.add(ab); + for (final CardCharactersticName state : c.getStates()) { + c.addSpellAbility(grantedAbility, state); } } } - // Grant triggers - final ArrayList addedTriggers = new ArrayList(); - if (triggers.size() > 0) { - for (final String s : triggers) { - final String actualTrigger = host.getSVar(s); - final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); - addedTriggers.add(c.addTrigger(parsedTrigger)); - } - } - // suppress triggers from the animated card final ArrayList removedTriggers = new ArrayList(); if (params.containsKey("OverwriteTriggers") || params.containsKey("RemoveAllAbilities")) { - final List triggersToRemove = c.getTriggers(); - for (final Trigger trigger : triggersToRemove) { - trigger.setSuppressed(true); - removedTriggers.add(trigger); + for (final CardCharactersticName state : c.getStates()) { + for (final Trigger trigger : c.getState(state).getTriggers()) { + trigger.setSuppressed(true); + removedTriggers.add(trigger); + } } } - // give static abilities (should only be used by cards to give - // itself a static ability) - if (stAbs.size() > 0) { - for (final String s : stAbs) { - final String actualAbility = host.getSVar(s); - c.addStaticAbility(actualAbility); - } - } - - // give sVars - if (sVars.size() > 0) { - for (final String s : sVars) { - final String actualsVar = host.getSVar(s); - c.setSVar(s, actualsVar); + // Grant triggers + final Map> addedTriggers = + new HashMap>(); + if (triggers.size() > 0) { + for (final CardCharactersticName state : c.getStates()) { + ArrayList added = new ArrayList(); + for (final String s : triggers) { + final String actualTrigger = source.getSVar(s); + final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); + added.add(c.addTrigger(parsedTrigger, state)); + } + addedTriggers.put(state, added); } } // suppress static abilities from the animated card final ArrayList removedStatics = new ArrayList(); if (params.containsKey("OverwriteStatics") || params.containsKey("RemoveAllAbilities")) { - final ArrayList staticsToRemove = c.getStaticAbilities(); - for (final StaticAbility stAb : staticsToRemove) { - stAb.setTemporarilySuppressed(true); - removedStatics.add(stAb); + for (final CardCharactersticName state : c.getStates()) { + for (final StaticAbility stAb : c.getState(state).getStaticAbilities()) { + stAb.setTemporarilySuppressed(true); + removedStatics.add(stAb); + } } } // suppress static abilities from the animated card final ArrayList removedReplacements = new ArrayList(); if (params.containsKey("OverwriteReplacements") || params.containsKey("RemoveAllAbilities")) { - final ArrayList replacementsToRemove = c.getReplacementEffects(); - for (final ReplacementEffect re : replacementsToRemove) { - re.setTemporarilySuppressed(true); - removedReplacements.add(re); + for (final CardCharactersticName state : c.getStates()) { + for (final ReplacementEffect re : c.getState(state).getReplacementEffects()) { + re.setTemporarilySuppressed(true); + removedReplacements.add(re); + } + } + } + + // give static abilities (should only be used by cards to give + // itself a static ability) + // TODO loop over states + if (stAbs.size() > 0) { + for (final String s : stAbs) { + final String actualAbility = source.getSVar(s); + c.addStaticAbility(actualAbility); + } + } + + // give sVars + // TODO loop over states and keep a list + if (sVars.size() > 0) { + for (final String s : sVars) { + final String actualsVar = source.getSVar(s); + for (final CardCharactersticName state : c.getStates()) { + c.getState(state).setSVar(s, actualsVar); + } } } // give Remembered if (animateRemembered != null) { - for (final Object o : AbilityFactory.getDefinedObjects(host, animateRemembered, sa)) { + for (final Object o : AbilityFactory.getDefinedObjects(source, animateRemembered, sa)) { c.addRemembered(o); } } @@ -721,9 +765,9 @@ public final class AbilityFactoryAnimate { if (params.containsKey("UntilEndOfCombat")) { AllZone.getEndOfCombat().addUntil(unanimate); } else if (params.containsKey("UntilHostLeavesPlay")) { - host.addLeavesPlayCommand(unanimate); + source.addLeavesPlayCommand(unanimate); } else if (params.containsKey("UntilYourNextUpkeep")) { - Singletons.getModel().getGameState().getUpkeep().addUntil(host.getController(), unanimate); + Singletons.getModel().getGameState().getUpkeep().addUntil(source.getController(), unanimate); } else if (params.containsKey("UntilControllerNextUntap")) { Singletons.getModel().getGameState().getUntap().addUntil(c.getController(), unanimate); } else { @@ -731,7 +775,7 @@ public final class AbilityFactoryAnimate { } } } - } // animateResolve + } // animateList /** *

@@ -834,15 +878,15 @@ public final class AbilityFactoryAnimate { * a {@link java.util.ArrayList} object. * @param addedAbilities * a {@link java.util.ArrayList} object. - * @param addedTriggers + * @param addedTriggers.keySet() * a {@link java.util.ArrayList} object. * @param timestamp * a long. */ private static void doUnanimate(final Card c, final AbilityFactory af, final String colorDesc, final ArrayList addedKeywords, final ArrayList addedAbilities, - final ArrayList addedTriggers, final long colorTimestamp, final boolean givesStAbs, - final ArrayList removedAbilities, final long timestamp) { + final Map> addedTriggers, final long colorTimestamp, final boolean givesStAbs, + final Map> removedAbilities, final long timestamp) { final HashMap params = af.getMapParams(); c.removeNewPT(timestamp); @@ -850,6 +894,7 @@ public final class AbilityFactoryAnimate { c.removeChangedCardKeywords(timestamp); // remove all static abilities + // TODO what if the card has static abilities already??? if (givesStAbs) { c.setStaticAbilities(new ArrayList()); } @@ -866,15 +911,21 @@ public final class AbilityFactoryAnimate { } for (final SpellAbility sa : addedAbilities) { - c.removeSpellAbility(sa); + for (final CardCharactersticName state : c.getStates()) { + c.removeSpellAbility(sa, state); + } } - for (final SpellAbility sa : removedAbilities) { - c.addSpellAbility(sa); + for (final CardCharactersticName state : removedAbilities.keySet()) { + for (final SpellAbility sa : removedAbilities.get(state)) { + c.addSpellAbility(sa, state); + } } - for (final Trigger t : addedTriggers) { - c.removeTrigger(t); + for (final CardCharactersticName state : addedTriggers.keySet()) { + for (final Trigger t : addedTriggers.get(state)) { + c.removeTrigger(t, state); + } } // any other unanimate cleanup @@ -1114,89 +1165,6 @@ public final class AbilityFactoryAnimate { private static void animateAllResolve(final AbilityFactory af, final SpellAbility sa) { final HashMap params = af.getMapParams(); final Card host = sa.getSourceCard(); - final Map svars = host.getSVars(); - long timest = -1; - - // AF specific params - int power = -1; - if (params.containsKey("Power")) { - power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); - } - int toughness = -1; - if (params.containsKey("Toughness")) { - toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); - } - - // Every Animate event needs a unique time stamp - timest = AllZone.getNextTimestamp(); - - final long timestamp = timest; - - final boolean permanent = params.containsKey("Permanent"); - - final ArrayList types = new ArrayList(); - if (params.containsKey("Types")) { - types.addAll(Arrays.asList(params.get("Types").split(","))); - } - - final ArrayList removeTypes = new ArrayList(); - if (params.containsKey("RemoveTypes")) { - removeTypes.addAll(Arrays.asList(params.get("RemoveTypes").split(","))); - } - - // allow ChosenType - overrides anything else specified - if (types.contains("ChosenType")) { - types.clear(); - types.add(host.getChosenType()); - } - - final ArrayList keywords = new ArrayList(); - if (params.containsKey("Keywords")) { - keywords.addAll(Arrays.asList(params.get("Keywords").split(" & "))); - } - - final ArrayList hiddenKeywords = new ArrayList(); - if (params.containsKey("HiddenKeywords")) { - hiddenKeywords.addAll(Arrays.asList(params.get("HiddenKeywords").split(" & "))); - } - // allow SVar substitution for keywords - for (int i = 0; i < keywords.size(); i++) { - final String k = keywords.get(i); - if (svars.containsKey(k)) { - keywords.add(svars.get(k)); - keywords.remove(k); - } - } - - // colors to be added or changed to - String tmpDesc = ""; - if (params.containsKey("Colors")) { - final String colors = params.get("Colors"); - if (colors.equals("ChosenColor")) { - tmpDesc = CardUtil.getShortColorsString(host.getChosenColor()); - } else { - tmpDesc = CardUtil.getShortColorsString(new ArrayList(Arrays.asList(colors.split(",")))); - } - } - final String finalDesc = tmpDesc; - - // abilities to add to the animated being - final ArrayList abilities = new ArrayList(); - if (params.containsKey("Abilities")) { - abilities.addAll(Arrays.asList(params.get("Abilities").split(","))); - } - - // triggers to add to the animated being - final ArrayList triggers = new ArrayList(); - if (params.containsKey("Triggers")) { - triggers.addAll(Arrays.asList(params.get("Triggers").split(","))); - } - - // sVars to add to the animated being - final ArrayList sVars = new ArrayList(); - if (params.containsKey("sVars")) { - sVars.addAll(Arrays.asList(params.get("sVars").split(","))); - } String valid = ""; @@ -1222,116 +1190,8 @@ public final class AbilityFactoryAnimate { } list = list.getValidCards(valid.split(","), host.getController(), host); + animateList(af, sa, list.toArray()); - for (final Card c : list) { - - final long colorTimestamp = AbilityFactoryAnimate.doAnimate(c, af, power, toughness, types, removeTypes, - finalDesc, keywords, null, hiddenKeywords, timestamp); - - // give abilities - final ArrayList addedAbilities = new ArrayList(); - if (abilities.size() > 0) { - for (final String s : abilities) { - final AbilityFactory newAF = new AbilityFactory(); - final String actualAbility = host.getSVar(s); - final SpellAbility grantedAbility = newAF.getAbility(actualAbility, c); - addedAbilities.add(grantedAbility); - c.addSpellAbility(grantedAbility); - } - } - - // remove abilities - final ArrayList removedAbilities = new ArrayList(); - if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { - for (final SpellAbility ab : c.getSpellAbilities()) { - if (ab.isAbility()) { - c.removeSpellAbility(ab); - removedAbilities.add(ab); - } - } - } - - // Grant triggers - final ArrayList addedTriggers = new ArrayList(); - if (triggers.size() > 0) { - for (final String s : triggers) { - final String actualTrigger = host.getSVar(s); - final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); - addedTriggers.add(c.addTrigger(parsedTrigger)); - } - } - - // suppress triggers from the animated card - final ArrayList removedTriggers = new ArrayList(); - if (params.containsKey("OverwriteTriggers") || params.containsKey("RemoveAllAbilities")) { - final List triggersToRemove = c.getTriggers(); - for (final Trigger trigger : triggersToRemove) { - trigger.setSuppressed(true); - removedTriggers.add(trigger); - } - } - - // suppress static abilities from the animated card - final ArrayList removedStatics = new ArrayList(); - if (params.containsKey("OverwriteStatics") || params.containsKey("RemoveAllAbilities")) { - final ArrayList staticsToRemove = c.getStaticAbilities(); - for (final StaticAbility stAb : staticsToRemove) { - stAb.setTemporarilySuppressed(true); - removedStatics.add(stAb); - } - } - - // suppress static abilities from the animated card - final ArrayList removedReplacements = new ArrayList(); - if (params.containsKey("OverwriteReplacements") || params.containsKey("RemoveAllAbilities")) { - final ArrayList replacementsToRemove = c.getReplacementEffects(); - for (final ReplacementEffect re : replacementsToRemove) { - re.setTemporarilySuppressed(true); - removedReplacements.add(re); - } - } - - // give sVars - if (sVars.size() > 0) { - for (final String s : sVars) { - final String actualsVar = host.getSVar(s); - c.setSVar(s, actualsVar); - } - } - - final Command unanimate = new Command() { - private static final long serialVersionUID = -5861759814760561373L; - - @Override - public void execute() { - AbilityFactoryAnimate.doUnanimate(c, af, finalDesc, hiddenKeywords, addedAbilities, addedTriggers, - colorTimestamp, false, removedAbilities, timestamp); - - // give back suppressed triggers - for (final Trigger t : removedTriggers) { - t.setSuppressed(false); - } - - // give back suppressed static abilities - for (final StaticAbility s : removedStatics) { - s.setTemporarilySuppressed(false); - } - - // give back suppressed replacement effects - for (final ReplacementEffect re : removedReplacements) { - re.setTemporarilySuppressed(false); - } - } - }; - - if (!permanent) { - if (params.containsKey("UntilEndOfCombat")) { - AllZone.getEndOfCombat().addUntil(unanimate); - } else { - AllZone.getEndOfTurn().addUntil(unanimate); - } - } - } } // animateAllResolve } // end class AbilityFactoryAnimate From ec9ce707834ec32e6ba677a79b0d8c5f9cfdd920 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 2 Jun 2012 03:12:14 +0000 Subject: [PATCH 06/29] Updated Animate AF to cleanup added SVars and static abilities. --- src/main/java/forge/Card.java | 24 +++++++++ .../abilityfactory/AbilityFactoryAnimate.java | 54 ++++++++++++------- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index a128a7f8ffb..c891f7d6a58 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -5584,6 +5584,30 @@ public class Card extends GameEntity implements Comparable { } } + /** + * Adds the static ability. + * + * @param s + * the s + * + * @param state + * a {@link forge.CardCharactersticName} object. + * + * @return a {@link forge.card.staticability.StaticAbility} object. + */ + public final StaticAbility addStaticAbility(final String s, final CardCharactersticName state) { + + if (s.trim().length() != 0) { + final StaticAbility stAb = new StaticAbility(s, this); + CardCharacteristics stateCharacteristics = this.getState(state); + stateCharacteristics.getStaticAbilities().add(stAb); + return stAb; + } + else { + return null; + } + } + /** *

* isPermanent. diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java index ac2fe5537c7..21baca469fb 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java @@ -20,7 +20,6 @@ package forge.card.abilityfactory; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; import forge.AllZone; @@ -31,6 +30,7 @@ import forge.CardList; import forge.CardUtil; import forge.Command; import forge.Singletons; +import forge.card.CardCharacteristics; import forge.card.replacement.ReplacementEffect; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilitySub; @@ -708,22 +708,29 @@ public final class AbilityFactoryAnimate { // give static abilities (should only be used by cards to give // itself a static ability) - // TODO loop over states + final Map> addedStatics = + new HashMap>(); if (stAbs.size() > 0) { - for (final String s : stAbs) { - final String actualAbility = source.getSVar(s); - c.addStaticAbility(actualAbility); + for (final CardCharactersticName state : c.getStates()) { + ArrayList added = new ArrayList(); + for (final String s : stAbs) { + final String actualAbility = source.getSVar(s); + added.add(c.addStaticAbility(actualAbility, state)); + } + addedStatics.put(state, added); } } // give sVars - // TODO loop over states and keep a list + // This could potentially overwrite an existing SVar!!! + final ArrayList addedSVars = new ArrayList(); if (sVars.size() > 0) { for (final String s : sVars) { final String actualsVar = source.getSVar(s); for (final CardCharactersticName state : c.getStates()) { c.getState(state).setSVar(s, actualsVar); } + addedSVars.add(s); } } @@ -734,15 +741,13 @@ public final class AbilityFactoryAnimate { } } - final boolean givesStAbs = (stAbs.size() > 0); - final Command unanimate = new Command() { private static final long serialVersionUID = -5861759814760561373L; @Override public void execute() { AbilityFactoryAnimate.doUnanimate(c, af, finalDesc, hiddenKeywords, addedAbilities, addedTriggers, - colorTimestamp, givesStAbs, removedAbilities, timestamp); + colorTimestamp, addedStatics, addedSVars, removedAbilities, timestamp); // give back suppressed triggers for (final Trigger t : removedTriggers) { @@ -885,7 +890,8 @@ public final class AbilityFactoryAnimate { */ private static void doUnanimate(final Card c, final AbilityFactory af, final String colorDesc, final ArrayList addedKeywords, final ArrayList addedAbilities, - final Map> addedTriggers, final long colorTimestamp, final boolean givesStAbs, + final Map> addedTriggers, final long colorTimestamp, + final Map> addedStatics, final ArrayList addedSVars, final Map> removedAbilities, final long timestamp) { final HashMap params = af.getMapParams(); @@ -893,13 +899,7 @@ public final class AbilityFactoryAnimate { c.removeChangedCardKeywords(timestamp); - // remove all static abilities - // TODO what if the card has static abilities already??? - if (givesStAbs) { - c.setStaticAbilities(new ArrayList()); - } - - if (params.containsKey("Types") || params.containsKey("RemoveTypes") + if (params.containsKey("Types") || params.containsKey("RemoveTypes") || params.containsKey("RemoveCreatureTypes")) { c.removeChangedCardTypes(timestamp); } @@ -910,24 +910,40 @@ public final class AbilityFactoryAnimate { c.removeExtrinsicKeyword(k); } - for (final SpellAbility sa : addedAbilities) { - for (final CardCharactersticName state : c.getStates()) { + for (final CardCharactersticName state : c.getStates()) { + final CardCharacteristics stateCharacteristics = c.getState(state); + // removed added SVars + for (final String s : addedSVars) { + stateCharacteristics.getSVars().remove(s); + } + // removed added abilities + for (final SpellAbility sa : addedAbilities) { c.removeSpellAbility(sa, state); } } + // add back removed abilities for (final CardCharactersticName state : removedAbilities.keySet()) { for (final SpellAbility sa : removedAbilities.get(state)) { c.addSpellAbility(sa, state); } } + // remove added triggers for (final CardCharactersticName state : addedTriggers.keySet()) { for (final Trigger t : addedTriggers.get(state)) { c.removeTrigger(t, state); } } + // remove added static abilities + for (final CardCharactersticName state : addedStatics.keySet()) { + CardCharacteristics stateCharacteristics = c.getState(state); + for (final StaticAbility stAb : addedStatics.get(state)) { + stateCharacteristics.getStaticAbilities().remove(stAb); + } + } + // any other unanimate cleanup if (!c.isCreature()) { c.unEquipAllCards(); From 0009e954a8fe16d71cf28e51cad4fb21452223b1 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 14 Jun 2012 23:35:58 +0000 Subject: [PATCH 07/29] added support for adding additional characteristics. started converting clones to scripts. --- res/cardsfolder/c/clone.txt | 6 +- res/cardsfolder/e/evil_twin.txt | 7 +- res/cardsfolder/j/jwari_shapeshifter.txt | 6 +- res/cardsfolder/p/phantasmal_image.txt | 8 +- res/cardsfolder/p/phyrexian_metamorph.txt | 6 +- res/cardsfolder/q/quicksilver_gargantuan.txt | 6 +- .../java/forge/card/CardCharacteristics.java | 2 +- .../abilityfactory/AbilityFactoryClone.java | 83 ++++++++++++++++++- .../cardfactory/CardFactoryCreatures.java | 12 ++- 9 files changed, 122 insertions(+), 14 deletions(-) diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index a7c7d659a52..b9bdc335961 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -1,8 +1,12 @@ Name:Clone ManaCost:3 U Types:Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index 4a1d6e43490..fd7d3477b1f 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -1,8 +1,13 @@ Name:Evil Twin ManaCost:2 U B Types:Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddAbilities$ EvilTwin | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/212.jpg diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index 260cbc93e2d..33c57f5c9b3 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -1,8 +1,12 @@ Name:Jwari Shapeshifter ManaCost:1 U Types:Creature Shapeshifter Ally -Text:You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index 8841a557185..55f78eece9c 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -1,8 +1,14 @@ Name:Phantasmal Image ManaCost:1 U Types:Creature Illusion -Text:You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Illusion | AddTriggers$ TgtTrig | AddSVars$ TrigSac | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:TgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. +SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index 6c94f4e3d72..4c54c3364bc 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -1,8 +1,12 @@ Name:Phyrexian Metamorph ManaCost:3 PU Types:Artifact Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Artifact | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index 32b3d082d55..e9d8d3904d0 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -1,8 +1,12 @@ Name:Quicksilver Gargantuan ManaCost:5 U U Types:Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. +Text:no text PT:7/7 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SetPower$ 7 | SetToughness$ 7 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg diff --git a/src/main/java/forge/card/CardCharacteristics.java b/src/main/java/forge/card/CardCharacteristics.java index a84fa7e5dbd..509cc439d63 100644 --- a/src/main/java/forge/card/CardCharacteristics.java +++ b/src/main/java/forge/card/CardCharacteristics.java @@ -391,7 +391,7 @@ public class CardCharacteristics { public void setReplacementEffects(ArrayList replacementEffects0) { this.replacementEffects = replacementEffects0; } - + /** *

* getSVar. diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index 08019a8e960..47f49240c30 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -34,6 +34,8 @@ import forge.card.spellability.AbilitySub; import forge.card.spellability.Spell; import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; +import forge.card.trigger.Trigger; +import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerType; import forge.game.phase.PhaseType; import forge.game.player.ComputerUtil; @@ -484,6 +486,7 @@ public final class AbilityFactoryClone { final HashMap params = af.getMapParams(); Card tgtCard; final Card host = sa.getSourceCard(); + Map origSVars = host.getSVars(); // find target of cloning @@ -499,8 +502,12 @@ public final class AbilityFactoryClone { } // find cloning source i.e. thing to be copied - Card cardToCopy = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa).get(0); - if (cardToCopy == null) { + ArrayList cloneSources = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa); + Card cardToCopy; + if (!cloneSources.isEmpty()) { + cardToCopy = cloneSources.get(0); + } + else { return; } @@ -508,6 +515,7 @@ public final class AbilityFactoryClone { Card cloned; + //boolean keepName = params.containsKey("KeepName"); AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); if (cardToCopy.isToken()) { @@ -548,6 +556,7 @@ public final class AbilityFactoryClone { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } + addExtraCharacteristics(tgtCard, params, origSVars); // If target is a flipped card, also copy the flipped // state. if (cardToCopy.isFlip()) { @@ -560,7 +569,7 @@ public final class AbilityFactoryClone { for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } - + addExtraCharacteristics(tgtCard, params, origSVars); tgtCard.setFlip(true); tgtCard.setState(CardCharactersticName.Original); @@ -574,4 +583,72 @@ public final class AbilityFactoryClone { tgtCard.setImageFilename(imageFileName); } // cloneResolve + private static void addExtraCharacteristics(final Card tgtCard, final HashMap params, final Map origSVars) { + // additional types to clone + if (params.containsKey("AddTypes")) { + for (final String type : Arrays.asList(params.get("AddTypes").split(","))) { + tgtCard.addType(type); + } + } + + // triggers to add to clone + final ArrayList triggers = new ArrayList(); + if (params.containsKey("AddTriggers")) { + triggers.addAll(Arrays.asList(params.get("AddTriggers").split(","))); + for (final String s : triggers) { + if (origSVars.containsKey(s)) { + final String actualTrigger = origSVars.get(s); + final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, tgtCard, true); + tgtCard.addTrigger(parsedTrigger); + } + } + } + + // SVars to add to clone + if (params.containsKey("AddSVars")) { + for (final String s : Arrays.asList(params.get("AddSVars").split(","))) { + if (origSVars.containsKey(s)) { + final String actualsVar = origSVars.get(s); + tgtCard.setSVar(s, actualsVar); + } + } + } + + // abilities to add to clone + if (params.containsKey("AddAbilities")) { + for (final String s : Arrays.asList(params.get("AddAbilities").split(","))) { + if (origSVars.containsKey(s)) { + final AbilityFactory newAF = new AbilityFactory(); + final String actualAbility = origSVars.get(s); + final SpellAbility grantedAbility = newAF.getAbility(actualAbility, tgtCard); + tgtCard.addSpellAbility(grantedAbility); + } + } + } + + // set power of clone + if (params.containsKey("SetPower")) { + String rhs = params.get("SetPower"); + int power = -1; + try { + power = Integer.parseInt(rhs); + } catch (final NumberFormatException e) { + power = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs)); + } + tgtCard.setBaseAttack(power); + } + + // set toughness of clone + if (params.containsKey("SetToughness")) { + String rhs = params.get("SetToughness"); + int toughness = -1; + try { + toughness = Integer.parseInt(rhs); + } catch (final NumberFormatException e) { + toughness = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs)); + } + tgtCard.setBaseDefense(toughness); + } + } + } // end class AbilityFactoryClone diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index eae197d1e19..e7d547fbc19 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -1962,10 +1962,14 @@ public class CardFactoryCreatures { getCard_YoseiTheMorningStar(card, cardName); } else if (cardName.equals("Phyrexian Dreadnought")) { getCard_PhyrexianDreadnought(card, cardName); - } else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger") - || cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter") - || cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image") - || cardName.equals("Body Double") || cardName.equals("Evil Twin") +// } else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger") +// || cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter") +// || cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image") +// || cardName.equals("Body Double") || cardName.equals("Evil Twin") +// || cardName.equals("Sakashima the Impostor")) { + } else if (cardName.equals("Vesuvan Doppelganger") + || cardName.equals("Jwari Shapeshifter") + || cardName.equals("Body Double") || cardName.equals("Sakashima the Impostor")) { getCard_ClonesSeries(card, cardName); } else if (cardName.equals("Nebuchadnezzar")) { From 9c2bcc4e7d37e230ecdd0aa8939d5f614f387f10 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 23 Jun 2012 22:39:53 +0000 Subject: [PATCH 08/29] add getCopy method the Clone AF. Created new method to copy state --- .../abilityfactory/AbilityFactoryClone.java | 82 +++++++++++-------- .../card/cardfactory/CardFactoryUtil.java | 65 +++++++++++++++ 2 files changed, 111 insertions(+), 36 deletions(-) diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index 47f49240c30..f643b3d8878 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -23,12 +23,16 @@ import java.util.HashMap; import java.util.Map; import forge.AllZone; +import forge.AllZoneUtil; import forge.Card; import forge.CardCharactersticName; +import forge.CardList; import forge.CardUtil; import forge.Singletons; +import forge.card.CardCharacteristics; import forge.card.cardfactory.AbstractCardFactory; import forge.card.cardfactory.CardFactoryUtil; +import forge.card.cost.Cost; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilitySub; import forge.card.spellability.Spell; @@ -39,6 +43,7 @@ import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerType; import forge.game.phase.PhaseType; import forge.game.player.ComputerUtil; +import forge.game.zone.ZoneType; /** *

@@ -68,7 +73,19 @@ public final class AbilityFactoryClone { * @return a {@link forge.card.spellability.SpellAbility} object. */ public static SpellAbility createAbilityClone(final AbilityFactory af) { - final SpellAbility abClone = new AbilityActivated(af.getHostCard(), af.getAbCost(), af.getAbTgt()) { + class AbilityClone extends AbilityActivated { + public AbilityClone(final Card ca, final Cost co, final Target t) { + super(ca, co, t); + } + + @Override + public AbilityActivated getCopy() { + AbilityActivated res = new AbilityClone(getSourceCard(), + getPayCosts(), getTarget() == null ? null : new Target(getTarget())); + CardFactoryUtil.copySpellAbility(this, res); + return res; + } + private static final long serialVersionUID = 1938171749867734123L; @Override @@ -90,7 +107,9 @@ public final class AbilityFactoryClone { public boolean doTrigger(final boolean mandatory) { return AbilityFactoryClone.cloneTriggerAI(af, this, mandatory); } - }; + } + + final SpellAbility abClone = new AbilityClone(af.getHostCard(), af.getAbCost(), af.getAbTgt()); return abClone; } @@ -135,7 +154,19 @@ public final class AbilityFactoryClone { * @return a {@link forge.card.spellability.SpellAbility} object. */ public static SpellAbility createDrawbackClone(final AbilityFactory af) { - final SpellAbility dbClone = new AbilitySub(af.getHostCard(), af.getAbTgt()) { + class DrawbackClone extends AbilitySub { + public DrawbackClone(final Card ca, final Target t) { + super(ca, t); + } + + @Override + public AbilitySub getCopy() { + AbilitySub res = new DrawbackClone(getSourceCard(), + getTarget() == null ? null : new Target(getTarget())); + CardFactoryUtil.copySpellAbility(this, res); + return res; + } + private static final long serialVersionUID = -8659938411435528741L; @Override @@ -157,7 +188,9 @@ public final class AbilityFactoryClone { public boolean doTrigger(final boolean mandatory) { return AbilityFactoryClone.cloneTriggerAI(af, this, mandatory); } - }; + } + + final SpellAbility dbClone = new DrawbackClone(af.getHostCard(), af.getAbTgt()); return dbClone; } @@ -518,40 +551,20 @@ public final class AbilityFactoryClone { //boolean keepName = params.containsKey("KeepName"); AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - if (cardToCopy.isToken()) { - cloned = CardFactoryUtil.copyStats(cardToCopy); - - cloned.setName(cardToCopy.getName()); - cloned.setImageName(cardToCopy.getImageName()); - - cloned.setOwner(sa.getActivatingPlayer()); - cloned.addController(sa.getActivatingPlayer()); - - cloned.setManaCost(cardToCopy.getManaCost()); - cloned.setColor(cardToCopy.getColor()); - cloned.setToken(true); - - cloned.setType(cardToCopy.getType()); - - cloned.setBaseAttack(cardToCopy.getBaseAttack()); - cloned.setBaseDefense(cardToCopy.getBaseDefense()); - } - else { - Card origin = cardToCopy; - // TODO: transform back before copying - cloned = AbstractCardFactory.getCard2(origin, tgtCard.getOwner()); - // TODO: transform origin back to how it was (if needed) - } + // add "Cloner" state to clone tgtCard.addAlternateState(CardCharactersticName.Cloner); tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); tgtCard.setState(CardCharactersticName.Original); - if (cardToCopy.getCurState() == CardCharactersticName.Transformed && cardToCopy.isDoubleFaced()) { - cloned.setState(CardCharactersticName.Transformed); + CardCharactersticName stateToCopy = null; + if (cardToCopy.isFlip()) { + stateToCopy = CardCharactersticName.Original; + } + else { + stateToCopy = cardToCopy.getCurState(); } - CardFactoryUtil.copyCharacteristics(cloned, tgtCard); - CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); + CardFactoryUtil.copyState(cardToCopy, stateToCopy, tgtCard, "Cloned"); for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } @@ -560,12 +573,9 @@ public final class AbilityFactoryClone { // If target is a flipped card, also copy the flipped // state. if (cardToCopy.isFlip()) { - cloned.setState(CardCharactersticName.Flipped); - cloned.setImageFilename(CardUtil.buildFilename(cloned)); tgtCard.addAlternateState(CardCharactersticName.Flipped); tgtCard.setState(CardCharactersticName.Flipped); - CardFactoryUtil.copyCharacteristics(cloned, tgtCard); - CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); + CardFactoryUtil.copyState(cardToCopy, CardCharactersticName.Flipped, tgtCard, "Cloned"); for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 8ccf49a17a5..07699f7b984 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -40,6 +40,7 @@ import forge.CommandArgs; import forge.Counters; import forge.GameActionUtil; import forge.Singletons; +import forge.card.CardCharacteristics; import forge.card.abilityfactory.AbilityFactory; import forge.card.cost.Cost; import forge.card.mana.ManaCost; @@ -3930,6 +3931,70 @@ public class CardFactoryUtil { } + /** + * Copy characteristics. + * + * @param from + * the from + * @param to + * the to + */ + public static void copyState(final Card from, final CardCharactersticName stateToCopy, final Card to, final String type) { + + // copy characteristics not associated with a state + to.setCurSetCode(from.getCurSetCode()); + to.setBaseLoyalty(from.getBaseLoyalty()); + to.setBaseAttackString(from.getBaseAttackString()); + to.setBaseDefenseString(from.getBaseDefenseString()); + to.setText(from.getSpellText()); + + // get CardCharacteristics for desired state + CardCharacteristics characteristics = from.getState(stateToCopy); + to.setBaseAttack(characteristics.getBaseAttack()); + to.setBaseDefense(characteristics.getBaseDefense()); + to.setIntrinsicKeyword(characteristics.getIntrinsicKeyword()); + to.setName(characteristics.getName()); + to.setType(characteristics.getType()); + to.setManaCost(characteristics.getManaCost()); + to.setColor(characteristics.getCardColor()); + to.setCardColorsOverridden(characteristics.isCardColorsOverridden()); + to.setSVars(characteristics.getSVars()); + to.setSets(characteristics.getSets()); + to.setIntrinsicAbilities(characteristics.getIntrinsicAbility()); + to.setImageName(characteristics.getImageName()); + to.setImageFilename(characteristics.getImageFilename()); + to.setTriggers(characteristics.getTriggers()); + to.setReplacementEffects(characteristics.getReplacementEffects()); + to.setStaticAbilityStrings(characteristics.getStaticAbilityStrings()); + + // copy activated abilities + for (SpellAbility sa : characteristics.getSpellAbility()) { + if (sa instanceof AbilityActivated) { + SpellAbility newSA = ((AbilityActivated) sa).getCopy(); + if (newSA == null) { + System.out.println("Uh-oh..."); + } + newSA.setType(type); + CardFactoryUtil.correctAbilityChainSourceCard(newSA, to); + to.addSpellAbility(newSA); + } + } + + // copy activated mana abilities + for (SpellAbility sa : characteristics.getManaAbility()) { + if (sa instanceof AbilityActivated) { + SpellAbility newSA = ((AbilityActivated) sa).getCopy(); + if (newSA == null) { + System.out.println("Uh-oh..."); + } + newSA.setType(type); + CardFactoryUtil.correctAbilityChainSourceCard(newSA, to); + to.addSpellAbility(newSA); + } + } + + } + public static void copySpellAbility(SpellAbility from, SpellAbility to) { to.setDescription(from.getDescription()); to.setStackDescription(from.getDescription()); From 1a96f1f635c659c89571f951ea4d35597be07c75 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 30 Jun 2012 14:57:08 +0000 Subject: [PATCH 09/29] converted Sakashima The Imposter to script --- res/cardsfolder/s/sakashima_the_impostor.txt | 8 +++++++- .../forge/card/abilityfactory/AbilityFactoryClone.java | 9 ++++++++- .../forge/card/cardfactory/CardFactoryCreatures.java | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index fe594d31587..fa704106e37 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -1,8 +1,14 @@ Name:Sakashima the Impostor ManaCost:2 U U Types:Legendary Creature Human Rogue -Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." +Text:no text PT:3/1 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. +SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashima_the_impostor.jpg Oracle:You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step." diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index f643b3d8878..906eb98fb2d 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -548,7 +548,8 @@ public final class AbilityFactoryClone { Card cloned; - //boolean keepName = params.containsKey("KeepName"); + boolean keepName = params.containsKey("KeepName"); + String originalName = tgtCard.getName(); AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); // add "Cloner" state to clone @@ -568,6 +569,9 @@ public final class AbilityFactoryClone { for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } + if (keepName) { + tgtCard.setName(originalName); + } addExtraCharacteristics(tgtCard, params, origSVars); // If target is a flipped card, also copy the flipped @@ -579,6 +583,9 @@ public final class AbilityFactoryClone { for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } + if (keepName) { + tgtCard.setName(originalName); + } addExtraCharacteristics(tgtCard, params, origSVars); tgtCard.setFlip(true); diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index 334801d6d3f..5b3049cc3c2 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -2072,8 +2072,7 @@ public class CardFactoryCreatures { // || cardName.equals("Sakashima the Impostor")) { } else if (cardName.equals("Vesuvan Doppelganger") || cardName.equals("Jwari Shapeshifter") - || cardName.equals("Body Double") - || cardName.equals("Sakashima the Impostor")) { + || cardName.equals("Body Double")) { getCard_ClonesSeries(card, cardName); } else if (cardName.equals("Nebuchadnezzar")) { getCard_Nebuchadnezzar(card, cardName); From 29f50625ee5efe963732aecb54fc98cef58ba909 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 30 Jun 2012 15:13:33 +0000 Subject: [PATCH 10/29] converted Jwari Shapeshifter to script --- src/main/java/forge/card/cardfactory/CardFactoryCreatures.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index 5b3049cc3c2..f33ea4564a4 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -2071,7 +2071,6 @@ public class CardFactoryCreatures { // || cardName.equals("Body Double") || cardName.equals("Evil Twin") // || cardName.equals("Sakashima the Impostor")) { } else if (cardName.equals("Vesuvan Doppelganger") - || cardName.equals("Jwari Shapeshifter") || cardName.equals("Body Double")) { getCard_ClonesSeries(card, cardName); } else if (cardName.equals("Nebuchadnezzar")) { From b2a7c7da71aff2b44bc9b0b6a16e65c8baebcb10 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 30 Jun 2012 21:00:32 +0000 Subject: [PATCH 11/29] changed targeting for Clone AF --- res/cardsfolder/c/clone.txt | 2 +- res/cardsfolder/e/evil_twin.txt | 2 +- res/cardsfolder/j/jwari_shapeshifter.txt | 2 +- res/cardsfolder/p/phantasmal_image.txt | 2 +- res/cardsfolder/p/phyrexian_metamorph.txt | 2 +- res/cardsfolder/q/quicksilver_gargantuan.txt | 2 +- res/cardsfolder/s/sakashima_the_impostor.txt | 2 +- .../abilityfactory/AbilityFactoryClone.java | 31 ++++++++++--------- 8 files changed, 24 insertions(+), 21 deletions(-) diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index b9bdc335961..85a4b0e0493 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -5,7 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index fd7d3477b1f..3bbd4e9ffad 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -5,7 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddAbilities$ EvilTwin | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. SVar:Rarity:Rare diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index 33c57f5c9b3..52208ab115b 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -5,7 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index 55f78eece9c..eae1f393d03 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -5,7 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Illusion | AddTriggers$ TgtTrig | AddSVars$ TrigSac | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ TgtTrig | AddSVars$ TrigSac | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:TgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index 4c54c3364bc..9406b294c0f 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -5,7 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Artifact | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index e9d8d3904d0..835742d522c 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -5,7 +5,7 @@ Text:no text PT:7/7 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SetPower$ 7 | SetToughness$ 7 | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index fa704106e37..bd467bb5a87 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -5,7 +5,7 @@ Text:no text PT:3/1 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index 906eb98fb2d..7ee5dd6d0c0 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -522,31 +522,34 @@ public final class AbilityFactoryClone { Map origSVars = host.getSVars(); - // find target of cloning + // find cloning source i.e. thing to be copied + Card cardToCopy = null; final Target tgt = sa.getTarget(); if (tgt != null) { - tgtCard = tgt.getTargetCards().get(0); + cardToCopy = tgt.getTargetCards().get(0); } else if (params.containsKey("Defined")) { - tgtCard = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa).get(0); + ArrayList cloneSources = AbilityFactory.getDefinedCards(host, params.get("Defined"), sa); + if (!cloneSources.isEmpty()) { + cardToCopy = cloneSources.get(0); + } + } + if (cardToCopy == null) { + return; + } + + // find target of cloning i.e. card becoming a clone + ArrayList cloneTargets = AbilityFactory.getDefinedCards(host, params.get("CloneTarget"), sa); + if (!cloneTargets.isEmpty()) { + tgtCard = cloneTargets.get(0); } else { tgtCard = host; } - // find cloning source i.e. thing to be copied - ArrayList cloneSources = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa); - Card cardToCopy; - if (!cloneSources.isEmpty()) { - cardToCopy = cloneSources.get(0); - } - else { - return; - } - String imageFileName = host.getImageFilename(); - Card cloned; + //Card cloned; boolean keepName = params.containsKey("KeepName"); String originalName = tgtCard.getName(); From 1d8d7518d0e22996561ea4f7b73b7653851817de Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sat, 30 Jun 2012 21:36:17 +0000 Subject: [PATCH 12/29] converted Copy Artifact and Sculpting Steel to scripts --- res/cardsfolder/c/copy_artifact.txt | 6 +- res/cardsfolder/s/sculpting_steel.txt | 6 +- .../cardfactory/CardFactoryArtifacts.java | 104 +----------------- .../cardfactory/CardFactoryEnchantments.java | 104 +----------------- 4 files changed, 12 insertions(+), 208 deletions(-) diff --git a/res/cardsfolder/c/copy_artifact.txt b/res/cardsfolder/c/copy_artifact.txt index 8b17e823bae..5e3c1e29040 100644 --- a/res/cardsfolder/c/copy_artifact.txt +++ b/res/cardsfolder/c/copy_artifact.txt @@ -1,7 +1,11 @@ Name:Copy Artifact ManaCost:1 U Types:Enchantment -Text:You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. +Text:no text +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. +SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/copy_artifact.jpg SetInfo:LEA|Rare|http://magiccards.info/scans/en/al/54.jpg diff --git a/res/cardsfolder/s/sculpting_steel.txt b/res/cardsfolder/s/sculpting_steel.txt index afda4dc780a..2cfdc043ca7 100644 --- a/res/cardsfolder/s/sculpting_steel.txt +++ b/res/cardsfolder/s/sculpting_steel.txt @@ -1,7 +1,11 @@ Name:Sculpting Steel ManaCost:3 Types:Artifact -Text:You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield. +Text:no text +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield. +SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sculpting_steel.jpg SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/238.jpg diff --git a/src/main/java/forge/card/cardfactory/CardFactoryArtifacts.java b/src/main/java/forge/card/cardfactory/CardFactoryArtifacts.java index 63b72b6bc49..9483406b913 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryArtifacts.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryArtifacts.java @@ -757,109 +757,7 @@ class CardFactoryArtifacts { card.addSpellAbility(ability); } // *************** END ************ END ************************** - // *************** START *********** START ************************** - else if (cardName.equals("Sculpting Steel")) { - final Card[] copyTarget = new Card[1]; - - final SpellAbility copy = new Spell(card) { - private static final long serialVersionUID = 4496978456522751302L; - - @Override - public void resolve() { - if (card.getController().isComputer()) { - final CardList cards = AllZoneUtil.getCardsIn(ZoneType.Battlefield).getType("Artifact"); - if (!cards.isEmpty()) { - copyTarget[0] = CardFactoryUtil.getBestAI(cards); - } - } - - if (copyTarget[0] != null) { - Card cloned; - - AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - - // TODO: transform back and forth - cloned = AbstractCardFactory.getCard2(copyTarget[0], card.getOwner()); - // TODO: untransform - - card.addAlternateState(CardCharactersticName.Cloner); - card.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); - card.setState(CardCharactersticName.Original); - - if (copyTarget[0].getCurState() == CardCharactersticName.Transformed && copyTarget[0].isDoubleFaced()) { - cloned.setState(CardCharactersticName.Transformed); - } - - CardFactoryUtil.copyCharacteristics(cloned, card); - this.grantExtras(); - - // If target is a flipped card, also copy the flipped - // state. - if (copyTarget[0].isFlip()) { - cloned.setState(CardCharactersticName.Flipped); - cloned.setImageFilename(CardUtil.buildFilename(cloned)); - card.addAlternateState(CardCharactersticName.Flipped); - card.setState(CardCharactersticName.Flipped); - CardFactoryUtil.copyCharacteristics(cloned, card); - this.grantExtras(); - - card.setFlip(true); - - card.setState(CardCharactersticName.Original); - } else { - card.setFlip(false); - } - - AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); - } - - Singletons.getModel().getGameAction().moveToPlay(card); - } - - private void grantExtras() { - // Grant stuff from specific cloners - if (cardName.equals("Copy Artifact")) { - card.addType("Enchantment"); - } - - } - }; // SpellAbility - - final Input runtime = new Input() { - private static final long serialVersionUID = 8117808324791871452L; - - @Override - public void showMessage() { - final StringBuilder sb = new StringBuilder(); - sb.append(cardName).append(" - Select an artifact on the battlefield"); - CMatchUI.SINGLETON_INSTANCE.showMessage(sb.toString()); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectButtonCancel() { - this.stop(); - } - - @Override - public void selectCard(final Card c, final PlayerZone z) { - if (z.is(ZoneType.Battlefield) && c.isArtifact()) { - copyTarget[0] = c; - this.stopSetNext(new InputPayManaCost(copy)); - } - } - }; - // Do not remove SpellAbilities created by AbilityFactory or - // Keywords. - card.clearFirstSpell(); - card.addSpellAbility(copy); - final StringBuilder sb = new StringBuilder(); - sb.append(cardName).append(" - enters the battlefield as a copy of selected card."); - copy.setStackDescription(sb.toString()); - copy.setBeforePayMana(runtime); - } // *************** END ************ END ************************** - - return card; + return card; } } diff --git a/src/main/java/forge/card/cardfactory/CardFactoryEnchantments.java b/src/main/java/forge/card/cardfactory/CardFactoryEnchantments.java index 9498bb8e3af..91ec2e356ea 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryEnchantments.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryEnchantments.java @@ -224,109 +224,7 @@ class CardFactoryEnchantments { card.addDestroyCommand(toGrave); } // *************** END ************ END ************************** - // *************** START *********** START ************************** - else if (cardName.equals("Copy Artifact")) { - final Card[] copyTarget = new Card[1]; - - final SpellAbility copy = new Spell(card) { - private static final long serialVersionUID = 4496978456522751302L; - - @Override - public void resolve() { - if (card.getController().isComputer()) { - final CardList cards = AllZoneUtil.getCardsIn(ZoneType.Battlefield).getType("Artifact"); - if (!cards.isEmpty()) { - copyTarget[0] = CardFactoryUtil.getBestAI(cards); - } - } - - if (copyTarget[0] != null) { - Card cloned; - - AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - - // TODO: transform back and forth - cloned = AbstractCardFactory.getCard2(copyTarget[0], card.getOwner()); - // TODO: untransform - - card.addAlternateState(CardCharactersticName.Cloner); - card.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); - card.setState(CardCharactersticName.Original); - - if (copyTarget[0].getCurState() == CardCharactersticName.Transformed && copyTarget[0].isDoubleFaced()) { - cloned.setState(CardCharactersticName.Transformed); - } - - CardFactoryUtil.copyCharacteristics(cloned, card); - this.grantExtras(); - - // If target is a flipped card, also copy the flipped - // state. - if (copyTarget[0].isFlip()) { - cloned.setState(CardCharactersticName.Flipped); - cloned.setImageFilename(CardUtil.buildFilename(cloned)); - card.addAlternateState(CardCharactersticName.Flipped); - card.setState(CardCharactersticName.Flipped); - CardFactoryUtil.copyCharacteristics(cloned, card); - this.grantExtras(); - - card.setFlip(true); - - card.setState(CardCharactersticName.Original); - } else { - card.setFlip(false); - } - - AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); - } - - Singletons.getModel().getGameAction().moveToPlay(card); - } - - private void grantExtras() { - // Grant stuff from specific cloners - if (cardName.equals("Copy Artifact")) { - card.addType("Enchantment"); - } - - } - }; // SpellAbility - - final Input runtime = new Input() { - private static final long serialVersionUID = 8117808324791871452L; - - @Override - public void showMessage() { - final StringBuilder sb = new StringBuilder(); - sb.append(cardName).append(" - Select an artifact on the battlefield"); - CMatchUI.SINGLETON_INSTANCE.showMessage(sb.toString()); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectButtonCancel() { - this.stop(); - } - - @Override - public void selectCard(final Card c, final PlayerZone z) { - if (z.is(ZoneType.Battlefield) && c.isArtifact()) { - copyTarget[0] = c; - this.stopSetNext(new InputPayManaCost(copy)); - } - } - }; - // Do not remove SpellAbilities created by AbilityFactory or - // Keywords. - card.clearFirstSpell(); - card.addSpellAbility(copy); - final StringBuilder sb = new StringBuilder(); - sb.append(cardName).append(" - enters the battlefield as a copy of selected card."); - copy.setStackDescription(sb.toString()); - copy.setBeforePayMana(runtime); - } // *************** END ************ END ************************** - - // *************** START *********** START ************************** + // *************** START *********** START ************************** else if (cardName.equals("Sylvan Library")) { final Ability ability = new Ability(card, "") { From 9286ae141e445158a7ad3075528989aef4814fc5 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 04:43:41 +0000 Subject: [PATCH 13/29] Converted Vesuvan Doppelganger to script --- res/cardsfolder/v/vesuvan_doppelganger.txt | 8 +- .../card/abilityfactory/AbilityFactory.java | 4 +- .../abilityfactory/AbilityFactoryClone.java | 36 +++++- .../cardfactory/CardFactoryCreatures.java | 3 +- src/main/java/forge/game/phase/Upkeep.java | 116 +----------------- 5 files changed, 43 insertions(+), 124 deletions(-) diff --git a/res/cardsfolder/v/vesuvan_doppelganger.txt b/res/cardsfolder/v/vesuvan_doppelganger.txt index f8027209e1b..313a8236c44 100644 --- a/res/cardsfolder/v/vesuvan_doppelganger.txt +++ b/res/cardsfolder/v/vesuvan_doppelganger.txt @@ -1,8 +1,14 @@ Name:Vesuvan Doppelganger ManaCost:3 U U Types:Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | Colors$ Blue | OverwriteColors$ True | AddTriggers$ UpkeepTrig | AddSVars$ TrigCopy,UpkeepTrig | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:UpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigCopy | TriggerDescription$ At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability. +SVar:TrigCopy:AB$ Clone | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | AddTriggers$ UpkeepTrig | AddSVars$ TrigCopy,UpkeepTrig | SubAbility$ DBCleanup SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuvan_doppelganger.jpg diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index 23424684fb2..de9f41944b6 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -564,7 +564,9 @@ public class AbilityFactory { } else if (this.api.equals("Clone")) { - if (this.isDb) { + if (this.isAb) { + spellAbility = AbilityFactoryClone.createAbilityClone(this); + } else if (this.isDb) { spellAbility = AbilityFactoryClone.createDrawbackClone(this); } } diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index 7ee5dd6d0c0..e15dc95b1cb 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -26,8 +26,10 @@ import forge.AllZone; import forge.AllZoneUtil; import forge.Card; import forge.CardCharactersticName; +import forge.CardColor; import forge.CardList; import forge.CardUtil; +import forge.GameActionUtil; import forge.Singletons; import forge.card.CardCharacteristics; import forge.card.cardfactory.AbstractCardFactory; @@ -538,6 +540,14 @@ public final class AbilityFactoryClone { return; } + final StringBuilder sb = new StringBuilder(); + sb.append("Do you want to copy " + cardToCopy + "?"); + boolean optional = params.containsKey("Optional"); + if (host.getController().isHuman() && optional + && !GameActionUtil.showYesNoDialog(host, sb.toString())) { + return; + } + // find target of cloning i.e. card becoming a clone ArrayList cloneTargets = AbilityFactory.getDefinedCards(host, params.get("CloneTarget"), sa); if (!cloneTargets.isEmpty()) { @@ -549,16 +559,18 @@ public final class AbilityFactoryClone { String imageFileName = host.getImageFilename(); - //Card cloned; - boolean keepName = params.containsKey("KeepName"); String originalName = tgtCard.getName(); + boolean copyingSelf = (tgtCard == cardToCopy); + AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); // add "Cloner" state to clone - tgtCard.addAlternateState(CardCharactersticName.Cloner); - tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); - tgtCard.setState(CardCharactersticName.Original); + if (!(copyingSelf && tgtCard.isCloned())) { + tgtCard.addAlternateState(CardCharactersticName.Cloner); + tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); + tgtCard.setState(CardCharactersticName.Original); + } CardCharactersticName stateToCopy = null; if (cardToCopy.isFlip()) { @@ -589,6 +601,7 @@ public final class AbilityFactoryClone { if (keepName) { tgtCard.setName(originalName); } + addExtraCharacteristics(tgtCard, params, origSVars); tgtCard.setFlip(true); @@ -669,6 +682,19 @@ public final class AbilityFactoryClone { } tgtCard.setBaseDefense(toughness); } + + // colors to be added or changed to + String shortColors = ""; + if (params.containsKey("Colors")) { + final String colors = params.get("Colors"); + if (colors.equals("ChosenColor")) { + shortColors = CardUtil.getShortColorsString(tgtCard.getChosenColor()); + } else { + shortColors = CardUtil.getShortColorsString(new ArrayList(Arrays.asList(colors.split(",")))); + } + } + tgtCard.addColor(shortColors, tgtCard, !params.containsKey("OverwriteColors"), true); + } } // end class AbilityFactoryClone diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index f33ea4564a4..34f7bb55508 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -2070,8 +2070,7 @@ public class CardFactoryCreatures { // || cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image") // || cardName.equals("Body Double") || cardName.equals("Evil Twin") // || cardName.equals("Sakashima the Impostor")) { - } else if (cardName.equals("Vesuvan Doppelganger") - || cardName.equals("Body Double")) { + } else if (cardName.equals("Body Double")) { getCard_ClonesSeries(card, cardName); } else if (cardName.equals("Nebuchadnezzar")) { getCard_Nebuchadnezzar(card, cardName); diff --git a/src/main/java/forge/game/phase/Upkeep.java b/src/main/java/forge/game/phase/Upkeep.java index b90d8a0c882..6e243ccd6f9 100644 --- a/src/main/java/forge/game/phase/Upkeep.java +++ b/src/main/java/forge/game/phase/Upkeep.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import forge.AllZone; import forge.AllZoneUtil; import forge.Card; -import forge.CardCharactersticName; import forge.CardList; import forge.CardListFilter; import forge.CardListUtil; @@ -36,7 +35,6 @@ import forge.card.spellability.Ability; import forge.card.spellability.AbilityMana; import forge.card.spellability.AbilityStatic; import forge.card.spellability.SpellAbility; -import forge.card.trigger.TriggerType; import forge.control.input.Input; import forge.game.player.ComputerUtil; import forge.game.player.Player; @@ -85,8 +83,6 @@ public class Upkeep extends Phase implements java.io.Serializable { Upkeep.upkeepDemonicHordes(); Upkeep.upkeepTangleWire(); - Upkeep.upkeepVesuvanDoppelgangerKeyword(); - // Kinship cards Upkeep.upkeepInkDissolver(); Upkeep.upkeepKithkinZephyrnaut(); @@ -2206,117 +2202,7 @@ public class Upkeep extends Phase implements java.io.Serializable { } } // for } // upkeepPowerSurge() - - /** - *

- * upkeepVesuvanDoppelgangerKeyword. - *

- */ - private static void upkeepVesuvanDoppelgangerKeyword() { - final Player player = Singletons.getModel().getGameState().getPhaseHandler().getPlayerTurn(); - final String keyword1 = "At the beginning of your upkeep, you may have this " - + "creature become a copy of target creature except it doesn't copy that " - + "creature's color. If you do, this creature gains this ability."; - final String keyword2 = "At the beginning of your upkeep, you may have this " - + "creature become a copy of another target creature. If you do, " - + "this creature gains this ability."; - CardList list = player.getCardsIn(ZoneType.Battlefield); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.hasAnyKeyword(new String[] {keyword1, keyword2}); - } - }); - - for (final Card c : list) { - final String keyword = c.hasKeyword(keyword1) ? keyword1 : keyword2; - final SpellAbility ability = new Ability(c, "0") { - @Override - public void resolve() { - final StringBuilder question = new StringBuilder(); - question.append("Use triggered ability of ").append(c).append("?"); - question.append("\r\n").append("(").append(keyword).append(")").append("\r\n"); - if (GameActionUtil.showYesNoDialog(c, question.toString(), true)) { - final Card[] newTarget = new Card[1]; - newTarget[0] = null; - - final Ability switchTargets = new Ability(c, "0") { - @Override - public void resolve() { - - if (newTarget[0] != null) { - /* - * 1. need to select new card - DONE 1a. - * need to create the newly copied card with - * pic and setinfo 2. need to add the leaves - * play command 3. need to transfer the - * keyword 4. need to update the clone - * origin of new card and old card 5. remove - * clone leaves play commands from old 5a. - * remove old from play 6. add new to play - */ - - final Card newCopy = AllZone.getCardFactory().getCard( - newTarget[0].getState(CardCharactersticName.Original).getName(), player); - newCopy.setCurSetCode(newTarget[0].getCurSetCode()); - // preserve the image of the Vesuvan - // Doppelganger/whatever the source is - newCopy.setImageFilename(c.getImageFilename()); - - AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - newCopy.setState(newTarget[0].getCurState()); - AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); - - CardFactoryUtil.copyCharacteristics(newCopy, c); - - c.addExtrinsicKeyword(keyword); - if (c.hasKeyword(keyword1)) { - c.addColor("U"); - } - } - } - }; - - AllZone.getInputControl().setInput(new Input() { - private static final long serialVersionUID = 5662272658873063221L; - - @Override - public void showMessage() { - CMatchUI.SINGLETON_INSTANCE - .showMessage(c.getName() + " - Select target creature."); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectButtonCancel() { - this.stop(); - } - - @Override - public void selectCard(final Card selectedCard, final PlayerZone z) { - if (z.is(ZoneType.Battlefield) && selectedCard.isCreature() - && selectedCard.canBeTargetedBy(switchTargets)) { - newTarget[0] = selectedCard; - final StringBuilder sb = new StringBuilder(); - sb.append(c).append(" - switching to copy "); - sb.append(selectedCard.getName()).append("."); - switchTargets.setStackDescription(sb.toString()); - AllZone.getStack().add(switchTargets); - this.stop(); - } - } - }); - } - } - }; - - ability.setDescription(keyword); - ability.setStackDescription("(OPTIONAL) " + keyword); - - AllZone.getStack().addSimultaneousStackEntry(ability); - - } // foreach(Card) - } // upkeepVesuvanDoppelgangerKeyword - + /** *

* upkeepTangleWire. From 02bc27ff9323b903a128db795486be98f6a3bad5 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 07:57:58 +0000 Subject: [PATCH 14/29] Fixed an issue with non-copyable abilities. Scripted Vesuva --- .gitattributes | 1 + res/cardsfolder/v/vesuva.txt | 13 ++++++ .../abilityfactory/AbilityFactoryClone.java | 44 +++++++++++++++---- .../card/cardfactory/CardFactoryUtil.java | 29 +----------- 4 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 res/cardsfolder/v/vesuva.txt diff --git a/.gitattributes b/.gitattributes index 74bfce59354..405e2835168 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10171,6 +10171,7 @@ res/cardsfolder/v/vertigo.txt svneol=native#text/plain res/cardsfolder/v/vertigo_spawn.txt svneol=native#text/plain res/cardsfolder/v/vesper_ghoul.txt svneol=native#text/plain res/cardsfolder/v/vessel_of_endless_rest.txt -text +res/cardsfolder/v/vesuva.txt -text res/cardsfolder/v/vesuvan_doppelganger.txt svneol=native#text/plain res/cardsfolder/v/veteran_armorer.txt svneol=native#text/plain res/cardsfolder/v/veteran_armorsmith.txt svneol=native#text/plain diff --git a/res/cardsfolder/v/vesuva.txt b/res/cardsfolder/v/vesuva.txt new file mode 100644 index 00000000000..45aa73b21a9 --- /dev/null +++ b/res/cardsfolder/v/vesuva.txt @@ -0,0 +1,13 @@ +Name:Vesuva +ManaCost:no cost +Types:Land +Text:no text +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseLand | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. +SVar:ChooseLand:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuva.jpg +SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/281.jpg +Oracle:You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index e15dc95b1cb..dffe7e27b0e 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -580,7 +580,10 @@ public final class AbilityFactoryClone { stateToCopy = cardToCopy.getCurState(); } - CardFactoryUtil.copyState(cardToCopy, stateToCopy, tgtCard, "Cloned"); + CardFactoryUtil.copyState(cardToCopy, stateToCopy, tgtCard); + // must call this before addAbilityFactoryAbilities so cloned added abilities are handled correctly + addExtraCharacteristics(tgtCard, params, origSVars); + CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } @@ -588,21 +591,20 @@ public final class AbilityFactoryClone { tgtCard.setName(originalName); } - addExtraCharacteristics(tgtCard, params, origSVars); // If target is a flipped card, also copy the flipped // state. if (cardToCopy.isFlip()) { tgtCard.addAlternateState(CardCharactersticName.Flipped); tgtCard.setState(CardCharactersticName.Flipped); - CardFactoryUtil.copyState(cardToCopy, CardCharactersticName.Flipped, tgtCard, "Cloned"); + CardFactoryUtil.copyState(cardToCopy, CardCharactersticName.Flipped, tgtCard); + addExtraCharacteristics(tgtCard, params, origSVars); + CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) { tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i)); } if (keepName) { tgtCard.setName(originalName); } - - addExtraCharacteristics(tgtCard, params, origSVars); tgtCard.setFlip(true); tgtCard.setState(CardCharactersticName.Original); @@ -651,14 +653,40 @@ public final class AbilityFactoryClone { if (params.containsKey("AddAbilities")) { for (final String s : Arrays.asList(params.get("AddAbilities").split(","))) { if (origSVars.containsKey(s)) { - final AbilityFactory newAF = new AbilityFactory(); + //final AbilityFactory newAF = new AbilityFactory(); final String actualAbility = origSVars.get(s); - final SpellAbility grantedAbility = newAF.getAbility(actualAbility, tgtCard); - tgtCard.addSpellAbility(grantedAbility); + // final SpellAbility grantedAbility = newAF.getAbility(actualAbility, tgtCard); + // tgtCard.addSpellAbility(grantedAbility); + tgtCard.getIntrinsicAbilities().add(actualAbility); } } } + // keywords to add to clone + final ArrayList keywords = new ArrayList(); + if (params.containsKey("AddKeywords")) { + keywords.addAll(Arrays.asList(params.get("AddKeywords").split(" & "))); + // allow SVar substitution for keywords + for (int i = 0; i < keywords.size(); i++) { + final String k = keywords.get(i); + if (origSVars.containsKey(k)) { + keywords.add("\"" + k + "\""); + keywords.remove(k); + } + if (keywords.get(i).startsWith("HIDDEN")) { + tgtCard.addExtrinsicKeyword(keywords.get(i)); + } + else { + tgtCard.addIntrinsicKeyword(keywords.get(i)); + } + } + } + + // set power of clone + if (params.containsKey("IntoPlayTapped")) { + tgtCard.setTapped(true); + } + // set power of clone if (params.containsKey("SetPower")) { String rhs = params.get("SetPower"); diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 39b970f3ceb..79ad995be24 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -3942,7 +3942,7 @@ public class CardFactoryUtil { * @param to * the to */ - public static void copyState(final Card from, final CardCharactersticName stateToCopy, final Card to, final String type) { + public static void copyState(final Card from, final CardCharactersticName stateToCopy, final Card to) { // copy characteristics not associated with a state to.setCurSetCode(from.getCurSetCode()); @@ -3969,33 +3969,6 @@ public class CardFactoryUtil { to.setTriggers(characteristics.getTriggers()); to.setReplacementEffects(characteristics.getReplacementEffects()); to.setStaticAbilityStrings(characteristics.getStaticAbilityStrings()); - - // copy activated abilities - for (SpellAbility sa : characteristics.getSpellAbility()) { - if (sa instanceof AbilityActivated) { - SpellAbility newSA = ((AbilityActivated) sa).getCopy(); - if (newSA == null) { - System.out.println("Uh-oh..."); - } - newSA.setType(type); - CardFactoryUtil.correctAbilityChainSourceCard(newSA, to); - to.addSpellAbility(newSA); - } - } - - // copy activated mana abilities - for (SpellAbility sa : characteristics.getManaAbility()) { - if (sa instanceof AbilityActivated) { - SpellAbility newSA = ((AbilityActivated) sa).getCopy(); - if (newSA == null) { - System.out.println("Uh-oh..."); - } - newSA.setType(type); - CardFactoryUtil.correctAbilityChainSourceCard(newSA, to); - to.addSpellAbility(newSA); - } - } - } public static void copySpellAbility(SpellAbility from, SpellAbility to) { From e717131e50363a6a1935b42e9f135cd9c17440db Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 20:02:03 +0000 Subject: [PATCH 15/29] fixed some issues with overwriting SVars and cloning clones --- res/cardsfolder/c/clone.txt | 3 +-- res/cardsfolder/c/copy_artifact.txt | 3 +-- res/cardsfolder/c/cryptoplasm.txt | 5 ++++- res/cardsfolder/e/evil_twin.txt | 4 ++-- res/cardsfolder/j/jwari_shapeshifter.txt | 3 +-- res/cardsfolder/p/phantasmal_image.txt | 10 +++++----- res/cardsfolder/p/phyrexian_metamorph.txt | 3 +-- res/cardsfolder/q/quicksilver_gargantuan.txt | 3 +-- res/cardsfolder/s/sakashima_the_impostor.txt | 4 ++-- res/cardsfolder/s/sculpting_steel.txt | 3 +-- res/cardsfolder/v/vesuva.txt | 3 +-- res/cardsfolder/v/vesuvan_doppelganger.txt | 8 ++++---- 12 files changed, 24 insertions(+), 28 deletions(-) diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index 85a4b0e0493..6f6a0f57873 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -5,8 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg diff --git a/res/cardsfolder/c/copy_artifact.txt b/res/cardsfolder/c/copy_artifact.txt index 5e3c1e29040..4bdc736bf72 100644 --- a/res/cardsfolder/c/copy_artifact.txt +++ b/res/cardsfolder/c/copy_artifact.txt @@ -4,8 +4,7 @@ Types:Enchantment Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/copy_artifact.jpg SetInfo:LEA|Rare|http://magiccards.info/scans/en/al/54.jpg diff --git a/res/cardsfolder/c/cryptoplasm.txt b/res/cardsfolder/c/cryptoplasm.txt index 7f7531de5d6..9cb4bb2df41 100644 --- a/res/cardsfolder/c/cryptoplasm.txt +++ b/res/cardsfolder/c/cryptoplasm.txt @@ -3,7 +3,10 @@ ManaCost:1 U U Types:Creature Shapeshifter Text:no text PT:2/2 -K:At the beginning of your upkeep, you may have this creature become a copy of another target creature. If you do, this creature gains this ability. +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ CryptoplasmCopy | TriggerDescription$ At the beginning of your upkeep, you may have CARDNAME become a copy of another target creature. If you do, CARDNAME gains this ability. +SVar:CryptoplasmCopy:AB$ Clone | Cost$ 0 | ValidTgts$ Creature.Other | TgtPrompt$ Select another target creature to copy. | Optional$ True | AddTriggers$ CryptoplasmUpkeepTrig | AddSVars$ CryptoplasmCopy,CryptoplasmUpkeepTrig +SVar:CryptoplasmUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ CryptoplasmCopy | TriggerDescription$ At the beginning of your upkeep, you may have CARDNAME become a copy of another target creature. If you do, CARDNAME gains this ability. SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/cryptoplasm.jpg SetInfo:MBS|Rare|http://magiccards.info/scans/en/mbs/23.jpg diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index 3bbd4e9ffad..2957a91017c 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -3,10 +3,10 @@ ManaCost:2 U B Types:Creature Shapeshifter Text:no text PT:0/0 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index 52208ab115b..badfdbeec90 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -5,8 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:RemRandomDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index eae1f393d03..ca43d79e465 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -3,14 +3,14 @@ ManaCost:1 U Types:Creature Illusion Text:no text PT:0/0 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ TgtTrig | AddSVars$ TrigSac | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:TgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. -SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ PhantasmalImageTgtTrig | AddSVars$ PhantasmalImageSac +SVar:PhantasmalImageTgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ PhantasmalImageSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. +SVar:PhantasmalImageSac:AB$Sacrifice | Cost$ 0 | Defined$ Self SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg Oracle:You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it." -End \ No newline at end of file +End diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index 9406b294c0f..810705c334c 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -5,8 +5,7 @@ Text:no text PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index 835742d522c..1ac1eba19e7 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -5,8 +5,7 @@ Text:no text PT:7/7 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index bd467bb5a87..b7bc2516e14 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -3,10 +3,10 @@ ManaCost:2 U U Types:Legendary Creature Human Rogue Text:no text PT:3/1 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except its name is still CARDNAME, it's legendary in addition to its other types, and it gains "2 U U: Return CARDNAME to its owner's hand at the beginning of the next end step." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand SVar:Rarity:Rare diff --git a/res/cardsfolder/s/sculpting_steel.txt b/res/cardsfolder/s/sculpting_steel.txt index 2cfdc043ca7..9d0cf4c7d5c 100644 --- a/res/cardsfolder/s/sculpting_steel.txt +++ b/res/cardsfolder/s/sculpting_steel.txt @@ -4,8 +4,7 @@ Types:Artifact Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield. SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sculpting_steel.jpg SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/238.jpg diff --git a/res/cardsfolder/v/vesuva.txt b/res/cardsfolder/v/vesuva.txt index 45aa73b21a9..b44c7345f10 100644 --- a/res/cardsfolder/v/vesuva.txt +++ b/res/cardsfolder/v/vesuva.txt @@ -4,8 +4,7 @@ Types:Land Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseLand | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. SVar:ChooseLand:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuva.jpg SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/281.jpg diff --git a/res/cardsfolder/v/vesuvan_doppelganger.txt b/res/cardsfolder/v/vesuvan_doppelganger.txt index 313a8236c44..c6318837d32 100644 --- a/res/cardsfolder/v/vesuvan_doppelganger.txt +++ b/res/cardsfolder/v/vesuvan_doppelganger.txt @@ -3,12 +3,12 @@ ManaCost:3 U U Types:Creature Shapeshifter Text:no text PT:0/0 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | Colors$ Blue | OverwriteColors$ True | AddTriggers$ UpkeepTrig | AddSVars$ TrigCopy,UpkeepTrig | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:UpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigCopy | TriggerDescription$ At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability. -SVar:TrigCopy:AB$ Clone | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | AddTriggers$ UpkeepTrig | AddSVars$ TrigCopy,UpkeepTrig | SubAbility$ DBCleanup +SVar:DBCopy:DB$ Clone | Defined$ Remembered | Colors$ Blue | OverwriteColors$ True | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig +SVar:VesDopUpkeepTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ VesDopCopy | TriggerDescription$ At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability. +SVar:VesDopCopy:AB$ Clone | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to copy. | Optional$ True | Colors$ Blue | OverwriteColors$ True | AddTriggers$ VesDopUpkeepTrig | AddSVars$ VesDopCopy,VesDopUpkeepTrig | SubAbility$ DBCleanup SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuvan_doppelganger.jpg From 4f88ebe1d8ade32e8b71ba1496da096ccbe2a1f2 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 20:02:58 +0000 Subject: [PATCH 16/29] added Cemetery Puca and Dimir Doppelganger --- .gitattributes | 2 ++ res/cardsfolder/c/cemetery_puca.txt | 14 ++++++++++++++ res/cardsfolder/d/dimir_doppelganger.txt | 14 ++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 res/cardsfolder/c/cemetery_puca.txt create mode 100644 res/cardsfolder/d/dimir_doppelganger.txt diff --git a/.gitattributes b/.gitattributes index 405e2835168..a676dd43941 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1403,6 +1403,7 @@ res/cardsfolder/c/celestial_purge.txt svneol=native#text/plain res/cardsfolder/c/celestial_sword.txt svneol=native#text/plain res/cardsfolder/c/cellar_door.txt -text res/cardsfolder/c/cemetery_gate.txt svneol=native#text/plain +res/cardsfolder/c/cemetery_puca.txt -text res/cardsfolder/c/cemetery_reaper.txt svneol=native#text/plain res/cardsfolder/c/cenns_enlistment.txt svneol=native#text/plain res/cardsfolder/c/cenns_heir.txt svneol=native#text/plain @@ -2302,6 +2303,7 @@ res/cardsfolder/d/diminish.txt svneol=native#text/plain res/cardsfolder/d/diminishing_returns.txt svneol=native#text/plain res/cardsfolder/d/dimir_aqueduct.txt svneol=native#text/plain res/cardsfolder/d/dimir_cutpurse.txt svneol=native#text/plain +res/cardsfolder/d/dimir_doppelganger.txt -text res/cardsfolder/d/dimir_guildmage.txt svneol=native#text/plain res/cardsfolder/d/dimir_house_guard.txt svneol=native#text/plain res/cardsfolder/d/dimir_infiltrator.txt svneol=native#text/plain diff --git a/res/cardsfolder/c/cemetery_puca.txt b/res/cardsfolder/c/cemetery_puca.txt new file mode 100644 index 00000000000..6c3378c2ca5 --- /dev/null +++ b/res/cardsfolder/c/cemetery_puca.txt @@ -0,0 +1,14 @@ +Name:Cemetery Puca +ManaCost:1 UB UB +Types:Creature Shapeshifter +Text:no text +PT:1/2 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. +SVar:CemeteryPucaCopy:AB$ Clone | Cost$ 1 | Defined$ TriggeredCard | AddTriggers$ CemeteryPucaDiesTrig | AddSVars$ CemeteryPucaCopy,CemeteryPucaDiesTrig +SVar:CemeteryPucaDiesTrig:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/cemetery_puca.jpg +Oracle:Whenever a creature dies, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability. +SetInfo:SHM|Rare|http://magiccards.info/scans/en/shm/158.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/d/dimir_doppelganger.txt b/res/cardsfolder/d/dimir_doppelganger.txt new file mode 100644 index 00000000000..f2219994be4 --- /dev/null +++ b/res/cardsfolder/d/dimir_doppelganger.txt @@ -0,0 +1,14 @@ +Name:Dimir Doppelganger +ManaCost:1 U B +Types:Creature Shapeshifter +Text:no text +PT:0/2 +# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone +A:AB$ ChangeZone | Cost$ 1 U B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DDCopy | SpellDescription$ Exile target creature card from a graveyard. CARDNAME becomes a copy of that card and gains this ability. +SVar:DDCopy:DB$ Clone | Cost$ 0 | Defined$ Remembered | AddAbilities$ DDAbility | AddSVars$ DDAbility,DDCopy +SVar:DDAbility:AB$ ChangeZone | Cost$ 1 U B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DDCopy | SpellDescription$ Exile target creature card from a graveyard. CARDNAME becomes a copy of that card and gains this ability. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/dimir_doppelganger.jpg +Oracle:{1}{U}{B}: Exile target creature card from a graveyard. Dimir Doppelganger becomes a copy of that card and gains this ability. +SetInfo:RAV|Rare|http://magiccards.info/scans/en/rav/202.jpg +End \ No newline at end of file From 348805c2e0a73427d417276731eb7ffce2752f13 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 20:04:38 +0000 Subject: [PATCH 17/29] more fixes some issues with overwriting SVars and cloning clones --- .../abilityfactory/AbilityFactoryClone.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index dffe7e27b0e..ed4f25bd2de 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -565,15 +565,31 @@ public final class AbilityFactoryClone { AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - // add "Cloner" state to clone - if (!(copyingSelf && tgtCard.isCloned())) { + if (!copyingSelf) { + if (tgtCard.isCloned()) { // cloning again + tgtCard.switchStates(CardCharactersticName.Cloner, CardCharactersticName.Original); + tgtCard.setState(CardCharactersticName.Original); + tgtCard.clearStates(CardCharactersticName.Cloner); + } + // add "Cloner" state to clone tgtCard.addAlternateState(CardCharactersticName.Cloner); tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); tgtCard.setState(CardCharactersticName.Original); } + else { + //copy Original state to Cloned + tgtCard.addAlternateState(CardCharactersticName.Cloned); + tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloned); + if (tgtCard.isFlip()) { + tgtCard.setState(CardCharactersticName.Original); + } + } CardCharactersticName stateToCopy = null; - if (cardToCopy.isFlip()) { + if (copyingSelf) { + stateToCopy = CardCharactersticName.Cloned; + } + else if (cardToCopy.isFlip()) { stateToCopy = CardCharactersticName.Original; } else { @@ -612,8 +628,17 @@ public final class AbilityFactoryClone { tgtCard.setFlip(false); } + //Clean up copy of cloned state + if (copyingSelf) { + tgtCard.clearStates(CardCharactersticName.Cloned); + } + AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); + //Clear Remembered and Imprint lists + tgtCard.clearRemembered(); + tgtCard.clearImprinted(); + //keep the Clone card image for the cloned card tgtCard.setImageFilename(imageFileName); } // cloneResolve From 5a6203088bd73b2f5de9f7295706064639a7d720 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 20:05:41 +0000 Subject: [PATCH 18/29] changed card template script to omit setInfo --- res/cardTemplateScript.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/res/cardTemplateScript.py b/res/cardTemplateScript.py index cb4e4f69935..686a25657d7 100755 --- a/res/cardTemplateScript.py +++ b/res/cardTemplateScript.py @@ -216,8 +216,6 @@ while line: # store Card object in hash table mtgDataCards[cardName] = card -print 'WARNING: Card template contains bogus SetInfo for testing only!!!' -print ' Please remove the SetInfo before committing to repository\n' inputName = raw_input("Enter Card Name: ") inputName = inputName.rstrip() while inputName != 'quit' : @@ -257,7 +255,6 @@ while inputName != 'quit' : setInfo.append(setInfoStr) print 'SVar:Rarity:'+rarity print 'SVar:Picture:http://www.wizards.com/global/images/magic/general/'+cleanName+'.jpg' - for edition in setInfo : print edition print 'End\n' else : print inputName+' not found\n' From 9f2476dea98ef52f98fd9cf4163630bed0594548 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Sun, 1 Jul 2012 22:15:08 +0000 Subject: [PATCH 19/29] added Sakashima's Student and Shapeshifter's Marrow --- .gitattributes | 2 ++ res/cardsfolder/s/sakashimas_student.txt | 14 ++++++++++++++ res/cardsfolder/s/shapeshifters_marrow.txt | 13 +++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 res/cardsfolder/s/sakashimas_student.txt create mode 100644 res/cardsfolder/s/shapeshifters_marrow.txt diff --git a/.gitattributes b/.gitattributes index a676dd43941..10f2bfbee33 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7776,6 +7776,7 @@ res/cardsfolder/s/sages_of_the_anima.txt -text res/cardsfolder/s/sai_of_the_shinobi.txt -text res/cardsfolder/s/sailmonger.txt svneol=native#text/plain res/cardsfolder/s/sakashima_the_impostor.txt -text +res/cardsfolder/s/sakashimas_student.txt -text res/cardsfolder/s/sakura_tribe_elder.txt svneol=native#text/plain res/cardsfolder/s/sakura_tribe_scout.txt svneol=native#text/plain res/cardsfolder/s/salt_flats.txt svneol=native#text/plain @@ -8162,6 +8163,7 @@ res/cardsfolder/s/shape_stealer.txt -text svneol=unset#text/plain res/cardsfolder/s/shaper_guildmage.txt svneol=native#text/plain res/cardsfolder/s/shaper_parasite.txt -text res/cardsfolder/s/shapeshifter.txt svneol=native#text/plain +res/cardsfolder/s/shapeshifters_marrow.txt -text res/cardsfolder/s/shard_convergence.txt svneol=native#text/plain res/cardsfolder/s/shard_phoenix.txt svneol=native#text/plain res/cardsfolder/s/shard_volley.txt svneol=native#text/plain diff --git a/res/cardsfolder/s/sakashimas_student.txt b/res/cardsfolder/s/sakashimas_student.txt new file mode 100644 index 00000000000..4a355a91b06 --- /dev/null +++ b/res/cardsfolder/s/sakashimas_student.txt @@ -0,0 +1,14 @@ +Name:Sakashima's Student +ManaCost:2 U U +Types:Creature Human Ninja +Text:no text +PT:0/0 +A:AB$ ChangeZone | Cost$ 1 U Return<1/Creature.attacking+unblocked> | CostDesc$ Ninjutsu 1 U | ActivationZone$ Hand | Origin$ Hand | Ninjutsu$ True | Destination$ Battlefield | Defined$ Self | SpellDescription$ (1 U, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.) +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Ninja +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashimas_student.jpg +SetInfo:PC2|Rare|http://magiccards.info/scans/en/pc2/24.jpg +Oracle:Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)\nYou may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. +End \ No newline at end of file diff --git a/res/cardsfolder/s/shapeshifters_marrow.txt b/res/cardsfolder/s/shapeshifters_marrow.txt new file mode 100644 index 00000000000..bfd98967109 --- /dev/null +++ b/res/cardsfolder/s/shapeshifters_marrow.txt @@ -0,0 +1,13 @@ +Name:Shapeshifter's Marrow +ManaCost:2 U U +Types:Enchantment +Text:no text +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | Execute$ TrigDig | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each opponent's upkeep, that player reveals the top card of his or her library. If it's a creature card, the player puts the card into his or her graveyard and CARDNAME becomes a copy of that card. (If it does, it loses this ability.) +SVar:TrigDig:AB$ Dig | Cost$ 0 | Defined$ TriggeredPlayer | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Creature | RememberChanged$ True | DestinationZone$ Graveyard | DestinationZone2$ Library | LibraryPosition2$ 0 | SubAbility$ DBCopy +SVar:DBCopy:DB$ Clone | Defined$ Remembered | ConditionDefined$ Remembered | ConditionPresent$ Creature | ConditionCompare$ EQ1 | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/shapeshifters_marrow.jpg +SetInfo:FUT|Rare|http://magiccards.info/scans/en/fut/58.jpg +Oracle:At the beginning of each opponent's upkeep, that player reveals the top card of his or her library. If it's a creature card, the player puts the card into his or her graveyard and Shapeshifter's Marrow becomes a copy of that card. (If it does, it loses this ability.) +End \ No newline at end of file From 1aab27207c05712167f6a5e6313d45d5e4d59711 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Tue, 3 Jul 2012 03:04:25 +0000 Subject: [PATCH 20/29] added support for TriggeredCardLKICopy --- res/cardsfolder/c/cemetery_puca.txt | 2 +- .../card/abilityfactory/AbilityFactory.java | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/res/cardsfolder/c/cemetery_puca.txt b/res/cardsfolder/c/cemetery_puca.txt index 6c3378c2ca5..105cf5514e5 100644 --- a/res/cardsfolder/c/cemetery_puca.txt +++ b/res/cardsfolder/c/cemetery_puca.txt @@ -5,7 +5,7 @@ Text:no text PT:1/2 # Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. -SVar:CemeteryPucaCopy:AB$ Clone | Cost$ 1 | Defined$ TriggeredCard | AddTriggers$ CemeteryPucaDiesTrig | AddSVars$ CemeteryPucaCopy,CemeteryPucaDiesTrig +SVar:CemeteryPucaCopy:AB$ Clone | Cost$ 1 | Defined$ TriggeredCardLKICopy | AddTriggers$ CemeteryPucaDiesTrig | AddSVars$ CemeteryPucaCopy,CemeteryPucaDiesTrig SVar:CemeteryPucaDiesTrig:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/cemetery_puca.jpg diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index de9f41944b6..6742cb35787 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -1840,12 +1840,21 @@ public class AbilityFactory { } } else if (defined.startsWith("Triggered") && (sa != null)) { final SpellAbility root = sa.getRootSpellAbility(); - final Object crd = root.getTriggeringObject(defined.substring(9)); - if (crd instanceof Card) { - c = AllZoneUtil.getCardState((Card) crd); - } else if (crd instanceof CardList) { - for (final Card cardItem : (CardList) crd) { - cards.add(cardItem); + if (defined.contains("LKICopy")) { //TriggeredCardLKICopy + final Object crd = root.getTriggeringObject(defined.substring(9, 13)); + if (crd instanceof Card) { + c = (Card) crd; + } + } + else { + final Object crd = root.getTriggeringObject(defined.substring(9)); + if (crd instanceof Card) { + c = AllZoneUtil.getCardState((Card) crd); + c = (Card) crd; + } else if (crd instanceof CardList) { + for (final Card cardItem : (CardList) crd) { + cards.add(cardItem); + } } } } else if (defined.startsWith("Replaced") && (sa != null)) { From c534c79b012b445d48d14dc48e0cd183851d10a2 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Tue, 3 Jul 2012 03:57:40 +0000 Subject: [PATCH 21/29] added Unstable Shapeshifter --- .gitattributes | 1 + res/cardsfolder/u/unstable_shapeshifter.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 res/cardsfolder/u/unstable_shapeshifter.txt diff --git a/.gitattributes b/.gitattributes index 10f2bfbee33..795ddb56007 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9996,6 +9996,7 @@ res/cardsfolder/u/unspeakable_symbol.txt svneol=native#text/plain res/cardsfolder/u/unstable_frontier.txt -text res/cardsfolder/u/unstable_hulk.txt svneol=native#text/plain res/cardsfolder/u/unstable_mutation.txt svneol=native#text/plain +res/cardsfolder/u/unstable_shapeshifter.txt -text res/cardsfolder/u/unstoppable_ash.txt svneol=native#text/plain res/cardsfolder/u/unsummon.txt svneol=native#text/plain res/cardsfolder/u/untaidake_the_cloud_keeper.txt -text diff --git a/res/cardsfolder/u/unstable_shapeshifter.txt b/res/cardsfolder/u/unstable_shapeshifter.txt new file mode 100644 index 00000000000..59d42179dc0 --- /dev/null +++ b/res/cardsfolder/u/unstable_shapeshifter.txt @@ -0,0 +1,14 @@ +Name:Unstable Shapeshifter +ManaCost:3 U +Types:Creature Shapeshifter +Text:no text +PT:0/1 +# Make SVars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other | TriggerZones$ Battlefield | Execute$ USCopy | TriggerDescription$ Whenever another creature enters the battlefield, CARDNAME becomes a copy of that creature and gains this ability. +SVar:USCopy:AB$ Clone | Cost$ 0 | Defined$ TriggeredCard | AddTriggers$ USTrig | AddSVars$ USCopy,USTrig +SVar:USTrig:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Other | TriggerZones$ Battlefield | Execute$ USCopy | TriggerDescription$ Whenever another creature enters the battlefield, CARDNAME becomes a copy of that creature and gains this ability. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/unstable_shapeshifter.jpg +SetInfo:TMP|Rare|http://magiccards.info/scans/en/tp/100.jpg +Oracle:Whenever another creature enters the battlefield, Unstable Shapeshifter becomes a copy of that creature and gains this ability. +End \ No newline at end of file From 2f3997931af6dcfd343e75cb46e946f4cef956af Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Tue, 3 Jul 2012 04:59:47 +0000 Subject: [PATCH 22/29] reverting to Trunk version of Animate AF --- .../abilityfactory/AbilityFactoryAnimate.java | 432 +++++++++++------- 1 file changed, 278 insertions(+), 154 deletions(-) diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java index 1601915fe1f..0f3fee73523 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryAnimate.java @@ -20,17 +20,16 @@ package forge.card.abilityfactory; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import forge.AllZone; import forge.AllZoneUtil; import forge.Card; -import forge.CardCharactersticName; import forge.CardList; import forge.CardUtil; import forge.Command; import forge.Singletons; -import forge.card.CardCharacteristics; import forge.card.replacement.ReplacementEffect; import forge.card.spellability.AbilityActivated; import forge.card.spellability.AbilitySub; @@ -517,38 +516,14 @@ public final class AbilityFactoryAnimate { private static void animateResolve(final AbilityFactory af, final SpellAbility sa) { final HashMap params = af.getMapParams(); final Card source = sa.getSourceCard(); - final Target tgt = sa.getTarget(); - ArrayList tgts; - if (tgt != null) { - tgts = tgt.getTargetCards(); - } else { - tgts = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa); - } - - animateList(af, sa, tgts.toArray()); - - } // animateResolve - - /** - *

- * animateList. - *

- * - * @param af - * a {@link forge.card.abilityfactory.AbilityFactory} object. - * @param sa - * a {@link forge.card.spellability.SpellAbility} object. - */ - private static void animateList(final AbilityFactory af, final SpellAbility sa, final Object[] tgts) { - final HashMap params = af.getMapParams(); - final Card source = sa.getSourceCard(); - final Map svars = source.getSVars(); + final Card host = sa.getSourceCard(); + final Map svars = host.getSVars(); long timest = -1; String animateRemembered = null; //if host is not on the battlefield don't apply if (params.containsKey("UntilHostLeavesPlay") - && !AllZoneUtil.isCardInPlay(source)) { + && !AllZoneUtil.isCardInPlay(sa.getSourceCard())) { return; } @@ -560,11 +535,11 @@ public final class AbilityFactoryAnimate { // AF specific params int power = -1; if (params.containsKey("Power")) { - power = AbilityFactory.calculateAmount(source, params.get("Power"), sa); + power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); } int toughness = -1; if (params.containsKey("Toughness")) { - toughness = AbilityFactory.calculateAmount(source, params.get("Toughness"), sa); + toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); } // Every Animate event needs a unique time stamp @@ -587,7 +562,7 @@ public final class AbilityFactoryAnimate { // allow ChosenType - overrides anything else specified if (types.contains("ChosenType")) { types.clear(); - types.add(source.getChosenType()); + types.add(host.getChosenType()); } final ArrayList keywords = new ArrayList(); @@ -619,7 +594,7 @@ public final class AbilityFactoryAnimate { final String colors = params.get("Colors"); if (colors.equals("ChosenColor")) { - tmpDesc = CardUtil.getShortColorsString(source.getChosenColor()); + tmpDesc = CardUtil.getShortColorsString(host.getChosenColor()); } else { tmpDesc = CardUtil.getShortColorsString(new ArrayList(Arrays.asList(colors.split(",")))); } @@ -650,139 +625,115 @@ public final class AbilityFactoryAnimate { sVars.addAll(Arrays.asList(params.get("sVars").split(","))); } - for (final Object obj : tgts) { + final Target tgt = sa.getTarget(); + ArrayList tgts; + if (tgt != null) { + tgts = tgt.getTargetCards(); + } else { + tgts = AbilityFactory.getDefinedCards(source, params.get("Defined"), sa); + } - if (!(obj instanceof Card)) { - continue; - } - - final Card c = (Card) obj; + for (final Card c : tgts) { final long colorTimestamp = AbilityFactoryAnimate.doAnimate(c, af, power, toughness, types, removeTypes, finalDesc, keywords, removeKeywords, hiddenKeywords, timestamp); - // remove abilities - final Map> removedAbilities = - new HashMap>(); - if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { - for (final CardCharactersticName state : c.getStates()) { - ArrayList removed = new ArrayList(); - for (final SpellAbility ab : c.getState(state).getSpellAbility()) { - removed.add(ab); - } - c.getState(state).getSpellAbility().clear(); - for (final SpellAbility ab : c.getState(state).getManaAbility()) { - removed.add(ab); - } - c.getState(state).getManaAbility().clear(); - removedAbilities.put(state, removed); - } - } - // give abilities final ArrayList addedAbilities = new ArrayList(); if (abilities.size() > 0) { for (final String s : abilities) { final AbilityFactory newAF = new AbilityFactory(); - final String actualAbility = source.getSVar(s); + final String actualAbility = host.getSVar(s); final SpellAbility grantedAbility = newAF.getAbility(actualAbility, c); addedAbilities.add(grantedAbility); - for (final CardCharactersticName state : c.getStates()) { - c.addSpellAbility(grantedAbility, state); + c.addSpellAbility(grantedAbility); + } + } + + // remove abilities + final ArrayList removedAbilities = new ArrayList(); + if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { + for (final SpellAbility ab : c.getSpellAbilities()) { + if (ab.isAbility()) { + c.removeSpellAbility(ab); + removedAbilities.add(ab); } } } + // Grant triggers + final ArrayList addedTriggers = new ArrayList(); + if (triggers.size() > 0) { + for (final String s : triggers) { + final String actualTrigger = host.getSVar(s); + final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); + addedTriggers.add(c.addTrigger(parsedTrigger)); + } + } + // suppress triggers from the animated card final ArrayList removedTriggers = new ArrayList(); if (params.containsKey("OverwriteTriggers") || params.containsKey("RemoveAllAbilities")) { - for (final CardCharactersticName state : c.getStates()) { - for (final Trigger trigger : c.getState(state).getTriggers()) { - trigger.setSuppressed(true); - removedTriggers.add(trigger); - } + final List triggersToRemove = c.getTriggers(); + for (final Trigger trigger : triggersToRemove) { + trigger.setSuppressed(true); + removedTriggers.add(trigger); } } - // Grant triggers - final Map> addedTriggers = - new HashMap>(); - if (triggers.size() > 0) { - for (final CardCharactersticName state : c.getStates()) { - ArrayList added = new ArrayList(); - for (final String s : triggers) { - final String actualTrigger = source.getSVar(s); - final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); - added.add(c.addTrigger(parsedTrigger, state)); - } - addedTriggers.put(state, added); + // give static abilities (should only be used by cards to give + // itself a static ability) + if (stAbs.size() > 0) { + for (final String s : stAbs) { + final String actualAbility = host.getSVar(s); + c.addStaticAbility(actualAbility); + } + } + + // give sVars + if (sVars.size() > 0) { + for (final String s : sVars) { + final String actualsVar = host.getSVar(s); + c.setSVar(s, actualsVar); } } // suppress static abilities from the animated card final ArrayList removedStatics = new ArrayList(); if (params.containsKey("OverwriteStatics") || params.containsKey("RemoveAllAbilities")) { - for (final CardCharactersticName state : c.getStates()) { - for (final StaticAbility stAb : c.getState(state).getStaticAbilities()) { - stAb.setTemporarilySuppressed(true); - removedStatics.add(stAb); - } + final ArrayList staticsToRemove = c.getStaticAbilities(); + for (final StaticAbility stAb : staticsToRemove) { + stAb.setTemporarilySuppressed(true); + removedStatics.add(stAb); } } // suppress static abilities from the animated card final ArrayList removedReplacements = new ArrayList(); if (params.containsKey("OverwriteReplacements") || params.containsKey("RemoveAllAbilities")) { - for (final CardCharactersticName state : c.getStates()) { - for (final ReplacementEffect re : c.getState(state).getReplacementEffects()) { - re.setTemporarilySuppressed(true); - removedReplacements.add(re); - } - } - } - - // give static abilities (should only be used by cards to give - // itself a static ability) - final Map> addedStatics = - new HashMap>(); - if (stAbs.size() > 0) { - for (final CardCharactersticName state : c.getStates()) { - ArrayList added = new ArrayList(); - for (final String s : stAbs) { - final String actualAbility = source.getSVar(s); - added.add(c.addStaticAbility(actualAbility, state)); - } - addedStatics.put(state, added); - } - } - - // give sVars - // This could potentially overwrite an existing SVar!!! - final ArrayList addedSVars = new ArrayList(); - if (sVars.size() > 0) { - for (final String s : sVars) { - final String actualsVar = source.getSVar(s); - for (final CardCharactersticName state : c.getStates()) { - c.getState(state).setSVar(s, actualsVar); - } - addedSVars.add(s); + final ArrayList replacementsToRemove = c.getReplacementEffects(); + for (final ReplacementEffect re : replacementsToRemove) { + re.setTemporarilySuppressed(true); + removedReplacements.add(re); } } // give Remembered if (animateRemembered != null) { - for (final Object o : AbilityFactory.getDefinedObjects(source, animateRemembered, sa)) { + for (final Object o : AbilityFactory.getDefinedObjects(host, animateRemembered, sa)) { c.addRemembered(o); } } + final boolean givesStAbs = (stAbs.size() > 0); + final Command unanimate = new Command() { private static final long serialVersionUID = -5861759814760561373L; @Override public void execute() { AbilityFactoryAnimate.doUnanimate(c, af, finalDesc, hiddenKeywords, addedAbilities, addedTriggers, - colorTimestamp, addedStatics, addedSVars, removedAbilities, timestamp); + colorTimestamp, givesStAbs, removedAbilities, timestamp); // give back suppressed triggers for (final Trigger t : removedTriggers) { @@ -805,9 +756,9 @@ public final class AbilityFactoryAnimate { if (params.containsKey("UntilEndOfCombat")) { AllZone.getEndOfCombat().addUntil(unanimate); } else if (params.containsKey("UntilHostLeavesPlay")) { - source.addLeavesPlayCommand(unanimate); + host.addLeavesPlayCommand(unanimate); } else if (params.containsKey("UntilYourNextUpkeep")) { - Singletons.getModel().getGameState().getUpkeep().addUntil(source.getController(), unanimate); + Singletons.getModel().getGameState().getUpkeep().addUntil(host.getController(), unanimate); } else if (params.containsKey("UntilControllerNextUntap")) { Singletons.getModel().getGameState().getUntap().addUntil(c.getController(), unanimate); } else { @@ -815,7 +766,7 @@ public final class AbilityFactoryAnimate { } } } - } // animateList + } // animateResolve /** *

@@ -918,23 +869,27 @@ public final class AbilityFactoryAnimate { * a {@link java.util.ArrayList} object. * @param addedAbilities * a {@link java.util.ArrayList} object. - * @param addedTriggers.keySet() + * @param addedTriggers * a {@link java.util.ArrayList} object. * @param timestamp * a long. */ private static void doUnanimate(final Card c, final AbilityFactory af, final String colorDesc, final ArrayList addedKeywords, final ArrayList addedAbilities, - final Map> addedTriggers, final long colorTimestamp, - final Map> addedStatics, final ArrayList addedSVars, - final Map> removedAbilities, final long timestamp) { + final ArrayList addedTriggers, final long colorTimestamp, final boolean givesStAbs, + final ArrayList removedAbilities, final long timestamp) { final HashMap params = af.getMapParams(); c.removeNewPT(timestamp); c.removeChangedCardKeywords(timestamp); - if (params.containsKey("Types") || params.containsKey("RemoveTypes") + // remove all static abilities + if (givesStAbs) { + c.setStaticAbilities(new ArrayList()); + } + + if (params.containsKey("Types") || params.containsKey("RemoveTypes") || params.containsKey("RemoveCreatureTypes")) { c.removeChangedCardTypes(timestamp); } @@ -945,38 +900,16 @@ public final class AbilityFactoryAnimate { c.removeExtrinsicKeyword(k); } - for (final CardCharactersticName state : c.getStates()) { - final CardCharacteristics stateCharacteristics = c.getState(state); - // removed added SVars - for (final String s : addedSVars) { - stateCharacteristics.getSVars().remove(s); - } - // removed added abilities - for (final SpellAbility sa : addedAbilities) { - c.removeSpellAbility(sa, state); - } + for (final SpellAbility sa : addedAbilities) { + c.removeSpellAbility(sa); } - // add back removed abilities - for (final CardCharactersticName state : removedAbilities.keySet()) { - for (final SpellAbility sa : removedAbilities.get(state)) { - c.addSpellAbility(sa, state); - } + for (final SpellAbility sa : removedAbilities) { + c.addSpellAbility(sa); } - // remove added triggers - for (final CardCharactersticName state : addedTriggers.keySet()) { - for (final Trigger t : addedTriggers.get(state)) { - c.removeTrigger(t, state); - } - } - - // remove added static abilities - for (final CardCharactersticName state : addedStatics.keySet()) { - CardCharacteristics stateCharacteristics = c.getState(state); - for (final StaticAbility stAb : addedStatics.get(state)) { - stateCharacteristics.getStaticAbilities().remove(stAb); - } + for (final Trigger t : addedTriggers) { + c.removeTrigger(t); } // any other unanimate cleanup @@ -1244,6 +1177,89 @@ public final class AbilityFactoryAnimate { private static void animateAllResolve(final AbilityFactory af, final SpellAbility sa) { final HashMap params = af.getMapParams(); final Card host = sa.getSourceCard(); + final Map svars = host.getSVars(); + long timest = -1; + + // AF specific params + int power = -1; + if (params.containsKey("Power")) { + power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); + } + int toughness = -1; + if (params.containsKey("Toughness")) { + toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); + } + + // Every Animate event needs a unique time stamp + timest = AllZone.getNextTimestamp(); + + final long timestamp = timest; + + final boolean permanent = params.containsKey("Permanent"); + + final ArrayList types = new ArrayList(); + if (params.containsKey("Types")) { + types.addAll(Arrays.asList(params.get("Types").split(","))); + } + + final ArrayList removeTypes = new ArrayList(); + if (params.containsKey("RemoveTypes")) { + removeTypes.addAll(Arrays.asList(params.get("RemoveTypes").split(","))); + } + + // allow ChosenType - overrides anything else specified + if (types.contains("ChosenType")) { + types.clear(); + types.add(host.getChosenType()); + } + + final ArrayList keywords = new ArrayList(); + if (params.containsKey("Keywords")) { + keywords.addAll(Arrays.asList(params.get("Keywords").split(" & "))); + } + + final ArrayList hiddenKeywords = new ArrayList(); + if (params.containsKey("HiddenKeywords")) { + hiddenKeywords.addAll(Arrays.asList(params.get("HiddenKeywords").split(" & "))); + } + // allow SVar substitution for keywords + for (int i = 0; i < keywords.size(); i++) { + final String k = keywords.get(i); + if (svars.containsKey(k)) { + keywords.add(svars.get(k)); + keywords.remove(k); + } + } + + // colors to be added or changed to + String tmpDesc = ""; + if (params.containsKey("Colors")) { + final String colors = params.get("Colors"); + if (colors.equals("ChosenColor")) { + tmpDesc = CardUtil.getShortColorsString(host.getChosenColor()); + } else { + tmpDesc = CardUtil.getShortColorsString(new ArrayList(Arrays.asList(colors.split(",")))); + } + } + final String finalDesc = tmpDesc; + + // abilities to add to the animated being + final ArrayList abilities = new ArrayList(); + if (params.containsKey("Abilities")) { + abilities.addAll(Arrays.asList(params.get("Abilities").split(","))); + } + + // triggers to add to the animated being + final ArrayList triggers = new ArrayList(); + if (params.containsKey("Triggers")) { + triggers.addAll(Arrays.asList(params.get("Triggers").split(","))); + } + + // sVars to add to the animated being + final ArrayList sVars = new ArrayList(); + if (params.containsKey("sVars")) { + sVars.addAll(Arrays.asList(params.get("sVars").split(","))); + } String valid = ""; @@ -1269,8 +1285,116 @@ public final class AbilityFactoryAnimate { } list = list.getValidCards(valid.split(","), host.getController(), host); - animateList(af, sa, list.toArray()); + for (final Card c : list) { + + final long colorTimestamp = AbilityFactoryAnimate.doAnimate(c, af, power, toughness, types, removeTypes, + finalDesc, keywords, null, hiddenKeywords, timestamp); + + // give abilities + final ArrayList addedAbilities = new ArrayList(); + if (abilities.size() > 0) { + for (final String s : abilities) { + final AbilityFactory newAF = new AbilityFactory(); + final String actualAbility = host.getSVar(s); + final SpellAbility grantedAbility = newAF.getAbility(actualAbility, c); + addedAbilities.add(grantedAbility); + c.addSpellAbility(grantedAbility); + } + } + + // remove abilities + final ArrayList removedAbilities = new ArrayList(); + if (params.containsKey("OverwriteAbilities") || params.containsKey("RemoveAllAbilities")) { + for (final SpellAbility ab : c.getSpellAbilities()) { + if (ab.isAbility()) { + c.removeSpellAbility(ab); + removedAbilities.add(ab); + } + } + } + + // Grant triggers + final ArrayList addedTriggers = new ArrayList(); + if (triggers.size() > 0) { + for (final String s : triggers) { + final String actualTrigger = host.getSVar(s); + final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, c, false); + addedTriggers.add(c.addTrigger(parsedTrigger)); + } + } + + // suppress triggers from the animated card + final ArrayList removedTriggers = new ArrayList(); + if (params.containsKey("OverwriteTriggers") || params.containsKey("RemoveAllAbilities")) { + final List triggersToRemove = c.getTriggers(); + for (final Trigger trigger : triggersToRemove) { + trigger.setSuppressed(true); + removedTriggers.add(trigger); + } + } + + // suppress static abilities from the animated card + final ArrayList removedStatics = new ArrayList(); + if (params.containsKey("OverwriteStatics") || params.containsKey("RemoveAllAbilities")) { + final ArrayList staticsToRemove = c.getStaticAbilities(); + for (final StaticAbility stAb : staticsToRemove) { + stAb.setTemporarilySuppressed(true); + removedStatics.add(stAb); + } + } + + // suppress static abilities from the animated card + final ArrayList removedReplacements = new ArrayList(); + if (params.containsKey("OverwriteReplacements") || params.containsKey("RemoveAllAbilities")) { + final ArrayList replacementsToRemove = c.getReplacementEffects(); + for (final ReplacementEffect re : replacementsToRemove) { + re.setTemporarilySuppressed(true); + removedReplacements.add(re); + } + } + + // give sVars + if (sVars.size() > 0) { + for (final String s : sVars) { + final String actualsVar = host.getSVar(s); + c.setSVar(s, actualsVar); + } + } + + final Command unanimate = new Command() { + private static final long serialVersionUID = -5861759814760561373L; + + @Override + public void execute() { + AbilityFactoryAnimate.doUnanimate(c, af, finalDesc, hiddenKeywords, addedAbilities, addedTriggers, + colorTimestamp, false, removedAbilities, timestamp); + + // give back suppressed triggers + for (final Trigger t : removedTriggers) { + t.setSuppressed(false); + } + + // give back suppressed static abilities + for (final StaticAbility s : removedStatics) { + s.setTemporarilySuppressed(false); + } + + // give back suppressed replacement effects + for (final ReplacementEffect re : removedReplacements) { + re.setTemporarilySuppressed(false); + } + } + }; + + if (!permanent) { + if (params.containsKey("UntilEndOfCombat")) { + AllZone.getEndOfCombat().addUntil(unanimate); + } else { + AllZone.getEndOfTurn().addUntil(unanimate); + } + } + } } // animateAllResolve } // end class AbilityFactoryAnimate From 4ff3162551075b95c64afc7e75d30f9bf9994fa0 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Wed, 4 Jul 2012 07:28:05 +0000 Subject: [PATCH 23/29] converted Body Double to script --- res/cardsfolder/b/body_double.txt | 5 +- .../abilityfactory/AbilityFactoryChoose.java | 7 +- .../cardfactory/CardFactoryCreatures.java | 216 +----------------- 3 files changed, 10 insertions(+), 218 deletions(-) diff --git a/res/cardsfolder/b/body_double.txt b/res/cardsfolder/b/body_double.txt index a652733d0f8..3007909b337 100644 --- a/res/cardsfolder/b/body_double.txt +++ b/res/cardsfolder/b/body_double.txt @@ -1,8 +1,11 @@ Name:Body Double ManaCost:4 U Types:Creature Shapeshifter -Text:You may have CARDNAME enter the battlefield as a copy of any creature card in a graveyard. +Text:no text PT:0/0 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature card in a graveyard. +SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | ChoiceZone$ Graveyard | SubAbility$ DBCopy | RememberChosen$ True +SVar:DBCopy:DB$ Clone | Defined$ Remembered SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/body_double.jpg diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java index 4a55c4f9cad..b4746e4cb5a 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryChoose.java @@ -1893,8 +1893,11 @@ public final class AbilityFactoryChoose { } else { tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), params.get("Defined"), sa); } - - CardList choices = AllZoneUtil.getCardsIn(ZoneType.Battlefield); + ZoneType choiceZone = ZoneType.Battlefield; + if (params.containsKey("ChoiceZone")) { + choiceZone = ZoneType.smartValueOf(params.get("ChoiceZone")); + } + CardList choices = AllZoneUtil.getCardsIn(choiceZone); if (params.containsKey("Choices")) { choices = choices.getValidCards(params.get("Choices"), host.getController(), host); } diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index 4dfdff73a16..136f612782d 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -1485,214 +1485,7 @@ public class CardFactoryCreatures { card.addComesIntoPlayCommand(comesIntoPlay); } - - private static void getCard_ClonesSeries(final Card card, final String cardName) { - final Card[] copyTarget = new Card[1]; - - final SpellAbility copy = new Spell(card) { - private static final long serialVersionUID = 4496978456522751302L; - - @Override - public void resolve() { - String imageFileName = card.getImageFilename(); - - if (card.getController().isComputer()) { - final CardList creatures = AllZoneUtil.getCreaturesInPlay(); - if (!creatures.isEmpty()) { - copyTarget[0] = CardFactoryUtil.getBestCreatureAI(creatures); - } - } - - if (copyTarget[0] != null) { - Card cloned; - - AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed); - - if (copyTarget[0].isToken()) { - cloned = CardFactoryUtil.copyStats(copyTarget[0]); - - cloned.setName(copyTarget[0].getName()); - cloned.setImageName(copyTarget[0].getImageName()); - - cloned.setOwner(this.getActivatingPlayer()); - cloned.addController(this.getActivatingPlayer()); - - cloned.setManaCost(copyTarget[0].getManaCost()); - cloned.setColor(copyTarget[0].getColor()); - cloned.setToken(true); - - cloned.setType(copyTarget[0].getType()); - - cloned.setBaseAttack(copyTarget[0].getBaseAttack()); - cloned.setBaseDefense(copyTarget[0].getBaseDefense()); - } - else { - Card origin = copyTarget[0]; - // TODO: transform back before copying - cloned = AbstractCardFactory.getCard2(origin, card.getOwner()); - // TODO: transform origin back to how it was (if needed) - } - card.addAlternateState(CardCharactersticName.Cloner); - card.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloner); - card.setState(CardCharactersticName.Original); - - if (copyTarget[0].getCurState() == CardCharactersticName.Transformed && copyTarget[0].isDoubleFaced()) { - cloned.setState(CardCharactersticName.Transformed); - } - - CardFactoryUtil.copyCharacteristics(cloned, card); - CardFactoryUtil.addAbilityFactoryAbilities(card); - for (int i = 0; i < card.getStaticAbilityStrings().size(); i++) { - card.addStaticAbility(card.getStaticAbilityStrings().get(i)); - } - this.grantExtras(); - - // If target is a flipped card, also copy the flipped - // state. - if (copyTarget[0].isFlip()) { - cloned.setState(CardCharactersticName.Flipped); - cloned.setImageFilename(CardUtil.buildFilename(cloned)); - card.addAlternateState(CardCharactersticName.Flipped); - card.setState(CardCharactersticName.Flipped); - CardFactoryUtil.copyCharacteristics(cloned, card); - CardFactoryUtil.addAbilityFactoryAbilities(card); - for (int i = 0; i < card.getStaticAbilityStrings().size(); i++) { - card.addStaticAbility(card.getStaticAbilityStrings().get(i)); - } - this.grantExtras(); - - card.setFlip(true); - - card.setState(CardCharactersticName.Original); - } else { - card.setFlip(false); - } - - AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); - } - - //keep the Clone card image for the cloned card - card.setImageFilename(imageFileName); - Singletons.getModel().getGameAction().moveToPlay(card); - } - - private void grantExtras() { - // Grant stuff from specific cloners - if (cardName.equals("Vesuvan Doppelganger")) { - final String keyword = "At the beginning of your upkeep, you may have this " - + "creature become a copy of target creature except it doesn't copy that " - + "creature's color. If you do, this creature gains this ability."; - card.addIntrinsicKeyword(keyword); - card.addColor("U"); - } else if (cardName.equals("Quicksilver Gargantuan")) { - card.setBaseAttack(7); - card.setBaseDefense(7); - } else if (cardName.equals("Phyrexian Metamorph")) { - card.addType("Artifact"); - } else if (cardName.equals("Phantasmal Image")) { - final Trigger t = forge.card.trigger.TriggerHandler - .parseTrigger( - "Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it.", - card, true); - card.addTrigger(t); - card.setSVar("TrigSac", "AB$Sacrifice | Cost$ 0 | Defined$ Self"); - card.setSVar("Targeting", "Dies"); - card.addType("Illusion"); - } else if (cardName.equals("Evil Twin")) { - final AbilityFactory af = new AbilityFactory(); - - final SpellAbility ab = af - .getAbility( - "AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature.", - card); - - card.addSpellAbility(ab); - } else if (cardName.equals("Sakashima the Impostor")) { - final AbilityFactory af = new AbilityFactory(); - final SpellAbility ab = af - .getAbility( - "AB$DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | TriggerDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step.", - card); - - card.addSpellAbility(ab); - card.setSVar("TrigReturnSak", - "AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand"); - card.setName("Sakashima the Impostor"); - card.addType("Legendary"); - } - } - }; // SpellAbility - - final Input runtime = new Input() { - private static final long serialVersionUID = 7615038074569687330L; - - @Override - public void showMessage() { - String message = "Select a creature "; - if (cardName.equals("Phyrexian Metamorph")) { - message += "or artifact "; - } - message += "on the battlefield"; - CMatchUI.SINGLETON_INSTANCE.showMessage(cardName + " - " + message); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectButtonCancel() { - // player chooses not to copy anything - that's legal - AllZone.getStack().add(copy); - AllZone.getInputControl().resetInput(); - } - - @Override - public void selectCard(final Card c, final PlayerZone z) { - if (!z.is(ZoneType.Battlefield)) { - return; - } - if (cardName.equals("Jwari Shapeshifter") && !c.isType("Ally")) { - return; - } - if (c.isCreature() || (cardName.equals("Phyrexian Metamorph") && c.isArtifact())) { - copyTarget[0] = c; - - AllZone.getStack().add(copy); - AllZone.getInputControl().resetInput(); - } - } - }; - - final Input graveyardRuntime = new Input() { - private static final long serialVersionUID = 6950318443268022876L; - - @Override - public void showMessage() { - final String message = "Select a creature in a graveyard"; - final CardList choices = AllZoneUtil.getCardsIn(ZoneType.Graveyard); - final Object o = GuiUtils.chooseOneOrNone(message, choices.toArray()); - if (null == o) { - this.stop(); - } else { - final Card c = (Card) o; - copyTarget[0] = c; - this.stopSetNext(new InputPayManaCost(copy)); - } - } - }; - - // Do not remove SpellAbilities created by AbilityFactory or - // Keywords. - card.clearFirstSpell(); - card.addSpellAbility(copy); - final StringBuilder sb = new StringBuilder(); - sb.append(cardName).append(" - enters the battlefield as a copy of selected card."); - copy.setStackDescription(sb.toString()); - if (cardName.equals("Body Double")) { - copy.setBeforePayMana(graveyardRuntime); - } else { - copy.setAfterPayMana(runtime); - } - } - + private static void getCard_Nebuchadnezzar(final Card card, final String cardName) { /* * X, T: Name a card. Target opponent reveals X cards at random from @@ -1883,13 +1676,6 @@ public class CardFactoryCreatures { getCard_YoseiTheMorningStar(card, cardName); } else if (cardName.equals("Phyrexian Dreadnought")) { getCard_PhyrexianDreadnought(card, cardName); -// } else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger") -// || cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter") -// || cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image") -// || cardName.equals("Body Double") || cardName.equals("Evil Twin") -// || cardName.equals("Sakashima the Impostor")) { - } else if (cardName.equals("Body Double")) { - getCard_ClonesSeries(card, cardName); } else if (cardName.equals("Nebuchadnezzar")) { getCard_Nebuchadnezzar(card, cardName); } else if (cardName.equals("Duct Crawler") || cardName.equals("Shrewd Hatchling") From 9d2bd88283e4ba32c81156ecaa0a7772aed5754f Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 04:04:52 +0000 Subject: [PATCH 24/29] fixed SVar name for Akki Lavarunner --- res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt index 592e627ada7..2e0932b55a9 100644 --- a/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt +++ b/res/cardsfolder/a/akki_lavarunner_tok_tok_volcano_born.txt @@ -23,7 +23,7 @@ K:Protection from red R:Event$ DamageDone | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1 | IsCombat$ False | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. R:Event$ DamageDone | ValidSource$ Card.Red | ValidTarget$ Player | ReplaceWith$ DmgPlus1Combat | IsCombat$ True | Secondary$ True | Description$ If a red source would deal damage to a player, it deals that much damage plus 1 to that player instead. SVar:DmgPlus1:AB$DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X -SVar:DmgPlus1:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X +SVar:DmgPlus1Combat:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X SVar:X:ReplaceCount$DamageAmount/Plus.1 SVar:Picture:http://www.wizards.com/global/images/magic/general/tok_tok_volcano_born.jpg SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/313.jpg From daf2c3e4e39adfc6b39877279bc273e4bfe48162 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 04:15:25 +0000 Subject: [PATCH 25/29] added a copy method to CardCharacteristics class that makes a deep copy of another instance of CardCharacteristics --- .../java/forge/card/CardCharacteristics.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/main/java/forge/card/CardCharacteristics.java b/src/main/java/forge/card/CardCharacteristics.java index 509cc439d63..f7ef5fc5a2c 100644 --- a/src/main/java/forge/card/CardCharacteristics.java +++ b/src/main/java/forge/card/CardCharacteristics.java @@ -449,4 +449,46 @@ public class CardCharacteristics { public final void setSVars(final Map newSVars) { this.sVars = newSVars; } + + /** + *

+ * copy. + *

+ * + * @param source + * a Map object. + */ + public final void copy(final CardCharacteristics source) { + // Makes a "deeper" copy of a CardCharacteristics object + + // String name : just copy reference + this.name = source.getName(); + // ArrayList type : list of String objects so use copy constructor + this.type = new ArrayList(source.getType()); + // CardManaCost manaCost : not sure if a deep copy is needed + this.manaCost = source.getManaCost(); + // ArrayList cardColor : not sure if a deep copy is needed + this.cardColor = new ArrayList(source.getCardColor()); + // boolean cardColorsOverridden : set value + this.cardColorsOverridden = source.isCardColorsOverridden(); + // int baseAttack : set value + this.baseAttack = source.getBaseAttack(); + // int baseDefense : set value + this.baseDefense = source.getBaseDefense(); + // ArrayList intrinsicKeyword : list of String objects so use copy constructor + this.intrinsicKeyword = new ArrayList(source.getIntrinsicKeyword()); + // ArrayList intrinsicAbility : list of String objects so use copy constructor + this.intrinsicAbility = new ArrayList(source.getIntrinsicAbility()); + // ArrayList staticAbilityStrings : list of String objects so use copy constructor + this.staticAbilityStrings = new ArrayList(source.getStaticAbilityStrings()); + // String imageFilename = copy reference + this.imageFilename = source.getImageFilename(); + // String imageName = ""; + this.imageName = source.getImageName(); + // ArrayList sets : deep copy not needed, just copy reference + this.sets = source.getSets(); + // Map sVars + this.sVars = new TreeMap(source.getSVars()); + + } } From 59e348b0cd9b935d17ecb5e1f009d5e29cc77f5d Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 04:16:52 +0000 Subject: [PATCH 26/29] add a flip status to Card class to support proper handling of flipped status for clones and copies. --- src/main/java/forge/Card.java | 39 ++++++++++++++----- src/main/java/forge/CardReader.java | 4 +- src/main/java/forge/GameAction.java | 7 ++++ .../abilityfactory/AbilityFactoryClone.java | 22 +++++++---- .../abilityfactory/AbilityFactoryCopy.java | 2 +- .../AbilityFactorySetState.java | 33 +++++++++++----- .../card/cardfactory/CardFactoryUtil.java | 18 ++------- src/main/java/forge/item/CardPrinted.java | 2 +- 8 files changed, 81 insertions(+), 46 deletions(-) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 566f0a4972d..975c1963337 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -80,7 +80,8 @@ public class Card extends GameEntity implements Comparable { private CardCharactersticName preTFDCharacteristic = CardCharactersticName.Original; private boolean isDoubleFaced = false; - private boolean isFlip = false; + private boolean isFlipCard = false; + private boolean isFlipped = false; private CardCharactersticName otherTransformable = null; private ZoneType castFrom = null; @@ -455,22 +456,42 @@ public class Card extends GameEntity implements Comparable { } /** - * Checks if is flip. + * Checks if is flip card. * - * @return the isFlip + * @return the isFlipCard */ - public final boolean isFlip() { - return this.isFlip; + public final boolean isFlipCard() { + return this.isFlipCard; } /** - * Sets the flip. + * Sets the flip card. * * @param isFlip0 * the isFlip to set */ - public final void setFlip(final boolean isFlip0) { - this.isFlip = isFlip0; + public final void setFlipCard(final boolean isFlip0) { + this.isFlipCard = isFlip0; + } + + /** + * + * Checks if card status is flipped. + * + * @return the flipped + */ + public final boolean isFlipped() { + return this.isFlipped; + } + + /** + * Sets a cards flipped status. + * + * @param newStatus + * boolean with new flipped status + */ + public final void setFlipStaus(final boolean newStatus) { + this.isFlipped = newStatus; } /** @@ -6531,7 +6552,7 @@ public class Card extends GameEntity implements Comparable { return false; } } else if (property.equals("Flip")) { - if (!this.isFlip) { + if (!this.isFlipCard) { return false; } } else if (property.startsWith("YouCtrl")) { diff --git a/src/main/java/forge/CardReader.java b/src/main/java/forge/CardReader.java index 3e03a3ec80a..33fbc11bb01 100644 --- a/src/main/java/forge/CardReader.java +++ b/src/main/java/forge/CardReader.java @@ -481,7 +481,7 @@ public class CardReader implements Runnable { // 8/18/11 11:08 PM } else if (line.equals("ALTERNATE")) { CardCharactersticName mode; - if (card.isFlip()) { + if (card.isFlipCard()) { mode = CardCharactersticName.Flipped; } else if (card.isDoubleFaced()) { mode = CardCharactersticName.Transformed; @@ -494,7 +494,7 @@ public class CardReader implements Runnable { //System.out.println(card.getName()); final CardCharactersticName value = CardCharactersticName.smartValueOf(line.substring("AlternateMode:".length())); if (value == CardCharactersticName.Flipped) { - card.setFlip(true); + card.setFlipCard(true); } else if (value == CardCharactersticName.Transformed) { card.setDoubleFaced(true); } else { diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index ef1c20d8581..a6963f5012f 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -157,6 +157,13 @@ public class GameAction { c.switchStates(CardCharactersticName.Cloner, CardCharactersticName.Original); c.setState(CardCharactersticName.Original); c.clearStates(CardCharactersticName.Cloner); + if (c.isFlipCard()) { + c.clearStates(CardCharactersticName.Flipped); + } + } + // reset flip status when card leaves battlefield + if (zoneFrom.is(ZoneType.Battlefield)) { + c.setFlipStaus(false); } AllZone.getTriggerHandler().clearSuppression(TriggerType.Transformed); copied = AllZone.getCardFactory().copyCard(c); diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index ed4f25bd2de..bccaa75f4fd 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -580,7 +580,7 @@ public final class AbilityFactoryClone { //copy Original state to Cloned tgtCard.addAlternateState(CardCharactersticName.Cloned); tgtCard.switchStates(CardCharactersticName.Original, CardCharactersticName.Cloned); - if (tgtCard.isFlip()) { + if (tgtCard.isFlipCard()) { tgtCard.setState(CardCharactersticName.Original); } } @@ -589,7 +589,7 @@ public final class AbilityFactoryClone { if (copyingSelf) { stateToCopy = CardCharactersticName.Cloned; } - else if (cardToCopy.isFlip()) { + else if (cardToCopy.isFlipCard()) { stateToCopy = CardCharactersticName.Original; } else { @@ -609,9 +609,11 @@ public final class AbilityFactoryClone { // If target is a flipped card, also copy the flipped // state. - if (cardToCopy.isFlip()) { - tgtCard.addAlternateState(CardCharactersticName.Flipped); - tgtCard.setState(CardCharactersticName.Flipped); + if (cardToCopy.isFlipCard()) { + if (!copyingSelf) { + tgtCard.addAlternateState(CardCharactersticName.Flipped); + tgtCard.setState(CardCharactersticName.Flipped); + } CardFactoryUtil.copyState(cardToCopy, CardCharactersticName.Flipped, tgtCard); addExtraCharacteristics(tgtCard, params, origSVars); CardFactoryUtil.addAbilityFactoryAbilities(tgtCard); @@ -621,11 +623,15 @@ public final class AbilityFactoryClone { if (keepName) { tgtCard.setName(originalName); } - tgtCard.setFlip(true); + tgtCard.setFlipCard(true); + //keep the Clone card image for the cloned card + tgtCard.setImageFilename(imageFileName); - tgtCard.setState(CardCharactersticName.Original); + if (!tgtCard.isFlipped()) { + tgtCard.setState(CardCharactersticName.Original); + } } else { - tgtCard.setFlip(false); + tgtCard.setFlipCard(false); } //Clean up copy of cloned state diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryCopy.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryCopy.java index 6797a9b0581..1d968e632fa 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryCopy.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryCopy.java @@ -447,7 +447,7 @@ public final class AbilityFactoryCopy { copy.setState(CardCharactersticName.Transformed); } } - if (c.isFlip()) { // Cloned Flips CAN flip. + if (c.isFlipCard()) { // Cloned Flips CAN flip. copy.setState(CardCharactersticName.Original); c.setState(CardCharactersticName.Original); copy.setImageFilename(c.getImageFilename()); diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactorySetState.java b/src/main/java/forge/card/abilityfactory/AbilityFactorySetState.java index 4d3d044f0e2..d2acfe262b3 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactorySetState.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactorySetState.java @@ -284,14 +284,21 @@ public class AbilityFactorySetState { } } } else if (mode.equals("Flip")) { - if (tgt.isFlip()) { + if (tgt.isFlipCard()) { if (tgt.getCurState() == CardCharactersticName.Original) { - if (tgt.setState(CardCharactersticName.Flipped) && remChanged) { - abilityFactory.getHostCard().addRemembered(tgt); + if (tgt.setState(CardCharactersticName.Flipped)) { + abilityFactory.getHostCard().setFlipStaus(true); + if (remChanged) { + abilityFactory.getHostCard().addRemembered(tgt); + } } + } else if (tgt.getCurState() == CardCharactersticName.Flipped) { - if (tgt.setState(CardCharactersticName.Original) && remChanged) { - abilityFactory.getHostCard().addRemembered(tgt); + if (tgt.setState(CardCharactersticName.Original)) { + abilityFactory.getHostCard().setFlipStaus(false); + if (remChanged) { + abilityFactory.getHostCard().addRemembered(tgt); + } } } } @@ -500,14 +507,20 @@ public class AbilityFactorySetState { } } } else if (mode.equals("Flip")) { - if (list.get(i).isFlip()) { + if (list.get(i).isFlipCard()) { if (list.get(i).getCurState() == CardCharactersticName.Original) { - if (list.get(i).setState(CardCharactersticName.Flipped) && remChanged) { - abilityFactory.getHostCard().addRemembered(tgt); + if (list.get(i).setState(CardCharactersticName.Flipped)) { + list.get(i).setFlipStaus(true); + if (remChanged) { + abilityFactory.getHostCard().addRemembered(tgt); + } } } else if (list.get(i).getCurState() == CardCharactersticName.Flipped) { - if (list.get(i).setState(CardCharactersticName.Original) && remChanged) { - abilityFactory.getHostCard().addRemembered(tgt); + if (list.get(i).setState(CardCharactersticName.Original)) { + list.get(i).setFlipStaus(false); + if (remChanged) { + abilityFactory.getHostCard().addRemembered(tgt); + } } } } diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 79ad995be24..692cf192940 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -3881,7 +3881,7 @@ public class CardFactoryUtil { public static Card copyStats(final Card sim) { final Card c = new Card(); - c.setFlip(sim.isFlip()); + c.setFlipCard(sim.isFlipCard()); c.setDoubleFaced(sim.isDoubleFaced()); c.setCurSetCode(sim.getCurSetCode()); @@ -3953,22 +3953,10 @@ public class CardFactoryUtil { // get CardCharacteristics for desired state CardCharacteristics characteristics = from.getState(stateToCopy); - to.setBaseAttack(characteristics.getBaseAttack()); - to.setBaseDefense(characteristics.getBaseDefense()); - to.setIntrinsicKeyword(characteristics.getIntrinsicKeyword()); - to.setName(characteristics.getName()); - to.setType(characteristics.getType()); - to.setManaCost(characteristics.getManaCost()); - to.setColor(characteristics.getCardColor()); - to.setCardColorsOverridden(characteristics.isCardColorsOverridden()); - to.setSVars(characteristics.getSVars()); - to.setSets(characteristics.getSets()); - to.setIntrinsicAbilities(characteristics.getIntrinsicAbility()); - to.setImageName(characteristics.getImageName()); - to.setImageFilename(characteristics.getImageFilename()); + to.getCharacteristics().copy(characteristics); + // handle triggers and replacement effect through Card class interface to.setTriggers(characteristics.getTriggers()); to.setReplacementEffects(characteristics.getReplacementEffects()); - to.setStaticAbilityStrings(characteristics.getStaticAbilityStrings()); } public static void copySpellAbility(SpellAbility from, SpellAbility to) { diff --git a/src/main/java/forge/item/CardPrinted.java b/src/main/java/forge/item/CardPrinted.java index 425e0f05671..b73aa31a8d0 100644 --- a/src/main/java/forge/item/CardPrinted.java +++ b/src/main/java/forge/item/CardPrinted.java @@ -298,7 +298,7 @@ public final class CardPrinted implements Comparable, InventoryItem c.setImageFilename(this.getImageFilename()); if (c.hasAlternateState()) { - if (c.isFlip()) { + if (c.isFlipCard()) { c.setState(CardCharactersticName.Flipped); } if (c.isDoubleFaced()) { From fb641fd7be54b333149a5303e28553404386c1be Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 04:53:17 +0000 Subject: [PATCH 27/29] change Clone AF stack description method --- .../abilityfactory/AbilityFactoryClone.java | 101 ++---------------- 1 file changed, 8 insertions(+), 93 deletions(-) diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java index bccaa75f4fd..ba5c2b2001c 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClone.java @@ -210,41 +210,8 @@ public final class AbilityFactoryClone { // TODO update this method private static String cloneStackDescription(final AbilityFactory af, final SpellAbility sa) { final HashMap params = af.getMapParams(); - final Card host = sa.getSourceCard(); - final Map svars = host.getSVars(); - - int power = -1; - if (params.containsKey("Power")) { - power = AbilityFactory.calculateAmount(host, params.get("Power"), sa); - } - int toughness = -1; - if (params.containsKey("Toughness")) { - toughness = AbilityFactory.calculateAmount(host, params.get("Toughness"), sa); - } - - final boolean permanent = params.containsKey("Permanent"); - final ArrayList types = new ArrayList(); - if (params.containsKey("Types")) { - types.addAll(Arrays.asList(params.get("Types").split(","))); - } - final ArrayList keywords = new ArrayList(); - if (params.containsKey("Keywords")) { - keywords.addAll(Arrays.asList(params.get("Keywords").split(" & "))); - } - // allow SVar substitution for keywords - for (int i = 0; i < keywords.size(); i++) { - final String k = keywords.get(i); - if (svars.containsKey(k)) { - keywords.add("\"" + k + "\""); - keywords.remove(k); - } - } - final ArrayList colors = new ArrayList(); - if (params.containsKey("Colors")) { - colors.addAll(Arrays.asList(params.get("Colors").split(","))); - } - - final StringBuilder sb = new StringBuilder(); + + final StringBuilder sb = new StringBuilder(); if (sa instanceof AbilitySub) { sb.append(" "); @@ -260,65 +227,13 @@ public final class AbilityFactoryClone { tgts = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa); } - for (final Card c : tgts) { - sb.append(c).append(" "); + sb.append(sa.getSourceCard()); + sb.append(" becomes a copy of "); + if (!tgts.isEmpty()) { + sb.append(tgts.get(0)).append("."); } - sb.append("become"); - if (tgts.size() == 1) { - sb.append("s a"); - } - // if power is -1, we'll assume it's not just setting toughness - if (power != -1) { - sb.append(" ").append(power).append("/").append(toughness); - } - - if (colors.size() > 0) { - sb.append(" "); - } - if (colors.contains("ChosenColor")) { - sb.append("color of that player's choice"); - } else { - for (int i = 0; i < colors.size(); i++) { - sb.append(colors.get(i)); - if (i < (colors.size() - 1)) { - sb.append(" and "); - } - } - } - sb.append(" "); - if (types.contains("ChosenType")) { - sb.append("type of player's choice "); - } else { - for (int i = types.size() - 1; i >= 0; i--) { - sb.append(types.get(i)); - sb.append(" "); - } - } - if (keywords.size() > 0) { - sb.append("with "); - } - for (int i = 0; i < keywords.size(); i++) { - sb.append(keywords.get(i)); - if (i < (keywords.size() - 1)) { - sb.append(" and "); - } - } - // sb.append(abilities) - // sb.append(triggers) - if (!permanent) { - if (params.containsKey("UntilEndOfCombat")) { - sb.append(" until end of combat."); - } else if (params.containsKey("UntilHostLeavesPlay")) { - sb.append(" until ").append(host).append(" leaves the battlefield."); - } else if (params.containsKey("UntilYourNextUpkeep")) { - sb.append(" until your next upkeep."); - } else if (params.containsKey("UntilControllerNextUntap")) { - sb.append(" until its controller's next untap step."); - } else { - sb.append(" until end of turn."); - } - } else { - sb.append("."); + else { + sb.append("target creature."); } final AbilitySub abSub = sa.getSubAbility(); From c46ba5e9ae5ae50dda5ba5280f0534add421445a Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 05:08:52 +0000 Subject: [PATCH 28/29] marking clones with choices as RemAIDeck:True until logic is added to appropriate AFs --- res/cardsfolder/c/cemetery_puca.txt | 1 + res/cardsfolder/c/clone.txt | 1 + res/cardsfolder/c/copy_artifact.txt | 3 ++- res/cardsfolder/d/dimir_doppelganger.txt | 1 + res/cardsfolder/e/evil_twin.txt | 1 + res/cardsfolder/j/jwari_shapeshifter.txt | 1 + res/cardsfolder/p/phantasmal_image.txt | 1 + res/cardsfolder/p/phyrexian_metamorph.txt | 1 + res/cardsfolder/q/quicksilver_gargantuan.txt | 1 + res/cardsfolder/s/sakashima_the_impostor.txt | 1 + res/cardsfolder/s/sakashimas_student.txt | 1 + res/cardsfolder/v/vesuva.txt | 1 + 12 files changed, 13 insertions(+), 1 deletion(-) diff --git a/res/cardsfolder/c/cemetery_puca.txt b/res/cardsfolder/c/cemetery_puca.txt index 105cf5514e5..48a951c7abc 100644 --- a/res/cardsfolder/c/cemetery_puca.txt +++ b/res/cardsfolder/c/cemetery_puca.txt @@ -7,6 +7,7 @@ PT:1/2 T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. SVar:CemeteryPucaCopy:AB$ Clone | Cost$ 1 | Defined$ TriggeredCardLKICopy | AddTriggers$ CemeteryPucaDiesTrig | AddSVars$ CemeteryPucaCopy,CemeteryPucaDiesTrig SVar:CemeteryPucaDiesTrig:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ CemeteryPucaCopy | TriggerDescription$ Whenever a creature dies, you may pay 1. If you do, CARDNAME becomes a copy of that creature and gains this ability. +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/cemetery_puca.jpg Oracle:Whenever a creature dies, you may pay {1}. If you do, Cemetery Puca becomes a copy of that creature and gains this ability. diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index 6f6a0f57873..c26f5c04843 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -6,6 +6,7 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg diff --git a/res/cardsfolder/c/copy_artifact.txt b/res/cardsfolder/c/copy_artifact.txt index 4bdc736bf72..d11e748d8d4 100644 --- a/res/cardsfolder/c/copy_artifact.txt +++ b/res/cardsfolder/c/copy_artifact.txt @@ -4,7 +4,8 @@ Types:Enchantment Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True -SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment +SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/copy_artifact.jpg SetInfo:LEA|Rare|http://magiccards.info/scans/en/al/54.jpg diff --git a/res/cardsfolder/d/dimir_doppelganger.txt b/res/cardsfolder/d/dimir_doppelganger.txt index f2219994be4..130250f88cc 100644 --- a/res/cardsfolder/d/dimir_doppelganger.txt +++ b/res/cardsfolder/d/dimir_doppelganger.txt @@ -7,6 +7,7 @@ PT:0/2 A:AB$ ChangeZone | Cost$ 1 U B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DDCopy | SpellDescription$ Exile target creature card from a graveyard. CARDNAME becomes a copy of that card and gains this ability. SVar:DDCopy:DB$ Clone | Cost$ 0 | Defined$ Remembered | AddAbilities$ DDAbility | AddSVars$ DDAbility,DDCopy SVar:DDAbility:AB$ ChangeZone | Cost$ 1 U B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DDCopy | SpellDescription$ Exile target creature card from a graveyard. CARDNAME becomes a copy of that card and gains this ability. +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/dimir_doppelganger.jpg Oracle:{1}{U}{B}: Exile target creature card from a graveyard. Dimir Doppelganger becomes a copy of that card and gains this ability. diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index 2957a91017c..7b70e04b520 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -8,6 +8,7 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/212.jpg diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index badfdbeec90..7c1d8919bdb 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -6,6 +6,7 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered +SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index ca43d79e465..f5280386514 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -9,6 +9,7 @@ SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choice SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ PhantasmalImageTgtTrig | AddSVars$ PhantasmalImageSac SVar:PhantasmalImageTgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ PhantasmalImageSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. SVar:PhantasmalImageSac:AB$Sacrifice | Cost$ 0 | Defined$ Self +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index 810705c334c..a0ea5620e7c 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -6,6 +6,7 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index 1ac1eba19e7..fc4dc09a70c 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -6,6 +6,7 @@ PT:7/7 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index b7bc2516e14..562d554fbda 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -9,6 +9,7 @@ SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choice SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashima_the_impostor.jpg Oracle:You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step." diff --git a/res/cardsfolder/s/sakashimas_student.txt b/res/cardsfolder/s/sakashimas_student.txt index 4a355a91b06..20f6020df54 100644 --- a/res/cardsfolder/s/sakashimas_student.txt +++ b/res/cardsfolder/s/sakashimas_student.txt @@ -7,6 +7,7 @@ A:AB$ ChangeZone | Cost$ 1 U Return<1/Creature.attacking+unblocked> | CostDesc$ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Ninja +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashimas_student.jpg SetInfo:PC2|Rare|http://magiccards.info/scans/en/pc2/24.jpg diff --git a/res/cardsfolder/v/vesuva.txt b/res/cardsfolder/v/vesuva.txt index b44c7345f10..30728cabb58 100644 --- a/res/cardsfolder/v/vesuva.txt +++ b/res/cardsfolder/v/vesuva.txt @@ -5,6 +5,7 @@ Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseLand | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. SVar:ChooseLand:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True +SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuva.jpg SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/281.jpg From 452750c9718a0e954f6d4c3fe1fda4c25e1524c3 Mon Sep 17 00:00:00 2001 From: ArsenalNut Date: Thu, 5 Jul 2012 05:36:34 +0000 Subject: [PATCH 29/29] removed RemAIDeck as Choose AF has some basic logic already --- res/cardsfolder/c/clone.txt | 1 - res/cardsfolder/c/copy_artifact.txt | 1 - res/cardsfolder/e/evil_twin.txt | 1 - res/cardsfolder/j/jwari_shapeshifter.txt | 1 - res/cardsfolder/p/phantasmal_image.txt | 1 - res/cardsfolder/p/phyrexian_metamorph.txt | 1 - res/cardsfolder/q/quicksilver_gargantuan.txt | 1 - res/cardsfolder/s/sakashima_the_impostor.txt | 1 - res/cardsfolder/s/sakashimas_student.txt | 1 - res/cardsfolder/v/vesuva.txt | 1 - 10 files changed, 10 deletions(-) diff --git a/res/cardsfolder/c/clone.txt b/res/cardsfolder/c/clone.txt index c26f5c04843..6f6a0f57873 100644 --- a/res/cardsfolder/c/clone.txt +++ b/res/cardsfolder/c/clone.txt @@ -6,7 +6,6 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg diff --git a/res/cardsfolder/c/copy_artifact.txt b/res/cardsfolder/c/copy_artifact.txt index d11e748d8d4..5319d4d1fd1 100644 --- a/res/cardsfolder/c/copy_artifact.txt +++ b/res/cardsfolder/c/copy_artifact.txt @@ -5,7 +5,6 @@ Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseArtifact | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. SVar:ChooseArtifact:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Enchantment -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/copy_artifact.jpg SetInfo:LEA|Rare|http://magiccards.info/scans/en/al/54.jpg diff --git a/res/cardsfolder/e/evil_twin.txt b/res/cardsfolder/e/evil_twin.txt index 7b70e04b520..2957a91017c 100644 --- a/res/cardsfolder/e/evil_twin.txt +++ b/res/cardsfolder/e/evil_twin.txt @@ -8,7 +8,6 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddAbilities$ EvilTwin SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature. -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/212.jpg diff --git a/res/cardsfolder/j/jwari_shapeshifter.txt b/res/cardsfolder/j/jwari_shapeshifter.txt index 7c1d8919bdb..badfdbeec90 100644 --- a/res/cardsfolder/j/jwari_shapeshifter.txt +++ b/res/cardsfolder/j/jwari_shapeshifter.txt @@ -6,7 +6,6 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered -SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg diff --git a/res/cardsfolder/p/phantasmal_image.txt b/res/cardsfolder/p/phantasmal_image.txt index f5280386514..ca43d79e465 100644 --- a/res/cardsfolder/p/phantasmal_image.txt +++ b/res/cardsfolder/p/phantasmal_image.txt @@ -9,7 +9,6 @@ SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choice SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Illusion | AddTriggers$ PhantasmalImageTgtTrig | AddSVars$ PhantasmalImageSac SVar:PhantasmalImageTgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ PhantasmalImageSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it. SVar:PhantasmalImageSac:AB$Sacrifice | Cost$ 0 | Defined$ Self -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg diff --git a/res/cardsfolder/p/phyrexian_metamorph.txt b/res/cardsfolder/p/phyrexian_metamorph.txt index a0ea5620e7c..810705c334c 100644 --- a/res/cardsfolder/p/phyrexian_metamorph.txt +++ b/res/cardsfolder/p/phyrexian_metamorph.txt @@ -6,7 +6,6 @@ PT:0/0 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Artifact -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg diff --git a/res/cardsfolder/q/quicksilver_gargantuan.txt b/res/cardsfolder/q/quicksilver_gargantuan.txt index fc4dc09a70c..1ac1eba19e7 100644 --- a/res/cardsfolder/q/quicksilver_gargantuan.txt +++ b/res/cardsfolder/q/quicksilver_gargantuan.txt @@ -6,7 +6,6 @@ PT:7/7 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | SetPower$ 7 | SetToughness$ 7 -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg diff --git a/res/cardsfolder/s/sakashima_the_impostor.txt b/res/cardsfolder/s/sakashima_the_impostor.txt index 562d554fbda..b7bc2516e14 100644 --- a/res/cardsfolder/s/sakashima_the_impostor.txt +++ b/res/cardsfolder/s/sakashima_the_impostor.txt @@ -9,7 +9,6 @@ SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choice SVar:DBCopy:DB$ Clone | Defined$ Remembered | KeepName$ True | AddTypes$ Legendary | AddAbilities$ ReturnSakashima | AddSVars$ TrigReturnSak SVar:ReturnSakashima:AB$ DelayedTrigger | Cost$ 2 U U | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturnSak | SpellDescription$ Return CARDNAME to it's owners hand at the beginning of the next end step. SVar:TrigReturnSak:AB$ChangeZone | Cost$ 0 | Defined$ Self | Origin$ Battlefield | Destination$ Hand -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashima_the_impostor.jpg Oracle:You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step." diff --git a/res/cardsfolder/s/sakashimas_student.txt b/res/cardsfolder/s/sakashimas_student.txt index 20f6020df54..4a355a91b06 100644 --- a/res/cardsfolder/s/sakashimas_student.txt +++ b/res/cardsfolder/s/sakashimas_student.txt @@ -7,7 +7,6 @@ A:AB$ ChangeZone | Cost$ 1 U Return<1/Creature.attacking+unblocked> | CostDesc$ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | AddTypes$ Ninja -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/sakashimas_student.jpg SetInfo:PC2|Rare|http://magiccards.info/scans/en/pc2/24.jpg diff --git a/res/cardsfolder/v/vesuva.txt b/res/cardsfolder/v/vesuva.txt index 30728cabb58..b44c7345f10 100644 --- a/res/cardsfolder/v/vesuva.txt +++ b/res/cardsfolder/v/vesuva.txt @@ -5,7 +5,6 @@ Text:no text T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseLand | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield tapped as a copy of any land on the battlefield. SVar:ChooseLand:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Land.Other | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ Clone | Defined$ Remembered | IntoPlayTapped$ True -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/vesuva.jpg SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/281.jpg