From c211b2eaa481639725f29490d93f87797ea5a718 Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Sat, 4 Sep 2021 21:14:05 +0200 Subject: [PATCH] Fixed several primitives with "castcard" ability, fixed a bug when using "noevent" and "copied" options togheter with "namedcard" option in "castcard" ability, allowed the usage of "and!()!" ability with "namedcard" option in "castcard" ability for permanents, added "daybound" and "nightbound" abilities. --- CHANGELOG.md | 4 +- .../bin/Res/sets/primitives/borderline.txt | 66 +++++++++---------- projects/mtg/bin/Res/sets/primitives/mtg.txt | 2 +- .../bin/Res/sets/primitives/planeswalkers.txt | 2 +- projects/mtg/include/MTGDefinitions.h | 4 +- projects/mtg/src/AllAbilities.cpp | 57 +++++++++------- projects/mtg/src/MTGDefinitions.cpp | 4 +- 7 files changed, 77 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 716fcfa54..d64fd3b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## [master] (https://github.com/WagicProject/wagic/tree/master) ### 04/09/21 -- *Committed:* Added/fixed primitives, refactored and improved almost all transforming human cards (included all the Werewolves), improved "flip ability and "doubleside" ability adding a new "backside" option, fixed a bug on "doubleside" ability for planeswalkers, added "backside=" key to CardPrimitive in order to specify the other side of double-faced cards, added "hasbackside" option to target chooser in order to find cards which have a back side, added "dualfaced" that return 1 if a card has a backside card, fixed loyalty counter ability on planeswalker flip (is was not resolving correctly), changed type of damageToController, damageToOpponent, damageToCreature, wasDealtDamage, combatdamageToOpponent from bool to int in order to retrieve those values if needed, added "totaldmg" keyword that returns the total amount of damage dealt by a creature in the current turn, added new restriction "coven in order to check if a player controls three or more creatures with different powers, added new ability "hasdisturb" when the Retrace cost of a card is a disturb cost (e.g. "Beloved Beggar"). ([Vitty85](https://github.com/Vitty85)) +- *Committed:* Fixed several primitives with "castcard" ability, fixed a bug when using "noevent" and "copied" options togheter with "namedcard" option in "castcard" ability, allowed the usage of "and!()!" ability with "namedcard" option in "castcard" ability for permanents, added "daybound" and "nightbound" abilities. ([Vitty85](https://github.com/Vitty85)) + +- *Committed:* Added/fixed primitives, refactored and improved almost all transforming human cards (included all the Werewolves), improved "flip ability and "doubleside" ability adding a new "backside" option, fixed a bug on "doubleside" ability for planeswalkers, added "backside=" key to CardPrimitive in order to specify the other side of double-faced cards, added "hasbackside" option to target chooser in order to find cards which have a back side, added "dualfaced" that return 1 if a card has a backside card, fixed loyalty counter ability on planeswalker flip (is was not resolving correctly), changed type of damageToController, damageToOpponent, damageToCreature, wasDealtDamage, combatdamageToOpponent from bool to int in order to retrieve those values if needed, added "totaldmg" keyword that returns the total amount of damage dealt by a creature in the current turn, added new restriction "coven in order to check if a player controls three or more creatures with different powers, added new ability "hasdisturb" when the Retrace cost of a card is a disturb cost (e.g. "Beloved Beggar"). https://github.com/WagicProject/wagic/commit/cc16db7256138febf26c1bf7fd4d9907c4f708fa ([Vitty85](https://github.com/Vitty85)) ### 03/09/21 - *Committed:* Fixed primitives, fixed some possible crashes on Commander Format. https://github.com/WagicProject/wagic/commit/236f677f2a08d538191de5c16970340dcd39c5f0 ([Vitty85](https://github.com/Vitty85)) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 58a0caebc..0fd1fa4fd 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -3628,9 +3628,9 @@ other={2}{U}{U} name(Echoing Equation) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Echoing Equation) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:echoing equation:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:echoing equation:!)])) forever auto=aslongas(land|mybattlefield) 5/5 >7 -text=Trample -- As long as you control eight or more lands, Augmenter Pugilist gets +5/+5. // Choose target creature you control. Each other creature you control becomes a copy of it until end of turn, except those creatures aren't legendary if the chosen creature is legendary. // {2}{U}{U} Echoing Equation +text=Trample -- As long as you control eight or more lands, Augmenter Pugilist gets +5/+5. // {2}{U}{U} Echoing Equation mana={1}{G}{G} type=Creature subtype=Troll Druid @@ -6148,10 +6148,10 @@ other={2}{B}{B} name(Search for Blex) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Search for Blex) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:search for blex:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:search for blex:!)])) forever auto=lord(other *[pest;bat;insect;snake;spider]|mybattlefield) 1/1 auto=_DIES_life:4 controller -text=Other Pests, Bats, Insects, Snakes, and Spiders you control get +1/+1. -- When Blex, Vexing Pest dies, you gain 4 life. // Look at the top five cards of your library. You may put any number of them into your hand and the rest into your graveyard. You lose 3 life for each card you put into your hand this way. // {2}{B}{B} Search for Blex +text=Other Pests, Bats, Insects, Snakes, and Spiders you control get +1/+1. -- When Blex, Vexing Pest dies, you gain 4 life. // {2}{B}{B} Search for Blex mana={2}{G} type=Legendary Creature subtype=Pest @@ -20880,10 +20880,10 @@ other={6}{B}{R} name(Awaken the Blood Avatar) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Awaken the Blood Avatar) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:awaken the blood avatar:!)])) forever -autohand={4}{B}{R}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~0,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 1) transforms((,newability[activate castcard(named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever -autohand={2}{B}{R}{S(creature|myBattlefield)}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~1,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 2) transforms((,newability[activate castcard(named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever -autohand={B}{R}{S(creature|myBattlefield)}{S(creature|myBattlefield)}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~2,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 3) transforms((,newability[activate castcard(named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:awaken the blood avatar:!)])) forever +autohand={4}{B}{R}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~0,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 1) transforms((,newability[activate castcard(copied named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever +autohand={2}{B}{R}{S(creature|myBattlefield)}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~1,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 2) transforms((,newability[activate castcard(copied named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever +autohand={B}{R}{S(creature|myBattlefield)}{S(creature|myBattlefield)}{S(creature|myBattlefield)} restriction{type(creature|mybattlefield)~morethan~2,can play sorcery,compare(isflipped)~equalto~1}:name(Sacrifice 3) transforms((,newability[copied activate castcard(named!:awaken the blood avatar:!)],newability[moveto(mygraveyard)])) forever auto=@movedto(*[instant;sorcery]|mystack):name(Return creature) target(creature[-legendary]|mygraveyard) moveto(myhand) text=Double strike -- Magecraft — Whenever you cast or copy an instant or sorcery spell, return target nonlegendary creature card from your graveyard to your hand. // {6}{B}{R} Awaken the Blood Avatar mana={1}{W}{B}{B} @@ -23036,7 +23036,7 @@ other={W}{W} name(Revel in Silence) otherrestriction=compare(isflipped)~equalto~1 restriction=can play creature,compare(isflipped)~equalto~0 anyzone={0}:doubleside(Revel in Silence) -autostack=if paid(alternative) then transforms((,newability[moveto(myexile)],newability[activate castcard(named!:revel in silence:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(myexile)],newability[activate castcard(copied named!:revel in silence:!)])) forever auto={1}{R}:2/0 ueot text=Whenever an opponent activates an ability that isn't a mana ability, Flamescroll Celebrant deals 1 damage to that player. -- {1}{R}: Flamescroll Celebrant gets +2/+0 until end of turn. // {W}{W} Revel in Silence mana={1}{R} @@ -25495,7 +25495,7 @@ abilities=hasnokicker,hasreplicate target=*|battlefield kicker=multi{U} name(Replicate) auto=name(Tap creature) tap -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Gigadrowse) name(Copy Gigadrowse) activate castcard(named!:Gigadrowse:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Gigadrowse) name(Copy Gigadrowse) activate castcard(copied noevent named!:Gigadrowse:!)!$ controller text=Replicate {U} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Tap target permanent. mana={U} type=Instant @@ -33624,7 +33624,7 @@ other={2}{G}{G} name(Journey to the Oracle) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Journey to the Oracle) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:journey to the oracle:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:journey to the oracle:!)])) forever auto={D(*|myhand)}:moveto(ownerhand) auto=@movedto(*[instant;sorcery]|mystack):name(Look top card) reveal:1 optionone target(land|reveal) moveto(mybattlefield) oneshot optiononeend optiontwo name(Cast for 1 or put back) target(*|reveal) moveto(mylibrary) and!( becomes(tobecast) ueot )! optiontwoend afterrevealed all(tobecast|mylibrary) transforms((,newability[pay({1}) name(Cast for 1) activate castcard(normal)])) oneshot afterrevealedend revealend text=Discard a card: Return Jadzi, Oracle of Arcavios to its owner's hand. -- Magecraft — Whenever you cast or copy an instant or sorcery spell, reveal the top card of your library. If it's a nonland card, you may cast it by paying 1 rather than paying its mana cost. If it's a land card, put it onto the battlefield. // {2}{G}{G} Journey to the Oracle @@ -36866,7 +36866,7 @@ abilities=hasnokicker,hasreplicate target=creature kicker=multi{U}{R} name(Replicate) auto=name(Creature gets 1/0) transforms((,newability[flying],newability[first strike],newability[1/0])) ueot -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Leap of Flame) name(Copy Leap of Flame) activate castcard(named!:Leap of Flame:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Leap of Flame) name(Copy Leap of Flame) activate castcard(copied noevent named!:Leap of Flame:!)!$ controller text=Replicate {U}{R} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Target creature gets +1/+0 and gains flying and first strike until end of turn. mana={U}{R} type=Instant @@ -40795,7 +40795,7 @@ abilities=hasnokicker,hasreplicate target=*|opponentbattlefield kicker=multi{3}{U} name(Replicate) auto=name(Search same permanent) transforms((,newability[name(Search same card) target(*[share!name!]|mylibrary) moveto(opponentbattlefield) and!( shuffle )!])) forever -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Mimeofacture) name(Copy Mimeofacture) activate castcard(named!:Mimeofacture:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Mimeofacture) name(Copy Mimeofacture) activate castcard(copied noevent named!:Mimeofacture:!)!$ controller text=Replicate {3}{U} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Choose target permanent an opponent controls. Search that player's library for a card with the same name and put it onto the battlefield under your control. Then that player shuffles his or her library. mana={3}{U} type=Sorcery @@ -41678,7 +41678,7 @@ toughness=5 [/card] [card] name=Moonmist -auto=all(human[hasbackside]|battlefield) transforms((,newability[flip(backside)])) forever +auto=all(human[hasbackside;-daybound;-nightbound]|battlefield) transforms((,newability[flip(backside)])) forever auto=preventAllCombatDamage from(creature[-wolf;-werewolf]|battlefield) ueot text=Transform all Humans. Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. (Only double-faced cards can be transformed.) mana={1}{G} @@ -46504,7 +46504,7 @@ other={3}{G}{G} name(Restorative Burst) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Restorative Burst) -autostack=if paid(alternative) then transforms((,newability[moveto(myexile)],newability[activate castcard(named!:restorative burst:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(myexile)],newability[activate castcard(copied named!:restorative burst:!)])) forever auto={T}{D(*|myhand)}:name(Create Pest) token(Pest,Creature Pest,1/1,green,blue) and!( transforms((,newability[_DIES_life:1 controller])) forever )! auto={1}{T}:deplete:lifegain opponent auto={4}{T} restriction{type(*|mygraveyard)~morethan~3}:name(Exile from your graveyard) transforms((,newability[draw:1 controller],newability[name(Exile from your graveyard) target(<4>*|mygraveyard) moveto(exile)])) oneshot @@ -49073,7 +49073,7 @@ abilities=hasnokicker,hasreplicate target=player,creature,planeswalker kicker=multi{1}{R} name(Replicate) auto=name(Deal 1 damage) damage:1 -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Pyromatics) name(Copy Pyromatics) activate castcard(named!:Pyromatics:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Pyromatics) name(Copy Pyromatics) activate castcard(copied noevent named!:Pyromatics:!)!$ controller text=Replicate {1}{R} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Pyromatics deals 1 damage to any target. mana={1}{R} type=Instant @@ -55963,9 +55963,9 @@ other={5}{B}{B}{B} name(Deadly Vanity) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Deadly Vanity) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:deadly vanity:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:deadly vanity:!)])) forever auto={E}:name(All creatures gain indestructible) all(creature|mybattlefield) transforms((,newability[indestructible])) ueot -text=Exile Selfless Glyphweaver: Creatures you control gain indestructible until end of turn. // Choose a creature or planeswalker, then destroy all other creatures and planeswalkers. // {5}{B}{B}{B} Deadly Vanity +text=Exile Selfless Glyphweaver: Creatures you control gain indestructible until end of turn. // {5}{B}{B}{B} Deadly Vanity mana={2}{W} type=Creature subtype=Human Cleric @@ -56807,7 +56807,7 @@ abilities=hasnokicker,hasreplicate target=artifact kicker=multi{R} name(Replicate) auto=name(Destroy artifact) destroy -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Shattering Spree) name(Copy Shattering Spree) activate castcard(named!:Shattering Spree:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Shattering Spree) name(Copy Shattering Spree) activate castcard(copied noevent named!:Shattering Spree:!)!$ controller text=Replicate {R} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Destroy target artifact. mana={R} type=Instant @@ -57547,7 +57547,7 @@ abilities=hasnokicker,hasreplicate target=mountain kicker=multi{1}{R} name(Replicate) auto=name(Becomes creature) transforms((Creature,setpower=3,settoughness=1)) forever -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Siege of Towers) name(Copy Siege of Towers) activate castcard(named!:Siege of Towers:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Siege of Towers) name(Copy Siege of Towers) activate castcard(copied noevent named!:Siege of Towers:!)!$ controller text=Replicate {1}{R} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Target Mountain becomes a 3/1 creature. It's still a land. mana={1}{R} type=Sorcery @@ -62608,7 +62608,7 @@ toughness=4 [/card] [card] name=Storvald Effect -abilities=doublefacedeath +abilities=doublefacedeath,nomovetrigger auto=choice name(Creature becomes 7/7) target(creature|battlefield) transforms((,setpower=7,settoughness=7)) ueot auto=choice name(Creature becomes 1/1) target(creature|battlefield) transforms((,setpower=1,settoughness=1)) ueot auto=choice name(Choose both) target(creature|battlefield) transforms((,setpower=7,settoughness=7,newability[name(Creature becomes 1/1) target(other creature|battlefield) transforms((,setpower=1,settoughness=1)) ueot])) ueot @@ -62619,8 +62619,8 @@ type=Instant [card] name=Storvald, Frost Giant Jarl auto=@targeted(creature|mybattlefield) from(*|opponentzones):choice name(This spell costs 3 more) name(This spell costs 3 more) target(*|opponentzones) transforms((,newability[pay[[{3}]] name(pay 3 mana) donothing?fizzle])) oneshot -auto=name(Choose one or both) activate castcard(named!:storvald effect:!) -auto=_ATTACKING_name(Choose one or both) activate castcard(named!:storvald effect:!) +auto=name(Choose one or both) activate castcard(copied noevent named!:storvald effect:!) +auto=_ATTACKING_name(Choose one or both) activate castcard(copied noevent named!:storvald effect:!) text=Ward {3} -- Other creatures you control have ward {3}. -- Whenever Storvald enters the battlefield or attacks, choose one or both — -- • Target creature has base power and toughness 7/7 until end of turn. -- • Target creature has base power and toughness 1/1 until end of turn. mana={4}{G}{W}{U} type=Legendary Creature @@ -62666,7 +62666,7 @@ target=player kicker=multi{2}{U}{U} name(Replicate) auto=name(Mill 2 cars) deplete:2 auto=may name(Return cards form graveyard) target(*|mygraveyard) moveto(mylibrary) and!( shuffle )! -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Stream of Thought) name(Copy Stream of Thought) activate castcard(named!:Stream of Thought:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Stream of Thought) name(Copy Stream of Thought) activate castcard(copied noevent named!:Stream of Thought:!)!$ controller text=Target player puts the top four cards of their library into their graveyard. You shuffle up to four cards from your graveyard into your library. -- Replicate {2}{U}{U} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) mana={U} type=Sorcery @@ -66580,7 +66580,7 @@ name=Thunderheads abilities=hasnokicker,hasreplicate kicker=multi{2}{U} name(Replicate) auto=name(Create Weird) token(Weird,Creature Weird,3/3,blue,defender,flying,unearth) -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Thunderheads) name(Copy Thunderheads) activate castcard(named!:Thunderheads:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Thunderheads) name(Copy Thunderheads) activate castcard(copied noevent named!:Thunderheads:!)!$ controller text=Replicate {2}{U} (When you cast this spell, copy it for each time you paid its replicate cost.) -- Create a 3/3 blue Weird creature token with defender and flying. Exile it at the beginning of the next end step. mana={2}{U} type=Instant @@ -67268,9 +67268,9 @@ name=Tomb of Annihilation restriction=never autocommandzone=transforms((,newability[shroud],newability[indestructible])) forever autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~1}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Trapped Entry) name(Trapped Entry) life:-1 controller && life:-1 opponent!$ controller -autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~2}:ability$!name(Veils of Fear or Oubliette) transforms((,newability[choice name(Veils of Fear) activate castcard(kicked!:1:! named!:annihilation rooms:!)],newability[if type(*|myhand)~morethan~0 then choice name(Oubliette) name(Oubliette) activate castcard(normal named!:annihilation rooms:!)])) oneshot!$ controller -autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~0}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Sandfall Cell) name(Sandfall Cell) transforms((,newability[choice name(Loose 2 life) life:-2 controller],newability[if type(artifact|mybattlefield)~morethan~0 then if type(creature|mybattlefield)~morethan~0 then if type(land|mybattlefield)~morethan~0 then choice name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) activate castcard(alternative named!:annihilation rooms:!)])) oneshot!$ controller -autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~0}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Sandfall Cell) name(Sandfall Cell) transforms((,newability[choice name(Loose 2 life) life:-2 controller],newability[if type(artifact|mybattlefield)~morethan~0 then if type(creature|mybattlefield)~morethan~0 then if type(land|mybattlefield)~morethan~0 then choice name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) activate castcard(alternative named!:annihilation rooms:!)])) oneshot!$ opponent +autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~2}:ability$!name(Veils of Fear or Oubliette) transforms((,newability[choice name(Veils of Fear) activate castcard(copied noevent kicked!:1:! named!:annihilation rooms:!)],newability[if type(*|myhand)~morethan~0 then choice name(Oubliette) name(Oubliette) activate castcard(copied noevent normal named!:annihilation rooms:!)])) oneshot!$ controller +autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~0}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Sandfall Cell) name(Sandfall Cell) transforms((,newability[choice name(Loose 2 life) life:-2 controller],newability[if type(artifact|mybattlefield)~morethan~0 then if type(creature|mybattlefield)~morethan~0 then if type(land|mybattlefield)~morethan~0 then choice name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) activate castcard(copied alternative noevent named!:annihilation rooms:!)])) oneshot!$ controller +autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~0}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Sandfall Cell) name(Sandfall Cell) transforms((,newability[choice name(Loose 2 life) life:-2 controller],newability[if type(artifact|mybattlefield)~morethan~0 then if type(creature|mybattlefield)~morethan~0 then if type(land|mybattlefield)~morethan~0 then choice name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) name(Sacrifice cards) activate castcard(copied alternative noevent named!:annihilation rooms:!)])) oneshot!$ opponent autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~1}:choice name(Dungeon completed) all(Tomb of Annihilation|mycommandzone) completedungeon:1 controller autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~3,compare(hascntoubliette)~equalto~1}:thisforeach(variable{type:*[twodngtrg]:myBattlefieldplus1plusend}) ability$!name(Cradle of the Death God) name(Cradle of the Death God) token(The Atropal)!$ controller autocommandzone=@counteradded(0/0,1,Explore) from(Tomb of Annihilation|mycommandzone) restriction{compare(hascntexplore)~equalto~4}:choice name(Dungeon completed) all(Tomb of Annihilation|mycommandzone) completedungeon:1 controller @@ -67539,7 +67539,7 @@ other={1}{R} name(Flamethrower Sonata) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Flamethrower Sonata) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:flamethrower sonata:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:flamethrower sonata:!)])) forever auto=@targeted(this) from(*|opponentzones):choice name(This spell costs 2 more) name(This spell costs 2 more) target(*|opponentzones) transforms((,newability[pay[[{2}]] name(pay 2 mana) donothing?fizzle])) oneshot auto=if type(*[instant;sorcery:manacost=0]|mygraveyard)~morethan~0 then choice name(Exile instant or sorcery with manacost 0) name(Exile instant or sorcery with manacost 0) target(*[instant;sorcery;manacost=0]|mygraveyard) moveto(myexile) auto=if type(*[instant;sorcery:manacost=1]|mygraveyard)~morethan~0 then choice name(Exile instant or sorcery with manacost 1) name(Exile instant or sorcery with manacost 1) target(*[instant;sorcery;manacost=1]|mygraveyard) moveto(myexile) and!( all(this) counter(1/1) )! @@ -67737,7 +67737,7 @@ name=Train of Thought abilities=hasnokicker,hasreplicate auto=name(Draw a card) draw:1 controller kicker=multi{1}{U} name(Replicate) -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Train of Thought) name(Copy Train of Thought) activate castcard(named!:Train of Thought:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Train of Thought) name(Copy Train of Thought) activate castcard(copied noevent named!:Train of Thought:!)!$ controller text=Replicate {1}{U} (When you cast this spell, copy it for each time you paid its replicate cost.) -- Draw a card. mana={1}{U} type=Sorcery @@ -69634,7 +69634,7 @@ abilities=hasnokicker,hasreplicate target=creature kicker=multi{2}{U} name(Replicate) auto=name(Return to hand) moveto(ownerhand) -auto=thisforeach(variable{kicked}>0) ability$!name(Copy Vacuumelt) name(Copy Vacuumelt) activate castcard(named!:Vacuumelt:!)!$ controller +auto=thisforeach(variable{kicked}>0) ability$!name(Copy Vacuumelt) name(Copy Vacuumelt) activate castcard(copied noevent named!:Vacuumelt:!)!$ controller text=Replicate {2}{U} (When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.) -- Return target creature to its owner’s hand. mana={2}{U} type=Sorcery @@ -71916,7 +71916,7 @@ other={3} name(Explore the Vastlands) otherrestriction=can play sorcery,compare(isflipped)~equalto~1 restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(Explore the Vastlands) -autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(named!:explore the vastlands:!)])) forever +autostack=if paid(alternative) then transforms((,newability[moveto(mygraveyard)],newability[activate castcard(copied named!:explore the vastlands:!)])) forever auto=@movedto(*[instant;sorcery]|opponentstack):all(trigger[to]) transforms((,newability[[pay[[{2}]] name(pay 2 mana) donothing?counter(0/0.1.WanderingEffect)])) oneshot auto=@counteradded(0/0,1,WanderingEffect) from(instant|opponentstack):may name(Copy spell) all(instant[counter{0/0.1.WanderingEffect}]|opponentstack) activate castcard(copied) auto=@counteradded(0/0,1,WanderingEffect) from(sorcery|opponentstack):may name(Copy spell) all(sorcery[counter{0/0.1.WanderingEffect}]|opponentstack) activate castcard(copied) @@ -72420,7 +72420,7 @@ type=Instant [/card] [card] name=Waxing Moon -auto=may name(Transform a werewolf) target(werewolf[hasbackside]|mybattlefield) transforms((,newability[flip(backside)])) forever +auto=may name(Transform a werewolf) target(werewolf[hasbackside;-daybound;-nightbound]|mybattlefield) transforms((,newability[flip(backside)])) forever auto=all(creature|mybattlefield) transforms((,newability[trample])) ueot text=Transform up to one target Werewolf you control. Creatures you control gain trample until end of turn. mana={1}{G} diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 2a6fb5ac4..f982708c5 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -129013,7 +129013,7 @@ type=Instant [card] name=Vildin-Pack Alpha backside=Geier Reach Bandit -auto=@movedto(werewolf[hasbackside]|mybattlefield):name(Transforms werewolf) all(trigger[to]) transforms((,newability[if cantargetcard(*[fresh]|*) then may name(Transform Human Werewolf) name(Transform Human Werewolf) flip(backside) limit:1])) forever +auto=@movedto(werewolf[hasbackside;-nightbound;-daybound]|mybattlefield):name(Transforms werewolf) all(trigger[to]) transforms((,newability[if cantargetcard(*[fresh]|*) then may name(Transform Human Werewolf) name(Transform Human Werewolf) flip(backside) limit:1])) forever auto=@each upkeep restriction{lastturn(*|mystack)~morethan~1,lastturn(*|opponentstack)~lessthan~2}:name(Transform Werewolf) flip(backside) auto=@each upkeep restriction{lastturn(*|opponentstack)~morethan~1}:name(Transform Werewolf) flip(backside) text=Whenever a Werewolf enters the battlefield under your control, you may transform it. -- At the beginning of each upkeep, if a player cast two or more spells last turn, transform Vildin-Pack Alpha. // Geier Reach Bandit diff --git a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt index 9e849f6aa..6e40d6aeb 100644 --- a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt +++ b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt @@ -653,7 +653,7 @@ auto=counter(0/0,4,Loyalty) auto={C(0/0,1,Loyalty)}:name(+1: Opponent discards or sacrifice) transforms((,newability[counter(0/0.1.DavrielEffect)],newability[phaseaction[my untap once sourceinplay] counter(0/0.-1.DavrielEffect)])) forever auto=@each blockers restriction{type(creature[attacking]|opponentbattlefield)~morethan~0,compare(hascntdavrieleffect)~morethan~0,type(*|opponenthand)~morethan~0}:ability$!name(Discard a card) name(Discard a card) target(*|myhand) reject!$ opponent auto=@each blockers restriction{type(creature[attacking]|opponentbattlefield)~morethan~0,compare(hascntdavrieleffect)~morethan~0,type(*|opponenthand)~equalto~0}:ability$!name(Sacrifice a creature) name(Sacrifice a creature) target(creature[attacking]|mybattlefield) sacrifice!$ opponent -auto={C(0/0,-2,Loyalty)}:name(-2: Offers and conditions) activate castcard(normal named!:davriel conditions:!) and!( activate castcard(normal named!:davriel offers:!) )! +auto={C(0/0,-2,Loyalty)}:name(-2: Offers and conditions) activate castcard(copied noevent normal named!:davriel conditions:!) and!( activate castcard(copied noevent normal named!:davriel offers:!) )! auto={C(0/0,-3,Loyalty)}:name(-3: Creature perpetually gets -3/-3) target(creature) counter(-3/-3.1.PerpetualPT) text=+1: Until your next turn, whenever an opponent attacks you and/or planeswalkers you control, they discard a card. If they can’t, they sacrifice an attacking creature. -- −2: Accept one of Davriel’s offers, then accept one of Davriel’s conditions. -- −3: Target creature perpetually gets -3/-3. mana={2}{B}{B} diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index c60854b37..f02db86a0 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -324,7 +324,9 @@ class Constants HASREPLICATE = 197, ISPREY = 198, HASDISTURB = 199, - NB_BASIC_ABILITIES = 200, + DAYBOUND = 200, + NIGHTBOUND = 201, + NB_BASIC_ABILITIES = 202, RARITY_S = 'S', //Special Rarity RARITY_M = 'M', //Mythics diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index c448ff5f1..d8af723de 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -9719,7 +9719,6 @@ MTGCardInstance * AACastCard::makeCard() card = NEW MTGCardInstance(cardData, source->controller()->game); card->owner = source->controller(); card->lastController = source->controller(); - //source->controller()->game->temp->addCard(card); source->controller()->game->sideboard->addCard(card); return card; } @@ -9752,15 +9751,11 @@ int AACastCard::resolveSpell() { if(theNamedCard) { - //MTGCardInstance * copy = source->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->temp); - //copy->changeController(source->controller(),true); - Spell * spell = NEW Spell(game, -1,theNamedCard,NULL,NULL, 1); + _target = source->controller()->game->putInZone(theNamedCard, theNamedCard->currentZone, source->controller()->game->stack, noEvent); // Fixed a bug when using noevent option with namedcard option. + if(asCopy) + _target->isToken = 1; // Fixed a bug when using copied option with namedcard option. + Spell * spell = game->mLayers->stackLayer()->addSpell(_target, NULL, NULL, 1, 0); spell->resolve(); - delete spell; - - this->forceDestroy = true; - processed = true; - return 1; } else { @@ -9768,21 +9763,33 @@ int AACastCard::resolveSpell() a->oneShot = true; a->resolve(); SAFE_DELETE(a); - - this->forceDestroy = true; - processed = true; - return 1; } + if(andAbility) // Allow to use and!()! with lands. + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = _target; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } + this->forceDestroy = true; + processed = true; + return 1; } - // if(theNamedCard) { - //MTGCardInstance * copy = source->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->temp); - //copy->changeController(source->controller(),true); Spell * spell = NULL; - MTGCardInstance * copy = source->controller()->game->putInZone(theNamedCard, theNamedCard->currentZone, source->controller()->game->stack); - + MTGCardInstance * copy = source->controller()->game->putInZone(theNamedCard, theNamedCard->currentZone, source->controller()->game->stack, noEvent); // Fixed a bug when using noevent option with namedcard option. + + if(asCopy) + copy->isToken = 1; // Fixed a bug when using copied option with namedcard option. if(alternative) copy->alternateCostPaid[ManaCost::MANA_PAID_WITH_ALTERNATIVE] = 1; if(kicked > 0){ @@ -9823,6 +9830,10 @@ int AACastCard::resolveSpell() copy->castX = copy->X; } } + + if (putinplay && (copy->hasType(Subtypes::TYPE_ARTIFACT) || copy->hasType(Subtypes::TYPE_CREATURE) || copy->hasType(Subtypes::TYPE_ENCHANTMENT) || copy->hasType(Subtypes::TYPE_PLANESWALKER))) + spell->resolve(); // Fixed a crash when using and!()! with namedcard permanents. + if(andAbility) { MTGAbility * andAbilityClone = andAbility->clone(); @@ -9837,21 +9848,19 @@ int AACastCard::resolveSpell() andAbilityClone->addToGame(); } } - this->forceDestroy = true; processed = true; return 1; } - // Spell * spell = NULL; MTGCardInstance * copy = NULL; if ((normal || asNormalMadness)||(!_target->hasType(Subtypes::TYPE_INSTANT) && !_target->hasType(Subtypes::TYPE_SORCERY))) { if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); + copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield, noEvent); else - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent); + copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack, noEvent); copy->changeController(source->controller(),true); if(asNormalMadness) copy->MadnessPlay = true; @@ -9859,9 +9868,9 @@ int AACastCard::resolveSpell() else { if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER))) - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent); + copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield, noEvent); else - copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent); + copy = _target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack, noEvent); copy->changeController(source->controller(),true); } if(alternative) diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 5be87c6d4..5119a8a9a 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -230,7 +230,9 @@ const char* Constants::MTGBasicAbilities[] = { "showcontrollerhand", //controller plays with his hand revealed. "hasreplicate", //Kicker cost is a replicate cost (e.g. "Vacuumelt") "isprey", //Creature has been haunted by some other card. - "hasdisturb" //Retrace cost is a disturb cost (e.g. "Beloved Beggar") + "hasdisturb", //Retrace cost is a disturb cost (e.g. "Beloved Beggar") + "daybound", //Card has daybound (e.g. "Brutal Cathar") + "nightbound" //Card has nightbound (e.g. "Moonrage Brute") }; map Constants::MTGBasicAbilitiesMap;