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

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@1911 51575b47-30f0-44d4-a5cc-537603b46e54
parent f5b21533
No related branches found
No related tags found
No related merge requests found
......@@ -487,6 +487,13 @@ function _M:getTalentProjectileSpeed(t)
return t.proj_speed
end
--- Returns display name
function _M:getTalentDisplayName(t)
if not t.display_name then return t.name end
if type(t.display_name) == "function" then return t.display_name(self, t) end
return t.display_name
end
--- Cooldown all talents by one
-- This should be called in your actors "act()" method
function _M:cooldownTalents()
......
......@@ -931,6 +931,7 @@ function _M:setupMouse(reset)
end, {button=true})
-- Use hotkeys with mouse
self.mouse:registerZone(self.hotkeys_display.display_x, self.hotkeys_display.display_y, self.w, self.h, function(button, mx, my, xrel, yrel, bx, by, event)
if event == "button" and button == "left" and self.zone and self.zone.wilderness then return end
self.hotkeys_display:onMouse(button, mx, my, event == "button", function(text) self.tooltip:displayAtMap(nil, nil, self.w, self.h, tostring(text)) end)
end)
-- Use icons
......
......@@ -444,6 +444,9 @@ function _M:getTextualDesc()
game.player.__inscription_data_fake = nil
desc:add({"color","YELLOW"}, "When inscribed on your body:", {"color", "LAST"}, true)
desc:merge(tdesc)
if self.inscription_data.use_stat and self.inscription_data.use_stat_mod then
desc:add(("Its effects scale with your %s stat."):format(Stats.stats_def[self.inscription_data.use_stat].name), true)
end
desc:add(true)
end
......
......@@ -63,6 +63,7 @@ function _M:setInscription(id, name, data, cooldown, vocal, src)
-- Learn new talent
name = name.."_"..id
data.__id = id
if src and src.obj then data.item_name = src.obj:getName{do_color=true, no_count=true}:toTString() end
self.inscriptions_data[name] = data
self.inscriptions[id] = name
print("Inscribing on "..self.name..": "..tostring(name))
......
......@@ -19,6 +19,7 @@
local iname = iname
local idata = idata
local obj = obj
local inven = inven
local item = item
local answers = {}
......@@ -27,7 +28,7 @@ for i = 1, player.max_inscriptions do
local name = player.inscriptions[i]
local t = player:getTalentFromId("T_"..name)
answers[#answers+1] = {t.name, action=function(npc, player)
player:setInscription(i, iname, idata, true, true)
player:setInscription(i, iname, idata, true, true, {obj=obj})
player:removeObject(inven, item)
end}
end
......
......@@ -21,6 +21,17 @@ local newInscription = function(t)
for i = 1, 10 do
local tt = table.clone(t)
tt.short_name = tt.name:upper():gsub("[ ]", "_").."_"..i
tt.display_name = function(self, t)
local data = self:getInscriptionData(t.short_name)
if data.item_name then
local n = tstring{t.name, " ["}
n:merge(data.item_name)
n:add("]")
return n
else
return t.name
end
end
newTalent(tt)
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