Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UtBS: unified dehydration and stunned theme status icon checks
- Loading branch information
Showing
3 changed files
with
26 additions
and
42 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
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,25 @@ | ||
-- #textdomain wesnoth-utbs | ||
|
||
local _ = wesnoth.textdomain "wesnoth-utbs" | ||
local old_unit_status = wesnoth.theme_items.unit_status | ||
|
||
function wesnoth.theme_items.unit_status() | ||
local u = wesnoth.get_displayed_unit() | ||
if not u then return {} end | ||
local s = old_unit_status() | ||
|
||
if u.status.dehydrated then | ||
table.insert(s, { "element", { | ||
image = "misc/dehydration-status.png", | ||
tooltip = _ "dehydrated: This unit is dehydrated. It will lose 4 HP and have its damage reduced by 1 each turn during the day unless prevented by healers or cured by water at an oasis.\n\nUnits cannot be killed or deal no damage as a result of dehydration." | ||
} }) | ||
end | ||
|
||
if u.status.stunned then | ||
table.insert(s, { "element", { image = "misc/stunned-status-icon.png", | ||
tooltip = _ "stunned: This unit is stunned. It cannot enforce its Zone of Control." | ||
} } ) | ||
end | ||
|
||
return s | ||
end |
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