diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 0cb08fca5..a6cdadcc6 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -10,6 +10,7 @@ generic/hybrid_mana_3.txt generic/legendary.txt generic/persist.txt generic/persist2.txt +generic/sacrifice.txt generic/wither.txt ######################## #Specific Cards @@ -72,6 +73,7 @@ shivan_hellkite.txt shock.txt spark_elemental.txt stasis.txt +sword_to_plowshares.txt terror.txt volcanic_island.txt white_knight1.txt diff --git a/projects/mtg/bin/Res/test/generic/sacrifice.txt b/projects/mtg/bin/Res/test/generic/sacrifice.txt new file mode 100644 index 000000000..10ca77691 --- /dev/null +++ b/projects/mtg/bin/Res/test/generic/sacrifice.txt @@ -0,0 +1,29 @@ +#Bug: Creatures with shroud(e.g. Inkwell Leviathan(CFX)) can't be sacrificed by others(e.g. Nantuko Husk(10E)) +# text=Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. (Nantuko Husk 2/2) +[INIT] +COMBATBEGIN +[PLAYER1] +inplay:154081,129653 +[PLAYER2] +[DO] +129653 +154081 +next +#attackers +129653 +choice 0 +next +#blockers +next +#damages +next +#endofcombat +[ASSERT] +COMBATEND +[PLAYER1] +life:20 +graveyard:154081 +inplay:129653 +[PLAYER2] +life:16 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/sword_to_plowshares.txt b/projects/mtg/bin/Res/test/sword_to_plowshares.txt new file mode 100644 index 000000000..16fda5125 --- /dev/null +++ b/projects/mtg/bin/Res/test/sword_to_plowshares.txt @@ -0,0 +1,20 @@ +#Bug : removing a persisting creature from the game causes a crahs (swords to plowshares + creature with persist) +# sword to plowshares : 1367 +[INIT] +FIRSTMAIN +[PLAYER1] +hand:1367 +manapool:{W} +[PLAYER2] +inplay:141935 +[DO] +1367 +141935 +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:1367 +manapool:{0} +[PLAYER2] +life:23 +[END] \ No newline at end of file diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index deddcc220..e3def6518 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -15,11 +15,13 @@ int ExtraCost::setSource(MTGCardInstance * _source){ } SacrificeCost::SacrificeCost(TargetChooser *_tc):ExtraCost(_tc){ + if (tc) tc->source = NULL; //Sacrificing is not targetting, protections do not apply target = NULL; } int SacrificeCost::setSource(MTGCardInstance * card){ ExtraCost::setSource(card); + if (tc) tc->source = NULL; //Sacrificing is not targetting, protections do not apply if (!tc) target = card; return 1; }