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

more talents icons

Fixed a bug which made activate egos recharge too fast


git-svn-id: http://svn.net-core.org/repos/t-engine4@3973 51575b47-30f0-44d4-a5cc-537603b46e54
parent d35697c9
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 12 deletions
......@@ -99,11 +99,10 @@ function _M:display()
for page=1,3 do
for i = 1, 12 do
local j = i + (12 * (page - 1))
local ks = game.key:formatKeyString(game.key:findBoundKeys("HOTKEY_"..page_to_hotkey[page]..i))
if a.hotkey[j] and a.hotkey[j][1] == "talent" then
hks[#hks+1] = {a.hotkey[j][2], j, "talent", ks}
hks[#hks+1] = {a.hotkey[j][2], j, "talent", i, page}
elseif a.hotkey[j] and a.hotkey[j][1] == "inventory" then
hks[#hks+1] = {a.hotkey[j][2], j, "inventory", ks}
hks[#hks+1] = {a.hotkey[j][2], j, "inventory", i, page}
end
end
end
......@@ -147,11 +146,27 @@ function _M:display()
frame = "disabled"
end
display_entity = o
if o and o.use_talent then
local t = a:getTalentFromId(o.use_talent.id)
display_entity = t.display_entity
end
if o and (o.use_talent or o.use_power) then
angle = 360 * ((o.power / o.max_power))
color = {255,0,0}
local need = (o.use_talent and o.use_talent.power) or (o.use_power and o.use_power.power) or 0
if o.power < need then
if o.power_regen and o.power_regen > 0 then
frame = "cooldown"
txt = tostring(math.ceil((need - o.power) / o.power_regen))
else frame = "disabled" end
end
end
end
local w, h = self.icon_w, self.icon_h
-- local key = self.font:draw(ts[4], w, colors.YELLOW.r, colors.YELLOW.g, colors.YELLOW.b, true)[1]
self.font:setStyle("bold")
local key = self.font:draw(("%d/%d"):format(ts[4], ts[5]), w, colors.ANTIQUE_WHITE.r, colors.ANTIQUE_WHITE.g, colors.ANTIQUE_WHITE.b, true)[1]
self.font:setStyle("normal")
local gtxt = nil
if txt then
......@@ -176,10 +191,13 @@ function _M:toScreen()
local frame = self.frames[item.frame]
frame[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, self.frames.w, self.frames.h, frame[2] * self.frames.rw, frame[3] * self.frames.rh)
item.e:toScreen(self.tiles, self.display_x + item.x + self.frames.fx, self.display_y + item.y + self.frames.fy, self.icon_w, self.icon_h)
-- key._tex:toScreenFull(self.display_x + item.x + 64 - key.w, self.display_y + item.y, key.w, key.h, key._tex_w, key._tex_h)
if self.shadow then key._tex:toScreenFull(self.display_x + item.x + 1 + self.frames.fx + self.icon_w - key.w, self.display_y + item.y + 1 + self.icon_h - key.h, key.w, key.h, key._tex_w, key._tex_h, 0, 0, 0, self.shadow) end
key._tex:toScreenFull(self.display_x + item.x + self.frames.fx + self.icon_w - key.w, self.display_y + item.y + self.icon_h - key.h, key.w, key.h, key._tex_w, key._tex_h)
if item.color then core.display.drawQuadPart(self.display_x + item.x + self.frames.fx, self.display_y + item.y + self.frames.fy, self.icon_w, self.icon_h, item.angle, item.color[1], item.color[2], item.color[3], 128) end
if gtxt then
if self.shadow then gtxt._tex:toScreenFull(self.display_x + item.x + self.frames.fy + 2 + (self.icon_w - gtxt.fw) / 2, self.display_y + item.y + self.frames.fy + 2 + (self.icon_h - gtxt.fh) / 2, gtxt.w, gtxt.h, gtxt._tex_w, gtxt._tex_h, 0, 0, 0, self.shadow) end
if self.shadow then gtxt._tex:toScreenFull(self.display_x + item.x + self.frames.fy + 2 + (self.icon_w - gtxt.fw) / 2, self.display_y + item.y + self.frames.fy + 2 + (self.icon_h - gtxt.fh) / 2, gtxt.w, gtxt.h, gtxt._tex_w, gtxt._tex_h, 0, 0, 0, self.shadow) end
gtxt._tex:toScreenFull(self.display_x + item.x + self.frames.fx + (self.icon_w - gtxt.fw) / 2, self.display_y + item.y + self.frames.fy + (self.icon_h - gtxt.fh) / 2, gtxt.w, gtxt.h, gtxt._tex_w, gtxt._tex_h)
end
......
......@@ -30,9 +30,8 @@ _M.display_on_unknown = false
function _M:init(t, no_default)
t = t or {}
self.energy = t.energy or { value=0, mod=1 }
self.energy = t.energy or { value=0 }
self.energy.value = self.energy.value or 0
self.energy.mod = self.energy.mod or 0
Entity.init(self, t, no_default)
end
......
......@@ -33,7 +33,8 @@ end
--- Regen resources, shout be called in your actor's act() method
function _M:regenPower()
if self.power_regen then self.power = util.bound(self.power + self.power_regen, 0, self.max_power) end
if self.power_regen then
self.power = util.bound(self.power + self.power_regen, 0, self.max_power) end
end
function _M:canUseObject()
......@@ -52,7 +53,7 @@ function _M:getUseDesc()
elseif self.use_simple then
return ("It can be used to %s."):format(self.use_simple.name)
elseif self.use_talent then
if not self.use_talent.power then print(self:getTalentFromId(self.use_talent.id),self.use_talent.id)
if not self.use_talent.power then
return ("It can be used to activate talent: %s (level %d)."):format(self:getTalentFromId(self.use_talent.id).name, self.use_talent.level)
else
return ("It can be used to activate talent: %s (level %d), costing %d power out of %d/%d."):format(self:getTalentFromId(self.use_talent.id).name, self.use_talent.level, self.use_talent.power, self.power, self.max_power)
......
......@@ -121,7 +121,7 @@ function _M:run()
profile.chat:enableFading(config.settings.tome.log_fade or 3)
profile.chat:enableDisplayChans(false)
self.hotkeys_display = HotkeysIconsDisplay.new(nil, 216, self.h - 70, self.w - 216, 70, "/data/gfx/ui/talents-list.png", font_mono, size_mono, 32, 32)
self.hotkeys_display = HotkeysIconsDisplay.new(nil, 216, self.h - 70, self.w - 216, 70, "/data/gfx/ui/talents-list.png", font_mono, size_mono, 48, 48)
self.hotkeys_display:enableShadow(0.6)
self.hotkeys_display:setColumns(3)
self.npcs_display = ActorsSeenDisplay.new(nil, 216, self.h - font_mono_h * 4.2, self.w - 216, font_mono_h * 4.2, "/data/gfx/ui/talents-list.png", font_mono, size_mono)
......
game/modules/tome/data/gfx/talents/arcane_combat.png

5.42 KiB

game/modules/tome/data/gfx/talents/arcane_destruction.png

3.43 KiB

game/modules/tome/data/gfx/talents/arcane_dexterity.png

4.39 KiB

game/modules/tome/data/gfx/talents/arcane_feed.png

3.78 KiB

game/modules/tome/data/gfx/talents/bellowing_roar.png

5.02 KiB

game/modules/tome/data/gfx/talents/blood_spray.png

2.68 KiB

game/modules/tome/data/gfx/talents/burrow.png

3.92 KiB

game/modules/tome/data/gfx/talents/devouring_flame.png

5.49 KiB

game/modules/tome/data/gfx/talents/earth_s_eyes.png

3.03 KiB

game/modules/tome/data/gfx/talents/elemental_harmony.png

3.99 KiB

game/modules/tome/data/gfx/talents/fire_breath.png

4.34 KiB

game/modules/tome/data/gfx/talents/healing_nexus.png

3.87 KiB

game/modules/tome/data/gfx/talents/ice_breath.png

5.29 KiB

game/modules/tome/data/gfx/talents/ice_claw.png

3.29 KiB

game/modules/tome/data/gfx/talents/ice_wall.png

2.93 KiB

game/modules/tome/data/gfx/talents/icy_skin.png

4.4 KiB

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