47 lines
1.8 KiB
Lua
47 lines
1.8 KiB
Lua
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 |