Skip to content

Commit

Permalink
Make the effects of the trickery and doom weapon specialls halve ever…
Browse files Browse the repository at this point in the history
…y turn
  • Loading branch information
Dugy committed Jun 6, 2024
1 parent 35b8fab commit 037e43e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 52 deletions.
10 changes: 10 additions & 0 deletions lua/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1195,3 +1195,13 @@ function wesnoth.wml_actions.set_resolve_intensity(cfg)
end
set_buildup_ability_intensity(cfg, "[set_resolve_intensity]", "resistance", "latent_resolve", get_resolve_intensity, generate_resolve_ability)
end

function wesnoth.wml_actions.set_elusiveness_intensity(cfg)
local function get_elusiveness_intensity(ability)
return ability.sub
end
local function generate_elusiveness_ability(intensity)
return { "chance_to_hit", { id = "latent_elusiveness", apply_to = "opponent", sub = intensity }}
end
set_buildup_ability_intensity(cfg, "[set_elusiveness_intensity]", "chance_to_hit", "latent_elusiveness", get_elusiveness_intensity, generate_elusiveness_ability)
end
4 changes: 2 additions & 2 deletions utils/abilities.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1615,14 +1615,14 @@ Enemy units cannot see this unit during dawn or dusk, except if they have units
[dummy]
id=trickery
name= _ "trickery"
description= _ "If this attack hits offensively, opponent's defence on all terrains is lowered by 5%, until he advances."
description= _ "If this attack hits offensively, opponent's defence on all terrains is lowered by 5%. This decrease halves every turn."
[/dummy]
#enddef
#define WEAPON_SPECIAL_DOOM
[dummy]
id=doom
name= _ "doom"
description= _ "If this attack hits offensively, opponent's resistances will drop by 5% until he advances."
description= _ "If this attack hits offensively, opponent's resistances will drop by 5%. This decrease halves every turn."
[/dummy]
#enddef
#define WEAPON_SPECIAL_CONE
Expand Down
77 changes: 27 additions & 50 deletions utils/abilities_events.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3660,35 +3660,10 @@
[filter_attack]
special_id=trickery
[/filter_attack]
[object]
silent=yes
duration=forever
sort=potion_like
remove_on_heal=yes
[filter]
x,y=$x2,$y2
[/filter]
[effect]
apply_to=defense
replace=false
[defense]
frozen=5
castle=5
sand=5
village=5
flat=5
hills=5
mountains=5
swamp_water=5
cave=5
shallow_water=5
reef=5
forest=5
fungus=5
unwalkable=5
[/defense]
[/effect]
[/object]
[set_elusiveness_intensity]
id=$second_unit.id
sub=5
[/set_elusiveness_intensity]
[floating_text]
x,y=$x2,$y2
text="<span color='red'>" + _ "-5% defence" + "</span>"
Expand All @@ -3700,27 +3675,10 @@
[filter_attack]
special_id=doom
[/filter_attack]
[object]
silent=yes
duration=forever
sort=potion_like
remove_on_heal=yes
[filter]
x,y=$x2,$y2
[/filter]
[effect]
apply_to=resistance
replace=false
[resistance]
fire=5
cold=5
arcane=5
impact=5
blade=5
pierce=5
[/resistance]
[/effect]
[/object]
[set_resolve_intensity]
id=$second_unit.id
sub=5
[/set_resolve_intensity]
[floating_text]
x,y=$x2,$y2
text="<span color='red'>" + _ "-5% all resistances" + "</span>"
Expand Down Expand Up @@ -6109,6 +6067,25 @@
[/do]
[/for]
{CLEAR_VARIABLE resolve}

[store_unit]
[filter]
side=$side_number
ability=latent_elusiveness
[/filter]
variable=elusive
[/store_unit]
[for]
array=elusive
variable=h
[do]
[set_elusiveness_intensity]
id=$elusive[$h].id
div=2
[/set_elusiveness_intensity]
[/do]
[/for]
{CLEAR_VARIABLE elusive}
[/event]

[event]
Expand Down

0 comments on commit 037e43e

Please sign in to comment.