More code compliance. New tests.

This commit is contained in:
Bjørn Snoen
2013-12-21 19:31:32 +01:00
parent 60219411f6
commit 928ca3497a
5 changed files with 130 additions and 5 deletions

View File

@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged creature this turn
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Flying Men,Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
Flying Men
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing,Flying Men
inplay:Plains,Swamp
[END]

View File

@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged player
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing
inplay:Plains,Swamp
life:18
[END]

View File

@@ -0,0 +1,34 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Prove that can't target passive creature
[INIT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
manapool:{B}{W}
hand:Executioner's Swing
[DO]
# attempt to kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
hand:Executioner's Swing
manapool:{W}{B}
[END]

View File

@@ -1227,9 +1227,12 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
//creature dealt damage to anything
else if (attribute.find("damager") != string::npos)
{
if (minus){
if (minus)
{
cd.CDdamager = -1;
} else {
}
else
{
cd.CDdamager = 1;
}
}

View File

@@ -486,10 +486,14 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
}
}
//creature dealt damage to anything
else if (attribute.find("damager") != string::npos){
if (minus){
else if (attribute.find("damager") != string::npos)
{
if (minus)
{
cd->CDdamager = -1;
} else {
}
else
{
cd->CDdamager = 1;
}
}