2025-01-04 23:00:19 +08:00

33 lines
1.0 KiB
Lua

local Buff_PlayerAddSpeed = {};
function Buff_PlayerAddSpeed:LuaDoAction()
if not UGCGameSystem.IsServer() then return true end
UGCLogSystem.Log("[Buff_PlayerAddSpeed_LuaDoAction]")
local OwnerPawn = self:GetOwnerPawn()
if UE.IsValid(OwnerPawn) and self.Params[1] then
UGCPawnAttrSystem.SetSpeedScale(OwnerPawn, UGCPawnAttrSystem.GetSpeedScale(OwnerPawn) * self.Params[1])
end
return true
end
function Buff_PlayerAddSpeed:LuaUndoAction()
if not UGCGameSystem.IsServer() then return true end
UGCLogSystem.Log("[Buff_PlayerAddSpeed_LuaUndoAction]")
local OwnerPawn = self:GetOwnerPawn()
if UE.IsValid(OwnerPawn) and self.Params[1] then
UGCPawnAttrSystem.SetSpeedScale(OwnerPawn, UGCPawnAttrSystem.GetSpeedScale(OwnerPawn) / self.Params[1])
end
return true
end
function Buff_PlayerAddSpeed:LuaResetAction()
UGCLogSystem.Log("[Buff_PlayerAddSpeed_LuaResetAction]")
return true
end
--function Buff_PlayerAddSpeed:LuaUpdateAction(DeltaSeconds)
-- return true
--end
return Buff_PlayerAddSpeed;