mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-12 10:03:53 +02:00
16 lines
336 B
Lua
16 lines
336 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(EVENT_BUS, function(event)
|
||
|
o:call(event)
|
||
|
end)
|
||
|
return o
|
||
|
end
|
||
|
|
||
|
return trigger
|