Fixes to commander damage, deathtouch, MAT card variants.

March of the Machine: The Aftermath (MAT) card variants.
The previous implementation of the deathtouch ability had a bug that destroyed planeswalkers even with any amount of damage. This has been fixed.
If a player has been dealt 21 points of combat damage by a particular Commander during the game, that player loses a game. The damage rule with commanders was incorrect in counting any type of damage, not only combat damage.

Bug fixes:
Athreos, Shroud-Veiled
Endless Atlas
Natural State
Savage Gorger
Kytheon's Irregulars
Lion Sash
Pyrophobia
Minas Tirith
Sakashima of a Thousand Faces
This commit is contained in:
Eduardo MG
2024-02-16 12:46:41 -06:00
parent 603af22b79
commit a0b3c00211
7 changed files with 2017 additions and 157 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -218,6 +218,9 @@
# Eternalize
#AUTO_DEFINE _ETERNALIZE_ name(Eternalize) clone and!( transforms((Zombie,removemc,setpower=4,settoughness=4,black)) forever )! assorcery
# Explores
#AUTO_DEFINE _EXPLORES_ name(Explores) reveal:1 optionone if type(land|reveal)~lessthan~1 then transforms((,newability[counter(1/1)])) forever optiononeend optiontwo if type(land|reveal)~morethan~0 then name(move to Hand) target(<1>*|reveal) moveto(myHand) else transforms((,newability[Choice name(back to library) target(<1>*|reveal) moveto(mylibrary)],newability[Choice name(put into Graveyard) target(<1>*|reveal) moveto(myGraveyard)])) oneshot optiontwoend afterrevealed explores afterrevealedend revealend
# Discard a card. If you do, draw a card
#AUTO_DEFINE _DISCARD&DRAW_ reject notatarget(*|myhand) and!(draw:1 controller)!

View File

@@ -5328,8 +5328,8 @@ abilities=indestructible
auto=this(variable{orzhov}<7) transforms((removetypes,newability[becomes(Legendary Enchantment God)]))
auto=this(variable{orzhov}>6) transforms((Legendary Enchantment Creature))
auto=@each my endofturn:name(Put coin counter) target(other creature|battlefield) counter(0/0,1,Coin)
auto=@movedto(creature[counter{0/0.1.Coin}]|graveyard):name(Return to battlefield) all(trigger[to]) name(Return to battlefield) moveTo(mybattlefield)
auto=@movedto(creature[counter{0/0.1.Coin}]|exile):name(Return to battlefield) all(trigger[to]) name(Return to battlefield) moveTo(mybattlefield)
auto=@movedto(graveyard) from(creature[counter{1/1.1.coin}]|battlefield):all(trigger[to]) moveTo(mybattlefield)
auto=@movedto(exile) from(creature[counter{1/1.1.coin}]|battlefield):all(trigger[to]) moveTo(mybattlefield)
text=Indestructible -- As long as your devotion to white and black is less than seven, Athreos isn't a creature. -- At the beginning of your end step, put a coin counter on another target creature. -- Whenever a creature with a coin counter on it dies or is put into exile, return that card to the battlefield under your control.
mana={4}{W}{B}
type=Legendary Enchantment Creature
@@ -15313,6 +15313,7 @@ toughness=1
[/card]
[card]
name=Cenote Scout
aicode=activate transforms((,newability[explores],newability[if type(land[zpos=1]|mylibrary)~lessthan~1 then all(this) counter(1/1) else all(land[zpos=1]|mylibrary) moveto(myhand)])) oneshot
auto=name(Explores) reveal:1 optionone if type(land|reveal)~lessthan~1 then transforms((,newability[counter(1/1)])) forever optiononeend optiontwo if type(land|reveal)~morethan~0 then name(move to Hand) target(<1>*|reveal) moveto(myHand) else transforms((,newability[Choice name(back to library) target(<1>*|reveal) moveto(mylibrary)],newability[Choice name(put into Graveyard) target(<1>*|reveal) moveto(myGraveyard)])) oneshot optiontwoend afterrevealed explores afterrevealedend revealend
text=When Cenote Scout enters the battlefield, it explores. (Reveal the top card of your library. Put that card into your hand if it's a land. Otherwise, put a +1/+1 counter on this creature, then put the card back or put it into your graveyard.)
mana={G}
@@ -30022,7 +30023,7 @@ type=Enchantment
[/card]
[card]
name=Endless Atlas
auto=aslongas(*[land]|mybattlefield) {2}{T}:draw:1 controller >2
auto={2}{T}:draw:1 restriction{control three or more lands with same name}
text={2}, {T}: Draw a card. Activate this ability only if you control three or more lands with the same name.
mana={2}
type=Artifact
@@ -30492,7 +30493,7 @@ toughness=2
[card]
name=Eomer, Marshal of Rohan
abilities=haste
auto=@movedto(creature[legendary]|graveyard) from(battlefield) turnlimited:untap all(creature|mybattlefield) && nextphasealter(add,combatphases,controller,after<combatends>)
auto=@movedto(graveyard) from(creature[legendary&attacking]|myBattlefield) turnlimited:untap all(creature|mybattlefield) && nextphasealter(add,combatphases,controller,after<combatends>)
text=Haste -- Whenever one or more other attacking legendary creatures you control die, untap all creatures you control. After this phase, there is an additional combat phase. This ability triggers only once each turn.
mana={2}{R}{R}
type=Legendary Creature
@@ -58641,7 +58642,7 @@ toughness=3
name=Lion Sash
auto={2}:reconfigure
auto=this(cantargetcard(*[attached]|*) {2}{unattach}:name(Reconfigure unattach) name(Reconfigure unattach) donothing
auto=teach(creature) storedhascnt11/storedhascnt11 nonstatic
auto=teach(creature) transforms((,newability[storedhascnt11/storedhascnt11 nonstatic]))
auto={W}:name(Exile card from graveyard) target(*|graveyard) moveto(exile) and!( if cantargetcard(*[-instant;-sorcery]|*) then all(this) counter(1/1) )!
text={W}: Exile target card from a graveyard. If it was a permanent card, put a +1/+1 counter on Lion Sash. -- Equipped creature gets +1/+1 for each +1/+1 counter on Lion Sash. -- Reconfigure {2} ({2}: Attach to target creature you control; or unattach from a creature. Reconfigure only as a sorcery. While attached, this isn't a creature.)
mana={1}{W}
@@ -63411,7 +63412,7 @@ type=Artifact
name=Minas Tirith
auto=if type(creature[legendary]|myBattlefield)~equalto~0 then name(Enter tapped) name(Enter tapped) tap(noevent)
auto={T}:add{W}
auto=this(variable{creature[attacking]|mybattlefield}>=2) {1}{W}{T}:name(Draw a card) name(Draw a card) draw:1 controller
auto={1}{W}{T}:name(Draw a card) name(Draw a card) draw:1 controller restriction{compare(pattackedcount)~morethan~1}
text=Minas Tirith enters the battlefield tapped unless you control a legendary creature. -- {T}: Add {W}. -- {1}{W}, {T}: Draw a card. Activate only if you attacked with two or more creatures this turn.
type=Legendary Land
[/card]
@@ -77066,7 +77067,8 @@ type=Instant
[/card]
[card]
name=Pyrophobia
auto=damage:3 target(creature)
target=creature
auto=damage:3
auto=all(creature[coward]) cantblock ueot
text=Pyrophobia deals 3 damage to target creature. Cowards can't block this turn.
mana={1}{R}
@@ -79255,7 +79257,7 @@ toughness=7
name=Realm-Scorcher Hellkite
abilities=flying,haste,hasotherkicker
other={4}{R}{R}{S(artifact,enchantment|myBattlefield)} name(Bargain)
otherrestriction=type(*[artifact;enchantment;token]|mybattlefield)~morethan~1
otherrestriction=type(*[artifact;enchantment]|mybattlefield)~morethan~1
auto=if paid(alternative) then thisforeach(variable{4}) ability$!name(Choose one) choice name(Add white) add{W} _ choice name(Add blue) add{U} _ choice name(Add black) add{B} _ choice name(Add red) add{R} _ choice name(Add green) add{G}!$ controller
auto={1}{R}:damage:1 target(creature,player)
text=Bargain (You may sacrifice an artifact, enchantment, or token as you cast this spell.) -- Flying, haste -- When Realm-Scorcher Hellkite enters the battlefield, if it was bargained, add four mana in any combination of colors. -- {1}{R}: Realm-Scorcher Hellkite deals 1 damage to any target.
@@ -84585,7 +84587,7 @@ toughness=7
[card]
name=Sakashima of a Thousand Faces
abilities=partner,legendruleremove
auto=may copy target(creature|mybattlefield) && all(this) transforms((,newability[partner],newability[legendruleremove])) forever
auto=may copy target(creature|mybattlefield)
text=You may have Sakashima of a Thousand Faces enter the battlefield as a copy of another creature you control, except it has Sakashima of a Thousand Faces's other abilities. -- The "legend rule" doesn't apply to permanents you control. -- Partner (You can have two commanders if both have partner.)
mana={3}{U}
type=Legendary Creature
@@ -85684,8 +85686,7 @@ type=Instant
[card]
name=Savage Gorger
abilities=flying
otherrestriction=_SPECTACLE_
auto=@each my endofturn:counter(1/1)
auto=@each my endofturn restriction{_SPECTACLE_}:counter(1/1)
text=Flying -- At the beginning of your end step, if an opponent lost life this turn, put a +1/+1 counter on Savage Gorger. (Damage causes loss of life.)
mana={1}{B}{B}
type=Creature
@@ -96911,7 +96912,8 @@ type=Sorcery
[card]
name=Storm the Citadel
auto=all(creature|myBattlefield) +2/+2
auto=all(creature|myBattlefield) @combatdamaged(player,planeswalker) from(this):destroy target(artifact,enchantment)
auto=all(creature|myBattlefield) transforms((,newability[@combatdamaged(player) from(this):destroy target(*[artifact;enchantment])]))
auto=all(creature|myBattlefield) transforms((,newability[@combatdamaged(Planeswalker) from(this):destroy target(*[artifact;enchantment])]))
text=Until end of turn, creatures you control get +2/+2 and gain "Whenever this creature deals combat damage to a player or planeswalker, destroy target artifact or enchantment defending player controls."
mana={4}{G}
type=Sorcery
@@ -112112,7 +112114,7 @@ type=Instant
[card]
name=Warkite Marauder
abilities=flying
auto=_ATTACKING_target(creature|opponentBattlefield) loseabilities
auto=_ATTACKING_target(creature|opponentBattlefield) transforms((,newability[loseabilities],setpower=0,settoughness=1))
text=Flying -- Whenever Warkite Marauder attacks, target creature defending player controls loses all abilities and has base power and toughness 0/1 until end of turn.
mana={1}{U}
type=Creature

View File

@@ -65232,8 +65232,8 @@ toughness=2
[/card]
[card]
name=Kytheon's Irregulars
auto={W}{W}:tap target(creature)
auto=_RENOWN_(1)
auto={W}{W}:tap target(creature)
text=Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.) -- {W}{W}: Tap target creature.
mana={2}{W}{W}
type=Creature
@@ -78500,7 +78500,7 @@ type=Sorcery
[card]
name=Natural State
auto=destroy
target=artifact,enchantment[manacost<=3]
target=*[artifact;enchantment;manacost<=3]
text=Destroy target artifact or enchantment with mana value 3 or less.
mana={G}
type=Instant
@@ -117224,7 +117224,7 @@ type=Artifact
[/card]
[card]
name=Syphon Flesh
auto=ability$! sacrifice notatarget(creature|mybattlefield) and!( _ZOMBIETOKEN_ opponent )! !$ opponent
auto=ability$! sacrifice notatarget(creature|mybattlefield) and!( _ZOMBIETOKEN_ )! opponent !$ opponent
text=Each other player sacrifices a creature. You put a 2/2 black Zombie creature token onto the battlefield for each creature sacrificed this way.
mana={4}{B}
type=Sorcery

View File

@@ -266,7 +266,7 @@ int Damage::resolve()
else
{
((MTGCardInstance*)source)->damageToOpponent += damage;
if(((MTGCardInstance*)source)->isCommander > 0)
if(((MTGCardInstance*)source)->isCommander > 0 && typeOfDamage == DAMAGE_COMBAT)
((MTGCardInstance*)source)->damageInflictedAsCommander += damage;
}
target->lifeLostThisTurn += damage;
@@ -283,7 +283,7 @@ int Damage::resolve()
}
WEvent * lifed = NEW WEventLife((Player*)target,-damage, source);
observer->receiveEvent(lifed);
if(((MTGCardInstance*)source)->damageInflictedAsCommander > 20) // if a Commander has dealt 21 or more damages to a player, he loose game.
if(((MTGCardInstance*)source)->damageInflictedAsCommander > 20) // If a player has been dealt 21 points of combat damage by a particular Commander during the game, that player loses a game.
observer->setLoser(((MTGCardInstance*)source)->controller()->opponent());
}
}

View File

@@ -4077,8 +4077,11 @@ int MTGDeathtouchRule::receiveEvent(WEvent * event)
if (card->basicAbilities[(int)Constants::DEATHTOUCH]||card->basicAbilities[(int)Constants::PERPETUALDEATHTOUCH]||card->LKIbasicAbilities[(int)Constants::DEATHTOUCH]||card->LKIbasicAbilities[(int)Constants::PERPETUALDEATHTOUCH])
{
_target->destroy();
return 1;
if(_target->isCreature())
{
_target->destroy();
return 1;
}
}
}
return 0;