diff --git a/projects/mtg/bin/Res/sets/EVE/_cards.dat b/projects/mtg/bin/Res/sets/EVE/_cards.dat index 60af67b7d..5a3142540 100644 --- a/projects/mtg/bin/Res/sets/EVE/_cards.dat +++ b/projects/mtg/bin/Res/sets/EVE/_cards.dat @@ -243,6 +243,19 @@ subtype=Hag toughness=1 [/card] [card] +text=Flying Attacking creatures you control get +2/+0. +auto=lord(creature[attacking]|myinplay) 2/0 includeself +abilities=flying +id=154258 +name=Nobilis of War +rarity=R +type=Creature +mana={RW}{RW}{RW}{RW}{RW} +power=3 +subtype=Spirit Avatar +toughness=4 +[/card] +[card] text={1}{BG}: Regenerate Odious Trow. auto={1}{BG}:regenerate id=150977 @@ -302,6 +315,19 @@ rarity=R type=Land [/card] [card] +text={1}, Sacrifice a Scarecrow: Draw a card. {4}, {T}: Return target artifact creature card from your graveyard to play. +auto={1}{S(scarecrow|myinplay)}:draw:1 +auto={4}{T}:moveTo(myinplay) target(artifact|mygraveyard) +id=157979 +name=Scarecrone +rarity=R +type=Artifact Creature +mana={3} +power=1 +subtype=Scarecrow +toughness=2 +[/card] +[card] text={3}: Target blue creature gains shroud until end of turn. auto={3}:shroud target(creature[blue]) id=158297 @@ -427,6 +453,17 @@ subtype=Elf Warrior toughness=1 [/card] [card] +target=creature +text=Remove target creature from the game. +target=creature +auto=moveTo(removedfromGame) +id=151083 +name=Unmake +rarity=C +type=Instant +mana={WB}{WB}{WB} +[/card] +[card] text={T}: Target red or green creature gets -2/-0 until end of turn. auto={T}:-2/0 target(creature[red]) id=153476 diff --git a/projects/mtg/bin/Res/sets/EVE/todo.dat b/projects/mtg/bin/Res/sets/EVE/todo.dat index 6d7f61fa8..05db6697a 100644 --- a/projects/mtg/bin/Res/sets/EVE/todo.dat +++ b/projects/mtg/bin/Res/sets/EVE/todo.dat @@ -864,18 +864,7 @@ power=2 subtype=Shapeshifter toughness=1 [/card] -[card] -text=Flying Attacking creatures you control get +2/+0. -abilities=flying -id=154258 -name=Nobilis of War -rarity=R -type=Creature -mana={RW}{RW}{RW}{RW}{RW} -power=3 -subtype=Spirit Avatar -toughness=4 -[/card] + [card] text=Noggle Bandit can't be blocked except by creatures with defender. id=157286 @@ -1124,19 +1113,7 @@ rarity=U type=Sorcery mana={3}{G}{G} [/card] -[card] -text={1}, Sacrifice a Scarecrow: Draw a card. {4}, {T}: Return target artifact creature card from your graveyard to play. -auto={1}{S(scarecrow|myinplay)}:draw:1 -auto={4}{T}:moveTo(myinplay) target(artifact|mygraveyard) -id=157979 -name=Scarecrone -rarity=R -type=Artifact Creature -mana={3} -power=1 -subtype=Scarecrow -toughness=2 -[/card] + [card] text=Enchant creature As long as enchanted creature is red, it gets +1/+1 and has "{RW}: This creature gets +1/+0 until end of turn." As long as enchanted creature is white, it gets +1/+1 and has lifelink. (Whenever it deals damage, its controller gains that much life.) target=creature @@ -1382,15 +1359,7 @@ power=* subtype=Elemental toughness=* [/card] -[card] -target=creature -text=Remove target creature from the game. -id=151083 -name=Unmake -rarity=C -type=Instant -mana={WB}{WB}{WB} -[/card] + [card] text=Creatures your opponents control get -1/-0 until end of turn if {U} was spent to play Unnerving Assault, and creatures you control get +1/+0 until end of turn if {R} was spent to play it. (Do both if {U}{R} was spent.) id=157416 diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index d93e636b5..0cb08fca5 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -9,6 +9,7 @@ generic/hybrid_mana_2.txt generic/hybrid_mana_3.txt generic/legendary.txt generic/persist.txt +generic/persist2.txt generic/wither.txt ######################## #Specific Cards @@ -22,6 +23,7 @@ ankh_of_mishra.txt ardakar_wastes.txt ascendant_evincar.txt ascendant_evincar2.txt +ascendant_evincar3.txt bottle_gnomes.txt boggart_arsonists.txt brass_man.txt diff --git a/projects/mtg/bin/Res/test/animate_dead3.txt b/projects/mtg/bin/Res/test/animate_dead3.txt new file mode 100644 index 000000000..59971c990 --- /dev/null +++ b/projects/mtg/bin/Res/test/animate_dead3.txt @@ -0,0 +1,22 @@ +#Testing Animate dead on a fire elemental in opponent's graveyard, then testing if removing the enchantment removes the card +[INIT] +FIRSTMAIN +[PLAYER1] +hand:1143,1343 +manapool:{B}{R}{W}{W} +[PLAYER2] +graveyard:1290 +[DO] +1143 +1290 +1343 +1143 +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:1143,1343 +manapool:{0} +life:20 +[PLAYER2] +graveyard:1290 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/ascendant_evincar3.txt b/projects/mtg/bin/Res/test/ascendant_evincar3.txt new file mode 100644 index 000000000..118bb6370 --- /dev/null +++ b/projects/mtg/bin/Res/test/ascendant_evincar3.txt @@ -0,0 +1,21 @@ +#Testing That Ascendant Evincar gives +1/+1 to black creatures +[INIT] +COMBATATTACKERS +[PLAYER1] +inplay:106525,185142 +[PLAYER2] +[DO] +185142 +next +#blockers +next +#damage +next +#end +[ASSERT] +COMBATEND +[PLAYER1] +inplay:106525,185142 +[PLAYER2] +life:17 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/generic/persist2.txt b/projects/mtg/bin/Res/test/generic/persist2.txt new file mode 100644 index 000000000..b8e01815c --- /dev/null +++ b/projects/mtg/bin/Res/test/generic/persist2.txt @@ -0,0 +1,65 @@ +#Testing Persist +#bug : persist works strange, the creature gets -1/-1 after it is killed, then back to play +#for the second time it be destroyed, it remain in a -1/-1 state even in the graveyard or back +#to hand by raise dead +[INIT] +FIRSTMAIN +[PLAYER1] +hand: 1303,129732 +manapool:{R}{R} +[PLAYER2] +inplay:152096,1375,1397,1396,1395,1391,1390 +hand:1174 +[DO] +1303 +152096 +129732 +152096 +eot +#untap 2 +next +#upkeep 2 +next +#draw2 +next +#main2 +1375 +1174 +152096 +1390 +1391 +1395 +1396 +1397 +152096 +eot +eot +#untap 2 +next +#upkeep 2 +next +#draw2 +next +#main2 +next +#comba begins 2 +next +#attackers +152096 +next +#blockers +next +#damages +next +#endofcombat +[ASSERT] +COMBATEND +[PLAYER1] +life:18 +graveyard:1303,129732 +manapool:{0} +[PLAYER2] +inplay:1375,1397,1396,1395,1391,1390,152096 +graveyard:1174 +life:20 +[END] \ No newline at end of file diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index 069100fa3..9dd6b998d 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -1,5 +1,6 @@ #include "../include/config.h" #include "../include/CardDescriptor.h" +#include "../include/Subtypes.h" CardDescriptor::CardDescriptor(): MTGCardInstance(){ init(); @@ -16,7 +17,7 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card){ int found = 1; for (int i = 0; i< nb_types; i++){ found = 0; - if (card->hasSubtype(types[i])){ + if (card->hasSubtype(types[i]) || (card->name.compare(Subtypes::subtypesList->find(types[i])) == 0)){ found = 1; break; } @@ -31,6 +32,13 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card){ break; } } + else if (colors[i] == -1){ + found = 0; + if(!card->hasColor(i)){ + found = 1; + break; + } + } } if (!found) return NULL; return card; @@ -40,12 +48,14 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card){ MTGCardInstance * match = card; for (int i = 0; i< nb_types; i++){ - if (!card->hasSubtype(types[i])){ + if (!card->hasSubtype(types[i]) && !(card->name.compare(Subtypes::subtypesList->find(types[i])) == 0)){ match = NULL; } } for (int i = 0; i< Constants::MTG_NB_COLORS; i++){ if ((colors[i] == 1 && !card->hasColor(i))||(colors[i] == -1 && card->hasColor(i))){ +OutputDebugString ("Too bad for "); +OutputDebugString(card->getName()); match = NULL; } }