add wmlindent in test and comment

i'm not sure to have implemented wmlindent correctly, i hope don't done error.
This commit is contained in:
newfrenchy83 2021-12-02 17:53:08 +01:00 committed by Steve Cotton
parent 0813c60142
commit 17e0c244ab
2 changed files with 99 additions and 68 deletions

View file

@ -1,30 +1,97 @@
# This unit test is used for verify the work of abilities used like weapons, but also of special_id_active attribute.
# Here, the teacher and student are the same unit
{GENERIC_UNIT_TEST "test_add_in_leadership_abilities" (
[event]
name=start
[modify_unit]
[filter]
[/filter]
max_hitpoints=100
hitpoints=100
attacks_left=1
[/modify_unit]
[object]
silent=yes
[effect]
apply_to=new_ability
[abilities]
[leadership]
id=leadership_pos
add=25
cumulative=no
affect_self=yes
[/leadership]
[attacks]
value=1
[/attacks]
[damage]
value=60
[/damage]
[chance_to_hit]
id=test_cth
value=100
[/chance_to_hit]
[/abilities]
[/effect]
[filter]
id=alice
[/filter]
[/object]
# Place Alice for fighting
{GENERIC_UNIT_TEST "test_add_or_sub_in_leadership_abilities" (
#define FILTER_BOB
[filter_student]
[filter_weapon]
type=blade
[/filter_weapon]
[/filter_student]
[filter_opponent]
race=elf
[filter_weapon]
special_id_active=test_cth #for testing if special_id_active work with abilities used like weapons
[/filter_weapon]
[/filter_opponent]
#enddef
#define FILTER_ALICE
[filter_student]
[filter_weapon]
type=blade,pierce
[/filter_weapon]
[/filter_student]
[filter_opponent]
race=orc
[/filter_opponent]
#enddef
[store_unit]
[filter]
id=alice
[/filter]
variable=a
kill=yes
[/store_unit]
[store_unit]
[filter]
id=bob
[/filter]
variable=b
[/store_unit]
[unstore_unit]
variable=a
find_vacant=yes
x,y=$b.x,$b.y
[/unstore_unit]
# Fight
[store_unit]
[filter]
id=alice
[/filter]
variable=a
[/store_unit]
[do_command]
[attack]
weapon=0
defender_weapon=0
[source]
x,y=$a.x,$a.y
[/source]
[destination]
x,y=$b.x,$b.y
[/destination]
[/attack]
[/do_command]
# Check results
[store_unit]
[filter]
id=bob
[/filter]
variable=b
[/store_unit]}
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 25})}
{SUCCEED}
[/event]
)}
# wmlindent: opener "{GENERIC_UNIT_TEST "
# wmlindent: closer ")}"
{GENERIC_UNIT_TEST "test_sub_in_leadership_abilities" (
[event]
name=start
[modify_unit]
@ -47,15 +114,12 @@
[/leadership]
[attacks]
value=1
{FILTER_BOB}
[/attacks]
[damage]
value=60
{FILTER_BOB}
[/damage]
[chance_to_hit]
value=100
{FILTER_BOB}
[/chance_to_hit]
[/abilities]
[/effect]
@ -63,36 +127,8 @@
id=bob
[/filter]
[/object]
[object]
silent=yes
[effect]
apply_to=new_ability
[abilities]
[leadership]
id=leadership_pos
add=25
cumulative=no
affect_self=yes
[/leadership]
[attacks]
value=1
{FILTER_ALICE}
[/attacks]
[damage]
value=60
{FILTER_ALICE}
[/damage]
[chance_to_hit]
id=test_cth
value=100
{FILTER_ALICE}
[/chance_to_hit]
[/abilities]
[/effect]
[filter]
id=alice
[/filter]
[/object]
# Place Alice for fighting
[store_unit]
[filter]
@ -112,6 +148,7 @@
find_vacant=yes
x,y=$b.x,$b.y
[/unstore_unit]
# Fight
[store_unit]
[filter]
id=alice
@ -131,23 +168,16 @@
[/destination]
[/attack]
[/do_command]
# Check results
[store_unit]
[filter]
id=alice
[/filter]
variable=a
[/store_unit]
[store_unit]
[filter]
id=bob
[/filter]
variable=b
[/store_unit]
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 70})}
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 25})}
{SUCCEED}
[/event]
)}
#undef FILTER_BOB
#undef FILTER_ALICE
# wmlindent: opener "{GENERIC_UNIT_TEST "
# wmlindent: closer ")}"

View file

@ -265,7 +265,8 @@
0 swarm_disables_upgrades_with_abilities_adjacent_fail
0 swarm_disables_upgrades_with_abilities_adjacent_leadership
0 swarm_disables_upgrades_with_abilities_adjacent_leadership_fail
0 test_add_or_sub_in_leadership_abilities
0 test_add_in_leadership_abilities
0 test_sub_in_leadership_abilities
0 unslowable_status_test
0 unpetrifiable_status_test
0 test_force_chance_to_hit_macro