simplify utbs daze ability code.

uses te new feature: abilities used like specials.

09_Blood_is_Thicker_Than_Water, the quenoth elf are in civil war, and unit dazed can be in last scenarios, for avoid have heavy savegame files, i prefer what [object] duration limited to scenario and no forever.
This commit is contained in:
newfrenchy83 2020-01-12 23:18:36 +01:00 committed by gfgtdf
parent 10f94c4aa9
commit 782a5ceda9

View file

@ -242,162 +242,6 @@ Marksman attacks are only affected if the chance to hit is greater than 60%."
#enddef
#define WEAPON_SPECIAL_DAZE_EVENTS
[event]
id=weapon_special_daze_event_1
name=unit placed
first_time_only=no
[filter]
[not]
[has_attack]
special_id=enemy_dazed
[/has_attack]
[/not]
[/filter]
[object]
silent=yes
[filter]
x,y=$x1,$y1
[/filter]
[effect]
apply_to=attack
[not]
special_id=magical
[/not]
[not]
special_id=marksman
[/not]
[not]
special_id=enemy_dazed
[/not]
[set_specials]
mode=append
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[and]
special_type=poison
[/and]
[not]
special_id=enemy_dazed
[/not]
# Note: instead of simply appending, we have to use replace and
# put marksman last because the +10% from daze must be applied
# first; the other way around, the base value would already be
# potentially modified by marksman
[set_specials]
mode=replace
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
active_on=offense
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
{WEAPON_SPECIAL_POISON}
[chance_to_hit]
id=enemy_dazed_marksman_defense
name=""
description=""
add=10
active_on=defense
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[not]
special_type=poison
[/not]
[not]
special_id=enemy_dazed
[/not]
# Note: instead of simply appending, we have to use replace and
# put marksman last because the +10% from daze must be applied
# first; the other way around, the base value would already be
# potentially modified by marksman
[set_specials]
mode=replace
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
active_on=offense
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
[chance_to_hit]
id=enemy_dazed_marksman_defense
name=""
description=""
add=10
active_on=defense
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[/object]
[/event]
[event]
id=weapon_special_daze_event_2
name=attacker hits
@ -429,135 +273,105 @@ Marksman attacks are only affected if the chance to hit is greater than 60%."
[object]
silent=yes
duration=scenario
[filter]
x,y=$x2,$y2
[not]
ability=self_dazed
[/not]
[/filter]
[effect]
apply_to=attack
[not]
special_id=magical
[/not]
[not]
special_id=marksman
[/not]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=append
apply_to=new_ability
[abilities]
[chance_to_hit]
id=self_dazed
id=enemy_dazed
name=""
description=""
sub=10
[filter_self]
add=10
apply_to=opponent
[filter_student]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/filter_student]
[filter_opponent]
[filter_weapon]
[not]
special_id=magical
[/not]
[not]
special_id_active=marksman
[/not]
[/filter_weapon]
[/filter_opponent]
[/chance_to_hit]
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
apply_to=opponent
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
[filter_student]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_student]
[filter_opponent]
[filter_weapon]
special_id_active=marksman
[/filter_weapon]
[/filter_opponent]
[/chance_to_hit]
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
[filter_student]
[filter_weapon]
[not]
special_id=magical
[/not]
[not]
special_id_active=marksman
[/not]
[/filter_weapon]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_student]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[and]
special_type=poison
[/and]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=replace
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
active_on=offense
[filter_base_value]
greater_than_equal_to=70
[/filter_base_value]
[filter_self]
[filter_student]
[filter_weapon]
special_id_active=marksman
[/filter_weapon]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/filter_student]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
{WEAPON_SPECIAL_POISON}
[chance_to_hit]
id=self_dazed_marksman_defense
name=""
description=""
sub=10
active_on=defense
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[not]
special_type=poison
[/not]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=replace
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
active_on=offense
[filter_base_value]
greater_than_equal_to=70
[/filter_base_value]
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
[chance_to_hit]
id=self_dazed_marksman_defense
name=""
description=""
sub=10
active_on=defense
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
[/set_specials]
[/abilities]
[/effect]
[/object]
[/event]