2023-04-09 05:35:35 +00:00
|
|
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
2023-02-28 17:43:44 +00:00
|
|
|
|
-- Definitions of game events
|
|
|
|
|
|
2023-06-08 17:10:16 +00:00
|
|
|
|
-- 某类事件对应的结束事件,其id刚好就是那个事件的相反数
|
|
|
|
|
-- GameEvent.EventFinish = -1
|
|
|
|
|
|
2023-02-28 17:43:44 +00:00
|
|
|
|
GameEvent.ChangeHp = 1
|
|
|
|
|
GameEvent.Damage = 2
|
|
|
|
|
GameEvent.LoseHp = 3
|
|
|
|
|
GameEvent.Recover = 4
|
|
|
|
|
GameEvent.ChangeMaxHp = 5
|
|
|
|
|
dofile "lua/server/events/hp.lua"
|
|
|
|
|
|
|
|
|
|
GameEvent.Dying = 6
|
|
|
|
|
GameEvent.Death = 7
|
2023-12-10 10:55:16 +00:00
|
|
|
|
GameEvent.Revive = 22
|
2023-02-28 17:43:44 +00:00
|
|
|
|
dofile "lua/server/events/death.lua"
|
|
|
|
|
|
|
|
|
|
GameEvent.MoveCards = 8
|
|
|
|
|
dofile "lua/server/events/movecard.lua"
|
|
|
|
|
|
|
|
|
|
GameEvent.UseCard = 9
|
|
|
|
|
GameEvent.RespondCard = 10
|
2023-05-28 10:45:54 +00:00
|
|
|
|
GameEvent.CardEffect = 20
|
2023-02-28 17:43:44 +00:00
|
|
|
|
dofile "lua/server/events/usecard.lua"
|
|
|
|
|
|
|
|
|
|
GameEvent.SkillEffect = 11
|
|
|
|
|
-- GameEvent.AddSkill = 12
|
|
|
|
|
-- GameEvent.LoseSkill = 13
|
|
|
|
|
dofile "lua/server/events/skill.lua"
|
|
|
|
|
|
|
|
|
|
GameEvent.Judge = 14
|
|
|
|
|
dofile "lua/server/events/judge.lua"
|
|
|
|
|
|
2023-03-07 06:55:28 +00:00
|
|
|
|
GameEvent.DrawInitial = 15
|
2023-04-08 12:45:55 +00:00
|
|
|
|
GameEvent.Round = 16
|
|
|
|
|
GameEvent.Turn = 17
|
2023-04-22 07:52:26 +00:00
|
|
|
|
GameEvent.Phase = 18
|
2023-03-07 06:55:28 +00:00
|
|
|
|
dofile "lua/server/events/gameflow.lua"
|
|
|
|
|
|
2023-04-22 07:52:26 +00:00
|
|
|
|
GameEvent.Pindian = 19
|
2023-03-14 12:48:08 +00:00
|
|
|
|
dofile "lua/server/events/pindian.lua"
|
|
|
|
|
|
2023-10-07 15:00:25 +00:00
|
|
|
|
-- 20 = CardEffect
|
2023-08-27 12:19:55 +00:00
|
|
|
|
GameEvent.ChangeProperty = 21
|
|
|
|
|
dofile "lua/server/events/misc.lua"
|
|
|
|
|
|
2023-02-28 17:43:44 +00:00
|
|
|
|
-- TODO: fix this
|
|
|
|
|
GameEvent.BreakEvent = 999
|
|
|
|
|
|
2023-08-24 13:37:24 +00:00
|
|
|
|
for _, l in ipairs(Fk._custom_events) do
|
|
|
|
|
local name, p, m, c, e = l.name, l.p, l.m, l.c, l.e
|
|
|
|
|
GameEvent.prepare_funcs[name] = p
|
|
|
|
|
GameEvent.functions[name] = m
|
|
|
|
|
GameEvent.cleaners[name] = c
|
|
|
|
|
GameEvent.exit_funcs[name] = e
|
|
|
|
|
end
|
|
|
|
|
|
2023-04-09 03:44:19 +00:00
|
|
|
|
local eventTranslations = {
|
|
|
|
|
[GameEvent.ChangeHp] = "GameEvent.ChangeHp",
|
|
|
|
|
[GameEvent.Damage] = "GameEvent.Damage",
|
|
|
|
|
[GameEvent.LoseHp] = "GameEvent.LoseHp",
|
|
|
|
|
[GameEvent.Recover] = "GameEvent.Recover",
|
|
|
|
|
[GameEvent.ChangeMaxHp] = "GameEvent.ChangeMaxHp",
|
|
|
|
|
[GameEvent.Dying] = "GameEvent.Dying",
|
|
|
|
|
[GameEvent.Death] = "GameEvent.Death",
|
2023-12-10 10:55:16 +00:00
|
|
|
|
[GameEvent.Revive] = "GameEvent.Revive",
|
2023-04-09 03:44:19 +00:00
|
|
|
|
[GameEvent.MoveCards] = "GameEvent.MoveCards",
|
|
|
|
|
[GameEvent.UseCard] = "GameEvent.UseCard",
|
|
|
|
|
[GameEvent.RespondCard] = "GameEvent.RespondCard",
|
2023-05-28 10:45:54 +00:00
|
|
|
|
[GameEvent.CardEffect] = "GameEvent.CardEffect",
|
2023-04-09 03:44:19 +00:00
|
|
|
|
[GameEvent.SkillEffect] = "GameEvent.SkillEffect",
|
|
|
|
|
[GameEvent.Judge] = "GameEvent.Judge",
|
|
|
|
|
[GameEvent.DrawInitial] = "GameEvent.DrawInitial",
|
|
|
|
|
[GameEvent.Round] = "GameEvent.Round",
|
|
|
|
|
[GameEvent.Turn] = "GameEvent.Turn",
|
2023-04-22 07:52:26 +00:00
|
|
|
|
[GameEvent.Phase] = "GameEvent.Phase",
|
2023-04-09 03:44:19 +00:00
|
|
|
|
[GameEvent.Pindian] = "GameEvent.Pindian",
|
2023-04-22 07:52:26 +00:00
|
|
|
|
|
2023-08-27 12:19:55 +00:00
|
|
|
|
[GameEvent.ChangeProperty] = "GameEvent.ChangeProperty",
|
|
|
|
|
|
2023-04-22 07:52:26 +00:00
|
|
|
|
[GameEvent.BreakEvent] = "GameEvent.BreakEvent",
|
2023-04-09 03:44:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function GameEvent.static:translate(id)
|
2023-08-24 13:37:24 +00:00
|
|
|
|
local ret = eventTranslations[id]
|
|
|
|
|
if not ret then ret = id end
|
|
|
|
|
return ret
|
2023-04-09 03:44:19 +00:00
|
|
|
|
end
|