diff --git a/data/test/scenarios/test_berzerk_firststrike.cfg b/data/test/scenarios/test_berzerk_firststrike.cfg new file mode 100644 index 000000000000..87eea21d20ac --- /dev/null +++ b/data/test/scenarios/test_berzerk_firststrike.cfg @@ -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] +)} diff --git a/wml_test_schedule b/wml_test_schedule index 1c145408230c..7e543ebea10e 100644 --- a/wml_test_schedule +++ b/wml_test_schedule @@ -37,6 +37,7 @@ 0 move_skip_ally_sighted_yes_share_view 0 move_skip_all_sighted_yes_share_view # -# Attack calculations tests +# Attack calculations & codepath tests # 0 test_grunt_tod_damage +0 test_berzerk_firststrike