2021-04-10 14:43:30 +02:00
|
|
|
local Gizmo = require "scenes.overworld.actors.gizmo"
|
2021-03-22 21:15:33 +01:00
|
|
|
local ItemBox = Gizmo:extend()
|
|
|
|
|
|
|
|
local overrides = {
|
|
|
|
["isSolid"] = true,
|
|
|
|
["charset"] = "item1",
|
|
|
|
["charId"] = 1,
|
|
|
|
["charDir"] = "right",
|
2021-04-03 19:25:34 +02:00
|
|
|
["destroy"] = "forever",
|
2021-03-22 21:15:33 +01:00
|
|
|
["needButton"] = true,
|
2021-04-21 18:36:20 +02:00
|
|
|
["interactionName"] = "Take",
|
2021-03-22 21:15:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function ItemBox:new(world, x, y)
|
|
|
|
ItemBox.super.new(self, world, x, y, 16, 16, overrides)
|
|
|
|
end
|
|
|
|
|
|
|
|
function ItemBox:applyProperties()
|
|
|
|
ItemBox.super.applyProperties(self)
|
|
|
|
self.event = {
|
|
|
|
{"getItems", "", self.properties.category, self.properties.item, self.properties.number},
|
|
|
|
{"playSFX", "", "pop"},
|
|
|
|
{"simpleMessage", "", "You got " .. self.properties.number .. " " .. self.properties.item},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
return ItemBox
|