grinning_totem.txt refactor

This commit is contained in:
Northmoc
2022-08-09 19:21:06 -04:00
parent bed7321d65
commit 0ebb717057

View File

@@ -1,21 +1,11 @@
Name:Grinning Totem
ManaCost:4
Types:Artifact
A:AB$ ChangeZone | Cost$ 2 T Sac<1/CARDNAME> | ValidTgts$ Player.Opponent | IsCurse$ True | Chooser$ You | Origin$ Library | Destination$ Exile | ChangeType$ Card | ChangeNum$ 1 | IsCurse$ True | RememberChanged$ True | SubAbility$ TotemEffect | SpellDescription$ Search target opponent's library for a card and exile it. Then that player shuffles. Until the beginning of your next upkeep, you may play that card. At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard. | StackDescription$ SpellDescription
SVar:TotemEffect:DB$ Effect | StaticAbilities$ STGrinning | Duration$ Permanent | RememberObjects$ Remembered | Triggers$ TrigDuration,TrigReturn,TrigLandPlayed,TrigCast | SubAbility$ DBResetSVar
# Even though the Effect is "Permanent", it's not really permanent
SVar:DBResetSVar:DB$ StoreSVar | SVar$ ActiveTotem | Type$ Number | Expression$ 1 | SubAbility$ DBCleanup
A:AB$ ChangeZone | Cost$ 2 T Sac<1/CARDNAME> | ValidTgts$ Opponent | IsCurse$ True | Chooser$ You | Origin$ Library | Destination$ Exile | ChangeType$ Card | ChangeNum$ 1 | IsCurse$ True | RememberChanged$ True | SubAbility$ TotemEffect | SpellDescription$ Search target opponent's library for a card and exile it. Then that player shuffles. Until the beginning of your next upkeep, you may play that card. At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard. | StackDescription$ {p:You} searches {p:Targeted}'s library for a card and exiles it. Then {p:Targeted} shuffles.
SVar:TotemEffect:DB$ Effect | StaticAbilities$ STGrinning | Duration$ Permanent | RememberObjects$ Remembered | ExileOnMoved$ Exile | SubAbility$ DBDelayedTrigger | SpellDescription$ Until the beginning of your next upkeep, you may play that card. At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard.
SVar:STGrinning:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | EffectZone$ Command | AffectedZone$ Exile | Duration$ UntilYourNextUpkeep | Description$ Until the beginning of your next upkeep, you may play that card.
SVar:DBDelayedTrigger:DB$ DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | IsPresent$ Card.IsRemembered | PresentZone$ Exile | RememberObjects$ Remembered | Execute$ DBReturn | SubAbility$ DBCleanup | TriggerDescription$ At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard.
SVar:DBReturn:DB$ ChangeZone | Defined$ RememberedLKI | Origin$ Exile | Destination$ Graveyard
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:ActiveTotem:Number$1
SVar:STGrinning:Mode$ Continuous | Affected$ Card.IsRemembered+OppOwn | MayPlay$ True | EffectZone$ Command | AffectedZone$ Exile | CheckSVar$ ActiveTotem | Description$ Until the beginning of your next upkeep, you may play that card.
# Turn off the duration at the beginning of the upkeep statically
SVar:TrigDuration:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Static$ True | TriggerZones$ Command | Execute$ DBDuration
SVar:DBDuration:DB$ StoreSVar | SVar$ ActiveTotem | Type$ Number | Expression$ 0
# Return the card as a normal trigger
SVar:TrigReturn:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execute$ DBReturn | OneOff$ True | TriggerDescription$ At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard.
SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Graveyard
# Remove Totem Effect when the card is played
SVar:TrigLandPlayed:Mode$ LandPlayed | ValidCard$ Land.IsRemembered | Static$ True | TriggerZones$ Command | Execute$ RemoveEffect
SVar:TrigCast:Mode$ SpellCast | ValidCard$ Card.IsRemembered | Static$ True | TriggerZones$ Command | Execute$ RemoveEffect
AI:RemoveDeck:All
Oracle:{2}, {T}, Sacrifice Grinning Totem: Search target opponent's library for a card and exile it. Then that player shuffles. Until the beginning of your next upkeep, you may play that card. At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard.