7 class SCR_BaseDeployableSpawnPointComponent : SCR_BaseDeployableInventoryItemComponent
13 [
Attribute(
"{84680168E273774F}Prefabs/MP/Spawning/DeployableItemSpawnPoint_Base.et")]
31 protected static bool s_bDeployableSpawnPointsEnabled;
36 if (!s_OnSpawnPointDismantled)
39 return s_OnSpawnPointDismantled;
43 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
50 [
RplRpc(RplChannel.Unreliable, RplRcver.Broadcast)]
53 SoundComponent soundComp = SoundComponent.Cast(
GetOwner().FindComponent(SoundComponent));
60 soundComp.SoundEvent(
SCR_SoundEvent.SOUND_DEPLOYED_RADIO_UNDEPLOY);
66 SignalsManagerComponent signalsManagerComp = SignalsManagerComponent.Cast(
GetOwner().FindComponent(SignalsManagerComponent));
67 if (!signalsManagerComp)
70 int radioChatter = signalsManagerComp.FindSignal(
"DeployableRadioChatter");
73 signalsManagerComp.SetSignalValue(radioChatter, 1);
75 signalsManagerComp.SetSignalValue(radioChatter, 0);
94 override void Deploy(IEntity userEntity =
null)
97 if (!s_bDeployableSpawnPointsEnabled)
109 EntitySpawnParams
params =
new EntitySpawnParams();
110 params.Transform = transform;
111 params.TransformMode = ETransformMode.WORLD;
114 if (!resource.IsValid())
121 RplComponent rplCompReplacementEntity = RplComponent.Cast(
m_ReplacementEntity.FindComponent(RplComponent));
122 if (!rplCompReplacementEntity)
126 if (!replacementComp)
129 vector compositionTransform[4], combinedTransform[4];
130 replacementComp.GetItemTransform(compositionTransform);
131 Math3D.MatrixMultiply4(transform, compositionTransform, combinedTransform);
139 if (!resource.IsValid())
146 RplComponent rplCompSpawnpoint = RplComponent.Cast(
m_SpawnPoint.FindComponent(RplComponent));
147 if (!rplCompSpawnpoint)
154 Replication.BumpMe();
157 m_iItemOwnerID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(userEntity);
170 garbageSystem.Withdraw(owner);
181 RplComponent rplComp;
184 rplComp = RplComponent.Cast(
m_SpawnPoint.FindComponent(RplComponent));
204 Replication.BumpMe();
210 int userID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(userEntity);
211 if (s_OnSpawnPointDismantled)
212 s_OnSpawnPointDismantled.Invoke(userID);
224 garbageSystem.Insert(owner);
228 protected static void OnSpawnPointDeployingEnabledChanged(
bool enabled)
230 s_bDeployableSpawnPointsEnabled = enabled;
237 spawnPointComp.Dismantle();
243 static array<SCR_BaseDeployableSpawnPointComponent> GetActiveDeployedSpawnPoints()
258 void Update(
float timeSlice);
263 World world =
GetOwner().GetWorld();
268 updateSystem.Register(
this);
274 World world =
GetOwner().GetWorld();
279 updateSystem.Unregister(
this);
285 super.EOnInit(owner);
287 BaseGameMode gameMode =
GetGame().GetGameMode();
291 SCR_PlayerSpawnPointManagerComponent playerSpawnPointManager = SCR_PlayerSpawnPointManagerComponent.Cast(gameMode.FindComponent(SCR_PlayerSpawnPointManagerComponent));
292 if (!playerSpawnPointManager)
294 OnSpawnPointDeployingEnabledChanged(
true);
298 OnSpawnPointDeployingEnabledChanged(playerSpawnPointManager.IsDeployingSpawnPointsEnabled());
299 playerSpawnPointManager.GetOnSpawnPointDeployingEnabledChanged().Insert(OnSpawnPointDeployingEnabledChanged);
306 BaseGameMode gameMode =
GetGame().GetGameMode();
309 SCR_PlayerSpawnPointManagerComponent playerSpawnPointManager = SCR_PlayerSpawnPointManagerComponent.Cast(gameMode.FindComponent(SCR_PlayerSpawnPointManagerComponent));
310 if (playerSpawnPointManager)
311 playerSpawnPointManager.GetOnSpawnPointDeployingEnabledChanged().Remove(OnSpawnPointDeployingEnabledChanged);