11 protected bool m_bAllowAllGroupsToSpawn;
14 protected int m_iGroupID = -1;
16 protected int m_iMaxRespawns;
18 protected int m_iRespawnCount;
21 protected bool CanSpawn(notnull array<SCR_ChimeraCharacter> characters,
Faction spawnPointFaction, vector spawnPointOrigin)
23 SCR_RestrictedDeployableSpawnPointComponent restrictedDeployableSpawnPointComp = SCR_RestrictedDeployableSpawnPointComponent.Cast(m_DeployableSpawnPointComp);
24 if (!restrictedDeployableSpawnPointComp)
27 if (restrictedDeployableSpawnPointComp.GetIgnoreEnemyCharacters())
30 int friendlyCharactersCount, enemyCharactersCount = 0;
32 foreach (SCR_ChimeraCharacter character : characters)
34 if (character.GetCharacterController().IsDead())
37 float distanceToItemSq = (spawnPointOrigin - character.GetOrigin()).LengthSq();
38 float queryRadius = restrictedDeployableSpawnPointComp.GetQueryRadiusCharacters();
39 float queryRadiusSq = queryRadius * queryRadius;
41 if (distanceToItemSq > queryRadiusSq)
46 if (faction.DoCheckIfFactionFriendly(spawnPointFaction))
47 friendlyCharactersCount++;
49 enemyCharactersCount++;
52 return friendlyCharactersCount - enemyCharactersCount >= 0;
56 override bool IsSpawnPointVisibleForPlayer(
int pid)
58 if (m_bAllowAllGroupsToSpawn)
86 SCR_PlayerControllerGroupComponent playerControllerGroupComp = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(pid);
87 if (!playerControllerGroupComp)
90 int localPlayerGroupID = playerControllerGroupComp.GetGroupID();
96 override void OnFinalizeSpawnDone_S(SCR_SpawnRequestComponent requestComponent,
SCR_SpawnData data, IEntity entity)
98 super.OnFinalizeSpawnDone_S(requestComponent,
data, entity);
102 SCR_RestrictedDeployableSpawnPointComponent restrictedDeployableSpawnPointComp = SCR_RestrictedDeployableSpawnPointComponent.Cast(m_DeployableSpawnPointComp);
103 if (!restrictedDeployableSpawnPointComp)
112 if (!super.CanReserveFor_S(playerId, result))
125 FactionManager factionManager =
GetGame().GetFactionManager();
131 if (!CanSpawn(characters, faction,
GetOrigin()))
141 void SetAllowAllGroupsToSpawn(
bool allowAllGroupsToSpawn)
143 m_bAllowAllGroupsToSpawn = allowAllGroupsToSpawn;
144 Replication.BumpMe();
148 void SetGroupID(
int groupID)
151 Replication.BumpMe();
157 return m_iMaxRespawns;
161 void SetMaxRespawns(
int maxRespawns)
163 m_iMaxRespawns = maxRespawns;
167 int GetRespawnCount()
173 void SetRespawnCount(
int respawnCount)