Merge branch 'seanceCopyFix' into 'master'

Seance: use AddTypes and AtEOT instead of extra Clones defined

See merge request core-developers/forge!1249
This commit is contained in:
Michael Kamensky
2018-12-27 18:09:00 +00:00
7 changed files with 2 additions and 36 deletions

View File

@@ -225,10 +225,6 @@ public class AbilityUtils {
if (o != null && o instanceof Card) { if (o != null && o instanceof Card) {
cards.add(game.getCardState((Card) o)); 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")) { } else if (defined.equals("Imprinted")) {
for (final Card imprint : hostCard.getImprintedCards()) { for (final Card imprint : hostCard.getImprintedCards()) {
cards.add(game.getCardState(imprint)); cards.add(game.getCardState(imprint));

View File

@@ -164,7 +164,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
} else { } else {
tgtCards = getTargetCards(sa); tgtCards = getTargetCards(sa);
} }
host.clearClones();
for (final Card c : tgtCards) { for (final Card c : tgtCards) {
if (!sa.usesTargeting() || c.canBeTargetedBy(sa)) { if (!sa.usesTargeting() || c.canBeTargetedBy(sa)) {
@@ -184,7 +183,6 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
//copyInPlay.setSetCode(c.getSetCode()); //copyInPlay.setSetCode(c.getSetCode());
copyInPlay.setCloneOrigin(host); copyInPlay.setCloneOrigin(host);
sa.getHostCard().addClone(copyInPlay);
if (!pumpKeywords.isEmpty()) { if (!pumpKeywords.isEmpty()) {
copyInPlay.addChangedCardKeywords(pumpKeywords, Lists.<String>newArrayList(), false, false, timestamp); copyInPlay.addChangedCardKeywords(pumpKeywords, Lists.<String>newArrayList(), false, false, timestamp);
} }

View File

@@ -101,7 +101,7 @@ public class Card extends GameEntity implements Comparable<Card> {
// cards attached or otherwise linked to this card // cards attached or otherwise linked to this card
private CardCollection hauntedBy, devouredCards, delvedCards, convokedCards, imprintedCards, encodedCards; 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 // if this card is attached or linked to something, what card is it currently attached to
private Card encoding, cloneOrigin, haunting, effectSource, pairedWith, meldedWith; private Card encoding, cloneOrigin, haunting, effectSource, pairedWith, meldedWith;
@@ -1031,22 +1031,6 @@ public class Card extends GameEntity implements Comparable<Card> {
public final GameEntity getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; } public final GameEntity getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; }
public final void setMustAttackEntityThisTurn(GameEntity entThisTurn) { mustAttackEntityThisTurn = entThisTurn; } public final void setMustAttackEntityThisTurn(GameEntity entThisTurn) { mustAttackEntityThisTurn = entThisTurn; }
public final CardCollectionView getClones() {
return CardCollection.getView(clones);
}
public final void setClones(final Iterable<Card> 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() { public final Card getCloneOrigin() {
return cloneOrigin; return cloneOrigin;
} }

View File

@@ -95,7 +95,6 @@ public class CardFactory {
out.setAttachedCards(in.getAttachedCards()); out.setAttachedCards(in.getAttachedCards());
out.setEntityAttachedTo(in.getEntityAttachedTo()); out.setEntityAttachedTo(in.getEntityAttachedTo());
out.setClones(in.getClones());
out.setCastSA(in.getCastSA()); out.setCastSA(in.getCastSA());
for (final Object o : in.getRemembered()) { for (final Object o : in.getRemembered()) {
out.addRemembered(o); out.addRemembered(o);

View File

@@ -269,7 +269,6 @@ public final class CardUtil {
newCopy.setAttachedCards(in.getAttachedCards()); newCopy.setAttachedCards(in.getAttachedCards());
newCopy.setEntityAttachedTo(in.getEntityAttachedTo()); newCopy.setEntityAttachedTo(in.getEntityAttachedTo());
newCopy.setClones(in.getClones());
newCopy.setHaunting(in.getHaunting()); newCopy.setHaunting(in.getHaunting());
newCopy.setCopiedPermanent(in.getCopiedPermanent()); newCopy.setCopiedPermanent(in.getCopiedPermanent());
for (final Card haunter : in.getHauntedBy()) { for (final Card haunter : in.getHauntedBy()) {

View File

@@ -569,13 +569,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
// verified by System.identityHashCode(card); // verified by System.identityHashCode(card);
final Card tmp = sa.getHostCard(); final Card tmp = sa.getHostCard();
if (!(sa instanceof WrappedAbility && sa.isTrigger())) { tmp.setCanCounter(true); } // reset mana pumped counter magic flag if (!(sa instanceof WrappedAbility && sa.isTrigger())) { tmp.setCanCounter(true); } // reset mana pumped counter magic flag
if (tmp.getClones().size() > 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 // xManaCostPaid will reset when cast the spell, comment out to fix Venarian Gold
// sa.getHostCard().setXManaCostPaid(0); // sa.getHostCard().setXManaCostPaid(0);
} }

View File

@@ -3,10 +3,7 @@ ManaCost:2 W W
Types:Enchantment 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. 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: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: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: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:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:SneakAttackEOT:SVar:EndOfTurnLeavePlay:True SVar:SneakAttackEOT:SVar:EndOfTurnLeavePlay:True