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

more display

git-svn-id: http://svn.net-core.org/repos/t-engine4@61 51575b47-30f0-44d4-a5cc-537603b46e54
parent d9e22a98
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,8 @@ local DamageType = require "engine.DamageType"
module(..., package.seeall, class.make)
function _M:init(t)
self.life = t.life or 100
self.max_life = t.max_life or 100
self.life = t.life or self.max_life
end
--- Checks if something bumps in us
......
......@@ -22,8 +22,17 @@ function _M:display()
self.surface:drawString(self.font, game.player.name, 0, h, 0, 200, 255) h = h + self.font_h
self.surface:drawString(self.font, "Human", 0, h, 0, 200, 255) h = h + self.font_h
h = h + self.font_h
self.surface:drawString(self.font, "Level: "..game.player.level, 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawString(self.font, ("Exp: %2d%%"):format(100 * cur_exp / max_exp), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, "Level: #00ff00#"..game.player.level, 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("Exp: #00ff00#%2d%%"):format(100 * cur_exp / max_exp), 0, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
self.surface:drawColorString(self.font, ("#c00000#Life: #00ff00#%d/%d"):format(game.player.life, game.player.max_life), 0, h, 255, 255, 255) h = h + self.font_h
h = h + self.font_h
self.surface:drawColorString(self.font, ("STR: #00ff00#%3d"):format(game.player:getStr()), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("DEX: #00ff00#%3d"):format(game.player:getDex()), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("MAG: #00ff00#%3d"):format(game.player:getMag()), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("WIL: #00ff00#%3d"):format(game.player:getWil()), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("CUN: #00ff00#%3d"):format(game.player:getCun()), 0, h, 255, 255, 255) h = h + self.font_h
self.surface:drawColorString(self.font, ("CON: #00ff00#%3d"):format(game.player:getCon()), 0, h, 255, 255, 255) h = h + self.font_h
return self.surface
......
......@@ -4,8 +4,8 @@ return {
name = "dragon of death",
display = "D", color_r=255,
level = 10, exp_worth = 1,
life = 20,
mana = 1000,
max_life = 20,
max_mana = 1000,
energy = { mod=0.5 },
has_blood = true,
stats = { str=15, dex=8, mag=12, },
......@@ -16,8 +16,8 @@ return {
display = "d", color_r=128,
faction = "poorsods",
level = 10, exp_worth = 1,
life = 30,
mana = 1000,
max_life = 30,
max_mana = 1000,
energy = { mod=0.3 },
has_blood = {nb=3, color={50,255,120}},
combat = { dam=5, atk=6, def=2, apr=1, armor=2},
......
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