From 75347a2f3771f673d466e4ce90b5779af6512347 Mon Sep 17 00:00:00 2001 From: valfieri Date: Mon, 12 Oct 2020 17:20:07 +0200 Subject: [PATCH] Fixed a crash on counterremoved trigger, fixed/add some primitives that have ability to double the damage to any target. --- .../bin/Res/sets/primitives/borderline.txt | 91 ++++++++++++++++--- .../bin/Res/sets/primitives/unsupported.txt | 18 ---- projects/mtg/include/AllAbilities.h | 2 +- 3 files changed, 79 insertions(+), 32 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index c5554157a..bac675c6d 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1262,7 +1262,15 @@ toughness=3 [/card] [card] name=Angrath's Marauders -auto=@damaged(creature,player,planeswalker) once:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[instant;sorcery]|mystack,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[enchantment;artifact;land;planeswalker]|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(creature[-Angrath's Marauders]|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(creature[Angrath's Marauders]|mybattlefield,myGraveyard):thisforeach(variable{thatmuch}) all(trigger[to]) transform((,newability[0/-1])) oneshot +auto=@damaged(player) from(*[instant;sorcery]|mystack,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[enchantment;artifact;land;planeswalker]|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(creature[-Angrath's Marauders]|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@combatdamagefoeof(player) from(this):damage:thatmuch all(trigger[to]) +auto=@counterremoved(duplicateAll) from(planeswalker|opponentBattlefield) restriction{myTurnOnly}:donothing text=If a source you control would deal damage to a permanent or player, it deals double that damage to that permanent or player instead. mana={5}{R}{R} type=Creature @@ -1384,7 +1392,15 @@ type=Enchantment [/card] [card] name=Anthem of Rakdos -auto=@damage(from) notatarget(*|myBattlefield,myStack,myGraveyard,mySideboard) aslongas(*|myhand) transforms((,newability[@damage:twicethatmuch])) <1 +auto=@damaged(creature) from(*[instant;sorcery]|mystack,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[enchantment;artifact;land;planeswalker]|mybattlefield,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(creature[-Angrath's Marauders]|mybattlefield,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(creature[Angrath's Marauders]|mybattlefield,myGraveyard) restriction{type(*|myhand)~lessthan~1}:thisforeach(variable{thatmuch}) all(trigger[to]) transform((,newability[0/-1])) oneshot +auto=@damaged(player) from(*[instant;sorcery]|mystack,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[enchantment;artifact;land;planeswalker]|mybattlefield,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(creature[-Angrath's Marauders]|mybattlefield,myGraveyard) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@combatdamagefoeof(player) from(this) restriction{type(*|myhand)~lessthan~1}:damage:thatmuch all(trigger[to]) +auto=@counterremoved(duplicateAll) from(planeswalker|opponentBattlefield) restriction{restriction{type(*|myhand)~lessthan~1},myTurnOnly}:donothing auto=lord(creature[attacking]|myBattlefield) 2/0 ueot && damage:1 controller text=Whenever a creature you control attacks, it gets +2/+0 until end of turn and Anthem of Rakdos deals 1 damage to you. -- Hellbent — As long as you have no cards in hand, if a source you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. mana={2}{B}{R}{R} @@ -3947,6 +3963,14 @@ power=2 toughness=1 [/card] [card] +name=Blind Fury +restriction=before battle damage +auto=all(creature) transforms((,newability[-trample],newability[@combatdamaged(creature) from(this):damage:thatmuch all(trigger[to])])) ueot +text=Cast Blind Fury only before the combat damage step. -- All creatures lose trample until end of turn. If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead. +mana={2}{R}{R} +type=Instant +[/card] +[card] name=Blindblast target=creature auto=damage:1 @@ -9031,7 +9055,9 @@ toughness=3 [card] name=Curse of Bloodletting target=player -auto=@damaged(targetedplayer) once:damage:thatmuch all(trigger[to]) +auto=@damaged(targetedplayer) from(*[instant;sorcery]|Stack,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(targetedplayer) from(*[creature;artifact;land;planeswalker]|battlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(targetedplayer) from(enchantment[-Curse of Bloodletting]|battlefield,graveyard):damage:thatmuch all(trigger[to]) text=Enchant player -- If a source would deal damage to enchanted player, it deals double that damage to that player instead. mana={3}{R}{R} type=Enchantment @@ -10584,7 +10610,14 @@ toughness=3 [card] name=Dictate of the Twin Gods abilities=flash -auto=@damaged(creature,player,planeswalker) once:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[instant;sorcery]|Stack,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[creature;artifact;land;planeswalker]|battlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(enchantment[-Dictate of the Twin Gods]|battlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[instant;sorcery]|Stack,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[creature;artifact;land;planeswalker]|battlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(enchantment[-Dictate of the Twin Gods]|battlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@counterremoved(duplicateAll) from(planeswalker|opponentBattlefield) restriction{myTurnOnly}:donothing +auto=@counterremoved(duplicateAll) from(planeswalker|myBattlefield) restriction{opponentTurnOnly}:donothing text=Flash -- If a source would deal damage to a permanent or player, it deals double that damage to that permanent or player instead. mana={3}{R}{R} type=Enchantment @@ -14622,8 +14655,8 @@ type=Instant [/card] [card] name=Fire Servant -auto=@damaged(creature,player) from(*[red]|mybattlefield) once:damage:thatmuch all(trigger[to]) -auto=@damaged(creature,player) from(*[red]|mystack) once:damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[instant;sorcery;red]|myStack,mygraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[instant;sorcery;red]|myStack,mygraveyard):damage:thatmuch all(trigger[to]) text=If a red instant or sorcery spell you control would deal damage, it deals double that damage instead. mana={3}{R}{R} type=Creature @@ -15812,6 +15845,18 @@ mana={2}{R} type=Enchantment [/card] [card] +name=Furnace of Rath +auto=@damaged(creature) from(*[instant;sorcery]|stack,Graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(*[creature;artifact;land;planeswalker]|battlefield,Graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(creature) from(enchantment[-Furnace of Rath]|battlefield,Graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[instant;sorcery]|stack,Graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(*[creature;artifact;land;planeswalker]|battlefield,Graveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(enchantment[-Furnace of Rath]|battlefield,Graveyard):damage:thatmuch all(trigger[to]) +text=If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. +mana={1}{R}{R}{R} +type=Enchantment +[/card] +[card] name=Fury Storm target=*[instant;sorcery]|stack auto=castcard(copied noevent) @@ -17515,10 +17560,14 @@ toughness=2 [/card] [card] name=Goldnight Castigator -#need doubler damage ability... abilities=flying,haste -auto=@damaged(controller):damage:thatmuch controller -auto=@damaged(this):damage:thatmuch all(this) +auto=@damaged(this) from(*[instant;sorcery]|stack,graveyard):damage:thatmuch all(this) +auto=@damaged(this) from(*[enchantment;artifact;land;planeswalker]|battlefield,graveyard):damage:thatmuch all(this) +auto=@damaged(this) from(creature[-Goldnight Castigator]|battlefield,graveyard):damage:thatmuch all(this) +auto=@combatdamaged(this) from(creature[Goldnight Castigator]|battlefield,graveyard):damage:thatmuch all(this) +auto=@damageof(player) from(*[instant;sorcery]|mystack,graveyard):damage:thatmuch all(trigger[to]) +auto=@damageof(player) from(*[enchantment;artifact;land;planeswalker]|mybattlefield,graveyard):damage:thatmuch all(trigger[to]) +auto=@damageof(player) from(creature[-Goldnight Castigator]|mybattlefield,graveyard):damage:thatmuch all(trigger[to]) text=Flying, haste -- If a source would deal damage to you, it deals double that damage to you instead. -- If a source would deal damage to Goldnight Castigator, it deals double that damage to Goldnight Castigator instead. mana={2}{R}{R} type=Creature @@ -17808,6 +17857,14 @@ power=1 toughness=1 [/card] [card] +name=Gratuitous Violence +auto=@damaged(creature) from(creature|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +auto=@damaged(player) from(creature|mybattlefield,myGraveyard):damage:thatmuch all(trigger[to]) +text=If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. +mana={2}{R}{R}{R} +type=Enchantment +[/card] +[card] name=Gravebreaker Lamia abilities=lifelink,hiddenface auto=activate moveTo(mygraveyard) target(*|mylibrary) @@ -21403,10 +21460,16 @@ subtype=Aura [card] name=Insult // Injury auto=emblem transforms((,newability[@damaged(creature) from(*[creature;artifact;enchantment;land;planeswalker]|mybattlefield):damage:thatmuch all(trigger[to])])) ueot +auto=emblem transforms((,newability[@damaged(creature) from(*[creature;artifact;enchantment;land;planeswalker]|mygraveyard):damage:thatmuch all(trigger[to])])) ueot auto=emblem transforms((,newability[@damaged(creature) from(*[instant;sorcery]|myStack):damage:thatmuch all(trigger[to])])) ueot +auto=emblem transforms((,newability[@damaged(creature) from(*[instant;sorcery]|mygraveyard):damage:thatmuch all(trigger[to])])) ueot auto=emblem transforms((,newability[@damaged(player) from(*[instant;sorcery]|myStack):damage:thatmuch all(trigger[to])])) ueot +auto=emblem transforms((,newability[@damaged(player) from(*[instant;sorcery]|mygraveyard):damage:thatmuch all(trigger[to])])) ueot auto=emblem transforms((,newability[@damaged(player) from(*[creature;artifact;enchantment;land;planeswalker]|mybattlefield):damage:thatmuch all(trigger[to])])) ueot -autograveyard={2}{R}{E}:damage:2 target(player) && ability$!name(Deal 2 damage to target creature) damage:2 target(creature)!$ controller asSorcery +auto=emblem transforms((,newability[@damaged(player) from(*[creature;artifact;enchantment;land;planeswalker]|mygraveyard):damage:thatmuch all(trigger[to])])) ueot +auto=emblem transforms((,newability[@counterremoved(duplicateAll) from(planeswalker|opponentBattlefield) restriction{myTurnOnly}:donothing])) ueot +autograveyard={2}{R}{E}:name(Damage yourself and target creature) damage:2 controller && damage:2 target(creature) restriction{type(creature|battlefield)~morethan~0,myTurnOnly} asSorcery +autograveyard={2}{R}{E}:name(Damage opponent and target creature) damage:2 opponent && damage:2 target(creature) restriction{type(creature|battlefield)~morethan~0,myTurnOnly} asSorcery text=Damage can't be prevented this turn. If a source you control would deal damage this turn, it deals double that damage instead. -- Aftermath (Cast this spell only from your graveyard. Then exile it.) Injury deals 2 damage to target creature and 2 damage to target player. mana={2}{R} type=Sorcery @@ -30009,7 +30072,7 @@ toughness=2 [card] name=Orcish Hellraiser auto=upcost[{R};next upkeep] sacrifice -auto=@movedTo(this|graveyard) from(battlefield):choice damage:2 target(planeswalker,player) +auto=@movedTo(this|graveyard) from(battlefield):ability$!name(Choose one) choice name(Damage player) damage:2 target(player) _ choice name(Damage planeswalker) damage:2 target(planeswalker)!$ controller text=Echo {R} (At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep, sacrifice it unless you pay its echo cost.) -- When Orcish Hellraiser dies, it deals 2 damage to target player or planeswalker. mana={1}{R} type=Creature @@ -40328,7 +40391,6 @@ toughness=5 [card] name=Sower of Discord abilities=flying -auto=name(choose opponent) notatarget(opponent) deplete:0 auto=@damageof(player):damage:thatmuch opponent text=Flying -- As Sower of Discord enters the battlefield, choose two players. -- Whenever damage is dealt to one of the chosen players, the other chosen player also loses that much life. mana={4}{B}{B} @@ -45278,7 +45340,10 @@ type=Instant [/card] [card] name=Torbran, Thane of Red Fell -auto=@damage(from) notatarget(*[red]|myBattlefield,myStack,myGraveyard,mySideboard) transforms((,newability[@damage:thatmuchplus2plusend])) +auto=@damaged(creature|opponentBattlefield) from(*[instant;sorcery;red]|mystack,myGraveyard):all(trigger[to]) transforms((,newability[damage:2])) oneshot +auto=@damaged(creature|opponentBattlefield) from(*[creature;enchantment;artifact;land;planeswalker;red]|mybattlefield,myGraveyard):all(trigger[to]) transforms((,newability[damage:2])) oneshot +auto=@damagefoeof(player) from(*[instant;sorcery;red]|mystack,myGraveyard):ability$!name(Damage opponent) damage:2 opponent!$ controller +auto=@damagefoeof(player) from(*[creature;enchantment;artifact;land;planeswalker;red]|mybattlefield,myGraveyard):ability$!name(Damage opponent) damage:2 opponent!$ controller text=If a red source you control would deal damage to an opponent or a permanent an opponent controls, it deals that much damage plus 2 instead. mana={1}{R}{R}{R} type=Legendary Creature diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 174bf58ae..3ce1bd078 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -1172,12 +1172,6 @@ power=1 toughness=1 [/card] [card] -name=Blind Fury -text=Cast Blind Fury only before the combat damage step. -- All creatures lose trample until end of turn. If a creature would deal combat damage to a creature this turn, it deals double that damage to that creature instead. -mana={2}{R}{R} -type=Instant -[/card] -[card] name=Blind Hunter abilities=flying text=Flying -- Haunt (When this creature dies, exile it haunting target creature.) -- When Blind Hunter enters the battlefield or the creature it haunts dies, target player loses 2 life and you gain 2 life. @@ -4770,12 +4764,6 @@ type=Plane subtype=New Phyrexia [/card] [card] -name=Furnace of Rath -text=If a source would deal damage to a creature or player, it deals double that damage to that creature or player instead. -mana={1}{R}{R}{R} -type=Enchantment -[/card] -[card] name=GO TO JAIL text=When GO TO JAIL enters the battlefield, exile target creature an opponent controls until GO TO JAIL leaves the battlefield. -- At the beginning of the upkeep of the exiled card's owner, that player rolls two six-sided dice. If they roll doubles, sacrifice GO TO JAIL. mana={W} @@ -5550,12 +5538,6 @@ type=Artifact subtype=Equipment [/card] [card] -name=Gratuitous Violence -text=If a creature you control would deal damage to a creature or player, it deals double that damage to that creature or player instead. -mana={2}{R}{R}{R} -type=Enchantment -[/card] -[card] name=Grave Betrayal text=Whenever a creature you don't control dies, return it to the battlefield under your control with an additional +1/+1 counter on it at the beginning of the next end step. That creature is a black Zombie in addition to its other colors and types. mana={5}{B}{B} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 47473be4e..8baca8589 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2025,7 +2025,7 @@ public: if(type == 1) e->targetCard->counters->addCounter(e->name.c_str(),e->power,e->toughness,true,true,e->source); else - e->targetCard->counters->removeCounter(counter->name.c_str(),counter->power,counter->toughness,true,true,e->source); + e->targetCard->counters->removeCounter(e->name.c_str(),e->power,e->toughness,true,true,e->source); } return 1; }