More code compliance. New tests.
This commit is contained in:
42
projects/mtg/bin/Res/test/executioners_swing.txt
Normal file
42
projects/mtg/bin/Res/test/executioners_swing.txt
Normal 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]
|
||||||
42
projects/mtg/bin/Res/test/executioners_swing2.txt
Normal file
42
projects/mtg/bin/Res/test/executioners_swing2.txt
Normal 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]
|
||||||
34
projects/mtg/bin/Res/test/executioners_swing3.txt
Normal file
34
projects/mtg/bin/Res/test/executioners_swing3.txt
Normal 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]
|
||||||
@@ -1227,9 +1227,12 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
//creature dealt damage to anything
|
//creature dealt damage to anything
|
||||||
else if (attribute.find("damager") != string::npos)
|
else if (attribute.find("damager") != string::npos)
|
||||||
{
|
{
|
||||||
if (minus){
|
if (minus)
|
||||||
|
{
|
||||||
cd.CDdamager = -1;
|
cd.CDdamager = -1;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
cd.CDdamager = 1;
|
cd.CDdamager = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -486,10 +486,14 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//creature dealt damage to anything
|
//creature dealt damage to anything
|
||||||
else if (attribute.find("damager") != string::npos){
|
else if (attribute.find("damager") != string::npos)
|
||||||
if (minus){
|
{
|
||||||
|
if (minus)
|
||||||
|
{
|
||||||
cd->CDdamager = -1;
|
cd->CDdamager = -1;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
cd->CDdamager = 1;
|
cd->CDdamager = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user