From b01dbd84bcbab601623a6e89ae10e0695b8b7d2e Mon Sep 17 00:00:00 2001 From: Zireael07 Date: Sat, 12 Oct 2013 11:03:21 +0200 Subject: [PATCH] add missing spaces in item tooltips --- class/Object.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/class/Object.lua b/class/Object.lua index 904bd7dd..3992650f 100644 --- a/class/Object.lua +++ b/class/Object.lua @@ -1,4 +1,4 @@ --- Underdark +-- Veins of the Earth -- Zireael -- -- This program is free software: you can redistribute it and/or modify @@ -85,6 +85,10 @@ function _M:getName(t) else return qty.." "..name end + local colors = rng.table{"red","blue","pink","green","black","white","violet","yellow","teal","gold"} + + if self.type == "potion" then return colors.." "..name end + end --- Gets the full desc of the object @@ -106,10 +110,10 @@ function _M:getDesc() if magic_shield and magic_shield > 0 then str = str.."\n#GOLD#This shield grants a +"..(magic_shield).." magic bonus to AC" end elseif self.type == "amulet" and self.identified == true then local natural = self.wielder.combat_natural - if natural and natural > 0 then str = str.."\n#GOLD#This amulet grants a +"..(natural).."natural armor bonus to AC" end + if natural and natural > 0 then str = str.."\n#GOLD#This amulet grants a +"..(natural).." natural armor bonus to AC" end elseif self.type == "ring" and self.identified == true then local protection = self.wielder.combat_protection - if protection and protection > 0 then str = str.."\n#GOLD#This ring grants a +"..(protection).."protection bonus to AC" end + if protection and protection > 0 then str = str.."\n#GOLD#This ring grants a +"..(protection).." protection bonus to AC" end else end return str