UGCProjects/Counterattack/Script/Global/EventManager/EventAction/EventAction_PlayerDeadUpdateInfo.lua
2025-01-04 23:00:19 +08:00

44 lines
1.5 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local EventAction_PlayerDeadUpdateInfo = {
DeadPlayerKey = -1;
KillerPlayerKey = -1;
WeaponID = -1;
}
-- 触发器激活时将执行Action的Execute
function EventAction_PlayerDeadUpdateInfo:Execute(...)
if not UGCGameSystem.IsServer() then return end
UGCLogSystem.Log("[EventAction_PlayerDeadUpdateInfo_Execute] DeadPlayerKey:%s, KillerPlayerKey:%s", tostring(self.DeadPlayerKey), tostring(self.KillerPlayerKey))
-- 判断是否在游戏
if UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.Playing and UGCGameSystem.GameState.GameStateType ~= CustomEnum.EGameState.Waiting then
return true
end
-- 击杀队友不计算得分
if UGCPlayerStateSystem.GetTeamID(self.DeadPlayerKey) == UGCPlayerStateSystem.GetTeamID(self.KillerPlayerKey) then
return true
end
if self.DeadPlayerKey ~= self.KillerPlayerKey and self.KillerPlayerKey > 0 then
-- 增加击杀得分
PlayerScoreSystem.AddPlayerScoreData(self.KillerPlayerKey, PlayerScoreSystem.Config.EScoreType.Kills, 1)
-- 额外得分逻辑
self:OtherKillSucceedLogic()
end
-- 更新死亡玩家信息
self:UpdateDeadPlayerLogic()
-- 记录死亡数
PlayerScoreSystem.AddPlayerScoreData(self.DeadPlayerKey, PlayerScoreSystem.Config.EScoreType.Deaths, 1)
return true
end
function EventAction_PlayerDeadUpdateInfo:OtherKillSucceedLogic()
end
function EventAction_PlayerDeadUpdateInfo:UpdateDeadPlayerLogic()
end
return EventAction_PlayerDeadUpdateInfo