forked from wesnoth/wesnoth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add [attack_alignment] weapon special for specific attacks
Although it is possible to mimic the operation of an alignment of the unit according to the time of day in standard conditions with [damage], the use of a fixed value limits the use of this substitutes for pre-determined conditions, but in the case of deep caves or large illuminations, the absolute value is no longer 25 and the special damage continues to mimic the standard values. That's why I propose a [attack_alignment] which actually replicates the alignment for a single attack. The objective being that a unit can have attacks of alignment different from the standard alignment.
- Loading branch information
1 parent
b5805ec
commit 53e46ea
Showing
12 changed files
with
335 additions
and
9 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelog_entries/[unit_alignment]_[attack_alignment]_changelog.md
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,2 @@ | ||
### WML Engine | ||
* Add a [attack_alignment] special to change the alignment of an attack under specific conditions (terrain, leadership, etc) |
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
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
246 changes: 246 additions & 0 deletions
246
data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/special_alignment.cfg
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,246 @@ | ||
#textdomain wesnoth-test | ||
|
||
{GENERIC_UNIT_TEST "special_alignment_test" ( | ||
[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] | ||
{ABILITY_ILLUMINATES} | ||
[/abilities] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[attack_alignment] | ||
alignment=lawful | ||
[/attack_alignment] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
[/object] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[attack_alignment] | ||
alignment=chaotic | ||
[/attack_alignment] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=alice | ||
[/filter] | ||
[/object] | ||
|
||
[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] | ||
[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] | ||
[store_unit] | ||
[filter] | ||
id=alice | ||
[/filter] | ||
variable=a | ||
[/store_unit] | ||
[store_unit] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
variable=b | ||
[/store_unit] | ||
#damage without modification are 12, if test fail hitpoints = 100-12 = 88 | ||
#if succed then damage inflicted by bob are 15(lawful and illumination) and by alice 9(chaotic) | ||
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 85})} | ||
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 91})} | ||
{SUCCEED} | ||
[/event] | ||
)} | ||
|
||
{GENERIC_UNIT_TEST "special_custom_alignment_test" ( | ||
[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] | ||
{ABILITY_ILLUMINATES} | ||
[/abilities] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[attack_alignment] | ||
alignment=lawful | ||
multiply=2 | ||
[/attack_alignment] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
[/object] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[attack_alignment] | ||
alignment=chaotic | ||
[/attack_alignment] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=alice | ||
[/filter] | ||
[/object] | ||
|
||
[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] | ||
[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] | ||
[store_unit] | ||
[filter] | ||
id=alice | ||
[/filter] | ||
variable=a | ||
[/store_unit] | ||
[store_unit] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
variable=b | ||
[/store_unit] | ||
#damage without modification are 12, if test fail hitpoints = 100-12 = 88 | ||
#if succed then damage inflicted by bob are 15(lawful and illumination) and by alice 9(chaotic) | ||
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 82})} | ||
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 91})} | ||
{SUCCEED} | ||
[/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
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
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
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
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
Oops, something went wrong.