diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersNoteEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersNoteEffect.java index 9cbd6c7258e..b2705b69516 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersNoteEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersNoteEffect.java @@ -28,9 +28,9 @@ public class CountersNoteEffect extends SpellAbilityEffect { GameEntityCounterTable table = new GameEntityCounterTable(); for (Card c : getDefinedCardsOrTargeted(sa)) { if (mode.equals(MODE_STORE)) { - noteCounters(c, c); + noteCounters(c, source); } else if (mode.equals(MODE_LOAD)) { - loadCounters(c, c, p, table); + loadCounters(c, source, p, table); } } table.triggerCountersPutAll(game); diff --git a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java index 081b0045a23..92f6a45c2a6 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/EffectEffect.java @@ -24,6 +24,7 @@ import forge.game.zone.ZoneType; import java.util.EnumSet; import java.util.List; +import java.util.Map; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -53,6 +54,7 @@ public class EffectEffect extends SpellAbilityEffect { String[] effectReplacementEffects = null; FCollection rememberList = null; String effectImprinted = null; + String noteCounterDefined = null; List effectOwner = null; boolean imprintOnHost = false; @@ -101,6 +103,10 @@ public class EffectEffect extends SpellAbilityEffect { effectImprinted = sa.getParam("ImprintCards"); } + if (sa.hasParam("NoteCounterDefined")) { + noteCounterDefined = sa.getParam("NoteCounterDefined"); + } + String name = sa.getParam("Name"); if (name == null) { name = hostCard.getName() + "'s Effect"; @@ -224,6 +230,13 @@ public class EffectEffect extends SpellAbilityEffect { } } + // Note counters on defined + if (noteCounterDefined != null) { + for (final Card c : AbilityUtils.getDefinedCards(hostCard, noteCounterDefined, sa)) { + noteCounters(c, eff); + } + } + // Set Chosen Color(s) if (hostCard.hasChosenColor()) { eff.setChosenColors(Lists.newArrayList(hostCard.getChosenColors())); @@ -324,4 +337,12 @@ public class EffectEffect extends SpellAbilityEffect { } } + private void noteCounters(Card notee, Card source) { + for(Map.Entry counter : notee.getCounters().entrySet()) { + StringBuilder sb = new StringBuilder(); + sb.append("NoteCounters").append(counter.getKey().getName()); + source.setSVar(sb.toString(), counter.getValue().toString()); + } + } + } diff --git a/forge-gui/res/cardsfolder/t/tawnoss_coffin.txt b/forge-gui/res/cardsfolder/t/tawnoss_coffin.txt index cd050c20013..547f87763ea 100644 --- a/forge-gui/res/cardsfolder/t/tawnoss_coffin.txt +++ b/forge-gui/res/cardsfolder/t/tawnoss_coffin.txt @@ -2,16 +2,15 @@ Name:Tawnos's Coffin ManaCost:4 Types:Artifact K:You may choose not to untap CARDNAME during your untap step. -A:AB$ Pump | Cost$ 3 T | ValidTgts$ Creature | ImprintCards$ Targeted | SubAbility$ RecordCounters | StackDescription$ SpellDescription | SpellDescription$ Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature. When CARDNAME leaves the battlefield or becomes untapped, return that exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the other exiled cards to the battlefield under their owner's control attached to that permanent. -SVar:RecordCounters:DB$ NoteCounters | Mode$ Store | Defined$ Imprinted | SubAbility$ DBRememberAura +A:AB$ Pump | Cost$ 3 T | ValidTgts$ Creature | ImprintCards$ Targeted | SubAbility$ DBRememberAura | StackDescription$ SpellDescription | SpellDescription$ Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature. When CARDNAME leaves the battlefield or becomes untapped, return that exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the other exiled cards to the battlefield under their owner's control attached to that permanent. SVar:DBRememberAura:DB$ PumpAll | ValidCards$ Aura.AttachedTo Creature.IsImprinted | RememberAllPumped$ True | StackDescription$ None | SubAbility$ DBEffect -SVar:DBEffect:DB$ Effect | Triggers$ LeavesPlay,Untap | SVars$ RestoreCounters,TrigReturn,TrigAuraReturn,ExileSelf | References$ LeavesPlay,Untap | ImprintCards$ ParentTarget | RememberObjects$ Remembered | SubAbility$ DBExile +SVar:DBEffect:DB$ Effect | Triggers$ LeavesPlay,Untap | SVars$ RestoreCounters,TrigReturn,TrigAuraReturn,ExileSelf | ImprintCards$ ParentTarget | RememberObjects$ Remembered | NoteCounterDefined$ Imprinted | SubAbility$ DBExile SVar:DBExile:DB$ ChangeZoneAll | Origin$ Battlefield | Destination$ Exile | ChangeType$ Card.IsRemembered,Card.IsImprinted | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True SVar:LeavesPlay:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.EffectSource | Execute$ RestoreCounters | TriggerController$ TriggeredCardController | TriggerDescription$ When EFFECTSOURCE leaves the battlefield or becomes untapped, return that exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the other exiled cards to the battlefield under their owner's control attached to that permanent. -SVar:Untap:Mode$ Untaps | ValidCard$ Card.EffectSource | Execute$ RestoreCounters | TriggerController$ TriggeredCardController | Secondary$ True | TriggerDescription$ When EFFECTSOURCE leaves the battlefield or becomes untapped, return that exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the other exiled cards to the battlefield under their owner's control attached to that permanent. -SVar:RestoreCounters:DB$ NoteCounters | Mode$ Load | Defined$ Imprinted | SubAbility$ TrigReturn -SVar:TrigReturn:DB$ ChangeZone | Defined$ Imprinted | Origin$ Exile | Destination$ Battlefield | Tapped$ True | SubAbility$ TrigAuraReturn +SVar:Untap:Mode$ Untaps | ValidCard$ Card.EffectSource | Execute$ TrigReturn | TriggerController$ TriggeredCardController | Secondary$ True | TriggerDescription$ When EFFECTSOURCE leaves the battlefield or becomes untapped, return that exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the other exiled cards to the battlefield under their owner's control attached to that permanent. +SVar:TrigReturn:DB$ ChangeZone | Defined$ Imprinted | Origin$ Exile | Destination$ Battlefield | Tapped$ True | SubAbility$ RestoreCounters +SVar:RestoreCounters:DB$ NoteCounters | Mode$ Load | Defined$ Imprinted | SubAbility$ TrigAuraReturn SVar:TrigAuraReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | AttachedTo$ Valid Creature.IsImprinted | SubAbility$ ExileSelf SVar:ExileSelf:DB$ ChangeZone | Origin$ Command | Destination$ Exile | Defined$ Self AI:RemoveDeck:All