feat: new events
This commit is contained in:
parent
52243c7d8c
commit
8bce75aad9
5 changed files with 55 additions and 1 deletions
|
@ -3,6 +3,9 @@ return {
|
||||||
["simpleMessage"] = {"message"},
|
["simpleMessage"] = {"message"},
|
||||||
["dialogBox"] = {"message", "title", "avatar"},
|
["dialogBox"] = {"message", "title", "avatar"},
|
||||||
["optionBox"] = {"message", "title", "avatar", "option1", "option2", "option3", "flag"},
|
["optionBox"] = {"message", "title", "avatar", "option1", "option2", "option3", "flag"},
|
||||||
|
["playSFX"] = {"sfx"},
|
||||||
|
["getRings"] = {"number"},
|
||||||
|
["getItems"] = {"type", "item", "number"}
|
||||||
--[name] = {args...},
|
--[name] = {args...},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
sonic-radiance.love/game/events/event/getItems.lua
Normal file
16
sonic-radiance.love/game/events/event/getItems.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
local StepParent = require "game.events.event.parent"
|
||||||
|
local SimpleMessageStep = StepParent:extend()
|
||||||
|
|
||||||
|
function SimpleMessageStep:new(controller, args)
|
||||||
|
SimpleMessageStep.super.new(self, controller, args)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:start()
|
||||||
|
game.loot:addItem(self.arguments.type, self.arguments.item, self.arguments.number)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:update(dt)
|
||||||
|
self:finish()
|
||||||
|
end
|
||||||
|
|
||||||
|
return SimpleMessageStep;
|
16
sonic-radiance.love/game/events/event/getRings.lua
Normal file
16
sonic-radiance.love/game/events/event/getRings.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
local StepParent = require "game.events.event.parent"
|
||||||
|
local SimpleMessageStep = StepParent:extend()
|
||||||
|
|
||||||
|
function SimpleMessageStep:new(controller, args)
|
||||||
|
SimpleMessageStep.super.new(self, controller, args)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:start()
|
||||||
|
game.loot.rings = game.loot.rings + self.arguments.number
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:update(dt)
|
||||||
|
self:finish()
|
||||||
|
end
|
||||||
|
|
||||||
|
return SimpleMessageStep;
|
|
@ -2,5 +2,8 @@ return {
|
||||||
["wait"] = require("game.events.event.wait"),
|
["wait"] = require("game.events.event.wait"),
|
||||||
["simpleMessage"] = require("game.events.event.simpleMessage"),
|
["simpleMessage"] = require("game.events.event.simpleMessage"),
|
||||||
["dialogBox"] = require("game.events.event.dialogbox"),
|
["dialogBox"] = require("game.events.event.dialogbox"),
|
||||||
["optionBox"] = require("game.events.event.dialogbox")
|
["optionBox"] = require("game.events.event.dialogbox"),
|
||||||
|
["playSFX"] = require("game.events.event.playSFX"),
|
||||||
|
["getRings"] = require("game.events.event.getRings"),
|
||||||
|
["getItems"] = require("game.events.event.getItems")
|
||||||
}
|
}
|
16
sonic-radiance.love/game/events/event/playSFX.lua
Normal file
16
sonic-radiance.love/game/events/event/playSFX.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
local StepParent = require "game.events.event.parent"
|
||||||
|
local SimpleMessageStep = StepParent:extend()
|
||||||
|
|
||||||
|
function SimpleMessageStep:new(controller, args)
|
||||||
|
SimpleMessageStep.super.new(self, controller, args)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:start()
|
||||||
|
self.events.scene.assets.sfx[self.arguments.sfx]:play()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SimpleMessageStep:update(dt)
|
||||||
|
self:finish()
|
||||||
|
end
|
||||||
|
|
||||||
|
return SimpleMessageStep;
|
Loading…
Reference in a new issue