134
134
local sh = the.player.shield
135
local cost = (sh.max - sh.strength) * sh.cost
139
-- WTF: trailing space makes it not wrap?
140
label = Text:new{ text = 'Repair shields (' .. cost .. ') ',
142
onMouseDown = function(self)
143
if the.player.money >= cost and sh.strength < sh.max then
144
the.player.money = the.player.money - cost
151
local tw, th = b.label:getSize()
152
b.background = Fill:new{
153
fill = {100,100,100},
157
b.x = boxR - b.background.width - 60
158
b.y = boxB - b.background.height - 10
135
160
if sh.strength < sh.max then
139
text = 'Your shield has been recharged',
143
y = boxB - 4 * th - 12
147
-- local cost = (sh.max - sh.strength) * sh.cost
149
-- x = boxL, y = boxT,
151
-- -- WTF: trailing space makes it not wrap?
152
-- label = Text:new{ text = 'Repair shields (' .. cost .. ') ',
154
-- onMouseDown = function(self)
155
-- if the.player.money >= cost and sh.strength < sh.max then
156
-- the.player.money = the.player.money - cost
157
-- sh.strength = sh.max
158
-- self.visible = false
163
-- local tw, th = b.label:getSize()
164
-- b.background = Fill:new{
165
-- fill = {100,100,100},
169
-- b.x = boxR - b.background.width - 60
170
-- b.y = boxB - b.background.height - 10
172
-- if sh.strength < sh.max then
176
164
self.playerMoney = Text:new{
177
165
text = 'Your money: ',
190
178
self:add(self.availSpace)
192
180
if the.player.kills > 0 then
193
-- local award = the.player.kills * 100
194
-- self:add(Text:new{
195
-- text = 'You have been awarded ' ..
197
-- ' credits for killing bandits.',
201
-- y = boxB - 4 * th - 12
181
local award = the.player.kills * 100
183
text = 'You have been awarded ' ..
185
' credits for killing bandits.',
189
y = boxB - 4 * th - 12
204
-- the.player.money = the.player.money + award
192
the.player.money = the.player.money + award
205
193
the.player.kills = 0