2015-04-06 01:18:46 -07:00
|
|
|
local Paint = {}
|
2014-07-12 18:47:39 -07:00
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
local Memory = require "util.memory"
|
|
|
|
local Player = require "util.player"
|
|
|
|
local Utils = require "util.utils"
|
2014-07-12 18:47:39 -07:00
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
local Pokemon = require "storage.pokemon"
|
2014-07-12 18:47:39 -07:00
|
|
|
|
|
|
|
local encounters = 0
|
2015-04-06 01:18:46 -07:00
|
|
|
local elapsedTime = Utils.elapsedTime
|
2014-07-12 18:47:39 -07:00
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
function Paint.draw(currentMap)
|
|
|
|
local px, py = Player.position()
|
2014-07-12 18:47:39 -07:00
|
|
|
gui.text(0, 14, currentMap..": "..px.." "..py)
|
|
|
|
gui.text(0, 0, elapsedTime())
|
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
if Memory.value("battle", "our_id") > 0 then
|
|
|
|
local hp = Pokemon.index(0, "hp")
|
2014-07-12 18:47:39 -07:00
|
|
|
local hpStatus
|
2015-03-30 15:29:00 -07:00
|
|
|
if hp == 0 then
|
2014-07-12 18:47:39 -07:00
|
|
|
hpStatus = "DEAD"
|
2015-04-06 01:18:46 -07:00
|
|
|
elseif hp <= math.ceil(Pokemon.index(0, "max_hp") * 0.2) then
|
2014-07-12 18:47:39 -07:00
|
|
|
hpStatus = "RED"
|
|
|
|
end
|
2015-03-30 15:29:00 -07:00
|
|
|
if hpStatus then
|
2014-07-12 18:47:39 -07:00
|
|
|
gui.text(120, 7, hpStatus)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
local nidx = Pokemon.indexOf("nidoran", "nidorino", "nidoking")
|
2015-03-30 15:29:00 -07:00
|
|
|
if nidx ~= -1 then
|
2015-04-06 01:18:46 -07:00
|
|
|
local att = Pokemon.index(nidx, "attack")
|
|
|
|
local def = Pokemon.index(nidx, "defense")
|
|
|
|
local spd = Pokemon.index(nidx, "speed")
|
|
|
|
local scl = Pokemon.index(nidx, "special")
|
2014-07-12 18:47:39 -07:00
|
|
|
gui.text(100, 0, att.." "..def.." "..spd.." "..scl)
|
|
|
|
end
|
|
|
|
local enc = " encounter"
|
2015-03-30 15:29:00 -07:00
|
|
|
if encounters ~= 1 then
|
2014-07-12 18:47:39 -07:00
|
|
|
enc = enc.."s"
|
|
|
|
end
|
2015-04-06 01:18:46 -07:00
|
|
|
gui.text(0, 116, Memory.value("battle", "critical"))
|
|
|
|
gui.text(0, 125, Memory.value("player", "repel"))
|
2014-07-12 18:47:39 -07:00
|
|
|
gui.text(0, 134, encounters..enc)
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
function Paint.wildEncounters(count)
|
2014-07-12 18:47:39 -07:00
|
|
|
encounters = count
|
|
|
|
end
|
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
function Paint.reset()
|
2014-07-12 18:47:39 -07:00
|
|
|
encounters = 0
|
|
|
|
end
|
|
|
|
|
2015-04-06 01:18:46 -07:00
|
|
|
return Paint
|