33 lines
1.2 KiB
Lua
33 lines
1.2 KiB
Lua
|
local BuffAction_DefenceChangeSelf = {
|
||
|
BuffColor = {R = 0.4, G = 1., B = 0.1, A = 1.};
|
||
|
BuffIconPath = UGCGameSystem.GetUGCResourcesFullPath('Asset/Texture/BUFFIcon/T_AddHealth.T_AddHealth');
|
||
|
BuffParticlePath = UGCGameSystem.GetUGCResourcesFullPath('Asset/FX/P_AddHealth.P_AddHealth');
|
||
|
BuffDesc = "全队玩家收到安全区外伤害降低";
|
||
|
}
|
||
|
|
||
|
function BuffAction_DefenceChangeSelf:ApplyBuff(BuffTag, ValidPawn, InDefence)
|
||
|
self:ApplyFunc(ValidPawn, InDefence, true);
|
||
|
|
||
|
return true
|
||
|
end
|
||
|
|
||
|
function BuffAction_DefenceChangeSelf:RemoveBuff(BuffTag, SelfPawn, InDefence)
|
||
|
self:ApplyFunc(SelfPawn, InDefence, false);
|
||
|
end
|
||
|
|
||
|
function BuffAction_DefenceChangeSelf:ApplyFunc(SelfPawn, InDefence, IsAdd)
|
||
|
local Pawns = UGCGameSystem.GetAllPlayerPawn();
|
||
|
local TeamId = UGCPlayerStateSystem.GetTeamID(SelfPawn.PlayerKey);
|
||
|
for Index, Pawn in pairs(Pawns) do
|
||
|
local PawnTeamId = UGCPlayerStateSystem.GetTeamID(Pawn.PlayerKey);
|
||
|
if PawnTeamId == TeamId then
|
||
|
if IsAdd then
|
||
|
Pawn:SetParam('Strong', Pawn:GetParam('Strong') * InDefence);
|
||
|
else
|
||
|
Pawn.Strong = Pawn.Strong / InDefence;
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return BuffAction_DefenceChangeSelf;
|