sonic-radiance/sonic-radiance.love/scenes/menus/mainmenu/infopanel/character.lua

32 lines
1.4 KiB
Lua
Raw Normal View History

2021-08-15 16:26:05 +02:00
local Parent = require "scenes.menus.mainmenu.infopanel.parent"
2020-08-02 10:33:31 +02:00
local CharacterPanel = Parent:extend()
function CharacterPanel:new(character)
CharacterPanel.super.new(self)
self.character = character
end
function CharacterPanel:drawContent(x, y)
2021-07-03 09:51:19 +02:00
local stats = self.character.stats
local debugString = "# DEBUG - " .. self.character.name .. "(" .. "Lvl " .. self.character.level .. ")" .. "\n"
2020-08-02 11:04:49 +02:00
local debugString = debugString .. "EXP: " .. self.character.exp .. " / " .. self.character.exp_next .. "\n"
2021-07-03 09:51:19 +02:00
local debugString = debugString .. "HP: " .. self.character.hp .. " / " .. stats:get(stats.HPMAX) .. "\n"
local debugString = debugString .. "PP: " .. self.character.pp .. " / " .. stats:get(stats.PPMAX) .. "\n"
local debugString = debugString .. self:addToDebugString(stats, stats.ATTACK)
local debugString = debugString .. " " .. self:addToDebugString(stats, stats.DEFENSE)
local debugString = debugString .. " " .. self:addToDebugString(stats, stats.SPEED) .. "\n"
local debugString = debugString .. self:addToDebugString(stats, stats.POWER)
local debugString = debugString .. " " .. self:addToDebugString(stats, stats.MIND)
local debugString = debugString .. " " .. self:addToDebugString(stats, stats.TECHNIC) .. "\n"
2020-08-02 10:33:31 +02:00
love.graphics.print(debugString, x, y)
end
2021-07-03 09:51:19 +02:00
function CharacterPanel:addToDebugString(stats, statname)
local stats = stats
return stats.CONST.SIMPLENAME[statname] .. ": " .. stats:get(statname)
end
2020-08-02 10:33:31 +02:00
return CharacterPanel