77 lines
1.9 KiB
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
---@class BP_IceTarget_C:AActor
---@field TargetMesh UStaticMeshComponent
---@field ParticleBoom UParticleSystemComponent
---@field TargetMesh_Old UStaticMeshComponent
---@field DefaultSceneRoot USceneComponent
--Edit Below--
local BP_IceTarget = {
ID = -1;
bShowing = false
};
--[[
function BP_IceTarget:ReceiveBeginPlay()
self.SuperClass.ReceiveBeginPlay(self);
end
--]]
--[[
function BP_IceTarget:ReceiveTick(DeltaTime)
self.SuperClass.ReceiveTick(self, DeltaTime);
end
--]]
--[[
function BP_IceTarget:ReceiveEndPlay()
self.SuperClass.ReceiveEndPlay(self);
end
--]]
--[[
function BP_IceTarget:GetReplicatedProperties()
return
end
--]]
--[[
function BP_IceTarget:GetAvailableServerRPCs()
return
end
--]]
function BP_IceTarget:SetID(NewID)
self.ID = NewID
end
function BP_IceTarget:ReceivePointDamage(Damage, DamageType, HitLocation, HitNormal, HitComponent, BoneName, ShotFromDirection, InstigatedBy, DamageCauser, HitInfo)
if UGCGameSystem.IsServer() and self.bShowing then
UGCEventSystem.SendEvent(EventEnum.BreakingIceCubes, InstigatedBy.PlayerKey, self.ID)
self:SetShowTarget(false)
UGCSendRPCSystem.ActorRPCNotify(nil, self, "BoomEffect", InstigatedBy.PlayerKey)
end
end
function BP_IceTarget:SetShowTarget(IsShow)
if UGCGameSystem.IsServer() then
self.bShowing = IsShow
else
self.TargetMesh:SetHiddenInGame(not IsShow)
end
local BlockType = (IsShow and ECollisionEnabled.QueryAndPhysics or ECollisionEnabled.NoCollision)
self.TargetMesh:SetCollisionEnabled(BlockType)
end
function BP_IceTarget:GetIsShowing()
return self.bShowing
end
function BP_IceTarget:BoomEffect(PlayerKey)
if PlayerKey == UGCSystemLibrary.GetLocalPlayerKey() then
SoundSystem.PlaySound(SoundSystem.ESound.AddScore)
else
SoundSystem.PlaySound(SoundSystem.ESound.Impact)
end
self.ParticleBoom:SetActive(true, true);
end
return BP_IceTarget;