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

35 lines
1.1 KiB
Lua

local Buff_Ice = {};
Buff_Ice.Emitter = nil;
---@param Pawn UGCPlayerPawn_C
function Buff_Ice:AddBuff(Pawn)
UGCLogSystem.Log("[Buff_Ice:AddBuff] 执行")
if not UE.IsValidPawn(Pawn) then return false; end
UGCLogSystem.Log("[Buff_Ice:AddBuff] Pawn = %s", UGCPawnAttrSystem.GetPlayerName(Pawn))
if IsServer then
local SpeedScale = UGCPawnAttrSystem.GetSpeedScale(Pawn);
UGCPawnAttrSystem.SetSpeedScale(Pawn, SpeedScale * self.Speed);
else
-- 特效
self:RemoveParticle();
ObjectPath.AddFunc("P_Implosive", function(Target)
self.Emitter = UE.SpawnEmitterAttached(Target, Pawn, VectorHelper.MakeVector(0, 0, 50));
end);
end
end
function Buff_Ice:RemoveBuff(Pawn)
UGCLogSystem.Log("[Buff_Ice:RemoveBuff] 执行");
if not UE.IsValidPawn(Pawn) then return false; end
UGCLogSystem.Log("[Buff_Ice:RemoveBuff] Pawn = %s", UGCPawnAttrSystem.GetPlayerName(Pawn))
if IsServer then
local SpeedScale = UGCPawnAttrSystem.GetSpeedScale(Pawn);
UGCPawnAttrSystem.SetSpeedScale(Pawn, SpeedScale / self.Speed);
else
self:RemoveParticle();
end
end
return Buff_Ice;