Added/Fixed primitives, updated the "missing_cards_by_sets" folder, added a new option "keepname" to keep the original name after the copy (e.g. Olag, Ludevic's Hubris), implemented a fix to avoid triggering of oneshot abilities when "flip" ability is used to return from a copy, fixed an issue with colors and "transforms" keyword, implemented a fix to avoid crashes when the card paying extracost has also a cost alteration (e.g. combo with "Pirate's Pillage" and "Ruby Medallion"), added a new keyword "totmanaspent" to return the real amount of mana spent to cast a card (e.g. Memory Deluge), added new keywords "pnumofidentitycols" and "onumofidentitycols" to return the total amount of commander identity colors for controller or opponent (e.g. War Room), improved "totcnt" keyword, added new keywords "totalcololorsinplay" and "oppototalcololorsinplay" to return the total amount of colors on controller or opponent battlefield (e.g. Moonveil Regent), added new keywords "pcoven" and "ocoven" to return if a player controls three or more creatures with different powers (e.g. Augur of Autumn).

This commit is contained in:
Vittorio Alfieri
2021-09-12 21:18:43 +02:00
parent 9aa15766d4
commit 04a6a4bfe2
12 changed files with 254 additions and 118 deletions
+4 -1
View File
@@ -2,8 +2,11 @@
## [master] (https://github.com/WagicProject/wagic/tree/master) ## [master] (https://github.com/WagicProject/wagic/tree/master)
### 12/09/21
- *Committed:* Added/Fixed primitives, updated the "missing_cards_by_sets" folder, added a new option "keepname" to keep the original name after the copy (e.g. Olag, Ludevic's Hubris), implemented a fix to avoid triggering of oneshot abilities when "flip" ability is used to return from a copy, fixed an issue with colors and "transforms" keyword, implemented a fix to avoid crashes when the card paying extracost has also a cost alteration (e.g. combo with "Pirate's Pillage" and "Ruby Medallion"), added a new keyword "totmanaspent" to return the real amount of mana spent to cast a card (e.g. Memory Deluge), added new keywords "pnumofidentitycols" and "onumofidentitycols" to return the total amount of commander identity colors for controller or opponent (e.g. War Room), improved "totcnt" keyword, added new keywords "totalcololorsinplay" and "oppototalcololorsinplay" to return the total amount of colors on controller or opponent battlefield (e.g. Moonveil Regent), added new keywords "pcoven" and "ocoven" to return if a player controls three or more creatures with different powers (e.g. Augur of Autumn). ([Vitty85](https://github.com/Vitty85))
### 07/09/21 ### 07/09/21
- *Committed:* Added/fixed primitives, updated the "missing_cards_by_sets" folder, added new ability "hasstrive" to implement Strive cost with multikicker and refactored all cards with Strive cost (now they use a special version of multikicker but they don't count as kicked spell), improved "targeted" and "vampired" trigger to allow the "turnlimited" option, improved Android gesture to emulate "option menu" button pressure (slide down) and emulate "back" button pressure (slide up). ([Vitty85](https://github.com/Vitty85)) - *Committed:* Added/fixed primitives, updated the "missing_cards_by_sets" folder, added new ability "hasstrive" to implement Strive cost with multikicker and refactored all cards with Strive cost (now they use a special version of multikicker but they don't count as kicked spell), improved "targeted" and "vampired" trigger to allow the "turnlimited" option, improved Android gesture to emulate "option menu" button pressure (slide down) and emulate "back" button pressure (slide up). https://github.com/WagicProject/wagic/commit/9aa15766d455c6b9f5fec1bb003ca35a34cbb5fc ([Vitty85](https://github.com/Vitty85))
### 06/09/21 ### 06/09/21
- *Committed:* Fixed primitives, changed type of "isFlipped" card variable from bool to int and fixed a related bug on targeting cards with "isFlipped" attribute, improved "disturb" ability (now fi you counter a card casted with disturb it correctly goes to exile), added "decayed" ability, added two new zone alias "mycommandplay" and "opponentcommandplay" for targeting Battlefield and CommandZone at the same time. https://github.com/WagicProject/wagic/commit/9dabf121d3719aa0d684e9d5d9732dc1b4a92b3d ([Vitty85](https://github.com/Vitty85)) - *Committed:* Fixed primitives, changed type of "isFlipped" card variable from bool to int and fixed a related bug on targeting cards with "isFlipped" attribute, improved "disturb" ability (now fi you counter a card casted with disturb it correctly goes to exile), added "decayed" ability, added two new zone alias "mycommandplay" and "opponentcommandplay" for targeting Battlefield and CommandZone at the same time. https://github.com/WagicProject/wagic/commit/9dabf121d3719aa0d684e9d5d9732dc1b4a92b3d ([Vitty85](https://github.com/Vitty85))
@@ -14,12 +14,6 @@ mana={4}{U}{U}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
[card]
name=High Ground name=High Ground
text=Each creature you control can block an additional creature. text=Each creature you control can block an additional creature.
mana={W} mana={W}
@@ -11,12 +11,6 @@ mana={W}
type=Instant type=Instant
[/card] [/card]
[card] [card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
[card]
name=Mirror of Fate name=Mirror of Fate
text={T}, Sacrifice Mirror of Fate: Choose up to seven face-up exiled cards you own. Exile all the cards from your library, then put the chosen cards on top of your library. text={T}, Sacrifice Mirror of Fate: Choose up to seven face-up exiled cards you own. Exile all the cards from your library, then put the chosen cards on top of your library.
mana={5} mana={5}
@@ -1,10 +1,4 @@
[card] [card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
[card]
name=Scroll Rack name=Scroll Rack
text={1}, {T}: Exile any number of cards from your hand face down. Put that many cards from the top of your library into your hand. Then look at the exiled cards and put them on top of your library in any order. text={1}, {T}: Exile any number of cards from your hand face down. Put that many cards from the top of your library into your hand. Then look at the exiled cards and put them on top of your library in any order.
mana={2} mana={2}
@@ -37,9 +37,3 @@ text=As Tablet of the Guilds enters the battlefield, choose two colors. -- Whene
mana={2} mana={2}
type=Artifact type=Artifact
[/card] [/card]
[card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
@@ -117,9 +117,3 @@ subtype=Zubera Spirit
power=3 power=3
toughness=3 toughness=3
[/card] [/card]
[card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
@@ -2473,12 +2473,11 @@ type=Land
[/card] [/card]
[card] [card]
name=Arcane Signet name=Arcane Signet
auto=if type(*[red]|myzones)~morethan~0 then transforms((,newability[{T}:add{R}])) forever auto=aslongas(*[iscommander&red]|myzones) {T}:add{R}
auto=if type(*[white]|myzones)~morethan~0 then transforms((,newability[{T}:add{W}])) forever auto=aslongas(*[iscommander&white]|myzones) {T}:add{W}
auto=if type(*[green]|myzones)~morethan~0 then transforms((,newability[{T}:add{G}])) forever auto=aslongas(*[iscommander&green]|myzones) {T}:add{G}
auto=if type(*[blue]|myzones)~morethan~0 then transforms((,newability[{T}:add{U}])) forever auto=aslongas(*[iscommander&blue]|myzones) {T}:add{U}
auto=if type(*[black]|myzones)~morethan~0 then transforms((,newability[{T}:add{B}])) forever auto=aslongas(*[iscommander&black]|myzones) {T}:add{B}
auto=if type(*[-black;-red;-white;-blue;-green]|myzones)~morethan~0 then transforms((,newability[{T}:add{C}])) forever
text={T}: Add one mana of any color in your commander's color identity. text={T}: Add one mana of any color in your commander's color identity.
mana={2} mana={2}
type=Artifact type=Artifact
@@ -5265,7 +5264,7 @@ type=Instant
name=Belbe, Corrupted Observer name=Belbe, Corrupted Observer
text=At the beginning of each player's postcombat main phase, that player adds {C}{C} for each of your opponents who lost life this turn. (Damage causes loss of life.) text=At the beginning of each player's postcombat main phase, that player adds {C}{C} for each of your opponents who lost life this turn. (Damage causes loss of life.)
auto=@each my secondmain restriction{compare(oplifelost)~morethan~0}:add{C}{C} auto=@each my secondmain restriction{compare(oplifelost)~morethan~0}:add{C}{C}
auto=@each opponent secondmain restriction{compare(lifelost)~morethan~0}:add{C}{C} opponent auto=@each opponent secondmain restriction{compare(oplifelost)~morethan~0}:add{C}{C} opponent
mana={B}{G} mana={B}{G}
type=Legendary Creature type=Legendary Creature
subtype=Zombie Elf subtype=Zombie Elf
@@ -11894,12 +11893,11 @@ type=Land
[/card] [/card]
[card] [card]
name=Command Tower name=Command Tower
auto=if type(*[red]|myzones)~morethan~0 then transforms((,newability[{T}:add{R}])) forever auto=aslongas(*[iscommander&red]|myzones) {T}:add{R}
auto=if type(*[white]|myzones)~morethan~0 then transforms((,newability[{T}:add{W}])) forever auto=aslongas(*[iscommander&white]|myzones) {T}:add{W}
auto=if type(*[green]|myzones)~morethan~0 then transforms((,newability[{T}:add{G}])) forever auto=aslongas(*[iscommander&green]|myzones) {T}:add{G}
auto=if type(*[blue]|myzones)~morethan~0 then transforms((,newability[{T}:add{U}])) forever auto=aslongas(*[iscommander&blue]|myzones) {T}:add{U}
auto=if type(*[black]|myzones)~morethan~0 then transforms((,newability[{T}:add{B}])) forever auto=aslongas(*[iscommander&black]|myzones) {T}:add{B}
auto=if type(*[-black;-red;-white;-blue;-green]|myzones)~morethan~0 then transforms((,newability[{T}:add{C}])) forever
text={T}: Add to your mana pool one mana of any color in your commander's color identity. text={T}: Add to your mana pool one mana of any color in your commander's color identity.
type=Land type=Land
[/card] [/card]
@@ -11939,12 +11937,11 @@ name=Commander's Plate
auto={5}:equip auto={5}:equip
auto=aslongas(*[iscommander]|myBattlefield) {3}:name(equip a commander) name(equip a commander) rehook target(creature[iscommander]|mybattlefield) auto=aslongas(*[iscommander]|myBattlefield) {3}:name(equip a commander) name(equip a commander) rehook target(creature[iscommander]|mybattlefield)
auto=teach(creature) 3/3 auto=teach(creature) 3/3
auto=aslongas(*[red]|myzones) teach(creature) protection from red <1 auto=aslongas(*[red]|myzones) <1 teach(creature) aslongas(*[iscommander]|myzones) protection from red
auto=aslongas(*[white]|myzones) teach(creature) protection from white <1 auto=aslongas(*[white]|myzones) <1 teach(creature) aslongas(*[iscommander]|myzones) protection from white
auto=aslongas(*[green]|myzones) teach(creature) protection from green <1 auto=aslongas(*[green]|myzones) <1 teach(creature) aslongas(*[iscommander]|myzones) protection from green
auto=aslongas(*[blue]|myzones) teach(creature) protection from blue <1 auto=aslongas(*[blue]|myzones) <1 teach(creature) aslongas(*[iscommander]|myzones) protection from blue
auto=aslongas(*[black]|myzones) then teach(creature) protection from black <1 auto=aslongas(*[black]|myzones) <1 teach(creature) aslongas(*[iscommander]|myzones) protection from black
auto=aslongas(*[colorless]|myzones) teach(creature) protection from(artifact) <1
text=Equipped creature gets +3/+3 and has protection from each color that's not in your commander's color identity. -- Equip commander {3} -- Equip {5} text=Equipped creature gets +3/+3 and has protection from each color that's not in your commander's color identity. -- Equip commander {3} -- Equip {5}
mana={1} mana={1}
type=Artifact type=Artifact
@@ -11953,12 +11950,11 @@ subtype=Equipment
[card] [card]
name=Commander's Sphere name=Commander's Sphere
auto={S}:name(Sacrifice and draw) draw:1 controller auto={S}:name(Sacrifice and draw) draw:1 controller
auto=aslongas(*[red]|myzones) {T}:add{R} auto=aslongas(*[iscommander&red]|myzones) {T}:add{R}
auto=aslongas(*[white]|myzones) {T}:add{W} auto=aslongas(*[iscommander&white]|myzones) {T}:add{W}
auto=aslongas(*[green]|myzones) {T}:add{G} auto=aslongas(*[iscommander&green]|myzones) {T}:add{G}
auto=aslongas(*[blue]|myzones) {T}:add{U} auto=aslongas(*[iscommander&blue]|myzones) {T}:add{U}
auto=aslongas(*[black]|myzones) {T}:add{B} auto=aslongas(*[iscommander&black]|myzones) {T}:add{B}
auto=aslongas(*[colorless]|myzones) {T}:add{C}
text={T}: Add to your mana pool one mana of any color in your commander's color identity. -- Sacrifice Commander's Sphere: Draw a card. text={T}: Add to your mana pool one mana of any color in your commander's color identity. -- Sacrifice Commander's Sphere: Draw a card.
mana={3} mana={3}
type=Artifact type=Artifact
@@ -21147,7 +21143,7 @@ toughness=0
[card] [card]
name=Faerie Artisans name=Faerie Artisans
abilities=flying abilities=flying
auto=@movedto(creature[-token]|opponentBattlefield) clone(creature[-token]|opponentBattlefield) with (transform[artifact]) then moveTo(exile all[other tokens creature]|myBattlefield) auto=@movedto(creature[-token]|opponentBattlefield):name(Copy creature) all(trigger[to]) clone addtype(artifact) and!( transform((,newability[counter(0/0.1.ArtisanCreated)],newability[name(Exile other tokens) all(other creature[counter{0/0.1.ArtisanCreated}]|myBattlefield) moveTo(exile)])) oneshot )!
text=Flying -- Whenever a nontoken creature enters the battlefield under an opponents control, create a token thats a copy of that creature except its an artifact in addition to its other types. Then exile all other tokens created with Faerie Artisans. text=Flying -- Whenever a nontoken creature enters the battlefield under an opponents control, create a token thats a copy of that creature except its an artifact in addition to its other types. Then exile all other tokens created with Faerie Artisans.
mana={3}{U} mana={3}{U}
type=Creature type=Creature
@@ -22118,7 +22114,7 @@ type=Sorcery
[card] [card]
name=Field of Ruin name=Field of Ruin
auto={T}:Add{1} auto={T}:Add{1}
auto={2}{T}{S}:destroy target(land[-basic]|opponentlbattlefield) && moveto(mybattlefield) target(basic|mylibrary) && ability$!moveto(mybattlefield) target(basic|mylibrary)!$ opponent auto={2}{T}{S}:name(Destroy non-basic land) target(land[-basic]|opponentbattlefield) destroy && ability$!name(Search library) name(Search library) target(land[basic]|mylibrary) moveto(mybattlefield) and!( shuffle )! !$ controller && ability$!name(Search library) name(Search library) target(land[basic]|mylibrary) moveto(mybattlefield) and!( shuffle )! !$ opponent
text={T}: Add {1} to your mana pool. -- {2}, {T}, Sacrifice Field of Ruin: Destroy target nonbasic land an opponent controls. Each player searches his or her library for a basic land card, puts it onto the battlefield, then shuffles his or her library. text={T}: Add {1} to your mana pool. -- {2}, {T}, Sacrifice Field of Ruin: Destroy target nonbasic land an opponent controls. Each player searches his or her library for a basic land card, puts it onto the battlefield, then shuffles his or her library.
type=Land type=Land
[/card] [/card]
@@ -41206,7 +41202,7 @@ subtype=Equipment
[/card] [/card]
[card] [card]
name=Mirror of the Forebears name=Mirror of the Forebears
auto=chooseatype transforms(([{1}:becomes [clone target(creature[chosentype]|myBattlefield)] && transforms(artifact)])) chooseend ueot auto=chooseatype transforms((,newability[{1}:name(Becomes copy) target(creature[chosentype]|myBattlefield) copy and!( all(this) transforms((Artifact,newability[phaseaction[endofturn once] flip(Mirror of the Forebears) undocpy])) forever )!])) forever chooseend
text=As Mirror of the Forebears enters the battlefield, choose a creature type. -- {1}: Until end of turn, Mirror of the Forebears becomes a copy of target creature you control of the chosen type, except its an artifact in addition to its other types. text=As Mirror of the Forebears enters the battlefield, choose a creature type. -- {1}: Until end of turn, Mirror of the Forebears becomes a copy of target creature you control of the chosen type, except its an artifact in addition to its other types.
mana={2} mana={2}
type=Artifact type=Artifact
@@ -44901,8 +44897,8 @@ type=Enchantment
[/card] [/card]
[card] [card]
name=Opal Acrolith name=Opal Acrolith
auto=@movedTo(creature|opponentstack):transforms((removetypes)) forever && transforms((Soldier Creature,setpower=2,settoughness=4)) forever auto=@movedTo(creature|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Soldier Creature,setpower=2,settoughness=4)) forever
auto={0}:transforms((removetypes,newability[becomes(Enchantment)])) forever auto={0}:name(Becomes an enchantment) transforms((removetypes,newability[becomes(Enchantment)])) forever
text=Whenever an opponent casts a creature spell, if Opal Acrolith is an enchantment, Opal Acrolith becomes a 2/4 Soldier creature. -- {0}: Opal Acrolith becomes an enchantment. text=Whenever an opponent casts a creature spell, if Opal Acrolith is an enchantment, Opal Acrolith becomes a 2/4 Soldier creature. -- {0}: Opal Acrolith becomes an enchantment.
mana={2}{W} mana={2}{W}
type=Enchantment type=Enchantment
@@ -44910,22 +44906,46 @@ type=Enchantment
[card] [card]
name=Opal Palace name=Opal Palace
auto={T}:add{C} auto={T}:add{C}
auto=if type(*[red]|myzones)~morethan~0 then transforms((,newability[{T}:add{R}])) forever auto=aslongas(*[iscommander&red]|myzones) {1}{T}:name(Add red mana) name(Add red mana) transforms((,newability[add{R}],newability[if type(*[iscommander]|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.OpalEffect)])) oneshot
auto=if type(*[white]|myzones)~morethan~0 then transforms((,newability[{T}:add{W}])) forever auto=aslongas(*[iscommander&white]|myzones) {1}{T}:name(Add white mana) name(Add white mana) transforms((,newability[add{W}],newability[if type(*[iscommander]|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.OpalEffect)])) oneshot
auto=if type(*[green]|myzones)~morethan~0 then transforms((,newability[{T}:add{G}])) forever auto=aslongas(*[iscommander&green]|myzones) {1}{T}:name(Add green mana) name(Add green mana) transforms((,newability[add{G}],newability[if type(*[iscommander]|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.OpalEffect)])) oneshot
auto=if type(*[blue]|myzones)~morethan~0 then transforms((,newability[{T}:add{U}])) forever auto=aslongas(*[iscommander&blue]|myzones) {1}{T}:name(Add blue mana) name(Add blue mana) transforms((,newability[add{U}],newability[if type(*[iscommander]|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.OpalEffect)])) oneshot
auto=if type(*[black]|myzones)~morethan~0 then transforms((,newability[{T}:add{B}])) forever auto=aslongas(*[iscommander&black]|myzones) {1}{T}:name(Add black mana) name(Add black mana) transforms((,newability[add{B}],newability[if type(*[iscommander]|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.OpalEffect)])) oneshot
auto=@movedto(*[iscommander]|mybattlefield) from(mycommandzone):all(trigger[to]) counter(1/1,pnumofcommandcast) limit:1 auto=@movedto(*[iscommander]|mybattlefield) restriction{compare(hascntopaleffect)~morethan~0}:name(Put 1/1 counter) all(trigger[to]) name(Put 1/1 counter) transforms((,newability[counter(1/1.numofcommandcast)])) oneshot
auto=@movedto(*[iscommander]|mybattlefield) restriction{compare(hascntopaleffect)~morethan~0}:name(Effect ends) removeallcounters(0/0.1.OpalEffect)
auto=@each endofturn restriction{compare(hascntopaleffect)~morethan~0}:name(Effect ends) removeallcounters(0/0.1.OpalEffect)
text={T}: Add {C} to your mana pool. -- {1}, {T}: Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of additional +1/+1 counters on it equal to the number of times it's been cast from the command zone this game. text={T}: Add {C} to your mana pool. -- {1}, {T}: Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of additional +1/+1 counters on it equal to the number of times it's been cast from the command zone this game.
type=Land type=Land
[/card] [/card]
[card] [card]
name=Opal Titan name=Opal Titan
auto=@movedTo(creature[blue]|opponentstack):transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,newability[protection from blue)) forever auto=@movedTo(creature[blue;-multicolor]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue])) forever
auto=@movedTo(creature[white]|opponentstack):transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,newability[protection from white)) forever auto=@movedTo(creature[white;-multicolor]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from white])) forever
auto=@movedTo(creature[green]|opponentstack):transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,newability[protection from green)) forever auto=@movedTo(creature[green;-multicolor]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from green])) forever
auto=@movedTo(creature[black]|opponentstack):transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,newability[protection from black)) forever auto=@movedTo(creature[black;-multicolor]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black])) forever
auto=@movedTo(creature[red]|opponentstack):transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,newability[protection from red)) forever auto=@movedTo(creature[red;-multicolor]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from red])) forever
auto=@movedto(creature[red&blue;-green;-black;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from red])) forever
auto=@movedto(creature[red&green;-blue;-black;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from green],newability[protection from red])) forever
auto=@movedto(creature[red&black;-blue;-green;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from red])) forever
auto=@movedto(creature[red&white;-blue;-green;-black]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from white],newability[protection from red])) forever
auto=@movedto(creature[white&blue;-green;-black;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from white])) forever
auto=@movedto(creature[white&green;-blue;-black;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from white],newability[protection from green])) forever
auto=@movedto(creature[white&black;-blue;-green;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from white],newability[protection from black])) forever
auto=@movedto(creature[black&blue;-green;-black;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from black])) forever
auto=@movedto(creature[black&green;-blue;-black;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from green])) forever
auto=@movedto(creature[green&blue;-red;-black;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from green])) forever
auto=@movedto(creature[green&blue&red;-black;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from green],newability[protection from blue],newability[protection from red])) forever
auto=@movedto(creature[green&blue&black;-red;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from black],newability[protection from green])) forever
auto=@movedto(creature[green&blue&white;-red;-black]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from green],newability[protection from blue],newability[protection from white])) forever
auto=@movedto(creature[red&blue&black;-green;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from black],newability[protection from red])) forever
auto=@movedto(creature[red&blue&white;-green;-black]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from white],newability[protection from red])) forever
auto=@movedto(creature[black&blue&white;-green;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from blue],newability[protection from white])) forever
auto=@movedto(creature[black&blue&white&green;-red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from blue],newability[protection from white],newability[protection from green])) forever
auto=@movedto(creature[black&blue&white&red;-green]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from blue],newability[protection from white],newability[protection from red])) forever
auto=@movedto(creature[black&blue&red&green;-white]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from blue],newability[protection from green],newability[protection from red])) forever
auto=@movedto(creature[black&red&white&green;-blue]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from black],newability[protection from red],newability[protection from white],newability[protection from green])) forever
auto=@movedto(creature[blue&red&white&green;-black]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from blue],newability[protection from red],newability[protection from white],newability[protection from green])) forever
auto=@movedto(creature[black&blue&white&green&red]|opponentstack):if cantargetcard(*[enchantment]|*) then transforms((removetypes)) forever && transforms((Giant Creature,setpower=4,settoughness=4,white,newability[protection from white],newability[protection from black],newability[protection from green],newability[protection from blue],newability[protection from red])) forever
text=When an opponent casts a creature spell, if Opal Titan is an enchantment, Opal Titan becomes a 4/4 Giant creature with protection from each of that spell's colors. text=When an opponent casts a creature spell, if Opal Titan is an enchantment, Opal Titan becomes a 4/4 Giant creature with protection from each of that spell's colors.
mana={2}{W}{W} mana={2}{W}{W}
type=Enchantment type=Enchantment
@@ -46267,12 +46287,14 @@ toughness=4
name=Path of Ancestry name=Path of Ancestry
auto=tap(noevent) auto=tap(noevent)
aicode=activate transforms((,newability[all(*[zpos<=1]|mylibrary) transforms((,newability[may name(Put on bottom of library) moveto(myreveal) and!( bottomoflibrary )!])) oneshot])) oneshot aicode=activate transforms((,newability[all(*[zpos<=1]|mylibrary) transforms((,newability[may name(Put on bottom of library) moveto(myreveal) and!( bottomoflibrary )!])) oneshot])) oneshot
auto=if type(*[red]|myzones)~morethan~0 then transforms((,newability[{T}:add{R} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever auto=aslongas(*[iscommander&red]|myzones) {T}:name(Add red mana) name(Add red mana) transforms((,newability[add{R}],newability[if type(creature|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.PathEffect)])) oneshot
auto=if type(*[white]|myzones)~morethan~0 then transforms((,newability[{T}:add{W} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend}])) forever auto=aslongas(*[iscommander&white]|myzones) {T}:name(Add white mana) name(Add white mana) transforms((,newability[add{W}],newability[if type(creature|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.PathEffect)])) oneshot
auto=if type(*[green]|myzones)~morethan~0 then transforms((,newability[{T}:add{G} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever auto=aslongas(*[iscommander&green]|myzones) {T}:name(Add green mana) name(Add green mana) transforms((,newability[add{G}],newability[if type(creature|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.PathEffect)])) oneshot
auto=if type(*[blue]|myzones)~morethan~0 then transforms((,newability[{T}:add{U} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever auto=aslongas(*[iscommander&blue]|myzones) {T}:name(Add blue mana) name(Add blue mana) transforms((,newability[add{U}],newability[if type(creature|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.PathEffect)])) oneshot
auto=if type(*[black]|myzones)~morethan~0 then transforms((,newability[{T}:add{B} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever auto=aslongas(*[iscommander&black]|myzones) {T}:name(Add black mana) name(Add black mana) transforms((,newability[add{B}],newability[if type(creature|myrestrictedcastingzone)~morethan~0 then counter(0/0.1.PathEffect)])) oneshot
auto=if type(*[-black;-red;-white;-blue;-green]|myzones)~morethan~0 then transforms((,newability[{T}:add{C} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever auto=@movedto(creature|mybattlefield) restriction{compare(hascntpatheffect)~morethan~0}:name(Scry if share type) all(trigger[to]) name(Scry if share type) transforms((,newability[if type(*[iscommander&share!types!]|myzones)~morethan~0 then scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) oneshot
auto=@movedto(creature|mybattlefield) restriction{compare(hascntpatheffect)~morethan~0}:name(Effect ends) removeallcounters(0/0.1.PathEffect)
auto=@each endofturn restriction{compare(hascntpatheffect)~morethan~0}:name(Effect ends) removeallcounters(0/0.1.PathEffect)
text=Path of Ancestry enters the battlefield tapped. -- {T}: Add one mana of any color in your commander's color identity. When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1. text=Path of Ancestry enters the battlefield tapped. -- {T}: Add one mana of any color in your commander's color identity. When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1.
type=Land type=Land
[/card] [/card]
@@ -46833,7 +46855,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Phyrexian Metamorph name=Phyrexian Metamorph
auto=may copy NotATarget(creature,artifact) transform(artifact) forever auto=may name(Copy artifact or creature) target(*[creature;artifact]|battlefield) copy and!( transforms((Artifact)) forever )!
text=({U/P} can be paid with either {U} or 2 life.) -- You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except its an artifact in addition to its other types. text=({U/P} can be paid with either {U} or 2 life.) -- You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except its an artifact in addition to its other types.
mana={3}{P(U)} mana={3}{P(U)}
type=Artifact Creature type=Artifact Creature
@@ -47118,7 +47140,7 @@ color=red
[/card] [/card]
[card] [card]
name=Pirate's Cutlass name=Pirate's Cutlass
auto=aslongas(parents) name(Attach to creature) rehook target(creature|myBattlefield) <1 auto=name(Attach to creature) rehook target(creature|myBattlefield)
auto=teach(creature) 2/1 auto=teach(creature) 2/1
auto={2}:equip auto={2}:equip
text=When Pirate's Cutlass enters the battlefield, attach it to target Pirate you control. -- Equipped creature gets +2/+1. -- Equip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.) text=When Pirate's Cutlass enters the battlefield, attach it to target Pirate you control. -- Equipped creature gets +2/+1. -- Equip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)
@@ -47130,7 +47152,7 @@ subtype=Equipment
name=Pirate's Pillage name=Pirate's Pillage
auto=draw:2 controller auto=draw:2 controller
auto=token(Treasure Sur)*2 auto=token(Treasure Sur)*2
text=As an additional cost to cast this spell, discard a card. -- Draw two cards and create two Treasure tokens. (They're artifacts with " {T}, Sacrifice this artifact: Add one mana of any color.") text=As an additional cost to cast this spell, discard a card. -- Draw two cards and create two Treasure tokens. (They're artifacts with "{T}, Sacrifice this artifact: Add one mana of any color.")
mana={3}{R}{D(other *|myhand)} mana={3}{R}{D(other *|myhand)}
type=Sorcery type=Sorcery
[/card] [/card]
@@ -47176,6 +47198,13 @@ power=2
toughness=5 toughness=5
[/card] [/card]
[card] [card]
name=Pithing Needle
auto=chooseanameopp lord(*[chosenname]) noactivatedability chooseend
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
[card]
name=Pitiless Gorgon name=Pitiless Gorgon
abilities=deathtouch abilities=deathtouch
text=Deathtouch text=Deathtouch
@@ -54039,9 +54068,9 @@ type=Instant
[/card] [/card]
[card] [card]
name=Saheeli's Artistry name=Saheeli's Artistry
auto=choice clone target(artifact) auto=if type(artifact|battlefield)~morethan~0 then choice name(Clone an artifact) name(Clone an artifact) target(artifact) clone
auto=choice clone target(creature) && transforms(artifact) forever auto=if type(creature|battlefield)~morethan~0 then choice name(Clone a creature) name(Clone a creature) target(creature) clone addtype(artifact)
auto=choice clone target(artifact) then clone target(creature) && transforms(artifact) forever auto=if type(artifact|battlefield)~morethan~0 then if type(creature|battlefield)~morethan~0 then choice name(Choose both) name(Choose both) name(Choose both) target(artifact) clone && ability$!name(Clone a creature) name(Clone a creature) target(creature) clone addtype(artifact)!$ controller
text=Choose one or both — • Create a token thats a copy of target artifact. • Create a token thats a copy of target creature, except its an artifact in addition to its other types. text=Choose one or both — • Create a token thats a copy of target artifact. • Create a token thats a copy of target creature, except its an artifact in addition to its other types.
mana={4}{U}{U} mana={4}{U}{U}
type=Sorcery type=Sorcery
@@ -72096,7 +72125,8 @@ toughness=3
[/card] [/card]
[card] [card]
name=War Barge name=War Barge
auto={3}:target(creature) islandwalk ueot && transforms((,newability[@movedto(War Barge|graveyard) from(battlefield):bury all(this)])) forever auto={3}:name(Your creature gains islandwalk) target(creature|myBattlefield) transforms((,newability[islandwalk],newability[@movedto(War Barge|nonbattlezone) from(mybattlefield):bury])) ueot
auto={3}:name(Opponent creature gains islandwalk) target(creature|opponentBattlefield) transforms((,newability[islandwalk],newability[@movedto(War Barge|nonbattlezone) from(opponentBattlefield):bury])) ueot
text={3}: Target creature gains islandwalk until end of turn. When War Barge leaves the battlefield this turn, destroy that creature. A creature destroyed this way can't be regenerated. text={3}: Target creature gains islandwalk until end of turn. When War Barge leaves the battlefield this turn, destroy that creature. A creature destroyed this way can't be regenerated.
mana={4} mana={4}
type=Artifact type=Artifact
@@ -72104,11 +72134,7 @@ type=Artifact
[card] [card]
name=War Room name=War Room
auto={T}:add{C} auto={T}:add{C}
auto={L:1}{3}{T}:name(1 color in your identity) name(1 color in your identity) draw:1 controller auto=aslongas(*[iscommander]|myzones) {L:pnumofidentitycols}{3}{T}:name(Draw a card) name(Draw a card) draw:1 controller
auto={L:2}{3}{T}:name(2 colors in your identity) name(2 colors in your identity) draw:1 controller
auto={L:3}{3}{T}:name(3 colors in your identity) name(3 colors in your identity) draw:1 controller
auto={L:4}{3}{T}:name(4 colors in your identity) name(4 colors in your identity) draw:1 controller
auto={L:5}{3}{T}:name(5 colors in your identity) name(5 colors in your identity) draw:1 controller
text={T}: Add {C}. -- {3}, {T}, Pay life equal to the number of colors in your commanders' color identity: Draw a card. text={T}: Add {C}. -- {3}, {T}, Pay life equal to the number of colors in your commanders' color identity: Draw a card.
type=Land type=Land
[/card] [/card]
+1 -1
View File
@@ -120715,7 +120715,7 @@ abilities=vigilance
backside=Thraben Militia backside=Thraben Militia
restriction=compare(isflipped)~equalto~0 restriction=compare(isflipped)~equalto~0
anyzone={0}:doubleside(backside) anyzone={0}:doubleside(backside)
auto=@movedTo(creature|graveyard) from(mybattlefield):may flip() auto=@movedTo(other creature|graveyard) from(mybattlefield):may flip(backside)
text=Vigilance -- Whenever another creature you control dies, you may transform Thraben Sentry. // Thraben Militia text=Vigilance -- Whenever another creature you control dies, you may transform Thraben Sentry. // Thraben Militia
mana={3}{W} mana={3}{W}
type=Creature type=Creature
@@ -7846,12 +7846,6 @@ mana={U}{U}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Pithing Needle
text=As Pithing Needle enters the battlefield, name a card. -- Activated abilities of sources with the chosen name can't be activated unless they're mana abilities.
mana={1}
type=Artifact
[/card]
[card]
name=Plague of Vermin name=Plague of Vermin
text=Starting with you, each player may pay any amount of life. Repeat this process until no one pays life. Each player puts a 1/1 black Rat creature token onto the battlefield for each 1 life he or she paid this way. text=Starting with you, each player may pay any amount of life. Repeat this process until no one pays life. Each player puts a 1/1 black Rat creature token onto the battlefield for each 1 life he or she paid this way.
mana={6}{B} mana={6}{B}
+27 -11
View File
@@ -2031,6 +2031,10 @@ int AACopier::resolve()
/*since we look for the real card it will not copy granted haste ability however for token we copy all*/ /*since we look for the real card it will not copy granted haste ability however for token we copy all*/
/*but how to do backup for token so we just copy the backup???*/ /*but how to do backup for token so we just copy the backup???*/
bool nolegend = options.find("nolegend") != string::npos; // Check if the copy has to be legendary or not. (e.g. Echoing Equation) bool nolegend = options.find("nolegend") != string::npos; // Check if the copy has to be legendary or not. (e.g. Echoing Equation)
string keepname = "";
if(options.find("keepname") != string::npos){ // Keep the original name after the copy. (e.g. "Olag, Ludevic's Hubris")
keepname = source->getName();
}
if(tokencopied && !_target->isACopier && !_target->getMTGId()) if(tokencopied && !_target->isACopier && !_target->getMTGId())
{ {
source->copy(_target->tokCard, nolegend); source->copy(_target->tokCard, nolegend);
@@ -2138,6 +2142,8 @@ int AACopier::resolve()
andAbilityClone->addToGame(); andAbilityClone->addToGame();
} }
} }
if(keepname != "")
source->name = keepname; // Keep the original name after the copy. (e.g. "Olag, Ludevic's Hubris")
} }
currentAbilities.clear(); currentAbilities.clear();
return 1; return 1;
@@ -4822,21 +4828,25 @@ int AAFlip::resolve()
{ {
if (a->oneShot) if (a->oneShot)
{ {
if(_target->hasType(Subtypes::TYPE_PLANESWALKER)){ // Fix to don't let planeswalker die on flip (since the counter ability is not resolving correctly during flip). if(!backfromcopy){ // Fix to avoid triggering of oneshot abilities when flip is used to return from a copy.
AACounter * tmp = dynamic_cast<AACounter *>(a); if(_target->hasType(Subtypes::TYPE_PLANESWALKER)){ // Fix to don't let planeswalker die on flip (since the counter ability is not resolving correctly during flip).
if(tmp && tmp->counterstring.find("loyalty") != string::npos){ AACounter * tmp = dynamic_cast<AACounter *>(a);
for (int j = 0; j < tmp->nb; j++) if(tmp && tmp->counterstring.find("loyalty") != string::npos){
_target->counters->addCounter("loyalty", 0, 0, true); for (int j = 0; j < tmp->nb; j++)
_target->counters->addCounter("loyalty", 0, 0, true);
} else a->resolve();
} else a->resolve(); } else a->resolve();
} else a->resolve(); }
SAFE_DELETE(a); SAFE_DELETE(a);
} }
else else
{ {
a->addToGame();
MayAbility * dontAdd = dynamic_cast<MayAbility*>(a); MayAbility * dontAdd = dynamic_cast<MayAbility*>(a);
if(!dontAdd) if(!dontAdd){
a->addToGame();
_target->cardsAbilities.push_back(a); _target->cardsAbilities.push_back(a);
} else if(!backfromcopy) // Fix to avoid triggering of may abilities when flip is used to return from a copy (e.g. Mirror of the Forebears).
a->addToGame();
} }
} }
} }
@@ -10270,11 +10280,17 @@ void PopulateColorIndexVector(list<int>& colors, const string& colorStringList,
vector<string> abilitiesList = split(colorStringList, delimiter); vector<string> abilitiesList = split(colorStringList, delimiter);
for (vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter) for (vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter)
{ {
// if the text is not a basic ability but contains a valid color add it to the color vector
if((*iter).find("newcolors[") != string::npos){
size_t start_pos = (*iter).find("newcolors[");
(*iter).replace(start_pos, 10, "");
start_pos = (*iter).find("]");
(*iter).replace(start_pos, 1, "");
}
for (int colorIndex = Constants::MTG_COLOR_ARTIFACT; colorIndex < Constants::NB_Colors; ++colorIndex) for (int colorIndex = Constants::MTG_COLOR_ARTIFACT; colorIndex < Constants::NB_Colors; ++colorIndex)
{ {
// if the text is not a basic ability but contains a valid color add it to the color vector // We match now exactly the color to avoid wrong color assignment from gained abilities (e.g. protection from blue)
if ((Constants::GetBasicAbilityIndex(*iter) == -1) if ((Constants::GetBasicAbilityIndex(*iter) == -1) && ((*iter) == Constants::MTGColorStrings[colorIndex]))
&& ((*iter).find(Constants::MTGColorStrings[colorIndex]) != string::npos))
colors.push_back(colorIndex); colors.push_back(colorIndex);
} }
} }
+5 -2
View File
@@ -1172,8 +1172,8 @@ void GameObserver::Affinity()
{ {
for (int dd = 0; dd < 2; dd++) for (int dd = 0; dd < 2; dd++)
{ {
MTGGameZone * dzones[] = { players[dd]->game->graveyard, players[dd]->game->hand, players[dd]->game->library, players[dd]->game->exile }; MTGGameZone * dzones[] = { players[dd]->game->graveyard, players[dd]->game->hand, players[dd]->game->library, players[dd]->game->commandzone, players[dd]->game->exile };
for (int kk = 0; kk < 4; kk++) for (int kk = 0; kk < 5; kk++)
{ {
MTGGameZone * zone = dzones[kk]; MTGGameZone * zone = dzones[kk];
for (int cc = zone->nb_cards - 1; cc >= 0; cc--) for (int cc = zone->nb_cards - 1; cc >= 0; cc--)
@@ -1280,6 +1280,9 @@ void GameObserver::Affinity()
if (!DoReduceIncrease) if (!DoReduceIncrease)
continue; continue;
if (mExtraPayment != NULL && card == mExtraPayment->source) // Fix to avoid crash when the card paying extracost has also a cost alteration (e.g. combo with "Pirate's Pillage" and "Ruby Medallion").
continue;
//above we check if there are even any cards that effect cards manacost //above we check if there are even any cards that effect cards manacost
//only do any of the following if a card with the stated ability is in your hand. //only do any of the following if a card with the stated ability is in your hand.
//kicker is an addon to normal cost, suspend is not casting. add cost as needed EXACTLY as seen below. //kicker is an addon to normal cost, suspend is not casting. add cost as needed EXACTLY as seen below.
+132 -8
View File
@@ -424,13 +424,35 @@ void WParsedInt::init(string s, Spell * spell, MTGCardInstance * card)
intValue = card->previous->previous->sunburst; intValue = card->previous->previous->sunburst;
} }
} }
else if (s == "converge") else if (s == "converge" || s == "totmanaspent")
{ {
intValue = 0; intValue = 0;
for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i) if(s == "converge"){
{ for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i){
if(card->getManaCost()->getManaUsedToCast()->hasColor(i)) if(card->getManaCost()->getManaUsedToCast() && card->getManaCost()->getManaUsedToCast()->hasColor(i))
intValue +=1; intValue +=1;
}
} else if(s == "totmanaspent") { // Return the real amount of mana spent to cast the card (e.g. Memory Deluge)
if(card->getManaCost()->getManaUsedToCast())
intValue = card->getManaCost()->getManaUsedToCast()->getConvertedCost();
else {
if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_RETRACE] == 1 && card->getManaCost()->getRetrace())
intValue = card->getManaCost()->getRetrace()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] == 1 && card->getManaCost()->getFlashback())
intValue = card->getManaCost()->getFlashback()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_ALTERNATIVE] == 1 && card->getManaCost()->getAlternative())
intValue = card->getManaCost()->getAlternative()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BESTOW] == 1 && card->getManaCost()->getBestow())
intValue = card->getManaCost()->getBestow()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] == 1 && card->getManaCost()->getBuyback())
intValue = card->getManaCost()->getBuyback()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_MORPH] == 1 && card->getManaCost()->getMorph())
intValue = card->getManaCost()->getMorph()->getConvertedCost();
else if(card->alternateCostPaid[ManaCost::MANA_PAID_WITH_SUSPEND] == 1 && card->getManaCost()->getSuspend())
intValue = card->getManaCost()->getSuspend()->getConvertedCost();
else
intValue = card->getManaCost()->getConvertedCost();
}
} }
} }
else if (s == "penergy" || s == "oenergy") else if (s == "penergy" || s == "oenergy")
@@ -469,9 +491,52 @@ void WParsedInt::init(string s, Spell * spell, MTGCardInstance * card)
{ {
intValue = (s == "countmycrespell")?card->controller()->game->stack->seenThisTurn("creature", Constants::CAST_ALL):card->controller()->game->stack->seenThisTurn("*[-creature]", Constants::CAST_ALL); intValue = (s == "countmycrespell")?card->controller()->game->stack->seenThisTurn("creature", Constants::CAST_ALL):card->controller()->game->stack->seenThisTurn("*[-creature]", Constants::CAST_ALL);
} }
else if(s == "pnumofcommandcast" || s == "onumofcommandcast") else if(s == "numofcommandcast" || s == "pnumofcommandcast" || s == "onumofcommandcast" || s == "pnumofidentitycols" || s == "onumofidentitycols")
{ {
intValue = (s == "pnumofcommandcast")?card->controller()->numOfCommandCast:card->controller()->opponent()->numOfCommandCast; intValue = 0;
if(s == "pnumofcommandcast") //Return how many times controller casted a commander (e.g. Skull Storm).
intValue = card->controller()->numOfCommandCast;
else if(s == "onumofcommandcast") //Return how many times controller casted a commander (e.g. Commander's Insight).
intValue = card->controller()->opponent()->numOfCommandCast;
else if(s == "numofcommandcast") //Return how many times this commander has been casted from command zone (e.g. Opal Palace).
intValue = card->numofcastfromcommandzone;
else if (s == "pnumofidentitycols" || s == "onumofidentitycols") //Return the total amount of commander identity colors for controller or opponent (e.g. War Room)
{
intValue = 0;
bool blueFound = false;
bool redFound = false;
bool whiteFound = false;
bool greenFound = false;
bool blackFound = false;
Player* p = card->controller();
if (s == "onumofidentitycols")
p = card->controller()->opponent();
MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->commandzone, p->game->sideboard };
for(int i = 0; i < 7; i++){
for(int j = 0; j < zones[i]->nb_cards; j++){
if(zones[i]->cards[j]->has(Constants::ISCOMMANDER) && zones[i]->cards[j]->hasColor(Constants::MTG_COLOR_RED) && !redFound){
intValue++;
redFound = true;
}
if(zones[i]->cards[j]->has(Constants::ISCOMMANDER) && zones[i]->cards[j]->hasColor(Constants::MTG_COLOR_BLACK) && !blackFound){
intValue++;
blackFound = true;
}
if(zones[i]->cards[j]->has(Constants::ISCOMMANDER) && zones[i]->cards[j]->hasColor(Constants::MTG_COLOR_BLUE) && !blueFound){
intValue++;
blueFound = true;
}
if(zones[i]->cards[j]->has(Constants::ISCOMMANDER) && zones[i]->cards[j]->hasColor(Constants::MTG_COLOR_GREEN) && !greenFound){
intValue++;
greenFound = true;
}
if(zones[i]->cards[j]->has(Constants::ISCOMMANDER) && zones[i]->cards[j]->hasColor(Constants::MTG_COLOR_WHITE) && !whiteFound){
intValue++;
whiteFound = true;
}
}
}
}
} }
else if (s == "isflipped" || s == "iscopied") // Return 1 if card has been flipped -- Return 1 if card has copied another card else if (s == "isflipped" || s == "iscopied") // Return 1 if card has been flipped -- Return 1 if card has copied another card
{ {
@@ -1230,7 +1295,12 @@ void WParsedInt::extendedParse(string s, Spell * spell, MTGCardInstance * card)
{ {
intValue = 0; intValue = 0;
for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j){ for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j){
if ((s.find("totcntcre") != string::npos || s.find("totcntall") != string::npos) && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE)){ if ((s.find("totcntcre") != string::npos && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE)) ||
(s.find("totcntpla") != string::npos && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_PLANESWALKER)) ||
(s.find("totcntart") != string::npos && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_ARTIFACT)) ||
(s.find("totcntenc") != string::npos && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_ENCHANTMENT)) ||
(s.find("totcntlan") != string::npos && card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_LAND)) ||
s.find("totcntall") != string::npos){
if (card->controller()->game->inPlay->cards[j]->counters){ if (card->controller()->game->inPlay->cards[j]->counters){
Counters * counters = card->controller()->game->inPlay->cards[j]->counters; Counters * counters = card->controller()->game->inPlay->cards[j]->counters;
for(size_t i = 0; i < counters->counters.size(); ++i){ for(size_t i = 0; i < counters->counters.size(); ++i){
@@ -1324,6 +1394,60 @@ void WParsedInt::extendedParse(string s, Spell * spell, MTGCardInstance * card)
else if (s == "totaldmg") else if (s == "totaldmg")
intValue = (card->damageToController + card->damageToCreature + card->damageToOpponent); intValue = (card->damageToController + card->damageToCreature + card->damageToOpponent);
} }
else if (s.find("totalcololorsinplay") != string::npos || s.find("oppototalcololorsinplay") != string::npos) //Return the total amount of colors on controller or opponent battlefield (e.g. Moonveil Regent)
{
intValue = 0;
bool blueFound = false;
bool redFound = false;
bool whiteFound = false;
bool greenFound = false;
bool blackFound = false;
Player* p = card->controller();
if (s == "oppototalcololorsinplay")
p = card->controller()->opponent();
for( int j = 0; j < p->inPlay()->nb_cards; j++){
if(p->inPlay()->cards[j]->hasColor(Constants::MTG_COLOR_RED) && !redFound){
intValue++;
redFound = true;
}
if(p->inPlay()->cards[j]->hasColor(Constants::MTG_COLOR_BLACK) && !blackFound){
intValue++;
blackFound = true;
}
if(p->inPlay()->cards[j]->hasColor(Constants::MTG_COLOR_BLUE) && !blueFound){
intValue++;
blueFound = true;
}
if(p->inPlay()->cards[j]->hasColor(Constants::MTG_COLOR_GREEN) && !greenFound){
intValue++;
greenFound = true;
}
if(p->inPlay()->cards[j]->hasColor(Constants::MTG_COLOR_WHITE) && !whiteFound){
intValue++;
whiteFound = true;
}
}
}
else if(s.find("pcoven") != string::npos || s.find("ocoven") != string::npos){ //Player or opponent controls three or more creatures with different powers (e.g. Augur of Autumn)
intValue = 0;
bool opponent = (s.find("ocoven")!=string::npos)?true:false;
Player* p = card->controller();
if (opponent)
p = card->controller()->opponent();
for(unsigned int i = 0; i < p->game->inPlay->cards.size() && intValue == 0; i++){
if(p->game->inPlay->cards[i]->hasType(Subtypes::TYPE_CREATURE)){
for(unsigned int j = i+1; j < p->game->inPlay->cards.size() && intValue == 0; j++){
if(p->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE) && p->game->inPlay->cards[j]->power != p->game->inPlay->cards[i]->power){
for(unsigned int k = j+1; k < p->game->inPlay->cards.size() && intValue == 0; k++){
if(p->game->inPlay->cards[k]->hasType(Subtypes::TYPE_CREATURE) && (p->game->inPlay->cards[k]->power != p->game->inPlay->cards[i]->power && p->game->inPlay->cards[k]->power != p->game->inPlay->cards[j]->power)){
intValue = 1;
}
}
}
}
}
}
}
else if(!intValue)//found nothing, try parsing a atoi else if(!intValue)//found nothing, try parsing a atoi
{ {
intValue = atoi(s.c_str()); intValue = atoi(s.c_str());