From f895ae627d99140aaa0f839b1fe6ece84c670571 Mon Sep 17 00:00:00 2001 From: swordshine Date: Thu, 2 May 2013 08:15:04 +0000 Subject: [PATCH] - Fixed Spellweaver Helix --- res/cardsfolder/s/spellweaver_helix.txt | 6 ++++-- src/main/java/forge/Card.java | 18 +++++++++++++++++ .../java/forge/card/ability/AbilityUtils.java | 20 ------------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/res/cardsfolder/s/spellweaver_helix.txt b/res/cardsfolder/s/spellweaver_helix.txt index ddd7fda8664..1369d362c0e 100644 --- a/res/cardsfolder/s/spellweaver_helix.txt +++ b/res/cardsfolder/s/spellweaver_helix.txt @@ -3,8 +3,10 @@ ManaCost:3 Types:Artifact T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigSpellweaverExile | OptionalDecider$ You | TriggerDescription$ Imprint - When CARDNAME enters the battlefield, you may exile two target sorcery cards from a single graveyard. SVar:TrigSpellweaverExile:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Exile | TargetsFromSingleZone$ True | ValidTgts$ Card.Sorcery | TargetMin$ 2 | TargetMax$ 2 | TgtPrompt$ Select two target sorcery cards from a single graveyard | Imprint$ True | SpellDescription$ Exile two sorcery cards from a single graveyard. -T:Mode$ SpellCast | ValidCard$ Card.sharesNameWith Imprinted | Execute$ TrigSpellweaverCopy | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts a card, if it has the same name as one of the cards exiled with CARDNAME, you may copy the other. If you do, you may cast the copy without paying its mana cost. -SVar:TrigSpellweaverCopy:AB$ Play | Cost$ 0 | Defined$ Imprinted.doesNotShareNameWith+TriggeredCard+Exiled | WithoutManaCost$ True | Optional$ True | CopyCard$ True +T:Mode$ SpellCast | ValidCard$ Card.sharesNameWith Imprinted+nonToken | Execute$ TrigSpellweaverCopy | OptionalDecider$ You | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts a card, if it has the same name as one of the cards exiled with CARDNAME, you may copy the other. If you do, you may cast the copy without paying its mana cost. +SVar:TrigSpellweaverCopy:AB$ Pump | Cost$ 0 | RememberObjects$ TriggeredCard | SubAbility$ DBPlay +SVar:DBPlay:DB$ Play | Defined$ ValidAll Card.IsImprinted+doesNotShareNameWith Remembered+inZoneExile | WithoutManaCost$ True | Optional$ True | CopyCard$ True | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/spellweaver_helix.jpg diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 7b6425e1334..d1911193e3f 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -5855,6 +5855,24 @@ public class Card extends GameEntity implements Comparable { return false; } } + } else if (property.startsWith("doesNotShareNameWith")) { + if (property.equals("doesNotShareNameWith")) { + if (this.getName().equals(source.getName())) { + return false; + } + } else { + final String restriction = property.split("doesNotShareNameWith ")[1]; + if (restriction.equals("Remembered")) { + for (final Object rem : source.getRemembered()) { + if (rem instanceof Card) { + final Card card = (Card) rem; + if (this.getName().equals(card.getName())) { + return false; + } + } + } + } + } } else if (property.startsWith("sharesControllerWith")) { if (property.equals("sharesControllerWith")) { if (!this.sharesControllerWith(source)) { diff --git a/src/main/java/forge/card/ability/AbilityUtils.java b/src/main/java/forge/card/ability/AbilityUtils.java index 1414e46a208..8d9299d8e7e 100644 --- a/src/main/java/forge/card/ability/AbilityUtils.java +++ b/src/main/java/forge/card/ability/AbilityUtils.java @@ -984,26 +984,6 @@ public class AbilityUtils { if (card.getEffectSource() != null) { sas.addAll(card.getEffectSource().getSpellAbilities()); } - } else if (defined.equals("Imprinted.doesNotShareNameWith+TriggeredCard+Exiled")) { - //get Imprinted list - ArrayList imprintedCards = new ArrayList(); - for (final Card imp : card.getImprinted()) { - imprintedCards.addAll(imp.getSpellAbilities()); - } //get Triggered card - Card triggeredCard = null; - final SpellAbility root = sa.getRootAbility(); - final Object crd = root.getTriggeringObject("Card"); - if (crd instanceof Card) { - triggeredCard = game.getCardState((Card) crd); - } //find the imprinted card that does not share a name with the triggered card - for (final SpellAbility spell : imprintedCards) { - if (!spell.getSourceCard().getName().equals(triggeredCard.getName())) { - sas.add(spell); - } - } //is it exiled? - if (!sas.get(0).getSourceCard().isInZone(ZoneType.Exile)) { - sas.clear(); - } } if (s != null) {