2021-04-10 14:43:30 +02:00
|
|
|
local Gizmo = require "scenes.overworld.actors.gizmo"
|
2021-04-02 22:46:37 +02:00
|
|
|
local Encounter = Gizmo:extend()
|
|
|
|
|
|
|
|
local overrides = {
|
|
|
|
["isSolid"] = false,
|
|
|
|
["charset"] = "item1",
|
|
|
|
["charId"] = 2,
|
|
|
|
["destroy"] = "none",
|
|
|
|
["needButton"] = false,
|
|
|
|
["isTurning"] = true,
|
|
|
|
}
|
|
|
|
|
|
|
|
function Encounter:new(world, x, y)
|
|
|
|
Encounter.super.new(self, world, x, y, 16, 16, overrides)
|
|
|
|
end
|
|
|
|
|
|
|
|
function Encounter:action()
|
|
|
|
core.scenemanager:storeCurrentScene("afterBattle")
|
|
|
|
local ox, oy = self.world.cameras:getViewCoordinate(1)
|
|
|
|
game.cbs:startBattle("test", "testBattle", self.x - ox, self.y - oy)
|
|
|
|
self.world.encounter = self
|
2021-04-03 10:56:35 +02:00
|
|
|
self.scene.isPlaying = ""
|
2021-04-02 22:46:37 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Encounter:drawCharset(charset, charId)
|
|
|
|
local x, y = utils.math.floorCoord(self.x, self.y)
|
|
|
|
y = y - 2
|
|
|
|
|
|
|
|
love.graphics.setColor(1,1,1,0.5)
|
|
|
|
self.assets.images["shadow"]:draw(x, y + 11)
|
|
|
|
utils.graphics.resetColor()
|
|
|
|
|
2021-08-21 17:05:49 +02:00
|
|
|
self.assets.sprites["encounter"]:draw(x - 1, y + 10)
|
2021-04-02 22:46:37 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return Encounter
|