Skip to content

Commit

Permalink
add overlay_image_self to leadership abilities except some case.
Browse files Browse the repository at this point in the history
the 'alliance' leadership  and [leadership]with malus don't have new attribute
  • Loading branch information
newfrenchy83 committed Oct 23, 2023
1 parent 2fafb30 commit 99e4e18
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 26 deletions.
12 changes: 0 additions & 12 deletions lua/stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,18 +629,6 @@ function wesnoth.update_stats(original)
if sorts_owned.amulet or sorts_owned.ring or sorts_owned.cloak or sorts_owned.limited then
table.insert(new_overlays, "misc/orb-overlay.png")
end
local has_leadership_item = false
for _, eff in loti.unit.effects(remade) do
if eff.apply_to == "new_ability" then
local abilities = wml.get_child(eff, "abilities")
if abilities and wml.get_child(abilities, "leadership") then
has_leadership_item = true
end
end
end
if has_leadership_item then
table.insert(new_overlays, "misc/fist-overlay.png")
end
local overlays_object = { "object", { visual_provider = true, { "effect", { apply_to = "overlay", add = table.concat(new_overlays, ",")}}}}
table.insert(visible_modifications, overlays_object)

Expand Down
2 changes: 1 addition & 1 deletion units/Argan_lich.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Advancements with crossbow add great precision."
image="portraits/humans/marshal.png"
[/portrait]
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
{ABILITY_SOUL_EATER}
{ABILITY_REGENERATES}
{ABILITY_SUBMERGE}
Expand Down
4 changes: 2 additions & 2 deletions units/Duke.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
impact=75
[/resistance]
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
{ABILITY_CHARGE_LEADERSHIP}
[/abilities]
[attack]
Expand Down Expand Up @@ -237,7 +237,7 @@
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[/effect]
[effect]
Expand Down
4 changes: 2 additions & 2 deletions units/Elvish_Warlord.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
image="portraits/elves/captain.png"
[/portrait]
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
{ABILITY_MARKSMAN_LEADERSHIP}
[/abilities]
[attack]
Expand Down Expand Up @@ -318,7 +318,7 @@
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[/effect]
[effect]
Expand Down
2 changes: 1 addition & 1 deletion units/Fire_Dragon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
image="units/enemies/fire-dragon.png"
{DEFENSE_ANIM_RANGE "units/monsters/fire-dragon.png" "units/monsters/fire-dragon.png" {SOUND_LIST:DRAKE_HIT} melee}
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
hitpoints=101
movement_type=drakefly
Expand Down
4 changes: 2 additions & 2 deletions units/Goblin_Warbaner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
die_sound={SOUND_LIST:GOBLIN_DIE}
{DEFENSE_ANIM "units/orcs/goblinwarbanner.png" "units/orcs/goblinwarbanner.png" {SOUND_LIST:GOBLIN_HIT} }
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[portrait]
size=400
Expand Down Expand Up @@ -323,7 +323,7 @@
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[/effect]
[effect]
Expand Down
4 changes: 2 additions & 2 deletions units/Infernal_Knight.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
description= _ "Tales are told of the mightiest warriors and generals, who, cursed with hate and stung by betrayal, have experimented with demonic magic and returned back to this world as Infernal Knights. Wielding the same weapons as in life, they command both fire and the Undead in their quest for revenge."
die_sound=lich-die.ogg
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
{ABILITY_SUBMERGE}
[/abilities]
[portrait]
Expand Down Expand Up @@ -300,7 +300,7 @@
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[/effect]
[effect]
Expand Down
4 changes: 2 additions & 2 deletions units/Lich_King.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
description= _ "Lich Kings are powerful undead warriors with free will and magic powers. Unlike other undead, they are not obeying a master, they are raising and controlling their minions, and unlike liches, they are leading their minions into battles."
die_sound=lich-die.ogg
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
{ABILITY_SUBMERGE}
[/abilities]
[portrait]
Expand Down Expand Up @@ -387,7 +387,7 @@
[effect]
apply_to=remove_ability
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[/effect]
[effect]
Expand Down
2 changes: 1 addition & 1 deletion units/The_Prince.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
arcane=60
[/resistance]
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
#textdomain wesnoth-units
[attack]
Expand Down
2 changes: 1 addition & 1 deletion units/corruption.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
[/portrait]
{DEFENSE_ANIM "units/elves-wood/captain-defend.png" "units/elves-wood/captain.png" {SOUND_LIST:ELF_HIT}}
[abilities]
{ABILITY_LEADERSHIP}
{ABILITY_LEADERSHIP_LOTI}
[/abilities]
[attack]
name=sword
Expand Down
26 changes: 26 additions & 0 deletions utils/abilities.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
#textdomain wesnoth-help

#define ABILITY_LEADERSHIP_LOTI
# same what mainline but with overlay_image_self attribute
[leadership]
id=leadership
value="(25 * (level - other.level))"
cumulative=no
name= _ "leadership"
female_name= _ "female^leadership"
description= _ "This unit can lead other troops in battle.
All adjacent lower-level units from the same side deal 25% more damage for each difference in level."
special_note={INTERNAL:SPECIAL_NOTES_LEADERSHIP}
affect_self=no
overlay_image_self="misc/fist-overlay.png"
[affect_adjacent]
[filter]
formula="level < other.level"
[/filter]
[/affect_adjacent]
[/leadership]
#enddef

#textdomain wesnoth-loti
#define WEAPON_SPECIAL_PLAGUE_TYPE_LOTI TYPE LANGUAGE_TYPE
[plague]
Expand Down Expand Up @@ -561,6 +585,7 @@ Enemy units cannot see this unit during dawn or dusk, except if they have units
female_name={NAME}+_" ("+{INTENSITY}+_")"
description= _ "Adjacent allies will do "+{INTENSITY}+_"% more damage."
affect_self=no
overlay_image_self="misc/fist-overlay.png"
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
Expand All @@ -577,6 +602,7 @@ Enemy units cannot see this unit during dawn or dusk, except if they have units
description= _ "This unit can lead your own units that are next to it, making them fight better. Adjacent own units of lower level will do more damage in battle. When a unit adjacent to, of a lower level than, and on the same side as a unit with Leadership engages in combat, its attacks do 25% more damage times the difference in their levels."
special_note = _"The leadership of this unit enables adjacent units of the same side to deal more damage in combat, though this only applies to units of lower level."
affect_self=no
overlay_image_self="misc/fist-overlay.png"
[affect_adjacent]
[filter]
formula="level < " + {LEVEL}
Expand Down
2 changes: 2 additions & 0 deletions utils/item_list.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@ Stand up and see the sky turn bright"
Adjacent own units will do 30% more damage and will have 20% better resistances."
affect_self=no
overlay_image_self="misc/fist-overlay.png"
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
Expand Down Expand Up @@ -1400,6 +1401,7 @@ Adjacent own units will do 30% more damage and will have 20% better resistances.
Adjacent own units will do 20% more damage and will have 10% better resistances."
affect_self=no
overlay_image_self="misc/fist-overlay.png"
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
Expand Down

0 comments on commit 99e4e18

Please sign in to comment.