From 7f0f62abb66322bf0a34eef028db287e64b97c64 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Thu, 27 Dec 2018 16:41:10 +0100 Subject: [PATCH] Seance: use AddTypes and AtEOT instead of extra Clones defined --- .../java/forge/game/ability/AbilityUtils.java | 4 ---- .../ability/effects/CopyPermanentEffect.java | 2 -- .../src/main/java/forge/game/card/Card.java | 18 +----------------- .../main/java/forge/game/card/CardFactory.java | 1 - .../main/java/forge/game/card/CardUtil.java | 1 - .../main/java/forge/game/zone/MagicStack.java | 7 ------- forge-gui/res/cardsfolder/s/seance.txt | 5 +---- 7 files changed, 2 insertions(+), 36 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 22b4bba4797..1629ce8167d 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -225,10 +225,6 @@ public class AbilityUtils { if (o != null && o instanceof Card) { cards.add(game.getCardState((Card) o)); } - } else if (defined.equals("Clones")) { - for (final Card clone : hostCard.getClones()) { - cards.add(game.getCardState(clone)); - } } else if (defined.equals("Imprinted")) { for (final Card imprint : hostCard.getImprintedCards()) { cards.add(game.getCardState(imprint)); diff --git a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java index a534d296e96..54e96418b11 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CopyPermanentEffect.java @@ -164,7 +164,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect { } else { tgtCards = getTargetCards(sa); } - host.clearClones(); for (final Card c : tgtCards) { if (!sa.usesTargeting() || c.canBeTargetedBy(sa)) { @@ -184,7 +183,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect { //copyInPlay.setSetCode(c.getSetCode()); copyInPlay.setCloneOrigin(host); - sa.getHostCard().addClone(copyInPlay); if (!pumpKeywords.isEmpty()) { copyInPlay.addChangedCardKeywords(pumpKeywords, Lists.newArrayList(), false, false, timestamp); } diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index cd54eab13f7..ece24a74a2f 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -101,7 +101,7 @@ public class Card extends GameEntity implements Comparable { // cards attached or otherwise linked to this card private CardCollection hauntedBy, devouredCards, delvedCards, convokedCards, imprintedCards, encodedCards; - private CardCollection mustBlockCards, clones, gainControlTargets, chosenCards, blockedThisTurn, blockedByThisTurn; + private CardCollection mustBlockCards, gainControlTargets, chosenCards, blockedThisTurn, blockedByThisTurn; // if this card is attached or linked to something, what card is it currently attached to private Card encoding, cloneOrigin, haunting, effectSource, pairedWith, meldedWith; @@ -1031,22 +1031,6 @@ public class Card extends GameEntity implements Comparable { public final GameEntity getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; } public final void setMustAttackEntityThisTurn(GameEntity entThisTurn) { mustAttackEntityThisTurn = entThisTurn; } - public final CardCollectionView getClones() { - return CardCollection.getView(clones); - } - public final void setClones(final Iterable clones0) { - clones = clones0 == null ? null : new CardCollection(clones0); - } - public final void addClone(final Card c) { - if (clones == null) { - clones = new CardCollection(); - } - clones.add(c); - } - public final void clearClones() { - clones = null; - } - public final Card getCloneOrigin() { return cloneOrigin; } diff --git a/forge-game/src/main/java/forge/game/card/CardFactory.java b/forge-game/src/main/java/forge/game/card/CardFactory.java index 2f9114b4143..e353efe0382 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactory.java +++ b/forge-game/src/main/java/forge/game/card/CardFactory.java @@ -95,7 +95,6 @@ public class CardFactory { out.setAttachedCards(in.getAttachedCards()); out.setEntityAttachedTo(in.getEntityAttachedTo()); - out.setClones(in.getClones()); out.setCastSA(in.getCastSA()); for (final Object o : in.getRemembered()) { out.addRemembered(o); diff --git a/forge-game/src/main/java/forge/game/card/CardUtil.java b/forge-game/src/main/java/forge/game/card/CardUtil.java index d8f143470a6..b6db1c2e940 100644 --- a/forge-game/src/main/java/forge/game/card/CardUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardUtil.java @@ -269,7 +269,6 @@ public final class CardUtil { newCopy.setAttachedCards(in.getAttachedCards()); newCopy.setEntityAttachedTo(in.getEntityAttachedTo()); - newCopy.setClones(in.getClones()); newCopy.setHaunting(in.getHaunting()); newCopy.setCopiedPermanent(in.getCopiedPermanent()); for (final Card haunter : in.getHauntedBy()) { diff --git a/forge-game/src/main/java/forge/game/zone/MagicStack.java b/forge-game/src/main/java/forge/game/zone/MagicStack.java index 53e8e676291..a449a07789f 100644 --- a/forge-game/src/main/java/forge/game/zone/MagicStack.java +++ b/forge-game/src/main/java/forge/game/zone/MagicStack.java @@ -569,13 +569,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable 0) { - for (final Card c : game.getCardsIn(ZoneType.Battlefield)) { - if (c.equals(tmp)) { - c.setClones(tmp.getClones()); - } - } - } // xManaCostPaid will reset when cast the spell, comment out to fix Venarian Gold // sa.getHostCard().setXManaCostPaid(0); } diff --git a/forge-gui/res/cardsfolder/s/seance.txt b/forge-gui/res/cardsfolder/s/seance.txt index b90424950a9..c0411422466 100644 --- a/forge-gui/res/cardsfolder/s/seance.txt +++ b/forge-gui/res/cardsfolder/s/seance.txt @@ -3,10 +3,7 @@ ManaCost:2 W W Types:Enchantment T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigExile | TriggerDescription$ At the beginning of each upkeep, you may exile target creature card from your graveyard. If you do, create a token that's a copy of that card, except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. SVar:TrigExile:DB$ ChangeZone | RememberChanged$ True | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature.YouCtrl | ChangeNum$ 1 | SubAbility$ DBCopy -SVar:DBCopy:DB$ CopyPermanent | Defined$ Remembered | SubAbility$ DBAnimate | SpellDescription$ Create a token that's a copy of that card, except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. -SVar:DBAnimate:DB$ Animate | Defined$ Clones | Types$ Spirit | sVars$ SneakAttackEOT | SubAbility$ DelTrig -SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ DBExile | RememberObjects$ Clones | TriggerDescription$ CARDNAME - Exile the token at the beginning of the next end step. | SubAbility$ DBCleanup | AILogic$ Always -SVar:DBExile:DB$ ChangeZone | Defined$ DelayTriggerRemembered | Origin$ Battlefield | Destination$ Exile +SVar:DBCopy:DB$ CopyPermanent | Defined$ Remembered | AddTypes$ Spirit | AtEOT$ Exile | AddSVars$ SneakAttackEOT | SubAbility$ DBCleanup | SpellDescription$ Create a token that's a copy of that card, except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True AI:RemoveDeck:All SVar:SneakAttackEOT:SVar:EndOfTurnLeavePlay:True