UGCProjects/LineOfDefense/Script/Global/EventManager/EventAction/EventAction_EnableInfBullets.lua
2025-01-04 23:00:19 +08:00

26 lines
948 B
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 EventAction_EnableInfBullets = {
}
-- 触发器激活时将执行Action的Execute
function EventAction_EnableInfBullets:Execute(...)
if UGCGameSystem.IsServer() then
UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function()
local AllPlayerPawn = UGCGameSystem.GetAllPlayerPawn()
for i, PlayerPawn in pairs(AllPlayerPawn) do
for k, ShootWeaponEnum in pairs(ShootWeaponEnums) do
local Weapon = UGCWeaponManagerSystem.GetWeaponBySlot(PlayerPawn, ShootWeaponEnum)
if UE.IsValid(Weapon) then
UGCGunSystem.EnableClipInfiniteBullets(Weapon, true)
-- Weapon:ForceModifyCurrentBulletNumInClipOnServer(UGCGunSystem.GetMaxBulletNumInOneClip(Weapon))
end
end
end
end, 0.5
)
end
return true
end
return EventAction_EnableInfBullets