2023-04-09 05:35:35 +00:00
|
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-02-28 17:43:44 +00:00
|
|
|
GameEvent.functions[GameEvent.SkillEffect] = function(self)
|
2023-08-09 14:25:15 +00:00
|
|
|
local effect_cb, player, _skill = table.unpack(self.data)
|
2023-06-08 17:10:16 +00:00
|
|
|
local room = self.room
|
|
|
|
local logic = room.logic
|
2023-08-09 14:25:15 +00:00
|
|
|
local skill = _skill.main_skill and _skill.main_skill or _skill
|
|
|
|
|
|
|
|
if player then
|
|
|
|
player:addSkillUseHistory(skill.name)
|
|
|
|
end
|
2023-06-08 17:10:16 +00:00
|
|
|
|
|
|
|
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
|
2023-02-28 17:43:44 +00:00
|
|
|
end
|