From 0d9c17ab646c8033de92c6c26f8f1466b42109b5 Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Thu, 3 Nov 2022 23:53:40 -0600 Subject: [PATCH] Bug fixes. Damage prevention was crashing the game on certain cards Piston-Fist Cyclops Leapfrog Burrenton Forge-Tender was crashing the game damage prevention doesn't work in the stack Burrenton Forge-Tender, Prahv, Spires of Order Biblioplex Assistant Rhonas's Monument was crashing the game --- .../bin/Res/sets/primitives/borderline.txt | 38 ++++++++++--------- projects/mtg/bin/Res/sets/primitives/mtg.txt | 14 +++---- .../bin/Res/sets/primitives/planeswalkers.txt | 5 ++- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 1f86cd67d..17dab8740 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -6072,7 +6072,7 @@ type=Instant [card] name=Biblioplex Assistant abilities=flying -auto=may name(Return instant or sorcery) target(*instant;sorcery]|mygraveyard) moveto(mylibrary) +auto=may name(Return instant or sorcery) target(*[instant;sorcery]|mygraveyard) moveto(mylibrary) text=Flying -- When Biblioplex Assistant enters the battlefield, put up to one target instant or sorcery card from your graveyard on top of your library. mana={4} type=Artifact Creature @@ -6402,7 +6402,7 @@ toughness=4 [card] name=Blackblade Reforged auto=teach(creature) type:land:mybattlefield/type:land:mybattlefield nonstatic -auto=name(Equip legendary) {3}:rehook target(creature[legendary]|mybattlefield) +auto=name(Equip legendary) {3}:rehook target(creature[legendary]|mybattlefield) asSorcery auto={7}:equip text=Equipped creature gets +1/+1 for each land you control. -- Equip legendary creature {3} -- Equip {7} mana={2} @@ -25233,7 +25233,7 @@ type=Sorcery [/card] [card] name=Field Trip -auto=ability$!name(Search basic plains) name(Search basic plains) target(plains[basic]|mylibrary) moveto(mybattlefield) and!( tap(noevent) )! !$ controller +auto=ability$!name(Search basic Forest) name(Search basic Forest) target(Forest[basic]|mylibrary) moveto(mybattlefield) and!( tap(noevent) )! !$ controller auto=_LEARN_ text=Search your library for a basic Forest card, put that card onto the battlefield tapped, then shuffle. -- Learn. (You may reveal a Lesson card you own from outside the game and put it into your hand, or discard a card to draw a card.) mana={2}{G} @@ -26356,7 +26356,7 @@ type=Sorcery [/card] [card] name=Fleet Swallower -auto=_ATTACKING_target(player) deplete:halfdowntype:*:targetedpersonslibrary +auto=_ATTACKING_target(player) deplete:halfuptype:*:targetedpersonslibrary text=Whenever Fleet Swallower attacks, target player puts the top half of his or her library, rounded up, into his or her graveyard. mana={5}{U}{U} type=Creature @@ -28803,7 +28803,7 @@ toughness=2 [card] name=Ghostfire Blade auto={3}:equip -auto={1}:rehook target(creature[colorless]|mybattlefield) +auto={1}:equip target(creature[colorless]|mybattlefield) auto=teach(creature) 2/2 text=Equipped creature gets +2/+2. -- Equip {3} -- Ghostfire Blade's equip ability costs {2} less to activate if it targets a colorless creature. mana={1} @@ -37790,7 +37790,7 @@ subtype=Plains Island [card] name=Isareth the Awakener abilities=deathtouch -auto=_ATTACKING_may {x} :target(creature[manacost<=x] mygraveyard) moveto(mybattlefield) +auto=_ATTACKING_pay({2}) target(creature[manacost<=2]|mygraveyard) moveto(mybattlefield) text=Deathtouch -- Whenever Isareth the Awakener attacks, you may pay {X}. When you do, return target creature card with mana value X from your graveyard to the battlefield with a corpse counter on it. If that creature would leave the battlefield, exile it instead of putting it anywhere else. mana={1}{B}{B} type=Legendary Creature @@ -37801,7 +37801,7 @@ toughness=3 [card] name=Ishai, Ojutai Dragonspeaker abilities=flying,partner -auto=@movedTo(*|opponentStack): counter(1/1) +auto=@movedTo(*|opponentStack):counter(1/1) text=Flying -- Whenever an opponent casts a spell, put a +1/+1 counter on Ishai, Ojutai Dragonspeaker. -- Partner (You can have two commanders if both have partner.) mana={2}{W}{U} type=Legendary Creature @@ -41817,7 +41817,7 @@ type=Instant [/card] [card] name=Leapfrog -auto=@movedTo(instant,sorcery|mystack) flying ueot +auto=@movedTo(instant,sorcery|mystack) turnlimited:flying ueot text=Leapfrog has flying as long as you've cast an instant or sorcery spell this turn. mana={2}{U} type=Creature @@ -43914,7 +43914,7 @@ toughness=5 [card] name=Lurrus of the Dream-Den abilities=lifelink -auto={0}:name(Choose a permanent in graveyard) target(*[-instant;-sorcery]|mygraveyard) transforms((,newability[canplayfromgraveyard])) ueot limit:1 +auto={0}:name(Choose a permanent in graveyard) target(*[manacost<=2;-instant;-sorcery]|mygraveyard) transforms((,newability[canplayfromgraveyard])) ueot limit:1 text=Companion - Each permanent card in your starting deck has mana value 2 or less. (If this card is your chosen companion, you may cast it once from outside the game.) -- Lifelink -- During each of your turns, you may cast one permanent spell with mana value 2 or less from your graveyard. mana={1}{WB}{WB} type=Legendary Creature @@ -52515,7 +52515,7 @@ type=Instant [/card] [card] name=Pay No Heed -auto=name(prevent all damage) notatarget(*|battlefield,stack,hand,graveyard) transforms((,newability[preventalldamage from(this)])) ueot +auto=name(prevent all damage) target(*) transforms((,newability[preventalldamage from(this)])) ueot text=Prevent all damage a source of your choice would deal this turn. mana={W} type=Instant @@ -53327,6 +53327,7 @@ toughness=7 [card] name=Piston-Fist Cyclops abilities=defender +auto=@movedTo(instant,sorcery|mystack) turnlimited:-defender ueot text=Defender -- As long as you've cast an instant or sorcery spell this turn, Piston-Fist Cyclops can attack as though it didn't have defender. mana={1}{UR}{UR} type=Creature @@ -58665,7 +58666,7 @@ type=Sorcery [card] name=Rhonas's Monument auto=lord(creature[green]|mycastingzone) altercost(colorless,-1) -auto=@movedto(creature|mystack):target(creature|mybattlefield) transforms((,newability[2/2 ueot],newability[trample ueot])) +auto=@movedto(creature|mystack):target(creature|mybattlefield) transforms((,newability[2/2],newability[trample])) ueot text=Green creature spells you cast cost {1} less to cast. -- Whenever you cast a creature spell, target creature you control gets +2/+2 and gains trample until end of turn. mana={3} type=Legendary Artifact @@ -59399,7 +59400,7 @@ type=Sorcery name=Rith's Charm auto=choice name(Destroy land) target(land[-basic]) destroy auto=choice name(Create 3 saproling) token(Saproling,Creature Saproling,1/1,green)*3 -auto=choice name(Prevent damage) notatarget(*|battlefield,stack,hand,graveyard) transforms((,newability[preventalldamage from(this)])) ueot +auto=choice name(Prevent damage) target(*) transforms((,newability[preventalldamage from(this)])) ueot text=Choose one Destroy target nonbasic land; or put three 1/1 green Saproling creature tokens onto the battlefield; or prevent all damage a source of your choice would deal this turn. mana={R}{G}{W} type=Instant @@ -61341,10 +61342,10 @@ auto=untap auto=life:5 controller auto=all(*|myexile) removeallcounters(0/0,1,AzorExiled) auto={T}:name(Add white mana) name(Add white mana) thisforeach(variable{lifetotal}) add{W} -auto={T}:name(Add green mana) name(Add green mana) thisforeach(variable{lifetotal}) add{G} -auto={T}:name(Add black mana) name(Add black mana) thisforeach(variable{lifetotal}) add{B} auto={T}:name(Add blue mana) name(Add blue mana) thisforeach(variable{lifetotal}) add{U} +auto={T}:name(Add black mana) name(Add black mana) thisforeach(variable{lifetotal}) add{B} auto={T}:name(Add red mana) name(Add red mana) thisforeach(variable{lifetotal}) add{R} +auto={T}:name(Add green mana) name(Add green mana) thisforeach(variable{lifetotal}) add{G} text=(Transforms from Azor's Gateway.) -- {T}: Add X mana of any one color, where X is your life total. type=Legendary Land [/card] @@ -62380,7 +62381,7 @@ type=Sorcery [card] name=Scourge of Nel Toth abilities=flying -flashback={B}{B}{S(creature|mybattlefield)}{S(creature|mybattlefield)} +flashback={B}{B}{S(creature|mybattlefield)}{S(creature|mybattlefield)} restriction{type(creature|myBattlefield)~morethan~1} text=Flying -- You may cast Scourge of Nel Toth from your graveyard by paying {B}{B} and sacrificing two creatures rather than paying its mana cost. mana={5}{B}{B} type=Creature @@ -72915,7 +72916,7 @@ subtype=Lesson [/card] [card] name=Team Pennant -auto=name(Equip creature token) {1}:rehook target(creature[token]|mybattlefield) +auto=name(Equip creature token) {1}:rehook target(creature[token]|mybattlefield) asSorcery auto={3}:equip auto=teach(creature) 1/1 auto=teach(creature) vigilance @@ -76420,7 +76421,7 @@ type=Artifact [card] name=Treasure Cove auto={T}:Add{1} -auto={T}{S(artifact[-creature&token]|myBattlefield)}:draw:1 controller +auto={T}{S(Treasure|myBattlefield)}:draw:1 controller text=(Transforms from Treasure Map.) -- {T}: Add {1} to your mana pool. -- {T}, Sacrifice a Treasure: Draw a card. type=Land [/card] @@ -79331,6 +79332,7 @@ toughness=2 [/card] [card] name=Verazol, the Split Current +auto=counter(1/1,2) auto=counter(1/1,X) all(this) auto=@movedTo(*[kicked=1]|myStack):may name(copy spell) all(trigger[to]) castcard(copied noevent kicked!:1:!) && counter(1/1,-2) all(this) auto=@movedTo(*[kicked=2]|myStack):may name(copy spell) all(trigger[to]) castcard(copied noevent kicked!:2:!) && counter(1/1,-2) all(this) @@ -80902,7 +80904,7 @@ type=Sorcery [card] name=Wall of Corpses abilities=defender -auto={B}:if type(Wall of Corpses[blocking]|mybattlefield)~morethan~0 then destroy target(creature[blocked]|opponentbattlefield) +auto={B}{S}:if type(Wall of Corpses[blocking]|mybattlefield)~morethan~0 then destroy target(creature[blocked]|opponentbattlefield) text=Defender (This creature can't attack.) -- {B}, Sacrifice Wall of Corpses: Destroy target creature Wall of Corpses is blocking. mana={1}{B} type=Creature diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 0269f9c74..191957afd 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -7153,7 +7153,7 @@ toughness=1 [/card] [card] name=Auriok Replica -auto={W}{S}:name(prevent damage) target(other *|battlefield,stack,hand,graveyard,commandzone,exile) transforms((,newability[preventalldamage from(this)])) ueot +auto={W}{S}:name(prevent damage) target(*) transforms((,newability[preventalldamage from(this)])) ueot text={W}, Sacrifice Auriok Replica: Prevent all damage a source of your choice would deal to you this turn. mana={3} type=Artifact Creature @@ -9153,7 +9153,7 @@ type=Sorcery [card] name=Bargaining Table auto={T}:draw:1 restriction{type(*|opponenthand)~lessthan~1} -auto={1}{T}{T}:draw:1 restriction{type(*|opponenthand)~equalto~1} +auto={1}{T}:draw:1 restriction{type(*|opponenthand)~equalto~1} auto={2}{T}:draw:1 restriction{type(*|opponenthand)~equalto~2} auto={3}{T}:draw:1 restriction{type(*|opponenthand)~equalto~3} auto={4}{T}:draw:1 restriction{type(*|opponenthand)~equalto~4} @@ -15961,7 +15961,7 @@ toughness=2 [card] name=Burrenton Forge-Tender abilities=protection from red -auto={S}:name(Prevent all damage from red source) target(*[red]|battlefield,stack,hand,graveyard,commandzone,exile) transforms((,newability[preventalldamage from(this)])) ueot +auto={S}:name(Prevent all damage from red source) target(*[red]) transforms((,newability[preventalldamage from(this)])) ueot text=Protection from red -- Sacrifice Burrenton Forge-Tender: Prevent all damage a red source of your choice would deal this turn. mana={W} type=Creature @@ -36004,7 +36004,7 @@ auto=@movedTo(creature[manacost=12]|mystack):token(Thrull,Creature Thrull,1/1,bl auto=@movedTo(creature[manacost=13]|mystack):token(Thrull,Creature Thrull,1/1,black)*13 && aslongas(thrull|mybattlefield) sacrifice >6 auto=@movedTo(creature[manacost=14]|mystack):token(Thrull,Creature Thrull,1/1,black)*14 && aslongas(thrull|mybattlefield) sacrifice >6 auto=@movedTo(creature[manacost=15]|mystack):token(Thrull,Creature Thrull,1/1,black)*15 && aslongas(thrull|mybattlefield) sacrifice >6 -auto=aslongas(thrull|mybattlefield) sacrifice while >6 +auto=aslongas(thrull|mybattlefield) sacrifice >6 text=Whenever you cast a creature spell, put X 1/1 black Thrull creature tokens onto the battlefield, where X is that spell's mana value. -- When you control seven or more Thrulls, sacrifice Endrek Sahr, Master Breeder. mana={4}{B} type=Legendary Creature @@ -88047,7 +88047,7 @@ type=Sorcery [card] name=Prahv, Spires of Order auto={T}:add{1} -auto={4}{W}{U}{T}:name(prevent damage) target(*|battlefield,stack,hand,graveyard,commandzone,exile) transforms((,newability[preventalldamage from(this)])) ueot +auto={4}{W}{U}{T}:name(prevent damage) target(*) transforms((,newability[preventalldamage from(this)])) ueot text={T}: Add {1} to your mana pool. -- {4}{W}{U}, {T}: Prevent all damage a source of your choice would deal this turn. type=Land [/card] @@ -91550,7 +91550,7 @@ type=Artifact [card] name=Rakdos the Defiler abilities=flying,trample -auto=_ATTACKING_choice target(*|mybattlefield) sacrifice +auto=_ATTACKING_choice target(*|mybattlefield) sacrifice cdaactive auto=@combatdamagefoeof(player) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ opponent auto=@combatdamageof(player) from(this):ability$!name(sacrifice) target(*|mybattlefield) sacrifice!$ controller text=Flying, trample -- Whenever Rakdos the Defiler attacks, sacrifice half the non-Demon permanents you control, rounded up. -- Whenever Rakdos deals combat damage to a player, that player sacrifices half the non-Demon permanents he or she controls, rounded up. @@ -129469,7 +129469,7 @@ toughness=2 [/card] [card] name=Viridian Longbow -auto={1}:equip +auto={3}:equip auto=teach(creature) {T}:damage:1 target(creature,player) text=Equipped creature has "{T}: This creature deals 1 damage to target creature or player." -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery. This card enters the battlefield unattached and stays on the battlefield if the creature leaves.) mana={1} diff --git a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt index f00171198..3df868a0d 100644 --- a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt +++ b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt @@ -989,7 +989,7 @@ subtype=Garruk name=Garruk, Unleashed auto=counter(0/0,4,loyalty) auto={C(0/0,1,Loyalty)}:name(+1: Target creature gets +3/+3 and trample) target(creature) 3/3 ueot && trample ueot -auto={C(0/0,-2,Loyalty)}:name(-2: Create a Beast 3/3) token(Beast Gar) && transforms((,newability[if type(creature|opponentbattlefield)~morethan~type(creature|mybattlefield) then counter(0/0,1,Loyalty) all(this)])) oneshot +auto={C(0/0,-2,Loyalty)}:name(-2: Create a Beast 3/3) _BEASTTOKEN_ && transforms((,newability[if type(creature|opponentbattlefield)~morethan~type(creature|mybattlefield) then counter(0/0,1,Loyalty) all(this)])) oneshot auto={C(0/0,-7,Loyalty)}:name(-7: Emblem: "Search a creature") emblem transforms((,newability[@each my endofturn:may moveTo(myBattlefield) target(creature|myLibrary) && shuffle])) forever dontremove text=+1: Up to one target creature gets +3/+3 and gains trample until end of turn. -- −2: Create a 3/3 green Beast creature token. Then if an opponent controls more creatures than you, put a loyalty counter on Garruk, Unleashed. -- −7: You get an emblem with "At the beginning of your end step, you may search your library for a creature card, put it onto the battlefield, then shuffle your library." mana={2}{G}{G} @@ -2595,7 +2595,8 @@ subtype=Sorin [card] name=Sorin, Imperious Bloodlord auto=counter(0/0,4,loyalty) -auto={C(0/0,1,Loyalty)}:name(+1: Deathtouch and Lifelink) target(creature|myBattlefield) deathtouch ueot && lifelink ueot && restriction{type(creature[vampire]) counter(1/1) +auto={C(0/0,1,Loyalty)}:name(+1: Deathtouch and Lifelink a Vampire) target(creature[vampire]|myBattlefield) deathtouch ueot && lifelink ueotcounter(1/1) restriction{type(creature[vampire]) +auto={C(0/0,1,Loyalty)}:name(+1: Deathtouch and Lifelink) target(creature[-vampire]|myBattlefield) deathtouch ueot && lifelink ueot auto={C(0/0,1,Loyalty)}{S(vampire|myBattlefield)}:name(+1: Sacrifice and deals 3 damage) damage:3 target(player,creature,planeswalker) auto={C(0/0,-3,Loyalty)}:name(-3: Put a Vampire from your hand onto the battlefield) moveto(myBattlefield) target(creature[vampire]|myHand) text=+1: Target creature you control gains deathtouch and lifelink until end of turn. If it's a Vampire, put a +1/+1 counter on it. -- +1: You may sacrifice a Vampire. When you do, Sorin, Imperious Bloodlord deals 3 damage to any target and you gain 3 life. -- -3: You may put a Vampire creature card from your hand onto the battlefield.