Bug fix for the biggest crash and fixes to the primitives

I figured a while ago that the cause of the crash was a rendering issue, not an engine issue, since you could copy spells in the stack if you didn't targeted them. The crash was most likely in ActionStack, just had to follow the trace. It doesn't affect anithing else, that line was trying to render something in the stack that's a permanent but it always had bad ptrs.
This commit is contained in:
Eduardo
2019-04-17 20:28:43 -05:00
parent c3937ce517
commit 3dfcc65fa6
5 changed files with 221 additions and 196 deletions
+32 -30
View File
@@ -1534,6 +1534,7 @@ target=creature[attacking;blocking]
auto=moveTo(ownerlibrary) auto=moveTo(ownerlibrary)
auto=alternative moveTo(ownerlibrary) target(creature[attacking;blocking]) auto=alternative moveTo(ownerlibrary) target(creature[attacking;blocking])
other={3}{WU}{T(creature[blue;white]|mybattlefield)}{T(creature[blue;white]|mybattlefield)} name(Cast with Conspire) other={3}{WU}{T(creature[blue;white]|mybattlefield)}{T(creature[blue;white]|mybattlefield)} name(Cast with Conspire)
otherrestriction=type(creature[blue;white]|myBattlefield)~morethan~1
text=Put target attacking or blocking creature on top of its owner's library. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Put target attacking or blocking creature on top of its owner's library. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={3}{WU} mana={3}{WU}
type=Instant type=Instant
@@ -2484,7 +2485,7 @@ toughness=1
name=Alabaster Potion name=Alabaster Potion
auto=choice life:X target(player) auto=choice life:X target(player)
auto=choice prevent:X target(creature,player) auto=choice prevent:X target(creature,player)
text=Choose one - Target player gains X life; or prevent the next X damage that would be dealt to target creature or player this turn. text=Choose one Target player gains X life. Prevent the next X damage that would be dealt to any target this turn.
mana={X}{W}{W} mana={X}{W}{W}
type=Instant type=Instant
[/card] [/card]
@@ -9234,6 +9235,7 @@ target=creature
auto=2/2 auto=2/2
auto=alternative target(creature) 2/2 auto=alternative target(creature) 2/2
other={GW}{T(creature[green;white]|mybattlefield)}{T(creature[green;white]|mybattlefield)} name(Conspire) other={GW}{T(creature[green;white]|mybattlefield)}{T(creature[green;white]|mybattlefield)} name(Conspire)
otherrestriction=type(creature[green;white]|myBattlefield)~morethan~1
text=Target creature gets +2/+2 until end of turn. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Target creature gets +2/+2 until end of turn. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={GW} mana={GW}
type=Instant type=Instant
@@ -11395,8 +11397,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Blaze name=Blaze
target=creature,player auto=damage:X target(creature,player)
auto=damage:X
text=Blaze deals X damage to target creature or player. text=Blaze deals X damage to target creature or player.
mana={X}{R} mana={X}{R}
type=Sorcery type=Sorcery
@@ -15272,8 +15273,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Brood Birthing name=Brood Birthing
auto=aslongas(eldrazi spawn|myBattlefield) token(Eldrazi Spawn,Creature Eldrazi Spawn,0/1) and!( transforms((,newability[{S}:Add{1}])) forever )!*2 auto=aslongas(eldrazi spawn|myBattlefield) token(Eldrazi Spawn,Creature Eldrazi Spawn,0/1) and!( transforms((,newability[{S}:Add{1}])) forever )!*3
auto=token(Eldrazi Spawn,Creature Eldrazi Spawn,0/1) and!( transforms((,newability[{S}:Add{1}])) forever )!
text=If you control at least one 0/1 Eldrazi Spawn creature token, put three 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." text=If you control at least one 0/1 Eldrazi Spawn creature token, put three 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."
mana={1}{R} mana={1}{R}
type=Sorcery type=Sorcery
@@ -15281,7 +15281,7 @@ type=Sorcery
[card] [card]
name=Brood Butcher name=Brood Butcher
auto=choice token(Eldrazi Scion,Creature Eldrazi Scion,1/1) and!( transforms((,newability[{S}:Add{C}])) forever )! controller auto=choice token(Eldrazi Scion,Creature Eldrazi Scion,1/1) and!( transforms((,newability[{S}:Add{C}])) forever )! controller
auto={B}{G}{S(creature|mybattlefield):target(creature) -2/-2 ueot auto={B}{G}{S(creature|mybattlefield)}:target(creature) -2/-2 ueot
text=Devoid (This card has no color.) -- When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." -- {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. text=Devoid (This card has no color.) -- When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." -- {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn.
mana={3}{B}{G} mana={3}{B}{G}
abilities=devoid abilities=devoid
@@ -15790,6 +15790,7 @@ target=creature,player
auto=damage:3 auto=damage:3
auto=alternative damage:3 target(creature,player) auto=alternative damage:3 target(creature,player)
other={3}{R}{T(creature[red]|mybattlefield)}{T(creature[red]|mybattlefield)} name(pay Conspire) other={3}{R}{T(creature[red]|mybattlefield)}{T(creature[red]|mybattlefield)} name(pay Conspire)
otherrestriction=type(creature[red]|myBattlefield)~morethan~1
text=Burn Trail deals 3 damage to target creature or player. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Burn Trail deals 3 damage to target creature or player. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={3}{R} mana={3}{R}
type=Sorcery type=Sorcery
@@ -17622,7 +17623,7 @@ type=Enchantment
[/card] [/card]
[card] [card]
name=Cathar's Shield name=Cathar's Shield
auto=teach(creature) vigilence auto=teach(creature) vigilance
auto=teach(creature) 0/3 auto=teach(creature) 0/3
auto={3}:equip auto={3}:equip
text=Equipped creature gets +0/+3 and has vigilance. -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature gets +0/+3 and has vigilance. -- Equip {3} ({3}: Attach to target creature you control. Equip only as a sorcery.)
@@ -22166,8 +22167,7 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Consume Spirit name=Consume Spirit
target=creature,player auto=damage:castx target(creature,player)
auto=damage:castx
auto=life:castx controller auto=life:castx controller
text=Spend only black mana on X. -- Consume Spirit deals X damage to target creature or player and you gain X life. text=Spend only black mana on X. -- Consume Spirit deals X damage to target creature or player and you gain X life.
mana={1}{B}{X:black} mana={1}{B}{X:black}
@@ -23482,8 +23482,8 @@ type=Sorcery
[card] [card]
name=Crater's Claws name=Crater's Claws
target=creature,player target=creature,player
auto=if type(creature[power=>4]|mybattlefield) then damage:2
auto=damage:X auto=damage:X
auto=if type(creature[power>=4]|mybattlefield)~morethan~0 then damage:2
text=Crater's Claws deals X damage to target creature or player. -- Ferocious -- Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater. text=Crater's Claws deals X damage to target creature or player. -- Ferocious -- Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater.
mana={R}{X} mana={R}{X}
type=Sorcery type=Sorcery
@@ -27047,8 +27047,7 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Death Grasp name=Death Grasp
target=creature,player auto=damage:X target(creature,player)
auto=damage:X
auto=life:X controller auto=life:X controller
text=Death Grasp deals X damage to target creature or player. You gain X life. text=Death Grasp deals X damage to target creature or player. You gain X life.
mana={X}{W}{B} mana={X}{W}{B}
@@ -29122,8 +29121,7 @@ subtype=Aura
[/card] [/card]
[card] [card]
name=Devil's Play name=Devil's Play
target=creature,player auto=damage:X target(creature,player)
auto=damage:X
flashback={X}{R}{R}{R} flashback={X}{R}{R}{R}
text=Devil's Play deals X damage to target creature or player. -- Flashback {X}{R}{R}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.) text=Devil's Play deals X damage to target creature or player. -- Flashback {X}{R}{R}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={X}{R} mana={X}{R}
@@ -30346,6 +30344,7 @@ target=creature|graveyard
auto=moveTo(ownerhand) auto=moveTo(ownerhand)
auto=alternative moveTo(ownerhand) target(creature|graveyard) auto=alternative moveTo(ownerhand) target(creature|graveyard)
other={1}{B}{T(creature[black]|mybattlefield)}{T(creature[black]|mybattlefield)} (Pay Conspire) other={1}{B}{T(creature[black]|mybattlefield)}{T(creature[black]|mybattlefield)} (Pay Conspire)
otherrestriction=type(creature[black]|myBattlefield)~morethan~1
text=Return target creature card in a graveyard to its owner's hand. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Return target creature card in a graveyard to its owner's hand. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={1}{B} mana={1}{B}
type=Sorcery type=Sorcery
@@ -30539,7 +30538,7 @@ toughness=6
[card] [card]
name=Djinn of Wishes name=Djinn of Wishes
auto=counter(0/0,3,wish) auto=counter(0/0,3,wish)
auto={C(0/0,-1,wish)}:reveal:1 optionone name(Reveal card to cast) target(<upto:1>*|reveal) transforms((,newability[castcard(putinplay)])) forever optiononeend optiontwo all(*|reveal) moveto(exile) optiontwoend revealend auto={2}{U}{U}{C(0/0,-1,wish)}:reveal:1 optionone name(Reveal card to cast) target(<upto:1>*|reveal) transforms((,newability[castcard(putinplay)])) forever optiononeend optiontwo all(*|reveal) moveto(exile) optiontwoend revealend
abilities=flying abilities=flying
text=Flying -- Djinn of Wishes enters the battlefield with three wish counters on it. -- {2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it. text=Flying -- Djinn of Wishes enters the battlefield with three wish counters on it. -- {2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it.
mana={3}{U}{U} mana={3}{U}{U}
@@ -39064,8 +39063,7 @@ toughness=6
[/card] [/card]
[card] [card]
name=Fanning the Flames name=Fanning the Flames
target=creature,player auto=damage:X target(creature,player)
auto=damage:X
buyback={X}{3}{R}{R} buyback={X}{3}{R}{R}
text=Buyback {3} (You may pay an additional {3} as you cast this spell. If you do, put this card into your hand as it resolves.) -- Fanning the Flames deals X damage to target creature or player. text=Buyback {3} (You may pay an additional {3} as you cast this spell. If you do, put this card into your hand as it resolves.) -- Fanning the Flames deals X damage to target creature or player.
mana={X}{R}{R} mana={X}{R}{R}
@@ -45688,6 +45686,7 @@ auto=draw:2
auto=reject target(*|myhand) auto=reject target(*|myhand)
auto=alternative draw:2 reject target(*|myhand) auto=alternative draw:2 reject target(*|myhand)
other={2}{U}{T(creature[blue]|mybattlefield)}{T(creature[blue]|mybattlefield)} name(Pay Conspire) other={2}{U}{T(creature[blue]|mybattlefield)}{T(creature[blue]|mybattlefield)} name(Pay Conspire)
otherrestriction=type(creature[blue]|myBattlefield)~morethan~1
text=Draw two cards, then discard a card. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it.) text=Draw two cards, then discard a card. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it.)
mana={2}{U} mana={2}{U}
type=Sorcery type=Sorcery
@@ -46405,6 +46404,7 @@ name=Giantbaiting
auto=token(Giant,Creature Giant Warrior,4/4,haste,unearth,red green) auto=token(Giant,Creature Giant Warrior,4/4,haste,unearth,red green)
auto=alternative token(Giant,Creature Giant Warrior,4/4,haste,unearth,red green) auto=alternative token(Giant,Creature Giant Warrior,4/4,haste,unearth,red green)
other={2}{RG}{T(creature[red;green]|mybattlefield)}{T(creature[red;green]|mybattlefield)} name(Pay Conspire) other={2}{RG}{T(creature[red;green]|mybattlefield)}{T(creature[red;green]|mybattlefield)} name(Pay Conspire)
otherrestriction=type(creature[green;red]|myBattlefield)~morethan~1
text=Put a 4/4 red and green Giant Warrior creature token with haste onto the battlefield. Exile it at the beginning of the next end step. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it.) text=Put a 4/4 red and green Giant Warrior creature token with haste onto the battlefield. Exile it at the beginning of the next end step. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it.)
mana={2}{RG} mana={2}{RG}
type=Sorcery type=Sorcery
@@ -46990,6 +46990,7 @@ target=artifact,enchantment
auto=destroy auto=destroy
auto=alternative destroy target(artifact,enchantment) auto=alternative destroy target(artifact,enchantment)
other={1}{G}{T(creature[green]|mybattlefield)}{T(creature[green]|mybattlefield)} name(Pay Conspire) other={1}{G}{T(creature[green]|mybattlefield)}{T(creature[green]|mybattlefield)} name(Pay Conspire)
otherrestriction=type(creature[green]|myBattlefield)~morethan~1
text=Destroy target artifact or enchantment. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Destroy target artifact or enchantment. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={1}{G} mana={1}{G}
type=Sorcery type=Sorcery
@@ -47827,7 +47828,7 @@ toughness=2
[card] [card]
name=Goblin Dark-Dwellers name=Goblin Dark-Dwellers
abilities=menace abilities=menace
auto=may name(cast card) castcard(normal) target(instant,sorcery[manacost<=3]|mygraveyard) and!(transforms((,newability[exiledeath])) forever)! auto=may name(cast card) castcard(normal) target(*[instant;sorcery;manacost<=3]|mygraveyard) and!(transforms((,newability[exiledeath])) forever)!
text=Menace -- When Goblin Dark-Dwellers enters the battlefield, you may cast target instant or sorcery card with converted mana cost 3 or less from your graveyard without paying its mana cost. If that card would be put into your graveyard this turn, exile it instead. text=Menace -- When Goblin Dark-Dwellers enters the battlefield, you may cast target instant or sorcery card with converted mana cost 3 or less from your graveyard without paying its mana cost. If that card would be put into your graveyard this turn, exile it instead.
mana={3}{R}{R} mana={3}{R}{R}
type=Creature type=Creature
@@ -51879,11 +51880,11 @@ toughness=5
[/card] [/card]
[card] [card]
name=Gwyllion Hedge-Mage name=Gwyllion Hedge-Mage
auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~lessthan~2 then may token(Kithkin Soldier,creature Kithikin Soldier,1/1,white)*2 oneshot auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~lessthan~2 then may token(Kithkin Soldier,creature Kithikin Soldier,1/1,white) oneshot
auto=if type(swamp|mybattlefield)~morethan~1 then if type(plains|mybattlefield)~lessthan~2 then may counter(-1/-1,1) target(creature) oneshot auto=if type(swamp|mybattlefield)~morethan~1 then if type(plains|mybattlefield)~lessthan~2 then may counter(-1/-1,1) target(creature) oneshot
auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then choice token(Kithkin Soldier,creature Kithikin Soldier,1/1,white)*2 oneshot auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then choice token(Kithkin Soldier,creature Kithikin Soldier,1/1,white) oneshot
auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then choice target(creature) counter(-1/-1,1) oneshot auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then choice target(creature) counter(-1/-1,1) oneshot
auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then name(do both) choice name(do both) target(creature) counter(-1/-1,1) oneshot && name(do both) token(Kithkin Soldier,creature Kithikin Soldier,1/1,white)*2 oneshot auto=if type(plains|mybattlefield)~morethan~1 then if type(swamp|mybattlefield)~morethan~1 then name(do both) choice name(do both) target(creature) counter(-1/-1,1) oneshot && name(do both) token(Kithkin Soldier,creature Kithikin Soldier,1/1,white) oneshot
text=When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield. -- When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature. text=When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield. -- When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.
mana={2}{WB} mana={2}{WB}
type=Creature type=Creature
@@ -67040,7 +67041,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Lifeforce name=Lifeforce
auto={G}{G}:fizzle target(*[black]|stack) auto={G}{G}:fizzle target(sorcery|stack)
text={G}{G}: Counter target black spell. text={G}{G}: Counter target black spell.
mana={G}{G} mana={G}{G}
type=Enchantment type=Enchantment
@@ -72785,6 +72786,7 @@ target=player
auto=deplete:4 auto=deplete:4
auto=alternative deplete:4 target(player) auto=alternative deplete:4 target(player)
other={UB}{T(creature[black;blue]|mybattlefield)}{T(creature[black;blue]|mybattlefield)} name(Pay Conspire) other={UB}{T(creature[black;blue]|mybattlefield)}{T(creature[black;blue]|mybattlefield)} name(Pay Conspire)
otherrestriction=type(creature[black;blue]|myBattlefield)~morethan~1
text=Target player puts the top four cards of his or her library into his or her graveyard. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Target player puts the top four cards of his or her library into his or her graveyard. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={UB} mana={UB}
type=Sorcery type=Sorcery
@@ -93610,9 +93612,8 @@ subtype=Aura
[/card] [/card]
[card] [card]
name=Red Sun's Zenith name=Red Sun's Zenith
target=creature,player auto=choice name(Target creature) exiledeath && damage:X target(creature)
auto=teach(creature) exiledeath auto=choice name(Target player) damage:X target(player)
auto=damage:X
alias=135262 alias=135262
text=Red Sun's Zenith deals X damage to target creature or player. If a creature dealt damage this way would die this turn, exile it instead. Shuffle Red Sun's Zenith into its owner's library. text=Red Sun's Zenith deals X damage to target creature or player. If a creature dealt damage this way would die this turn, exile it instead. Shuffle Red Sun's Zenith into its owner's library.
mana={X}{R} mana={X}{R}
@@ -99522,7 +99523,7 @@ subtype=Sarkhan
[/card] [/card]
[card] [card]
name=Sarkhan Unbroken name=Sarkhan Unbroken
auto=counter(0/0,9,Loyalty) auto=counter(0/0,4,Loyalty)
aicode=activate moveto(mybattlefield) notatarget(<anyamount>creature[dragon]|mylibrary) aicode=activate moveto(mybattlefield) notatarget(<anyamount>creature[dragon]|mylibrary)
auto={C(0/0,1,Loyalty)}:name(+1: Draw card) draw:1 controller && transforms((,newability[activatechooseacolor add{chosencolor} activatechooseend])) forever asSorcery auto={C(0/0,1,Loyalty)}:name(+1: Draw card) draw:1 controller && transforms((,newability[activatechooseacolor add{chosencolor} activatechooseend])) forever asSorcery
auto={C(0/0,-2,Loyalty)}:name(-2: 4/4 dragon token) token(Dragon,creature dragon,4/4,flying,red) controller asSorcery auto={C(0/0,-2,Loyalty)}:name(-2: 4/4 dragon token) token(Dragon,creature dragon,4/4,flying,red) controller asSorcery
@@ -99873,7 +99874,7 @@ toughness=4
name=Sawtooth Loon name=Sawtooth Loon
abilities=flying abilities=flying
auto=moveTo(ownerhand) notatarget(creature[white;blue]|myBattlefield) auto=moveTo(ownerhand) notatarget(creature[white;blue]|myBattlefield)
auto=draw:2 && transforms((,newability[target(<2>*|myhand) bottomoflibrary])) auto=draw:2 && transforms((,newability[target(<2>*|myhand) bottomoflibrary])) oneshot
text=Flying -- When Sawtooth Loon enters the battlefield, return a white or blue creature you control to its owner's hand. -- When Sawtooth Loon enters the battlefield, draw two cards, then put two cards from your hand on the bottom of your library. text=Flying -- When Sawtooth Loon enters the battlefield, return a white or blue creature you control to its owner's hand. -- When Sawtooth Loon enters the battlefield, draw two cards, then put two cards from your hand on the bottom of your library.
mana={2}{W}{U} mana={2}{W}{U}
type=Creature type=Creature
@@ -119846,7 +119847,8 @@ name=Tezzeret, Agent of Bolas
auto=counter(0/0,3,loyalty) auto=counter(0/0,3,loyalty)
aicode=activate target(artifact[zpos<=5]|mylibrary) moveto(myhand) aicode=activate target(artifact[zpos<=5]|mylibrary) moveto(myhand)
auto={C(0/0,1,Loyalty)}:reveal:5 optionone name(Get artifact) target(<upto:1>artifact|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<5>*|reveal) bottomoflibrary optiontwoend revealend auto={C(0/0,1,Loyalty)}:reveal:5 optionone name(Get artifact) target(<upto:1>artifact|reveal) moveto(myhand) optiononeend optiontwo name(put on bottom) target(<5>*|reveal) bottomoflibrary optiontwoend revealend
auto={C(0/0,-1,Loyalty)}:name(Create Construct) target(artifact) transforms((Construct,Artifact Creature,setpower=5,settoughness=5)) auto={C(0/0,-4,Loyalty)}:target(player) life:-twicetype:artifact:mybattlefield && life:twicetype:artifact:mybattlefield controller auto={C(0/0,-1,Loyalty)}:name(Create Construct) target(artifact) transforms((Construct Artifact Creature,setpower=5,settoughness=5))
auto={C(0/0,-4,Loyalty)}:target(player) life:-twicetype:artifact:mybattlefield && life:twicetype:artifact:mybattlefield controller
text=+1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order. -- -1: Target artifact becomes a 5/5 artifact creature. -- -4: Target player loses X life and you gain X life, where X is twice the number of artifacts you control. text=+1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order. -- -1: Target artifact becomes a 5/5 artifact creature. -- -4: Target player loses X life and you gain X life, where X is twice the number of artifacts you control.
mana={2}{U}{B} mana={2}{U}{B}
type=Legendary Planeswalker type=Legendary Planeswalker
@@ -123712,6 +123714,7 @@ auto=tap
auto=dynamicability<!mytgt powerstrike targetcontroller!> auto=dynamicability<!mytgt powerstrike targetcontroller!>
auto=alternative target(creature) dynamicability<!mytgt powerstrike targetcontroller!> tap auto=alternative target(creature) dynamicability<!mytgt powerstrike targetcontroller!> tap
other={4}{BR}{T(creature[black;red]|mybattlefield)}{T(creature[black;red]|mybattlefield)} name(Conspire) other={4}{BR}{T(creature[black;red]|mybattlefield)}{T(creature[black;red]|mybattlefield)} name(Conspire)
otherrestriction=type(creature[black;red]|myBattlefield)~morethan~1
text=Tap target untapped creature. It deals damage equal to its power to its controller. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.) text=Tap target untapped creature. It deals damage equal to its power to its controller. -- Conspire (As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)
mana={4}{BR} mana={4}{BR}
type=Sorcery type=Sorcery
@@ -130625,8 +130628,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Volcanic Geyser name=Volcanic Geyser
target=creature,player auto=damage:X target(creature,player)
auto=damage:X
text=Volcanic Geyser deals X damage to target creature or player. text=Volcanic Geyser deals X damage to target creature or player.
mana={X}{R}{R} mana={X}{R}{R}
type=Instant type=Instant
+32 -15
View File
@@ -342,14 +342,14 @@ int OrderedAIAction::getEfficiency()
// Bonus if almost no cards in hand // Bonus if almost no cards in hand
if (p->game->hand->nb_cards <= 1) if (p->game->hand->nb_cards <= 1)
{ {
efficiency = 60; efficiency = 50;
} }
else efficiency = 30; else efficiency = 30;
} }
//nothing huge here, just ensuring that Ai makes his noncreature becomers into creatures during first main, so it can actually use them in combat. //nothing huge here, just ensuring that Ai makes his noncreature becomers into creatures during first main, so it can actually use them in combat.
if (coreAbilityCardTarget && !coreAbilityCardTarget->isCreature() && currentPhase == MTG_PHASE_FIRSTMAIN) if (coreAbilityCardTarget && !coreAbilityCardTarget->isCreature() && !coreAbilityCardTarget->isTapped() && currentPhase == MTG_PHASE_FIRSTMAIN)
{ {
efficiency = 60; efficiency = 50;
} }
break; break;
} }
@@ -603,8 +603,8 @@ int OrderedAIAction::getEfficiency()
} }
else else
{ {
// We don't want to return the ability source cards in play to own hand, save rare combos // We don't want to return the ability source cards that are in play to own hand, save rare combos
// cards like Blinking Spirit use to be auto lose for AI // cards like Blinking Spirit used to be auto lose for AI
if(z == p->game->hand || z == p->game->library) if(z == p->game->hand || z == p->game->library)
efficiency = 1; efficiency = 1;
else efficiency = 50; else efficiency = 50;
@@ -662,8 +662,8 @@ int OrderedAIAction::getEfficiency()
SAFE_DELETE(parsedAICC); SAFE_DELETE(parsedAICC);
} }
else else // this is why the AI never chooses any card at all? reveal is used to get cards so it should be at better value
efficiency = 0; efficiency = 60;
} }
//At this point the "basic" efficiency is computed, we further tweak it depending on general decisions, independent of theAbility type //At this point the "basic" efficiency is computed, we further tweak it depending on general decisions, independent of theAbility type
@@ -708,7 +708,14 @@ int OrderedAIAction::getEfficiency()
if (ability->source) if (ability->source)
if(ability->source->hasType(Subtypes::TYPE_PLANESWALKER)) if(ability->source->hasType(Subtypes::TYPE_PLANESWALKER))
efficiency += 50; efficiency += 40;
else if(ability->source->hasType(Subtypes::TYPE_LAND))
{ // probably a shockland, don't pay life if hand is empty
if (p->game->hand->nb_cards == 0 || p->life<=2)
// check that's not a manland(like Celestial Colonnade)
if(efficiency < 50)
efficiency = 0;
}
SAFE_DELETE(transAbility); SAFE_DELETE(transAbility);
return efficiency; return efficiency;
@@ -2365,6 +2372,10 @@ int AIPlayerBaka::chooseTarget(TargetChooser * _tc, Player * forceTarget,MTGCard
cardEffect = af.abilityEfficiency(withoutGuessing,this,MODE_TARGET,tc,NULL); cardEffect = af.abilityEfficiency(withoutGuessing,this,MODE_TARGET,tc,NULL);
delete withoutGuessing; delete withoutGuessing;
} }
// Don't really like it but green mana producing auras targeting the player is one of the most reported bugs
if(cardEffect == BAKA_EFFECT_DONTKNOW && tc->source->hasSubtype(Subtypes::TYPE_AURA) && tc->source->hasColor(Constants::MTG_COLOR_GREEN))
cardEffect = BAKA_EFFECT_GOOD;
if (cardEffect != BAKA_EFFECT_GOOD) if (cardEffect != BAKA_EFFECT_GOOD)
{ {
target = this->opponent(); target = this->opponent();
@@ -2707,7 +2718,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
if(shouldPlayPercentage <= 10) if(shouldPlayPercentage <= 10)
shouldPlayPercentage = shouldPlayPercentage/3; shouldPlayPercentage = shouldPlayPercentage/3;
} }
DebugTrace("Should I play " << (card ? card->name : "Nothing" ) << "?" << endl DebugTrace("Should I play from grave " << (card ? card->name : "Nothing" ) << "?" << endl
<<"shouldPlayPercentage = "<< shouldPlayPercentage); <<"shouldPlayPercentage = "<< shouldPlayPercentage);
if(card->getRestrictions().size()) if(card->getRestrictions().size())
{ {
@@ -2863,7 +2874,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
if(shouldPlayPercentage <= 10) if(shouldPlayPercentage <= 10)
shouldPlayPercentage = shouldPlayPercentage/3; shouldPlayPercentage = shouldPlayPercentage/3;
} }
DebugTrace("Should I play " << (card ? card->name : "Nothing" ) << "?" << endl DebugTrace("Should I play from exile" << (card ? card->name : "Nothing" ) << "?" << endl
<<"shouldPlayPercentage = "<< shouldPlayPercentage); <<"shouldPlayPercentage = "<< shouldPlayPercentage);
if(card->getRestrictions().size()) if(card->getRestrictions().size())
{ {
@@ -2912,8 +2923,9 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN) if (card->has(Constants::TREASON) && observer->getCurrentGamePhase() != MTG_PHASE_FIRSTMAIN)
continue; continue;
if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1])) //PLaneswalkers are now legendary so this is redundant
continue; //if (card->hasType(Subtypes::TYPE_PLANESWALKER) && card->types.size() > 0 && game->inPlay->hasTypeSpecificInt(Subtypes::TYPE_PLANESWALKER,card->types[1]))
//continue;
if(hints && hints->HintSaysItsForCombo(observer,card)) if(hints && hints->HintSaysItsForCombo(observer,card))
{ {
@@ -3017,7 +3029,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
if(shouldPlayPercentage <= 10) if(shouldPlayPercentage <= 10)
shouldPlayPercentage = shouldPlayPercentage/3; shouldPlayPercentage = shouldPlayPercentage/3;
} }
DebugTrace("Should I play " << (card ? card->name : "Nothing" ) << "?" << endl DebugTrace("Should I play from hand" << (card ? card->name : "Nothing" ) << "?" << endl
<<"shouldPlayPercentage = "<< shouldPlayPercentage); <<"shouldPlayPercentage = "<< shouldPlayPercentage);
if(card->getRestrictions().size()) if(card->getRestrictions().size())
{ {
@@ -3444,12 +3456,17 @@ int AIPlayerBaka::getCreaturesInfo(Player * player, int neededInfo, int untapMod
int AIPlayerBaka::chooseAttackers() int AIPlayerBaka::chooseAttackers()
{ {
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1, 1);
if (myCreatures < 1)
return 0;
//Attack with all creatures //Attack with all creatures
//How much damage can the other player do during his next Attack ? //How much damage can the other player do during his next Attack ?
int opponentForce = getCreaturesInfo(opponent(), INFO_CREATURESPOWER); int opponentForce = getCreaturesInfo(opponent(), INFO_CREATURESPOWER);
int opponentCreatures = getCreaturesInfo(opponent(), INFO_NBCREATURES); int opponentCreatures = getCreaturesInfo(opponent(), INFO_NBCREATURES);
int myForce = getCreaturesInfo(this, INFO_CREATURESPOWER, -1, 1); int myForce = getCreaturesInfo(this, INFO_CREATURESPOWER, -1, 1);
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1, 1); if(opponent()->life < 5)
agressivity += 31;
bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2 * opponent()->life)); bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2 * opponent()->life));
if (agressivity > 80 && !attack && life > opponentForce) if (agressivity > 80 && !attack && life > opponentForce)
{ {
@@ -3466,7 +3483,7 @@ int AIPlayerBaka::chooseAttackers()
MTGCardInstance * card = NULL; MTGCardInstance * card = NULL;
while ((card = cd.nextmatch(game->inPlay, card))) while ((card = cd.nextmatch(game->inPlay, card)))
{ {
if (hints && hints->HintSaysAlwaysAttack(observer, card)) if ((hints && hints->HintSaysAlwaysAttack(observer, card)) || card->has(Constants::UNBLOCKABLE))
{ {
if (!card->isAttacker()) if (!card->isAttacker())
{ {
+2 -2
View File
@@ -274,8 +274,8 @@ void StackAbility::Render()
else else
fmLibrary++; fmLibrary++;
} }
else //else // This was crashing the game when a permanent targeted a spell in the stack
mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() ); //mytargetQuads.push_back( ((Damageable *)(tt))->getIcon() );
} }
} }
} }
+4
View File
@@ -4626,6 +4626,10 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
return BAKA_EFFECT_GOOD; return BAKA_EFFECT_GOOD;
if (dynamic_cast<AAModTurn *> (a)) if (dynamic_cast<AAModTurn *> (a))
return BAKA_EFFECT_GOOD; return BAKA_EFFECT_GOOD;
if (dynamic_cast<ATransformer *> (a))
return BAKA_EFFECT_GOOD;
if (dynamic_cast<AADamager *> (a))
return BAKA_EFFECT_BAD;
if (PTInstant * abi = dynamic_cast<PTInstant *>(a)) if (PTInstant * abi = dynamic_cast<PTInstant *>(a))
return (abi->wppt->power.getValue() >= 0 && abi->wppt->toughness.getValue() >= 0) ? BAKA_EFFECT_GOOD : BAKA_EFFECT_BAD; return (abi->wppt->power.getValue() >= 0 && abi->wppt->toughness.getValue() >= 0) ? BAKA_EFFECT_GOOD : BAKA_EFFECT_BAD;
+6 -4
View File
@@ -1353,16 +1353,18 @@ int MTGCardInstance::DangerRanking()
result += 1; result += 1;
} }
} }
if (result > 1) // Even at 60(danger=3) the AI is hasty to play removal on a simple creature
danger += 1; // a vanilla 2 mana, 2/2 used to be eff = 60
if (result > 2)
danger += 1;
if (result > 4) if (result > 4)
danger += 1; danger += 1;
if (result > 6) if (result > 6)
danger += 1; danger += 1;
if (result > 10) if (result > 10)
danger += 1; danger += 1;
if (result > 12)
danger += 1;
if (result > 14)
danger += 1;
return danger; return danger;
} }