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

Inspect Creature will also show talents

git-svn-id: http://svn.net-core.org/repos/t-engine4@4650 51575b47-30f0-44d4-a5cc-537603b46e54
parent 43795c60
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,8 @@ function _M:init(t, no_default)
t.rank = t.rank or 3
t.old_life = 0
t.money_value_multiplier = 1 -- changes amounts in gold piles and such
mod.class.Actor.init(self, t, no_default)
engine.interface.PlayerHotkeys.init(self, t)
......
......@@ -37,6 +37,7 @@ newEntity{
newEntity{ base = "BASE_NPC_CAT",
name = "snow cat", color=colors.GRAY,
resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/animal_feline_snow_cat.png", display_h=2, display_y=-1}}},
desc = [[A large cat with a grey fur matted with black.]],
level_range = {3, nil}, exp_worth = 1,
rarity = 4,
......
......@@ -137,7 +137,7 @@ newTalent{
if choose then
Dialog:yesnoLongPopup(
"Cursed Fate",
("The %s lying nearby catches your attention. What draws you to it is not the thing itself, but something burning inside you. You feel contempt for it and all worldly things. This feeling is not new but the power of it overwhelms you. You reach out to touch the object, to curse it, to defile it. And you notice it begin to change. The colors of it begin to fade and are replaced with an insatiable hate. For a moment you hesistate..."):format(item.name),
("The %s lying nearby catches your attention. What draws you to it is not the thing itself, but something burning inside you. You feel contempt for it and all worldly things. This feeling is not new but the power of it overwhelms you. You reach out to touch the object, to curse it, to defile it. And you notice it begin to change. The colors of it begin to fade and are replaced with an insatiable hate. For a moment you hesistate. You know you must choose to resist this manifestation of your curse now and forever, or fall further into your madness."):format(item.name),
300,
function(ret)
if ret then
......
......@@ -65,7 +65,7 @@ newTalent{
local armor = t.getArmor(self, t)
local criticalreduction = t.getCriticalChanceReduction(self, t)
local classrestriction = ""
if self.descriptor.subclass == "Brawler" then
if self.descriptor and self.descriptor.subclass == "Brawler" then
classrestriction = "(Note that brawlers will be unable to perform many of their talents in massive armour.)"
end
if self:knowTalent(self.T_STEALTH) then
......
......@@ -44,6 +44,7 @@ function _M:init(actor)
self.c_general = Tab.new{title="General", default=true, fct=function() end, on_change=function(s) if s then self:switchTo("general") end end}
self.c_attack = Tab.new{title="Attack", default=false, fct=function() end, on_change=function(s) if s then self:switchTo("attack") end end}
self.c_defence = Tab.new{title="Defense", default=false, fct=function() end, on_change=function(s) if s then self:switchTo("defence") end end}
self.c_talents = Tab.new{title="Talents", default=false, fct=function() end, on_change=function(s) if s then self:switchTo("talents") end end}
local tw, th = self.font_bold:size(self.title)
......@@ -86,6 +87,7 @@ Mouse: Hover over stat for info
{left=15, top=self.c_tut.h, ui=self.c_general},
{left=15+self.c_general.w, top=self.c_tut.h, ui=self.c_attack},
{left=15+self.c_general.w+self.c_attack.w, top=self.c_tut.h, ui=self.c_defence},
{left=15+self.c_general.w+self.c_attack.w+self.c_defence.w, top=self.c_tut.h, ui=self.c_talents},
{left=0, top=self.c_tut.h + self.c_general.h, ui=self.vs},
{left=0, top=self.c_tut.h + self.c_general.h + 5 + self.vs.h, ui=self.c_desc},
......@@ -104,9 +106,10 @@ end
function _M:switchTo(kind)
self:drawDialog(kind, _M.cs_player_dup)
if kind == "general" then self.c_attack.selected = false self.c_defence.selected = false
elseif kind == "attack" then self.c_general.selected = false self.c_defence.selected = false
elseif kind == "defence" then self.c_attack.selected = false self.c_general.selected = false
if kind == "general" then self.c_attack.selected = false self.c_defence.selected = false self.c_talents.selected = false
elseif kind == "attack" then self.c_general.selected = false self.c_defence.selected = false self.c_talents.selected = false
elseif kind == "defence" then self.c_attack.selected = false self.c_general.selected = false self.c_talents.selected = false
elseif kind == "talents" then self.c_attack.selected = false self.c_general.selected = false self.c_defence.selected = false
end
self:updateKeys()
end
......@@ -131,9 +134,11 @@ function _M:updateKeys()
end
function _M:tabTabs()
if self.c_general.selected == true then self.c_attack:select() elseif
self.c_attack.selected == true then self.c_defence:select() elseif
self.c_defence.selected == true then self.c_general:select() end
if self.c_general.selected == true then self.c_attack:select()
elseif self.c_attack.selected == true then self.c_defence:select()
elseif self.c_defence.selected == true then self.c_talents:select()
elseif self.c_talents.selected == true then self.c_general:select()
end
end
function _M:mouseZones(t, no_new)
......@@ -853,6 +858,38 @@ function _M:drawDialog(kind, actor_to_compare)
end
--player.combat_mentalresist
elseif kind=="talents" then
h = 0
w = 0
local list = {}
for j, t in pairs(player.talents_def) do
if player:knowTalent(t.id) and not t.hide then
-- local typename = "talent"
-- local status = tstring{{"color", "LIGHT_GREEN"}, "Active"}
-- if self.actor:isTalentCoolingDown(t) then
-- nodes = cooldowns
-- status = tstring{{"color", "LIGHT_RED"}, self.actor:isTalentCoolingDown(t).." turns"}
-- elseif t.mode == "sustained" then
-- if self.actor:isTalentActive(t.id) then nodes = sustained end
-- status = self.actor:isTalentActive(t.id) and tstring{{"color", "YELLOW"}, "Sustaining"} or tstring{{"color", "LIGHT_GREEN"}, "Sustain"}
-- end
local lvl = player:getTalentLevelRaw(t)
list[#list+1] = {
name = ("%s (%d)"):format(t.name, lvl),
desc = player:getTalentFullDescription(t):toString(),
}
end
end
table.sort(list, function(a,b) return a.name < b.name end)
for i, t in ipairs(list) do
self:mouseTooltip(t.desc, s:drawColorStringBlended(self.font, ("#LIGHT_GREEN#%s"):format(t.name), w, h, 255, 255, 255, true)) h = h + self.font_h
if h + self.font_h >= self.c_desc.h then h = 0 w = w + self.c_desc.w / 6 end
end
end
self.c_desc:generate()
......
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