Name:Kharasha Foothills
ManaCost:no cost
Types:Plane Mongseng
T:Mode$ Attacks | ValidCard$ Creature.YouCtrl | TriggerZones$ Command | Attacked$ Player | Execute$ TrigCopy | TriggerDescription$ Whenever a creature you control attacks a player, for each other opponent, you may create a token that's a copy of that creature, tapped and attacking that opponent. Exile those tokens at the beginning of the next end step.
SVar:TrigCopy:DB$ RepeatEach | RepeatPlayers$ OppNonTriggeredDefender | RepeatSubAbility$ DBCopy | ChangeZoneTable$ True | SubAbility$ DelTrig
SVar:DBCopy:DB$ CopyPermanent | Defined$ TriggeredAttacker | NumCopies$ 1 | TokenAttacking$ Remembered | TokenTapped$ True | Optional$ True | ImprintTokens$ True
# The DelayedTrigger is for all player, not just for each attacking, so can't use AtEOT there
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ TrigExile | RememberObjects$ ImprintedLKI | TriggerDescription$ At the beginning of the next end step, exile those tokens. | SubAbility$ DBCleanup
SVar:TrigExile:DB$ ChangeZone | Defined$ DelayTriggerRememberedLKI | Origin$ Battlefield | Destination$ Exile
T:Mode$ ChaosEnsues | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever chaos ensues, you may sacrifice any number of creatures. If you do, CARDNAME deals that much damage to target creature.
SVar:RolledChaos:DB$ Sacrifice | Defined$ You | Amount$ SacX | SacValid$ Creature | RememberSacrificed$ True | Optional$ True | SubAbility$ DBDmg
SVar:SacX:Count$Valid Creature.YouCtrl
SVar:DBDmg:DB$ DealDamage | ValidTgts$ Creature | NumDmg$ DmgX | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True
SVar:DmgX:Remembered$Amount
Oracle:Whenever a creature you control attacks a player, for each other opponent, you may create a token that's a copy of that creature, tapped and attacking that opponent. Exile those tokens at the beginning of the next end step.\nWhenever chaos ensues, you may sacrifice any number of creatures. If you do, Kharasha Foothills deals that much damage to target creature.
