mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
16 lines
335 B
Lua
16 lines
335 B
Lua
local TriggerBase = require("core:erm.TriggerBase")
|
|
local ApplyDamage = require("events.ApplyDamage")
|
|
local eventBus = EVENT_BUS;
|
|
|
|
local trigger = TriggerBase:new()
|
|
|
|
function trigger:new(o)
|
|
o = TriggerBase.new(self, o)
|
|
o.sub = ApplyDamage.subscribeBefore(eventBus, function(event)
|
|
o:call(event)
|
|
end)
|
|
return o
|
|
end
|
|
|
|
return trigger
|