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 a 'type' and 'added_type' attribute in [damage] special or abilit…
…y who modify the type of attack used At the suggestion of @stevecotton, I propose a special 'type' and 'added_type' attribute capable of modifying the type of attack used when the conditions are met.
- Loading branch information
1 parent
29777d3
commit 5ecaf34
Showing
14 changed files
with
444 additions
and
22 deletions.
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,2 @@ | ||
### WML Engine | ||
* Add a 'type' and 'added_type' attribute to [damage] to change the type of attack under specific conditions (terrain, time of day, 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
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
287 changes: 287 additions & 0 deletions
287
data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/special_damage_type.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,287 @@ | ||
|
||
{GENERIC_UNIT_TEST "damage_type_test" ( | ||
[event] | ||
name=start | ||
[modify_unit] | ||
[filter] | ||
[/filter] | ||
max_hitpoints=100 | ||
hitpoints=100 | ||
attacks_left=1 | ||
[/modify_unit] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=resistance | ||
replace=yes | ||
[resistance] | ||
arcane=50 | ||
fire=200 | ||
[/resistance] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[damage] | ||
type=fire | ||
[/damage] | ||
[damage] | ||
type=cold | ||
[/damage] | ||
[damage] | ||
type=cold | ||
[/damage] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
[/object] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=resistance | ||
replace=yes | ||
[resistance] | ||
cold=200 | ||
fire=50 | ||
[/resistance] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[damage] | ||
type=cold | ||
[/damage] | ||
[damage] | ||
type=arcane | ||
[/damage] | ||
[damage] | ||
type=arcane | ||
[/damage] | ||
[damage] | ||
type=fire | ||
[/damage] | ||
[damage] | ||
type=fire | ||
[/damage] | ||
[damage] | ||
type=fire | ||
[/damage] | ||
[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 !=76 | ||
#if succed then damage by alice 24(bob vulnerable to fire and fire prioritized) | ||
#if succed then damage by bob 24(alice vulnerable to cold, cold priority is 1) | ||
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 76})} | ||
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 76})} | ||
{SUCCEED} | ||
[/event] | ||
)} | ||
|
||
{GENERIC_UNIT_TEST "damage_secondary_type_test" ( | ||
[event] | ||
name=start | ||
[modify_unit] | ||
[filter] | ||
[/filter] | ||
max_hitpoints=100 | ||
hitpoints=100 | ||
attacks_left=1 | ||
[/modify_unit] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=resistance | ||
replace=yes | ||
[resistance] | ||
blade=200 | ||
fire=100 | ||
[/resistance] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[damage] | ||
added_type=cold | ||
[/damage] | ||
[chance_to_hit] | ||
value=100 | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
[/object] | ||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=resistance | ||
replace=yes | ||
[resistance] | ||
cold=200 | ||
blade=100 | ||
[/resistance] | ||
[/effect] | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
mode=append | ||
[attacks] | ||
value=1 | ||
[/attacks] | ||
[damage] | ||
value=12 | ||
[/damage] | ||
[damage] | ||
added_type=fire | ||
[/damage] | ||
[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 !=76 | ||
#if succed then damage by alice 24(bob more vulnerable to blade) | ||
#if succed then damage by bob 24(alice vulnerable to cold, cold [damage] is used) | ||
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 76})} | ||
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 76})} | ||
{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
Oops, something went wrong.