Fixed some primitives from issue #1085, fixed some primitives from Discord Channel, fixed "except" keyword for triggers, added "nocost" option for "totalcounteradded" event to avoid to trigger in case of counter cost (e.g. "Doubling Season"), added "removeallcolors" and "removeallsubtypes" options for "transforms" ability.

This commit is contained in:
Vittorio Alfieri
2023-07-25 17:38:25 +02:00
parent 751fda6521
commit 816c42b63b
9 changed files with 183 additions and 123 deletions
@@ -1,7 +1,7 @@
grade=borderline grade=borderline
#Bordeline Primitives Pack for Wagic the Homebrew. #Bordeline Primitives Pack for Wagic the Homebrew.
#Please keep these card alphabetized, and try to have the "name=" line at the top of each card #Please keep these card alphabetized, and try to have the "name=" line at the top of each card
#I sorted this programmatically - Thanks to Vitty85 24-07-2023 #I sorted this programmatically - Thanks to Vitty85 25-07-2023
[card] [card]
name=+2 Mace name=+2 Mace
auto={3}:equip auto={3}:equip
@@ -18701,7 +18701,7 @@ name=Contamination
auto=upcost[{S(creature|mybattlefield)}] sacrifice auto=upcost[{S(creature|mybattlefield)}] sacrifice
auto=lord(land) loseabilities auto=lord(land) loseabilities
auto=lord(land) losesubtypesof(land) auto=lord(land) losesubtypesof(land)
auto=lord(land) transforms((Swamp)) auto=lord(land) transforms((,newability[{T}:add{B}]))
text=At the beginning of your upkeep, sacrifice Contamination unless you sacrifice a creature. -- If a land is tapped for mana, it produces {B} instead of any other type and amount. text=At the beginning of your upkeep, sacrifice Contamination unless you sacrifice a creature. -- If a land is tapped for mana, it produces {B} instead of any other type and amount.
mana={2}{B} mana={2}{B}
type=Enchantment type=Enchantment
@@ -18907,7 +18907,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Corpsejack Menace name=Corpsejack Menace
auto=@counteradded(1/1) from(creature|battlefield) except(Corpsejack Menace):may target(creature[counter{1/1.1}]|Battlefield) counter(1/1) notrg auto=@totalcounteradded(1/1) from(creature|battlefield) duplicate(all):ability$!name(Double the counter) donothing!$ controller
text=If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead. text=If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead.
mana={2}{B}{G} mana={2}{B}{G}
type=Creature type=Creature
@@ -22478,7 +22478,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Deep Water name=Deep Water
auto={U}:name(All lands produce blue mana) ueot loseabilities && losesubtypesof(land) && transforms((island)) target(<type:land:myBattlefield>land|mybattlefield) auto={U}:name(All lands produce blue mana) transforms((,newability[lord(land|mybattlefield) loseabilities],newability[lord(land|mybattlefield) losesubtypesof(land)],newability[lord(land|mybattlefield) transforms((,newability[{T}:add{U}]))])) ueot
text={U}: Until end of turn, if you tap a land you control for mana, it produces {U} instead of any other type. text={U}: Until end of turn, if you tap a land you control for mana, it produces {U} instead of any other type.
mana={U}{U} mana={U}{U}
type=Enchantment type=Enchantment
@@ -25063,7 +25063,7 @@ type=Sorcery
[card] [card]
name=Doubling Season name=Doubling Season
auto=@tokencreated(*|myBattlefield):name(Double the token) all(trigger) clone options(notrigger) auto=@tokencreated(*|myBattlefield):name(Double the token) all(trigger) clone options(notrigger)
auto=@counteradded(duplicateAll) from(*|myBattlefield):ability$!name(Double the counter) donothing!$ controller auto=@totalcounteradded(1/1) from(*|myBattlefield) duplicate(all) nocost:ability$!name(Double the counter) donothing!$ controller
text=If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead. -- If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead. text=If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead. -- If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead.
mana={4}{G} mana={4}{G}
type=Enchantment type=Enchantment
@@ -37247,8 +37247,8 @@ type=Instant
[/card] [/card]
[card] [card]
name=Generous Patron name=Generous Patron
auto=target(<upto:2>creature) counter(1/1) auto=may name(Put 1/1 counters) target(<upto:2>creature) counter(1/1)
auto=@counteradded(any) from(creature|opponentbattlefield):may draw:1 controller auto=@totalcounteradded(any) from(creature|opponentbattlefield):may name(Draw a card) draw:1 controller
text=When Generous Patron enters the battlefield, support 2. (Put a +1/+1 counter on each of up to two other target creatures.) -- Whenever you put one or more counters on a creature you don't control, draw a card. text=When Generous Patron enters the battlefield, support 2. (Put a +1/+1 counter on each of up to two other target creatures.) -- Whenever you put one or more counters on a creature you don't control, draw a card.
mana={2}{G} mana={2}{G}
type=Creature type=Creature
@@ -43466,7 +43466,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Harvest Mage name=Harvest Mage
auto={G}{T}{D(*|myhand)}:lord(land|mybattlefield) transforms((,newability[producecolor:land],newability[producecolor:green],newability[producecolor:blue],newability[producecolor:red],newability[producecolor:black],newability[producecolor:white])) ueot auto={G}{T}{D(*|myhand)}:name(Lands produce any color) transforms((,newability[lord(land|mybattlefield) loseabilities],newability[lord(land|mybattlefield) losesubtypesof(land)],newability[lord(land|mybattlefield) transforms((,newability[{T}:add{G}],newability[{T}:add{R}],newability[{T}:add{U}],newability[{T}:add{B}],newability[{T}:add{W}]))])) ueot
text={G}, {T}, Discard a card: Until end of turn, if you tap a land for mana, it produces one mana of a color of your choice instead of any other type and amount. text={G}, {T}, Discard a card: Until end of turn, if you tap a land for mana, it produces one mana of a color of your choice instead of any other type and amount.
mana={G} mana={G}
type=Creature type=Creature
@@ -46951,8 +46951,9 @@ type=Artifact
[/card] [/card]
[card] [card]
name=Idol of Oblivion name=Idol of Oblivion
auto={T}:draw:1 restriction{thisturn(*[token]|mybattlefield)~morethan~0} auto=if type(*[token&fresh]|mybattlefield)~morethan~0 then name(Gain ability)name(Gain ability) transforms((,newability[{T}:name(Draw a card) name(Draw a card) draw:1 controller])) ueot
auto={8}{T}{S}:token(Eldrazi,Creature Eldrazi,10/10,colorless) auto=@movedto(*[token]|mybattlefield):name(Gain ability) transforms((,newability[{T}:name(Draw a card) name(Draw a card) draw:1 controller])) ueot
auto={8}{T}{S}:name(Create eldrazi) token(Eldrazi,Creature Eldrazi,10/10)
text={T}: Draw a card. Activate this ability only if you created a token this turn. -- {8}, {T}, Sacrifice Idol of Oblivion: Create a 10/10 colorless Eldrazi creature token. text={T}: Draw a card. Activate this ability only if you created a token this turn. -- {8}, {T}, Sacrifice Idol of Oblivion: Create a 10/10 colorless Eldrazi creature token.
mana={2} mana={2}
type=Artifact type=Artifact
@@ -47040,8 +47041,8 @@ type=Instant
[card] [card]
name=Ignite the Future name=Ignite the Future
flashback={7}{R} flashback={7}{R}
auto=ifnot gravecast then all(*[zpos<=3]|mylibrary) moveto(exile) and!( transforms((,newability[canplayfromexile uent])) uent )! auto=ifnot gravecast then all(*[zpos<=3]|mylibrary) moveto(myexile) and!( transforms((,newability[canplayfromexile uent])) uent )!
auto=if gravecast then all(*[zpos<=3]|mylibrary) moveto(exile) and!( transforms((,newability[canplayfromexile uent],newability[zerocast uent])) uent )! auto=if gravecast then all(*[zpos<=3]|mylibrary) moveto(myexile) and!( transforms((,newability[canplayfromexile uent],newability[zerocast uent])) uent )!
text=Exile the top three cards of your library. Until the end of your next turn, you may play those cards. If this spell was cast from a graveyard, you may play cards this way without paying their mana costs. -- Flashback {7}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.) text=Exile the top three cards of your library. Until the end of your next turn, you may play those cards. If this spell was cast from a graveyard, you may play cards this way without paying their mana costs. -- Flashback {7}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={3}{R} mana={3}{R}
type=Sorcery type=Sorcery
@@ -47703,9 +47704,9 @@ toughness=1
[/card] [/card]
[card] [card]
name=Imprisoned in the Moon name=Imprisoned in the Moon
target=*[creature;land;planeswalker]|battlefield target=creature,land,planeswalker
auto=loseabilities auto=loseabilities
auto=transforms((removetypes,newability[becomes(Land)],newability[{T}:add{1}])) forever auto=teach(*) transforms((removeallsubtypes,removeallcolors,newability[becomes(Land)],newability[{T}:add{C}]))
text=Enchant creature, land, or planeswalker -- Enchanted permanent is a colorless land with "{T}: Add {C} to your mana pool" and loses all other card types and abilities. text=Enchant creature, land, or planeswalker -- Enchanted permanent is a colorless land with "{T}: Add {C} to your mana pool" and loses all other card types and abilities.
mana={2}{U} mana={2}{U}
type=Enchantment type=Enchantment
@@ -47713,7 +47714,7 @@ subtype=Aura
[/card] [/card]
[card] [card]
name=Improbable Alliance name=Improbable Alliance
auto=_SECOND_DRAW_create(Faerie:creature Faerie:1/1:blue:flying) auto=_SECOND_DRAW_ name(Create faerie) token(Faerie,Creature Faerie,1/1,blue,flying)
auto={4}{U}{R}:_LOOT_ auto={4}{U}{R}:_LOOT_
text=Whenever you draw your second card each turn, create a 1/1 blue Faerie creature token with flying. -- {4}{U}{R}: Draw a card, then discard a card. text=Whenever you draw your second card each turn, create a 1/1 blue Faerie creature token with flying. -- {4}{U}{R}: Draw a card, then discard a card.
mana={U}{R} mana={U}{R}
@@ -48095,7 +48096,7 @@ type=Sorcery
[card] [card]
name=Inevitable End name=Inevitable End
target=creature target=creature
auto=teach(creature) @each controller upkeep:upcost[{S(creature|myBattlefield)}] sacrifice auto=teach(creature) transforms((,newability[@each my upkeep:name(Sacrifice a creature) target(creature|myBattlefield) sacrifice]))
text=Enchant creature -- Enchanted creature has "At the beginning of your upkeep, sacrifice a creature." text=Enchant creature -- Enchanted creature has "At the beginning of your upkeep, sacrifice a creature."
mana={2}{B} mana={2}{B}
type=Enchantment type=Enchantment
@@ -48150,9 +48151,9 @@ subtype=Aura
[card] [card]
name=Infernal Darkness name=Infernal Darkness
auto=cumulativeupcost[{B}{L:1}] sacrifice auto=cumulativeupcost[{B}{L:1}] sacrifice
auto=all(land|battlefield) loseabilities && all(land|battlefield) losesubtypesof(land) && all(land|battlefield) transforms((swamp)) ueot auto=lord(land) loseabilities
auto=@each untap:all(land|battlefield) loseabilities && all(land|battlefield) losesubtypesof(land) && all(land|battlefield) transforms((swamp)) ueot auto=lord(land) losesubtypesof(land)
auto=@movedTo(land|battlefield):all(trigger[to]) loseabilities && all(trigger[to]) losesubtypesof(land) && all(trigger[to]) transforms((swamp)) ueot auto=lord(land) transforms((,newability[{T}:add{B}]))
text=Cumulative upkeep-Pay {B} and 1 life. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- If a land is tapped for mana, it produces {B} instead of any other type. text=Cumulative upkeep-Pay {B} and 1 life. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- If a land is tapped for mana, it produces {B} instead of any other type.
mana={2}{B}{B} mana={2}{B}{B}
type=Enchantment type=Enchantment
@@ -49175,8 +49176,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Intuition name=Intuition
auto=target(*|mylibrary) moveto(myhand) auto=name(Search first card) target(*|mylibrary) moveto(myhand) and!( transforms((tobeint,newability[name(Search second card) target(*|mylibrary) moveto(myhand) and!( transforms((tobeint,newability[name(Search third card) target(*|mylibrary) moveto(myhand) and!( transforms((tobeint,newability[shuffle],newability[ability$!name(Put in graveyard) name(Put in graveyard) target(tobeint|opponenthand) moveto(opponentgraveyard) and!( all(other tobeint|opponenthand) losesatype(tobeint) )!!$ opponent])) ueot )!])) ueot )!])) ueot )!
auto=ability$!name(Put in graveyard) name(Put in graveyard) target(<2>*|opponentlibrary) moveto(opponentgraveyard)!$ opponent
text=Search your library for any three cards and reveal them. Target opponent chooses one. Put that card into your hand and the rest into your graveyard. Then shuffle your library. text=Search your library for any three cards and reveal them. Target opponent chooses one. Put that card into your hand and the rest into your graveyard. Then shuffle your library.
mana={2}{U} mana={2}{U}
type=Instant type=Instant
@@ -50186,7 +50186,7 @@ subtype=Plains Island
[card] [card]
name=Isareth the Awakener name=Isareth the Awakener
abilities=deathtouch abilities=deathtouch
auto=_ATTACKING_pay({2}) target(creature[manacost<=2]|mygraveyard) moveto(mybattlefield) auto=_ATTACKING_may name(Pay and return) pay({x}) name(Pay and return) transforms((,newability[name(Pay and return) target(creature[manacost=x]|mygraveyard) moveto(mybattlefield) and!( transforms((,newability[counter(0/0.1.Corpse)],newability[exiledeath])) forever )!])) forever
text=Deathtouch -- Whenever Isareth the Awakener attacks, you may pay {X}. When you do, return target creature card with mana value X from your graveyard to the battlefield with a corpse counter on it. If that creature would leave the battlefield, exile it instead of putting it anywhere else. text=Deathtouch -- Whenever Isareth the Awakener attacks, you may pay {X}. When you do, return target creature card with mana value X from your graveyard to the battlefield with a corpse counter on it. If that creature would leave the battlefield, exile it instead of putting it anywhere else.
mana={1}{B}{B} mana={1}{B}{B}
type=Legendary Creature type=Legendary Creature
@@ -50230,7 +50230,9 @@ type=Legendary Instant
[/card] [/card]
[card] [card]
name=Island Sanctuary name=Island Sanctuary
auto=replacedraw turnlimited ability$!name(Choose one) choice name(Skip draw and become unattackable) lord(creature[-flying;-islandwalk]|opponentBattlefield) cantattack uynt _ choice name(Draw card) draw:1 noreplace controller!$ controller auto=replacedraw turnlimited ability$!name(Choose one) choice name(Skip draw and become unattackable) all(Island Sanctuary[-unattackable]|mybattlefield) becomes(unattackable) forever _ choice name(Draw card) draw:1 noreplace controller!$ controller
auto=this(cantargetcard(*[unattackable]|*) transforms((,newability[lord(creature[-flying]|opponentBattlefield) cantattack],newability[lord(creature[-islandwalk]|opponentBattlefield) cantattack]))
auto=@each opponent end:name(Effect ends) losesatype(unattackable)
text=If you would draw a card during your draw step, instead you may skip that draw. If you do, until your next turn, you can't be attacked except by creatures with flying and/or islandwalk. text=If you would draw a card during your draw step, instead you may skip that draw. If you do, until your next turn, you can't be attacked except by creatures with flying and/or islandwalk.
mana={1}{W} mana={1}{W}
type=Enchantment type=Enchantment
@@ -69806,7 +69808,7 @@ type=Legendary Artifact
[/card] [/card]
[card] [card]
name=Pale Moon name=Pale Moon
auto=emblem transforms((,newability[lord(land[-basic]|battlefield) transforms((,newability[loseabilities],newability[{T}:name(Add colorless) add{C}]))])) ueot auto=emblem transforms((,newability[lord(land[-basic]|battlefield) transforms((,newability[loseabilities],newability[losesubtypesof(land)],newability[{T}:name(Add colorless) add{C}]))])) ueot
text=Until end of turn, if a player taps a nonbasic land for mana, it produces colorless mana instead of any other type. text=Until end of turn, if a player taps a nonbasic land for mana, it produces colorless mana instead of any other type.
mana={1}{U} mana={1}{U}
type=Instant type=Instant
@@ -73273,7 +73275,7 @@ type=Sorcery
name=Primal Vigor name=Primal Vigor
auto=@tokencreated(*|myBattlefield):name(Double the token) all(trigger) clone options(notrigger) auto=@tokencreated(*|myBattlefield):name(Double the token) all(trigger) clone options(notrigger)
auto=@tokencreated(*|opponentBattlefield):name(Double the token) all(trigger) clone options(notrigger) and!( transforms((,newability[moveto(opponentBattlefield)])) forever )! auto=@tokencreated(*|opponentBattlefield):name(Double the token) all(trigger) clone options(notrigger) and!( transforms((,newability[moveto(opponentBattlefield)])) forever )!
auto=@counteradded(1/1) from(creature|battlefield) except(Primal Vigor):may counter(1/1) target(creature[counter{1/1.1}]|Battlefield) auto=@totalcounteradded(1/1) from(creature|battlefield) duplicate(all):ability$!name(Double the counter) donothing!$ controller
text=If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead. -- If one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead. text=If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead. -- If one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead.
mana={4}{G} mana={4}{G}
type=Enchantment type=Enchantment
@@ -74249,7 +74251,9 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Pulse of Llanowar name=Pulse of Llanowar
auto=all(land[basic]|mybattlefield) transforms((,newability[producecolor:land],newability[producecolor:green],newability[producecolor:blue],newability[producecolor:red],newability[producecolor:black],newability[producecolor:white])) forever auto=lord(land[basic]|mybattlefield) loseabilities
auto=lord(land[basic]|mybattlefield) losesubtypesof(land)
auto=lord(land[basic]|mybattlefield) transforms((,newability[{T}:add{G}],newability[{T}:add{R}],newability[{T}:add{U}],newability[{T}:add{B}],newability[{T}:add{W}]))
text=If a basic land you control is tapped for mana, it produces mana of a color of your choice instead of any other type. text=If a basic land you control is tapped for mana, it produces mana of a color of your choice instead of any other type.
mana={3}{G} mana={3}{G}
type=Enchantment type=Enchantment
@@ -79547,8 +79551,9 @@ type=Sorcery
[card] [card]
name=Ritual of Subdual name=Ritual of Subdual
auto=cumulativeupcost[{2}] sacrifice auto=cumulativeupcost[{2}] sacrifice
auto=all(land|mybattlefield) loseabilities && transforms((,newability[producecolor:land])) forever auto=lord(land|battlefield) loseabilities
auto=all(land|opponentbattlefield) loseabilities && transforms((,newability[producecolor:land])) forever auto=lord(land|battlefield) losesubtypesof(land)
auto=lord(land|battlefield) transforms((,newability[{T}:name(Add colorless) add{C}]))
text=Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- If a land is tapped for mana, it produces colorless mana instead of any other type. text=Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- If a land is tapped for mana, it produces colorless mana instead of any other type.
mana={4}{G}{G} mana={4}{G}{G}
type=Enchantment type=Enchantment
@@ -106785,7 +106790,7 @@ toughness=0
[/card] [/card]
[card] [card]
name=Vizier of Remedies name=Vizier of Remedies
auto=@totalcounteradded(-1/-1) from(creature|myBattlefield):name(That many minus one) all(trigger[from]) name(That many minus one) counter(-1/-1,-1) auto=@totalcounteradded(-1/-1) from(creature|myBattlefield):name(That many minus one) all(trigger[from]) name(That many minus one) counter(-1/-1,-1) notrg
text=If one or more -1/-1 counters would be put on a creature you control, that many -1/-1 counters minus one are put on it instead. text=If one or more -1/-1 counters would be put on a creature you control, that many -1/-1 counters minus one are put on it instead.
mana={1}{W} mana={1}{W}
type=Creature type=Creature
@@ -107365,14 +107370,14 @@ toughness=6
[card] [card]
name=Vorinclex, Monstrous Raider name=Vorinclex, Monstrous Raider
abilities=trample,haste abilities=trample,haste
auto=@totalcounteradded(duplicateAll) from(*|myBattlefield):ability$!name(Double the counters) donothing!$ controller auto=@totalcounteradded(any) from(*|myBattlefield) duplicate(all) except(*|opponentzones):ability$!name(Double the counters) donothing!$ controller
auto=@totalcounteradded(halfAll) from(*|opponentbattlefield):ability$!name(Half the counters) donothing!$ controller auto=@totalcounteradded(any) from(*|opponentbattlefield) half(all) except(*|myzones):ability$!name(Half the counters) donothing!$ controller
auto=@energizedof(player) duplicate(All):ability$!name(Double the counters) donothing!$ controller auto=@energizedof(player) duplicate(all):ability$!name(Double the counters) donothing!$ controller
auto=@energizedfoeof(player) half(All):ability$!name(Half the counters) donothing!$ controller auto=@energizedfoeof(player) half(all):ability$!name(Half the counters) donothing!$ controller
auto=@poisonedof(player) half(All):ability$!name(Half the counters) donothing!$ controller auto=@poisonedof(player) half(all):ability$!name(Half the counters) donothing!$ controller
auto=@poisonedfoeof(player) duplicate(All):ability$!name(Double the counters) donothing!$ controller auto=@poisonedfoeof(player) duplicate(all):ability$!name(Double the counters) donothing!$ controller
auto=@experiencedof(player) duplicate(All):ability$!name(Double the counters) donothing!$ controller auto=@experiencedof(player) duplicate(all):ability$!name(Double the counters) donothing!$ controller
auto=@experiencedfoeof(player) half(All):ability$!name(Half the counters) donothing!$ controller auto=@experiencedfoeof(player) half(all):ability$!name(Half the counters) donothing!$ controller
text=Trample, haste -- If you would put one or more counters on a permanent or player, put twice that many of each of those kinds of counters on that permanent or player instead. -- If an opponent would put one or more counters on a permanent or player, they put half that many of each of those kinds of counters on that permanent or player instead, rounded down. text=Trample, haste -- If you would put one or more counters on a permanent or player, put twice that many of each of those kinds of counters on that permanent or player instead. -- If an opponent would put one or more counters on a permanent or player, they put half that many of each of those kinds of counters on that permanent or player instead, rounded down.
mana={4}{G}{G} mana={4}{G}{G}
type=Legendary Creature type=Legendary Creature
+13 -3
View File
@@ -1,6 +1,6 @@
#Primitives Pack for Wagic the Homebrew. #Primitives Pack for Wagic the Homebrew.
#Please keep these card alphabetized, and try to have the "name=" line at the top of each card #Please keep these card alphabetized, and try to have the "name=" line at the top of each card
#I sorted this programmatically so the other comments are removed except for AUTO_DEFINE - Vitty85 24-07-2023 #I sorted this programmatically so the other comments are removed except for AUTO_DEFINE - Vitty85 25-07-2023
[card] [card]
name=Abandon Reason name=Abandon Reason
target=<upto:2>creature target=<upto:2>creature
@@ -24482,7 +24482,16 @@ type=Land
[/card] [/card]
[card] [card]
name=Crypt Rats name=Crypt Rats
auto={X:black}:damage:X all(creature) && damage:X all(player) auto={B}:name(X=1) damage:1 all(creature|battlefield) && damage:1 all(player)
auto={B}{B}:name(X=2) damage:2 all(creature|battlefield) && damage:2 all(player)
auto={B}{B}{B}:name(X=3) damage:3 all(creature|battlefield) && damage:3 all(player)
auto={B}{B}{B}{B}:name(X=4) damage:4 all(creature|battlefield) && damage:4 all(player)
auto={B}{B}{B}{B}{B}:name(X=5) damage:5 all(creature|battlefield) && damage:5 all(player)
auto={B}{B}{B}{B}{B}{B}:name(X=6) damage:6 all(creature|battlefield) && damage:6 all(player)
auto={B}{B}{B}{B}{B}{B}{B}:name(X=7) damage:7 all(creature|battlefield) && damage:7 all(player)
auto={B}{B}{B}{B}{B}{B}{B}{B}:name(X=8) damage:8 all(creature|battlefield) && damage:8 all(player)
auto={B}{B}{B}{B}{B}{B}{B}{B}{B}:name(X=9) damage:9 all(creature|battlefield) && damage:9 all(player)
auto={B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{X:black}:name(X>=10) damage:Xplus10plusend all(creature|battlefield) && damage:Xplus10plusend all(player)
text={X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana this way. text={X}: Crypt Rats deals X damage to each creature and each player. Spend only black mana this way.
mana={2}{B} mana={2}{B}
type=Creature type=Creature
@@ -29106,7 +29115,8 @@ toughness=2
[card] [card]
name=Devoted Druid name=Devoted Druid
auto={T}:add{G} auto={T}:add{G}
auto={0}:name(Put counter and untap) transforms((,newability[counter(-1/-1)],newability[untap])) oneshot #auto={0}:name(Put counter and untap) transforms((,newability[counter(-1/-1)],newability[untap])) oneshot
auto={C(-1/-1,1)}:name(Put counter and untap) untap
text={T}: Add {G} to your mana pool. -- Put a -1/-1 counter on Devoted Druid: Untap Devoted Druid. text={T}: Add {G} to your mana pool. -- Put a -1/-1 counter on Devoted Druid: Untap Devoted Druid.
mana={1}{G} mana={1}{G}
type=Creature type=Creature
+17 -13
View File
@@ -746,8 +746,8 @@ class TrplayerProliferated: public Trigger
{ {
public: public:
bool thiscontroller, thisopponent; bool thiscontroller, thisopponent;
MTGCardInstance * proliferateException; //added exception to avid a proliferation loop (eg. Tekuthal, Inquiry Dominus) TargetChooser * proliferateException; //added exception to avid a proliferation loop (eg. Tekuthal, Inquiry Dominus)
TrplayerProliferated(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false, bool thiscontroller = false, bool thisopponent = false, MTGCardInstance * proliferateException = NULL) : TrplayerProliferated(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false, bool thiscontroller = false, bool thisopponent = false, TargetChooser * proliferateException = NULL) :
Trigger(observer, id, source, once, tc), thiscontroller(thiscontroller), thisopponent(thisopponent), proliferateException(proliferateException) Trigger(observer, id, source, once, tc), thiscontroller(thiscontroller), thisopponent(thisopponent), proliferateException(proliferateException)
{ {
} }
@@ -756,7 +756,7 @@ public:
{ {
WEventplayerProliferated * e = dynamic_cast<WEventplayerProliferated *> (event); WEventplayerProliferated * e = dynamic_cast<WEventplayerProliferated *> (event);
if (!e) return 0; if (!e) return 0;
if (proliferateException && e->source && !strcmp(proliferateException->data->name.c_str(), e->source->data->name.c_str())) return 0; //If the source of proliferation it's the exception card it doesn't have effect (loop avoidance); if (proliferateException && proliferateException->canTarget(e->source)) return 0; //If the source of proliferation belongs to exception it doesn't have effect (loop avoidance);
if (!tc->canTarget(e->player)) return 0; if (!tc->canTarget(e->player)) return 0;
if(thiscontroller) if(thiscontroller)
if(e->player != source->controller()) if(e->player != source->controller())
@@ -1485,8 +1485,8 @@ public:
bool sourceUntapped, thiscontroller, thisopponent; bool sourceUntapped, thiscontroller, thisopponent;
bool limitOnceATurn; bool limitOnceATurn;
int triggeredTurn; int triggeredTurn;
MTGCardInstance * gainException; //added exception to avid a gainlife loop (eg. Angels of Vitality) TargetChooser * gainException; //added exception to avid a gainlife loop
TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0, bool sourceUntapped = false, bool once = false, bool thiscontroller = false, bool thisopponent = false, bool limitOnceATurn = false, MTGCardInstance * gainException = NULL) : TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0, bool sourceUntapped = false, bool once = false, bool thiscontroller = false, bool thisopponent = false, bool limitOnceATurn = false, TargetChooser * gainException = NULL) :
Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type), sourceUntapped(sourceUntapped), thiscontroller(thiscontroller), thisopponent(thisopponent), limitOnceATurn(limitOnceATurn), gainException(gainException) Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type), sourceUntapped(sourceUntapped), thiscontroller(thiscontroller), thisopponent(thisopponent), limitOnceATurn(limitOnceATurn), gainException(gainException)
{ {
triggeredTurn = -1; triggeredTurn = -1;
@@ -1503,7 +1503,7 @@ public:
if (!tc->canTarget(e->player)) return 0; if (!tc->canTarget(e->player)) return 0;
//if (fromTc && !fromTc->canTarget(e->player)) return 0; //if (fromTc && !fromTc->canTarget(e->player)) return 0;
if (fromTc && !fromTc->canTarget(e->source)) return 0; //Now it's possible to specify if a source can trigger or not the event of life gain if (fromTc && !fromTc->canTarget(e->source)) return 0; //Now it's possible to specify if a source can trigger or not the event of life gain
if (gainException && e->source && !strcmp(gainException->data->name.c_str(), e->source->data->name.c_str())) return 0; //If the source of life gain it's the exception card don't gain life (loop avoidance); if (gainException && gainException->canTarget(e->source)) return 0; //If the source of life gain belongs to exception it doesn't have effect (loop avoidance);
if (type == 1 && (e->amount > 0)) return 0; if (type == 1 && (e->amount > 0)) return 0;
if (type == 0 && (e->amount < 0)) return 0; if (type == 0 && (e->amount < 0)) return 0;
if(thiscontroller) if(thiscontroller)
@@ -1618,8 +1618,8 @@ public:
bool duplicate; bool duplicate;
bool limitOnceATurn; bool limitOnceATurn;
int triggeredTurn; int triggeredTurn;
MTGCardInstance * counterException; //added exception to avid a counter loop (eg. Doubling Season) TargetChooser * counterException; //added exception to avid a counter loop (eg. Doubling Season)
TrCounter(GameObserver* observer, int id, MTGCardInstance * source, Counter * counter, TargetChooser * tc, int type = 0, bool once = false, bool duplicate = false, bool limitOnceATurn = false, MTGCardInstance * counterException = NULL) : TrCounter(GameObserver* observer, int id, MTGCardInstance * source, Counter * counter, TargetChooser * tc, int type = 0, bool once = false, bool duplicate = false, bool limitOnceATurn = false, TargetChooser * counterException = NULL) :
Trigger(observer, id, source, once, tc), counter(counter), type(type), duplicate(duplicate), limitOnceATurn(limitOnceATurn), counterException(counterException) Trigger(observer, id, source, once, tc), counter(counter), type(type), duplicate(duplicate), limitOnceATurn(limitOnceATurn), counterException(counterException)
{ {
triggeredTurn = -1; triggeredTurn = -1;
@@ -1633,7 +1633,7 @@ public:
return 0; return 0;
if (type == 0 && !e->removed) return 0; if (type == 0 && !e->removed) return 0;
if (type == 1 && !e->added) return 0; if (type == 1 && !e->added) return 0;
if (counterException && e->source && !strcmp(counterException->data->name.c_str(), e->source->data->name.c_str())) return 0; //If the source of counter gain/loss it's the exception card it doesn't have effect (loop avoidance); if (counterException && counterException->canTarget(e->source)) return 0; //If the source of counter gain/loss belongs to exception it doesn't have effect (loop avoidance);
if (counter && !(e->power == counter->power && e->toughness == counter->toughness && e->name == counter->name)) return 0; if (counter && !(e->power == counter->power && e->toughness == counter->toughness && e->name == counter->name)) return 0;
if (tc && !tc->canTarget(e->targetCard)) return 0; if (tc && !tc->canTarget(e->targetCard)) return 0;
if (duplicate){ if (duplicate){
@@ -1668,11 +1668,12 @@ public:
bool duplicate; bool duplicate;
bool half; bool half;
int plus; int plus;
bool nocost; //added to avoid trigger on counter cost payment (eg. Doubling Season)
bool limitOnceATurn; bool limitOnceATurn;
int triggeredTurn; int triggeredTurn;
MTGCardInstance * counterException; //added exception to avid a counter loop (eg. Doubling Season) TargetChooser * counterException; //added exception to avid a counter loop.
TrTotalCounter(GameObserver* observer, int id, MTGCardInstance * source, Counter * counter, TargetChooser * tc, int type = 0, bool once = false, bool duplicate = false, bool half = false, int plus = 0, bool limitOnceATurn = false, MTGCardInstance * counterException = NULL) : TrTotalCounter(GameObserver* observer, int id, MTGCardInstance * source, Counter * counter, TargetChooser * tc, int type = 0, bool once = false, bool duplicate = false, bool half = false, int plus = 0, bool nocost = false, bool limitOnceATurn = false, TargetChooser * counterException = NULL) :
Trigger(observer, id, source, once, tc), counter(counter), type(type), duplicate(duplicate), half(half), plus(plus), limitOnceATurn(limitOnceATurn), counterException(counterException) Trigger(observer, id, source, once, tc), counter(counter), type(type), duplicate(duplicate), half(half), plus(plus), nocost(nocost), limitOnceATurn(limitOnceATurn), counterException(counterException)
{ {
triggeredTurn = -1; triggeredTurn = -1;
} }
@@ -1685,7 +1686,8 @@ public:
return 0; return 0;
if (type == 0 && !e->removed) return 0; if (type == 0 && !e->removed) return 0;
if (type == 1 && !e->added) return 0; if (type == 1 && !e->added) return 0;
if (counterException && e->source && !strcmp(counterException->data->name.c_str(), e->source->data->name.c_str())) return 0; //If the source of counter gain/loss it's the exception card it doesn't have effect (loop avoidance); if (nocost && e->iscost) return 0;
if (counterException && counterException->canTarget(e->source)) return 0; //If the source of counter gain/loss belongs to exception it doesn't have effect (loop avoidance);
if (counter && !(e->power == counter->power && e->toughness == counter->toughness && e->name == counter->name)) return 0; if (counter && !(e->power == counter->power && e->toughness == counter->toughness && e->name == counter->name)) return 0;
if (tc && !tc->canTarget(e->targetCard)) return 0; if (tc && !tc->canTarget(e->targetCard)) return 0;
if (plus > 0){ if (plus > 0){
@@ -5409,10 +5411,12 @@ public:
list<int> oldtypes; list<int> oldtypes;
vector<int> dontremove; vector<int> dontremove;
bool removemc; bool removemc;
bool removeAllColors;
bool addNewColors; bool addNewColors;
bool remove; bool remove;
bool removeCreatureSubtypes; bool removeCreatureSubtypes;
bool removeTypes; bool removeTypes;
bool removeAllSubtypes;
string menu; string menu;
string newpower; string newpower;
+2 -1
View File
@@ -78,8 +78,9 @@ struct WEventTotalCounters : public WEvent {
bool added; bool added;
bool removed; bool removed;
int totalamount; int totalamount;
bool iscost;
MTGCardInstance * source; MTGCardInstance * source;
WEventTotalCounters(Counters *counter,string name,int power, int toughness,bool added = false, bool removed = false, int totalamount = 0, MTGCardInstance * source = NULL); WEventTotalCounters(Counters *counter,string name,int power, int toughness,bool added = false, bool removed = false, int totalamount = 0, bool iscost = false, MTGCardInstance * source = NULL);
using WEvent::getTarget; using WEvent::getTarget;
virtual Targetable * getTarget(int target); virtual Targetable * getTarget(int target);
}; };
+23 -6
View File
@@ -2796,7 +2796,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
} }
if (!noevent) if (!noevent)
{ {
WEvent * w = NEW WEventTotalCounters(_target->counters, name.c_str(), power, toughness, true, false, totalcounters, source); WEvent * w = NEW WEventTotalCounters(_target->counters, name.c_str(), power, toughness, true, false, totalcounters, false, source);
dynamic_cast<WEventTotalCounters*>(w)->targetCard = _target->counters->target; dynamic_cast<WEventTotalCounters*>(w)->targetCard = _target->counters->target;
_target->getObserver()->receiveEvent(w); _target->getObserver()->receiveEvent(w);
} }
@@ -2812,7 +2812,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
} }
if (!noevent) if (!noevent)
{ {
WEvent * e = NEW WEventTotalCounters(_target->counters, name.c_str(), power, toughness, false, true, totalcounters, source); WEvent * e = NEW WEventTotalCounters(_target->counters, name.c_str(), power, toughness, false, true, totalcounters, false, source);
dynamic_cast<WEventTotalCounters*>(e)->targetCard = _target->counters->target; dynamic_cast<WEventTotalCounters*>(e)->targetCard = _target->counters->target;
_target->getObserver()->receiveEvent(e); _target->getObserver()->receiveEvent(e);
} }
@@ -7826,10 +7826,12 @@ ATransformer::ATransformer(GameObserver* observer, int id, MTGCardInstance * sou
myCurrentTurn = 1000; myCurrentTurn = 1000;
//this subkeyword adds a color without removing the existing colors. //this subkeyword adds a color without removing the existing colors.
removemc = (sabilities.find("removemc") != string::npos); removemc = (sabilities.find("removemc") != string::npos);
removeAllColors = (sabilities.find("removeallcolors") != string::npos);
addNewColors = (sabilities.find("newcolors") != string::npos); addNewColors = (sabilities.find("newcolors") != string::npos);
remove = (stypes.find("removealltypes") != string::npos); remove = (stypes.find("removealltypes") != string::npos);
removeCreatureSubtypes = (stypes.find("removecreaturesubtypes") != string::npos); removeCreatureSubtypes = (stypes.find("removecreaturesubtypes") != string::npos);
removeTypes = (stypes.find("removetypes") != string::npos); removeTypes = (stypes.find("removetypes") != string::npos);
removeAllSubtypes = (stypes.find("removeallsubtypes") != string::npos);
if (stypes.find("allsubtypes") != string::npos || stypes.find("removecreaturesubtypes") != string::npos) if (stypes.find("allsubtypes") != string::npos || stypes.find("removecreaturesubtypes") != string::npos)
{ {
@@ -7894,13 +7896,28 @@ int ATransformer::addToGame()
if(!addNewColors) if(!addNewColors)
_target->setColor(0, 1); _target->setColor(0, 1);
} }
if (removeAllColors)
{
for (it = oldcolors.begin(); it != oldcolors.end(); it++)
{
_target->removeColor(*it);
}
}
if (removeTypes) if (removeTypes)
{ {
//remove the main types from a card, ie: hidden enchantment cycle. //remove the main types from a card, ie: hidden enchantment cycle.
for (int i = 0; i < Subtypes::LAST_TYPE; ++ i) for (int i = 0; i < Subtypes::LAST_TYPE; ++ i)
_target->removeType(i,1); _target->removeType(i,1);
} }
else if (removeAllSubtypes)
{
//remove all the types from a card without removing official supertypes (e.g. Imprisoned in the Moon)
for (it = oldtypes.begin(); it != oldtypes.end(); it++)
{
if(*it != Subtypes::TYPE_LEGENDARY && *it != Subtypes::TYPE_BASIC && *it != Subtypes::TYPE_SNOW && *it != Subtypes::TYPE_WORLD)
_target->removeType(*it);
}
}
else if (remove) else if (remove)
{ {
for (it = oldtypes.begin(); it != oldtypes.end(); it++) for (it = oldtypes.begin(); it != oldtypes.end(); it++)
@@ -8133,7 +8150,7 @@ int ATransformer::destroy()
{ {
for (unsigned int i = 0;i < newAbilities[_target].size(); i++) for (unsigned int i = 0;i < newAbilities[_target].size(); i++)
{ {
// The mutated cards probably cause a double free error and a crash in Wagic, so for now they have been exluded... // The mutated cards probably cause a double free error and a crash, so for now they have been exluded...
if(newAbilities[_target].at(i) && !_target->mutation && _target->currentZone != _target->owner->game->library && !(_target->name == "" && (UYNT || UENT))) if(newAbilities[_target].at(i) && !_target->mutation && _target->currentZone != _target->owner->game->library && !(_target->name == "" && (UYNT || UENT)))
{ {
newAbilities[_target].at(i)->forceDestroy = 1; newAbilities[_target].at(i)->forceDestroy = 1;
@@ -8145,7 +8162,7 @@ int ATransformer::destroy()
newAbilities.erase(_target); newAbilities.erase(_target);
} }
} }
if (remove || removeCreatureSubtypes) if (remove || removeCreatureSubtypes || removeAllSubtypes)
{ {
for (it = oldtypes.begin(); it != oldtypes.end(); it++) for (it = oldtypes.begin(); it != oldtypes.end(); it++)
{ {
@@ -8691,7 +8708,7 @@ int AProduceMana::produce()
{ {
if(ManaDescription == "selectmana") if(ManaDescription == "selectmana")
{ {
//I tried menu ability and vector<MTGAbility*abi> to have a shorter code but it crashes wagic at end of turn... //I tried menu ability and vector<MTGAbility*abi> to have a shorter code but it crashes at end of turn...
//The may ability on otherhand works but the ability is cumulative... //The may ability on otherhand works but the ability is cumulative...
//This must be wrapped on menuability so we can use it on successions... //This must be wrapped on menuability so we can use it on successions...
AManaProducer *ap0 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[0],NULL,source), NULL, 0,"",false); AManaProducer *ap0 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[0],NULL,source), NULL, 0,"",false);
+27 -21
View File
@@ -472,6 +472,7 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
if (count) if (count)
match = NULL; match = NULL;
} }
if (CDcanProduceC == 1) if (CDcanProduceC == 1)
{ {
int count = card->canproduceMana(Constants::MTG_COLOR_ARTIFACT) + card->canproduceMana(Constants::MTG_COLOR_WASTE); int count = card->canproduceMana(Constants::MTG_COLOR_ARTIFACT) + card->canproduceMana(Constants::MTG_COLOR_WASTE);
@@ -519,24 +520,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{ {
match = NULL; match = NULL;
} }
if ((isLeveler == -1 && card->isLeveler) || (isLeveler == 1 && !card->isLeveler))
{
match = NULL;
}
if ((CDenchanted == -1 && card->enchanted) || (CDenchanted == 1 && !card->enchanted))
{
match = NULL;
}
if ((CDdamaged == -1 && card->wasDealtDamage > 0) || (CDdamaged == 1 && card->wasDealtDamage == 0))
{
match = NULL;
}
if ((CDdamager == -1 && (card->damageToOpponent > 0 || card->damageToController > 0 || card->damageToCreature > 0)) if ((isLeveler == -1 && card->isLeveler) || (isLeveler == 1 && !card->isLeveler))
|| (CDdamager == 1 && !(card->damageToOpponent > 0 || card->damageToController > 0 || card->damageToCreature > 0))) {
{ match = NULL;
match = NULL; }
}
if ((CDenchanted == -1 && card->enchanted) || (CDenchanted == 1 && !card->enchanted))
{
match = NULL;
}
if ((CDdamaged == -1 && card->wasDealtDamage > 0) || (CDdamaged == 1 && card->wasDealtDamage == 0))
{
match = NULL;
}
if ((CDdamager == -1 && (card->damageToOpponent > 0 || card->damageToController > 0 || card->damageToCreature > 0))
|| (CDdamager == 1 && !(card->damageToOpponent > 0 || card->damageToController > 0 || card->damageToCreature > 0)))
{
match = NULL;
}
if(CDopponentDamaged == -1 || CDopponentDamaged == 1 || CDcontrollerDamaged == -1 || CDcontrollerDamaged == 1) if(CDopponentDamaged == -1 || CDopponentDamaged == 1 || CDcontrollerDamaged == -1 || CDcontrollerDamaged == 1)
{ {
@@ -556,10 +560,12 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
match = NULL; match = NULL;
} }
} }
if ((isToken == -1 && card->isToken) || (isToken == 1 && !card->isToken))
{ if ((isToken == -1 && card->isToken) || (isToken == 1 && !card->isToken))
match = NULL; {
} match = NULL;
}
if (attacker == 1) if (attacker == 1)
{ {
if (defenser == &AnyCard) if (defenser == &AnyCard)
+14 -3
View File
@@ -1560,12 +1560,18 @@ int CounterCost::doPay()
if (!target) if (!target)
return 0; return 0;
//Add counters as a cost
if (counter->nb >= 0) if (counter->nb >= 0)
{ //Add counters as a cost {
int totalcounters = 0;
for (int i = 0; i < counter->nb; i++) for (int i = 0; i < counter->nb; i++)
{//send no event because its a cost not an effect... for doubling season {
target->counters->addCounter(counter->name.c_str(), counter->power, counter->toughness, true); target->counters->addCounter(counter->name.c_str(), counter->power, counter->toughness);
totalcounters++;
} }
WEvent * w = NEW WEventTotalCounters(target->counters, counter->name.c_str(), counter->power, counter->toughness, true, false, totalcounters, true, source);
dynamic_cast<WEventTotalCounters*>(w)->targetCard = target->counters->target;
target->getObserver()->receiveEvent(w);
if (tc) if (tc)
tc->initTargets(); tc->initTargets();
target = NULL; target = NULL;
@@ -1575,10 +1581,15 @@ int CounterCost::doPay()
//remove counters as a cost //remove counters as a cost
if (hasCounters) if (hasCounters)
{ {
int totalcounters = 0;
for (int i = 0; i < -counter->nb; i++) for (int i = 0; i < -counter->nb; i++)
{ {
target->counters->removeCounter(counter->name.c_str(), counter->power, counter->toughness); target->counters->removeCounter(counter->name.c_str(), counter->power, counter->toughness);
totalcounters++;
} }
WEvent * w = NEW WEventTotalCounters(target->counters, counter->name.c_str(), counter->power, counter->toughness, false, true, totalcounters, true, source);
dynamic_cast<WEventTotalCounters*>(w)->targetCard = target->counters->target;
target->getObserver()->receiveEvent(w);
hasCounters = 0; hasCounters = 0;
if (tc) if (tc)
tc->initTargets(); tc->initTargets();
+42 -36
View File
@@ -1519,7 +1519,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "proliferateof", card)){ if (TargetChooser * tc = parseSimpleTC(s, "proliferateof", card)){
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify an exception in order to avoid proliferation loop (eg. Tekuthal, Inquiry Dominus) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify an exception in order to avoid proliferation loop (eg. Tekuthal, Inquiry Dominus)
if(exception) if(exception)
return NEW TrplayerProliferated(observer, id, card, tc, once, true, false, exception->source); return NEW TrplayerProliferated(observer, id, card, tc, once, true, false, exception);
else else
return NEW TrplayerProliferated(observer, id, card, tc, once, true, false); return NEW TrplayerProliferated(observer, id, card, tc, once, true, false);
} }
@@ -1528,7 +1528,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "proliferatefoeof", card)){ if (TargetChooser * tc = parseSimpleTC(s, "proliferatefoeof", card)){
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify an exception in order to avoid proliferation loop (eg. Tekuthal, Inquiry Dominus) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify an exception in order to avoid proliferation loop (eg. Tekuthal, Inquiry Dominus)
if(exception) if(exception)
return NEW TrplayerProliferated(observer, id, card, tc, once, false, true, exception->source); return NEW TrplayerProliferated(observer, id, card, tc, once, false, true, exception);
else else
return NEW TrplayerProliferated(observer, id, card, tc, once, false, true); return NEW TrplayerProliferated(observer, id, card, tc, once, false, true);
} }
@@ -1769,9 +1769,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifeof", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifeof", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, true, false, limitOnceATurn, exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, true, false, limitOnceATurn, exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, true, false, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, true, false, limitOnceATurn);
} }
@@ -1780,9 +1780,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifefoeof", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifefoeof", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped,once, false, true, limitOnceATurn, exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped,once, false, true, limitOnceATurn, exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped,once, false, true, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped,once, false, true, limitOnceATurn);
} }
@@ -1791,9 +1791,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifed", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifed", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, false, false, limitOnceATurn, exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, false, false, limitOnceATurn, exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, false, false, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 0, sourceUntapped, once, false, false, limitOnceATurn);
} }
@@ -1802,9 +1802,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifelostof", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifelostof", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, true, false, limitOnceATurn, exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, true, false, limitOnceATurn, exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, true, false, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, true, false, limitOnceATurn);
} }
@@ -1813,9 +1813,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifelostfoeof", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifelostfoeof", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, true, limitOnceATurn,exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, true, limitOnceATurn,exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, true, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, true, limitOnceATurn);
} }
@@ -1824,9 +1824,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "lifeloss", card)) if (TargetChooser * tc = parseSimpleTC(s, "lifeloss", card))
{ {
TargetChooser *fromTc = parseSimpleTC(s, "from", card); TargetChooser *fromTc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop (eg. Angels of Vitality) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a life gain/loss card exception in order to avoid life gain loop.
if(exception) if(exception)
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, false, limitOnceATurn, exception->source); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, false, limitOnceATurn, exception);
else else
return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, false, limitOnceATurn); return NEW TrLifeGained(observer, id, card, tc, fromTc, 1, sourceUntapped, once, false, false, limitOnceATurn);
} }
@@ -1849,6 +1849,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
{ {
vector<string>splitCounter = parseBetween(s,"totalcounteradded(",")"); vector<string>splitCounter = parseBetween(s,"totalcounteradded(",")");
Counter * counter = NULL; Counter * counter = NULL;
bool nocost = false;
bool duplicate = false; bool duplicate = false;
bool half = false; bool half = false;
int plus = 0; int plus = 0;
@@ -1862,24 +1863,27 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
plus = 4; plus = 4;
else if(s.find("plus(5)") != string::npos) else if(s.find("plus(5)") != string::npos)
plus = 5; plus = 5;
else if(s.find("(duplicateall)") != string::npos) else if(s.find("duplicate(all)") != string::npos)
duplicate = true; duplicate = true;
else if(s.find("(halfall)") != string::npos) else if(s.find("half(all)") != string::npos)
half = true; half = true;
else if(s.find("(any)") == string::npos) if(s.find("(any)") == string::npos)
counter = parseCounter(splitCounter[1],card,NULL); counter = parseCounter(splitCounter[1],card,NULL);
if(s.find("nocost") != string::npos)
nocost = true;
TargetChooser * tc = parseSimpleTC(s, "from", card); TargetChooser * tc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop (eg. Doubling Season) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop.
if(exception) if(exception)
return NEW TrTotalCounter(observer, id, card, counter, tc, 1, once, duplicate, half, plus, limitOnceATurn, exception->source); return NEW TrTotalCounter(observer, id, card, counter, tc, 1, once, duplicate, half, plus, nocost, limitOnceATurn, exception);
else else
return NEW TrTotalCounter(observer, id, card, counter, tc, 1, once, duplicate, half, plus, limitOnceATurn); return NEW TrTotalCounter(observer, id, card, counter, tc, 1, once, duplicate, half, plus, nocost, limitOnceATurn);
} }
if (s.find("totalcounterremoved(") != string::npos) if (s.find("totalcounterremoved(") != string::npos)
{ {
vector<string>splitCounter = parseBetween(s,"totalcounterremoved(",")"); vector<string>splitCounter = parseBetween(s,"totalcounterremoved(",")");
Counter * counter = NULL; Counter * counter = NULL;
bool nocost = false;
bool duplicate = false; bool duplicate = false;
bool half = false; bool half = false;
int plus = 0; int plus = 0;
@@ -1893,18 +1897,20 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
plus = 4; plus = 4;
else if(s.find("plus(5)") != string::npos) else if(s.find("plus(5)") != string::npos)
plus = 5; plus = 5;
else if(s.find("(duplicateall)") != string::npos) else if(s.find("duplicate(all)") != string::npos)
duplicate = true; duplicate = true;
else if(s.find("(halfall)") != string::npos) else if(s.find("half(all)") != string::npos)
half = true; half = true;
else if(s.find("(any)") == string::npos) if(s.find("(any)") == string::npos)
counter = parseCounter(splitCounter[1],card,NULL); counter = parseCounter(splitCounter[1],card,NULL);
if(s.find("nocost") != string::npos)
nocost = true;
TargetChooser * tc = parseSimpleTC(s, "from", card); TargetChooser * tc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop (eg. Doubling Season) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop.
if(exception) if(exception)
return NEW TrTotalCounter(observer, id, card, counter, tc, 0, once, duplicate, half, plus, limitOnceATurn, exception->source); return NEW TrTotalCounter(observer, id, card, counter, tc, 0, once, duplicate, half, plus, nocost, limitOnceATurn, exception);
else else
return NEW TrTotalCounter(observer, id, card, counter, tc, 0, once, duplicate, half, plus, limitOnceATurn); return NEW TrTotalCounter(observer, id, card, counter, tc, 0, once, duplicate, half, plus, nocost, limitOnceATurn);
} }
if (s.find("counteradded(") != string::npos) if (s.find("counteradded(") != string::npos)
@@ -1912,14 +1918,14 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
vector<string>splitCounter = parseBetween(s,"counteradded(",")"); vector<string>splitCounter = parseBetween(s,"counteradded(",")");
Counter * counter = NULL; Counter * counter = NULL;
bool duplicate = false; bool duplicate = false;
if(s.find("(duplicateall)") != string::npos) if(s.find("duplicate(all)") != string::npos)
duplicate = true; duplicate = true;
else if(s.find("(any)") == string::npos) if(s.find("(any)") == string::npos)
counter = parseCounter(splitCounter[1],card,NULL); counter = parseCounter(splitCounter[1],card,NULL);
TargetChooser * tc = parseSimpleTC(s, "from", card); TargetChooser * tc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop (eg. Doubling Season) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop.
if(exception) if(exception)
return NEW TrCounter(observer, id, card, counter, tc, 1, once, duplicate, limitOnceATurn, exception->source); return NEW TrCounter(observer, id, card, counter, tc, 1, once, duplicate, limitOnceATurn, exception);
else else
return NEW TrCounter(observer, id, card, counter, tc, 1, once, duplicate, limitOnceATurn); return NEW TrCounter(observer, id, card, counter, tc, 1, once, duplicate, limitOnceATurn);
} }
@@ -1929,14 +1935,14 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
vector<string>splitCounter = parseBetween(s,"counterremoved(",")"); vector<string>splitCounter = parseBetween(s,"counterremoved(",")");
Counter * counter = NULL; Counter * counter = NULL;
bool duplicate = false; bool duplicate = false;
if(s.find("(duplicateall)") != string::npos) if(s.find("duplicate(all)") != string::npos)
duplicate = true; duplicate = true;
else if(s.find("(any)") == string::npos) if(s.find("(any)") == string::npos)
counter = parseCounter(splitCounter[1],card,NULL); counter = parseCounter(splitCounter[1],card,NULL);
TargetChooser * tc = parseSimpleTC(s, "from", card); TargetChooser * tc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop (eg. Doubling Season) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop.
if(exception) if(exception)
return NEW TrCounter(observer, id, card, counter, tc, 0, once, duplicate, limitOnceATurn, exception->source); return NEW TrCounter(observer, id, card, counter, tc, 0, once, duplicate, limitOnceATurn, exception);
else else
return NEW TrCounter(observer, id, card, counter, tc, 0, once, duplicate, limitOnceATurn); return NEW TrCounter(observer, id, card, counter, tc, 0, once, duplicate, limitOnceATurn);
} }
@@ -1948,9 +1954,9 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if(s.find("(any)") == string::npos) if(s.find("(any)") == string::npos)
counter = parseCounter(splitCounter[1],card,NULL); counter = parseCounter(splitCounter[1],card,NULL);
TargetChooser * tc = parseSimpleTC(s, "from", card); TargetChooser * tc = parseSimpleTC(s, "from", card);
TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop (eg. Doubling Season) TargetChooser *exception = parseSimpleTC(s, "except", card); // Added a new keyword except to specify a counter add/remove exception in order to avoid counter loop.
if(exception) if(exception)
return NEW TrCounter(observer, id, card, counter, tc, 2, once, false, limitOnceATurn, exception->source); return NEW TrCounter(observer, id, card, counter, tc, 2, once, false, limitOnceATurn, exception);
else else
return NEW TrCounter(observer, id, card, counter, tc, 2, once, false, limitOnceATurn); return NEW TrCounter(observer, id, card, counter, tc, 2, once, false, limitOnceATurn);
} }
+2 -2
View File
@@ -48,8 +48,8 @@ WEvent(),counter(counter),name(name),power(power),toughness(toughness),added(add
{ {
} }
WEventTotalCounters::WEventTotalCounters(Counters *counter, string name, int power, int toughness, bool added, bool removed, int totalamount, MTGCardInstance* source) : WEventTotalCounters::WEventTotalCounters(Counters *counter, string name, int power, int toughness, bool added, bool removed, int totalamount, bool iscost, MTGCardInstance* source) :
WEvent(),counter(counter),name(name),power(power),toughness(toughness),added(added),removed(removed),totalamount(totalamount),source(source) WEvent(),counter(counter),name(name),power(power),toughness(toughness),added(added),removed(removed),totalamount(totalamount),iscost(iscost),source(source)
{ {
} }