diff --git a/projects/mtg/bin/Res/rules/Blitzkrieg.txt b/projects/mtg/bin/Res/rules/Blitzkrieg.txt index d1fba4593..7e534542e 100644 --- a/projects/mtg/bin/Res/rules/Blitzkrieg.txt +++ b/projects/mtg/bin/Res/rules/Blitzkrieg.txt @@ -3,6 +3,7 @@ unlock=prx_geirkztilb [INIT] mode=mtg +#MTG Game specific rules auto=bonusrule auto=putinplayrule auto=kickerrule @@ -47,4 +48,22 @@ auto=lord(Plains|MyBattlefield) {T}:Add{W} auto=lord(Island|MyBattlefield) {T}:Add{U} auto=lord(Swamp|MyBattlefield) {T}:Add{B} auto=lord(Mountain|MyBattlefield) {T}:Add{R} -auto=lord(Forest|MyBattlefield) {T}:Add{G}MyBattlefield) {T}:Add{G} \ No newline at end of file +auto=lord(Forest|MyBattlefield) {T}:Add{G} + + +#Mana Empties from manapool at the end of each phase +auto=@each untap:removeMana(*) +auto=@each upkeep:removeMana(*) +auto=@each draw:removeMana(*) +auto=@each firstmain:removeMana(*) +auto=@each combatbegins:removeMana(*) +auto=@each attackers:removeMana(*) +auto=@each blockers:removeMana(*) +auto=@each combatdamage:removeMana(*) +auto=@each combatEnds:removeMana(*) +auto=@each secondmain:removeMana(*) +auto=@each end:removeMana(*) +auto=@each cleanup:removeMana(*) + +#reset Creature damage at the cleanup phase +auto=@each cleanup:all(*|myBattlefield) resetDamage \ No newline at end of file diff --git a/projects/mtg/bin/Res/rules/hermit.txt b/projects/mtg/bin/Res/rules/hermit.txt index 64b0425ab..ab454866d 100644 --- a/projects/mtg/bin/Res/rules/hermit.txt +++ b/projects/mtg/bin/Res/rules/hermit.txt @@ -17,6 +17,8 @@ auto=blockrule auto=combattriggerrule auto=legendrule auto=planeswalkerrule +auto=planeswalkerdamage +auto=planeswalkerattack auto=tokencleanuprule auto=persistrule auto=vampirerule diff --git a/projects/mtg/bin/Res/sets/primitives/_macros.txt b/projects/mtg/bin/Res/sets/primitives/_macros.txt index f6b9701b9..ec9a18def 100644 --- a/projects/mtg/bin/Res/sets/primitives/_macros.txt +++ b/projects/mtg/bin/Res/sets/primitives/_macros.txt @@ -3,6 +3,8 @@ # Macro names are case insensitive, and the replacement algorithm does an exact match inside a string # it means that if you have a macro named MACRO and a macro named MACRO2, you'll run into trouble because MACRO2 will match MACRO # Because of that, you need to use a unique delimiter at the beginning and the end of a macro, I personally use "__" +# +# Limitations: parameter inside macro must not contian ")" # Standard Cycling #AUTO_DEFINE __CYCLING__($cost) $cost{cycle}:name(cycling) draw:1 diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index fd51f6571..b11841b60 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -25508,7 +25508,7 @@ toughness=2 [card] name=Edge of Autumn auto=if type(land|mybattlefield)~lessthan~5 then target(land[basic]|mybattlefield) moveTo(mybattlefield) -autohand=__CYCLING__({S(land|mybattlefield)}) +autohand={S(land|mybattlefield)}{cycle}:name(cycling) draw:1 text=If you control four or fewer lands, search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. -- Cycling - Sacrifice a land. (Sacrifice a land, Discard this card: Draw a card.) mana={1}{G} type=Sorcery @@ -49596,8 +49596,9 @@ toughness=2 [/card] [card] name=Lavalanche -auto=choice name(deal X damage to opponent and to each creature he controls) damage:X opponent && damage:X all(creature|opponentbattlefield) -auto=choice name(deal X damage to you and to each creature you control) damage:X controller && damage:X all(creature|mybattlefield) +target=player +auto=damage:X +auto=damage:X all(creature|targetedpersonsbattlefield) text=Lavalanche deals X damage to target player and each creature he or she controls. mana={X}{B}{R}{G} type=Sorcery @@ -56176,7 +56177,7 @@ toughness=4 name=Mirrorworks auto=@movedto(other artifact[-token]|mybattlefield):all(trigger[to]) pay[[{2}]] clone text=Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield. -mana={4} +mana={5} type=Artifact [/card] [card] diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 97d7a55e5..2f9efbfe0 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -609,6 +609,7 @@ SPIRITLINK_keyword#1.txt SPIRITLINK_keyword#2.txt SPIRITLINK_keyword#3.txt spitting_earth.txt +spitting_image.txt spoils_of_evil.txt spore_frog.txt stacking_flanking.txt diff --git a/projects/mtg/bin/Res/test/spitting_image.txt b/projects/mtg/bin/Res/test/spitting_image.txt new file mode 100644 index 000000000..712f36cd8 --- /dev/null +++ b/projects/mtg/bin/Res/test/spitting_image.txt @@ -0,0 +1,22 @@ +# Checking that casting spitting image doesnot trigger +# "when nontoken creatures enters battlefield" effects +# as there was issue about it +[INIT] +FIRSTMAIN +[PLAYER1] +manapool:{4}{U}{U} +inplay:grizzly bears,Genesis Chamber +hand:Spitting Image +library:mountain +[PLAYER2] +[DO] +Spitting Image +grizzly bears +[ASSERT] +FIRSTMAIN +[PLAYER1] +manapool{0} +inplay:grizzly bears,Genesis Chamber,grizzly bears +library:mountain +graveyard:Spitting Image +[END] diff --git a/projects/mtg/include/TestSuiteAI.h b/projects/mtg/include/TestSuiteAI.h index 13a925d23..6278de8ac 100644 --- a/projects/mtg/include/TestSuiteAI.h +++ b/projects/mtg/include/TestSuiteAI.h @@ -9,6 +9,7 @@ #include "Threading.h" #include "AIPlayerBaka.h" + class TestSuiteActions { public: diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 0f10f8ead..277bab170 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -2459,7 +2459,8 @@ int AACloner::resolve() if (!_target) return 0; - MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardByName(_target->name)); + // Use id of the card to have the same image as the original + MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardById(_target->getId())); Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller(); @@ -2467,8 +2468,8 @@ int AACloner::resolve() targetPlayer->game->temp->addCard(myClone); Spell * spell = NEW Spell(game, myClone); - spell->resolve(); spell->source->isToken = 1; + spell->resolve(); spell->source->fresh = 1; spell->source->model = spell->source; spell->source->model->data = spell->source;