mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-07 03:03:25 +00:00
display dehydration status in the status table
This commit is contained in:
parent
5f5067fe46
commit
bc7112fd35
@ -182,6 +182,29 @@ Hd, Dd*, Rd #enddef
|
||||
# Events
|
||||
#
|
||||
|
||||
[event]
|
||||
name=preload
|
||||
first_time_only=no
|
||||
[lua]
|
||||
code=<<
|
||||
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
|
||||
return s
|
||||
end
|
||||
>>
|
||||
[/lua]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=prestart
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user