FreeKill/lua/server/events/skill.lua
notify 713bbca17a
Recorder (#178)
提供了一个简单的事件记录器机制和一个功能简单的查询函数。
在GameEvent的clear环节中,先执行默认的clear函数,再执行用户自订的clear函数。
2023-06-09 01:10:16 +08:00

17 lines
436 B
Lua

-- SPDX-License-Identifier: GPL-3.0-or-later
GameEvent.functions[GameEvent.SkillEffect] = function(self)
local effect_cb, player, skill = table.unpack(self.data)
local room = self.room
local logic = room.logic
local cost_data_bak = skill.cost_data
logic:trigger(fk.SkillEffect, player, skill)
skill.cost_data = cost_data_bak
local ret = effect_cb()
logic:trigger(fk.AfterSkillEffect, player, skill)
return ret
end