UGCProjects/ProjectTemp_T/Script/gamemode/Action_TrophyOwnerAddReward.lua
2025-01-04 23:00:19 +08:00

47 lines
1.8 KiB
Lua
Raw 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 Action_TrophyOwnerAddReward = {
-- 可配置参数定义参数将显示在Action配置面板
-- 例:
-- MyIntParameter = 0
NewTrophyOwnerPlayerKey = "";
}
-- 触发器激活时将执行Action的Execute
function Action_TrophyOwnerAddReward:Execute(...)
UGCLogSystem.Log("[Action_TrophyOwnerAddReward_Execute]")
self.NewTrophyOwnerPlayerKey = tonumber(self.NewTrophyOwnerPlayerKey)
-- BP_BuffManager.GetBuffManager():CreateBuff(
-- self.NewTrophyOwnerPlayerKey,
-- true,
-- nil,
-- BP_BuffManager.BuffList.AddWeaponItem,
-- Tables.GameParam.RewardWeapon.WeaponID,
-- Tables.GameParam.RewardWeapon.Prop,
-- true, false
-- )
local BroadcastData = table.DeepCopy(Tables.BroadcastTable[Enum.EBroadcastType.Affix])
if self.NewTrophyOwnerPlayerKey > 0 then
-- 回满生命值
BP_BuffManager.GetBuffManager():CreateBuff(self.NewTrophyOwnerPlayerKey, true, Tables.ParticlePath.AddHealth, BP_BuffManager.BuffList.AddPlayerPawnHealth, 100)
-- 额外增加分数
UGCGameSystem.GameState:AddScore(self.NewTrophyOwnerPlayerKey, 8)
-- 广播信息
BroadcastData.BroadcastText = UGCGameSystem.GameState:GetPlayerNameByPlayerKey(self.NewTrophyOwnerPlayerKey)
BroadcastData.Suffix = "成为奖杯拥有者"
else
BroadcastData.BroadcastText = "奖杯已重置"
end
UGCGameSystem.GameState:AddBroadcast(Enum.EBroadcastType.Affix, BroadcastData, Enum.EBroadcastPos.MidUp)
return true
end
--[[
-- 需要勾选Action的EnableTick才会执行Update
-- 触发器激活后将在每个tick执行Action的Update直到self.bEnableActionTick为false
function Action_TrophyOwnerAddReward:Update(DeltaSeconds)
end
]]
return Action_TrophyOwnerAddReward