Skip to content
Snippets Groups Projects
Commit ea71883e authored by dg's avatar dg
Browse files

Escort talent tooltips are show with a 0.8 mastery if not known

git-svn-id: http://svn.net-core.org/repos/t-engine4@5897 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7b9e5e2f
No related branches found
No related tags found
No related merge requests found
......@@ -3802,7 +3802,7 @@ end
--- Return the full description of a talent
-- You may overload it to add more data (like power usage, ...)
function _M:getTalentFullDescription(t, addlevel, config)
function _M:getTalentFullDescription(t, addlevel, config, fake_mastery)
if not t then return tstring{"no talent"} end
config = config or {}
......@@ -3813,6 +3813,11 @@ function _M:getTalentFullDescription(t, addlevel, config)
self.talents[t.id] = (self.talents[t.id] or 0) + (addlevel or 0)
end
local oldmastery = nil
if fake_mastery then
self.talents_types_mastery[t.type[1]] = fake_mastery - 1
end
local d = tstring{}
d:add({"color",0x6f,0xff,0x83}, "Effective talent level: ", {"color",0x00,0xFF,0x00}, ("%.1f"):format(self:getTalentLevel(t)), true)
......@@ -3881,6 +3886,10 @@ function _M:getTalentFullDescription(t, addlevel, config)
self.talents[t.id] = old
if fake_mastery then
self.talents_types_mastery[t.type[1]] = oldmastery
end
return d
end
......
......@@ -273,7 +273,9 @@ local function generate_rewards()
action=doit,
on_select=function(npc, player)
game.tooltip_x, game.tooltip_y = 1, 1
game:tooltipDisplayAtMap(game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1)))
local mastery = nil
if not player:knowTalentType(t.type[1]) then mastery = 0.8 end
game:tooltipDisplayAtMap(game.w, game.h, "#GOLD#"..t.name.."#LAST#\n"..tostring(player:getTalentFullDescription(t, 1, nil, mastery)))
end,
}
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment