Skip to content
Snippets Groups Projects
Commit 066ce728 authored by DarkGod's avatar DarkGod
Browse files

Combat Training talents split into two lines

Object tooltip now shows which talent mastery affects them
parent 678c204c
No related branches found
No related tags found
No related merge requests found
......@@ -465,6 +465,11 @@ function _M:getTextualDesc(compare_with)
desc:add("Damage type: ", col[2],DamageType:get(combat.damtype or DamageType.PHYSICAL).name:capitalize(),{"color","LAST"}, true)
end
if combat.talented then
local t = game.player:combatGetTraining(combat)
if t and t.name then desc:add("Mastery: ", {"color","GOLD"}, t.name, {"color","LAST"}, true) end
end
if combat.wil_attack then
desc:add("Accuracy is based on willpower for this weapon.", true)
end
......
......@@ -889,6 +889,14 @@ _M.weapon_talents = {
unarmed = Talents.T_UNARMED_MASTERY,
}
--- Checks weapon training
function _M:combatGetTraining(weapon)
if not weapon then return nil end
if not weapon.talented then return nil end
if not weapon_talents[weapon.talented] then return nil end
return self:getTalentFromId(weapon_talents[weapon.talented])
end
--- Checks weapon training
function _M:combatCheckTraining(weapon)
if not weapon then return 0 end
......
......@@ -84,6 +84,7 @@ newTalent{
name = "Combat Accuracy", short_name = "WEAPON_COMBAT",
type = {"technique/combat-training", 1},
points = 5,
levelup_screen_break_line = true,
require = { level=function(level) return (level - 1) * 4 end },
mode = "passive",
getAttack = function(self, t) return self:getTalentLevel(t) * 10 end,
......
......@@ -455,6 +455,7 @@ function _M:generateList()
rawname=t.name,
entity=t.display_entity,
talent=t.id,
break_line=t.levelup_screen_break_line,
isgeneric=isgeneric and 0 or 1,
_type=tt.type,
do_shadow = function(item) if not self.actor:canLearnTalent(t) then return true else return false end end,
......
......@@ -405,6 +405,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y)
end
local addh = 0
local startdx = dx
if tree.shown then for j = 1, #tree.nodes do
local tal = tree.nodes[j]
......@@ -424,8 +425,13 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y)
mz[#mz+1] = {i=i, j=j, name=tal.name, item=tal, x1=dx-bdx, y1=dy-bdy, x2=dx+self.frame_size-bdx, y2=dy-bdy+self.frame_size+addh}
dx = dx + self.frame_size + self.frame_offset
addh = addh + self.frame_size
if tal.break_line then
dx = startdx
dy = dy + self.frame_size + addh + 8
else
dx = dx + self.frame_size + self.frame_offset
addh = addh + self.frame_size
end
end end
--self.max_display = i - self.scroll + 1
dx = 0
......
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