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

37 lines
1.4 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 BuffAction_Invincible = {
-- 以下参数信息可以通过manager的 GetBuffDefaultParam(BuffPath, ParamName)来获取 --
-- 默认颜色信息,非必要参数
BuffColor = {R = 1., G = 0.4, B = 0., A = 1.};
BuffIconPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/BUFFIcon/T_Shield.T_Shield');
BuffParticlePath = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/P_Invincible.P_Invincible');
BuffDesc = "将玩家置于无敌状态";
--------------------------------------------------------------------------------
PlayerKey = {};
}
--- 必须包含ApplyBuff函数
---@param ValidPawn BP_PlayerPawn_C*
---@tparam ...
---@return bool
function BuffAction_Invincible:ApplyBuff(BuffTag, ValidPawn)
UGCPawnSystem.SetIsInvincible(ValidPawn, true);
self.PlayerKey = {
[1] = ValidPawn.PlayerKey;
}
return true
end
--- 可以包含RemoveBuff若包含该函数则玩家应用该Buff时会保存Buff信息缓存作为移除或者获取玩家当前Buff的备份信息
---@param ValidPawn BP_PlayerPawn_C*
---@tparam Args顺序必须与ApplyBuff顺序一致
function BuffAction_Invincible:RemoveBuff(BuffTag, ValidPawn)
UGCPawnSystem.SetIsInvincible(ValidPawn, false);
end
function BuffAction_Invincible:GetBenefitPlayer()
return self.PlayerKey;
end
return BuffAction_Invincible;