Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit test for berzerk + firststrike interaction
- Loading branch information
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Tests the order of hits that results when a spearman is attacked by an ulfserker. | ||
# If first strike and berzerk interact correctly, should repeat DADADAA | ||
|
||
#define ADD_SYMBOL S | ||
{VARIABLE SEQUENCE ("$SEQUENCE|"+"{S}")} | ||
{VARIABLE_OP LEN string_length $SEQUENCE} | ||
{IF_VAR LEN equals 29 ( | ||
[then] | ||
{RETURN ({VARIABLE_CONDITIONAL SEQUENCE equals "DADADAADADADAADADADAADADADAAD"})} | ||
[/then] | ||
)} | ||
#enddef | ||
|
||
{GENERIC_UNIT_TEST "test_berzerk_firststrike" ( | ||
[event] | ||
name = attacker misses, attacker hits | ||
first_time_only=no | ||
{ADD_SYMBOL "A"} | ||
[/event] | ||
[event] | ||
name = defender misses, defender hits | ||
first_time_only=no | ||
{ADD_SYMBOL "D"} | ||
[/event] | ||
|
||
[event] | ||
name = start | ||
{VARIABLE SEQUENCE ""} | ||
{UNIT 1 "Dwarvish Ulfserker" 7 4 (hitpoints=100)} | ||
{UNIT 2 "Spearman" 8 4 (hitpoints=100)} | ||
[do_command] | ||
[attack] | ||
weapon = 0 | ||
defender_weapon = 0 | ||
[source] | ||
x,y=7,4 | ||
[/source] | ||
[destination] | ||
x,y=8,4 | ||
[/destination] | ||
[/attack] | ||
[/do_command] | ||
[/event] | ||
)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters