parent
ed92ba75fe
commit
93cd645205
1 changed files with 4 additions and 3 deletions
|
@ -52,9 +52,10 @@
|
|||
-- having a message that tells you that the unit gained 0 XP is simply obnoxious
|
||||
if xp_to_add > 0 then
|
||||
student.experience = student.experience + xp_to_add
|
||||
-- performance-wise, string concatenation is slower than string interpolation
|
||||
-- but it's way more readable than two nested interpolations...
|
||||
wesnoth.interface.float_label(student.x, student.y, "<span color='cyan'>" .. tostring(_ "+%d XP"):format(xp_to_add) .. "</span>")
|
||||
-- po: Floating text shown when Garak's teaching ability transfers experience points
|
||||
local xp_string = _ "+$amount XP"
|
||||
xp_string = xp_string:vformat{amount = xp_to_add}
|
||||
wesnoth.interface.float_label(student.x, student.y, "<span color='cyan'>" .. xp_string .. "</span>")
|
||||
if student.experience >= student.max_experience then
|
||||
-- advance unit, animate and fire events
|
||||
student:advance(true, true)
|
||||
|
|
Loading…
Add table
Reference in a new issue