UGCProjects/InfFire/Script/gamemode/Action_PlayerDead.lua

33 lines
1.1 KiB
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
local Action_PlayerDead = {
-- 可配置参数定义参数将显示在Action配置面板
-- 例:
-- MyIntParameter = 0
DeadPlayerKey = 0;
KillerPlayerKey = 0;
}
-- 触发器激活时将执行Action的Execute
function Action_PlayerDead:Execute(...)
-- 通知
UGCLogSystem.Log("[Action_PlayerDead:Execute] 玩家 %s 被 %s 击杀", tostring(self.DeadPlayerKey), tostring(self.KillerPlayerKey));
MiniGameManager:OnPlayerDead(self.DeadPlayerKey, self.KillerPlayerKey);
UGCEventSystem.SendEvent(EventTypes.PlayerDead, self.DeadPlayerKey, self.KillerPlayerKey);
2025-01-08 22:46:12 +08:00
if IsClient then
if LocalPlayerKey == self.KillerPlayerKey and self.DeadPlayerKey ~= self.KillerPlayerKey then
LocalKillNum1 = LocalKillNum1 + 1;
-- 同步一下
UGCEventSystem.SendEvent(EventTypes.SelfKill, LocalKillNum1);
end
end
2025-01-04 23:00:19 +08:00
return true;
end
--[[
-- 需要勾选Action的EnableTick才会执行Update
-- 触发器激活后将在每个tick执行Action的Update直到self.bEnableActionTick为false
function Action_PlayerDead:Update(DeltaSeconds)
end
]]
return Action_PlayerDead