40 protected ref array<SCR_CampaignMilitaryBaseComponent>
m_aBases = {};
64 FactionManager factionManager =
GetGame().GetFactionManager();
65 array<Faction> factions = {};
66 factionManager.GetFactionsList(factions);
68 array<int> baseCallsignIndexes = {};
70 int minBaseCallsignCount =
int.MAX;
71 foreach (
Faction faction : factions)
77 if (!campaignFaction.IsPlayable())
83 baseCallsignIndexes = campaignFaction.GetBaseCallsignIndexes();
86 if (baseCallsignIndexes.IsEmpty())
89 minBaseCallsignCount =
Math.Min(minBaseCallsignCount, baseCallsignIndexes.Count());
93 int predefinedBaseCallsignCount;
97 if (!
base.IsInitialized())
104 if (
base.GetBuiltByPlayers())
107 predefinedBaseCallsignCount++;
118 int factionBuiltBases;
122 if (!
base.GetBuiltByPlayers())
125 baseFactionKey =
base.GetBuiltFaction();
126 if (baseFactionKey.IsEmpty())
141 if (!
m_Campaign.GetEstablishingBasesEnabled())
149 if (factionsWithBuiltBases == 0)
153 int gameModeLimit =
m_Campaign.GetFactionEstablishBaseLimit();
156 if (gameModeLimit == -1)
181 int GetBases(notnull out array<SCR_CampaignMilitaryBaseComponent> bases,
Faction faction = null)
192 if (faction && theBase.GetFaction() != faction)
195 bases.Insert(theBase);
198 return bases.Count();
326 array<SCR_MilitaryBaseComponent> bases = {};
332 if (refreshTargetCount)
335 foreach (SCR_MilitaryBaseComponent
base : bases)
355 void SelectHQs(notnull array<SCR_CampaignMilitaryBaseComponent> candidates, notnull array<SCR_CampaignMilitaryBaseComponent> controlPoints, out notnull array<SCR_CampaignMilitaryBaseComponent> selectedHQs)
357 int candidatesCount = candidates.Count();
358 if (candidatesCount < 2)
371 if (candidatesCount == 2)
379 array<SCR_CampaignMilitaryBaseComponent> preferredForHQ = {};
382 bluforHQ = candidates.GetRandomElement();
383 candidates.RemoveItem(bluforHQ);
385 vector bluforHQPos = bluforHQ.GetOwner().GetOrigin();
386 float distanceBetweenHQs;
387 float acceptableDistanceBetweenHQs =
m_Campaign.GetAcceptableDistanceBetweenFactionHQs() *
m_Campaign.GetAcceptableDistanceBetweenFactionHQs();
388 float preferredDistanceBetweenHQs =
m_Campaign.GetPreferredDistanceBetweenFactionHQs() *
m_Campaign.GetPreferredDistanceBetweenFactionHQs();
393 distanceBetweenHQs =
vector.DistanceSqXZ(bluforHQPos, otherHQ.GetOwner().GetOrigin());
394 if (distanceBetweenHQs > acceptableDistanceBetweenHQs)
396 preferredForHQ.Insert(otherHQ);
399 if (distanceBetweenHQs > preferredDistanceBetweenHQs)
400 preferredForHQ.Insert(otherHQ);
405 if (preferredForHQ.IsEmpty())
406 opforHQ = candidates.GetRandomElement();
408 opforHQ = preferredForHQ.GetRandomElement();
412 if (
Math.RandomFloat01() >= 0.5)
413 selectedHQs = {bluforHQ, opforHQ};
415 selectedHQs = {opforHQ, bluforHQ};
420 protected void SelectHQsSimple(notnull array<SCR_CampaignMilitaryBaseComponent> candidates, out notnull array<SCR_CampaignMilitaryBaseComponent> selectedHQs)
426 selectedHQs = {candidates[0], candidates[1]};
435 selectedHQs = {candidates[0], candidates[1]};
437 selectedHQs = {candidates[1], candidates[0]};
443 candidates.RemoveItem(bluforHQ);
446 if (
Math.RandomFloat01() >= 0.5)
447 selectedHQs = {bluforHQ, opforHQ};
449 selectedHQs = {opforHQ, bluforHQ};
453 void SetHQFactions(notnull array<SCR_CampaignMilitaryBaseComponent> selectedHQs)
462 selectedHQs[0].SetFaction(factionBLUFOR);
463 selectedHQs[1].SetFaction(factionOPFOR);
470 if (selectedHQs[1].
GetFaction() == factionBLUFOR)
471 selectedHQs[0].SetFaction(factionOPFOR);
473 selectedHQs[0].SetFaction(factionBLUFOR);
477 if (selectedHQs[0].
GetFaction() == factionBLUFOR)
478 selectedHQs[1].SetFaction(factionOPFOR);
480 selectedHQs[1].SetFaction(factionBLUFOR);
489 int thresholdCP =
m_Campaign.GetControlPointTreshold();
492 if (thresholdCP == 0)
495 array<SCR_CampaignMilitaryBaseComponent> nearestControlPoints = {};
498 int controlPointsCount;
500 int nearestControlPointsCount;
502 vector HQPos = HQ.GetOwner().GetOrigin();
509 distanceToHQ =
vector.DistanceSqXZ(controlPoint.GetOwner().GetOrigin(), HQPos);
510 controlPointsCount = nearestControlPoints.Count();
511 arrayIndex = controlPointsCount;
513 for (
int i = 0; i < controlPointsCount; i++)
515 if (distanceToHQ <
vector.DistanceSqXZ(HQPos, nearestControlPoints[i].GetOwner().GetOrigin()))
522 nearestControlPointsCount = nearestControlPoints.InsertAt(controlPoint, arrayIndex);
526 if (nearestControlPointsCount == 0)
529 if (thresholdCP < nearestControlPointsCount)
530 nearestControlPoints.Resize(thresholdCP);
536 totalDist +=
vector.DistanceSqXZ(HQPos, controlPoint.GetOwner().GetOrigin());
539 return totalDist / nearestControlPointsCount;
550 FactionManager factionManager =
GetGame().GetFactionManager();
554 array<Faction> allFactions = {};
555 factionManager.GetFactionsList(allFactions);
557 int minCallsignCount =
int.MAX;
558 foreach (
Faction faction : allFactions)
561 if (!campaignFaction || !campaignFaction.IsPlayable())
567 int count = campaignFaction.GetBaseCallsignIndexes().Count();
571 if (count < minCallsignCount)
572 minCallsignCount = count;
575 if (minCallsignCount ==
int.
MAX)
578 for (
int i = 0; i < minCallsignCount; i++)
579 outIndexes.Insert(i);
583 void InitializeBases(notnull array<SCR_CampaignMilitaryBaseComponent> selectedHQs,
bool randomizeSupplies)
585 array<SCR_CampaignMilitaryBaseComponent> basesSorted = {};
587 vector originHQ1 = selectedHQs[0].GetOwner().GetOrigin();
588 vector originHQ2 = selectedHQs[1].GetOwner().GetOrigin();
592 array<int> allCallsignIndexes = {};
596 BaseRadioComponent radio;
601 if (!campaignBase.IsInitialized())
604 defaultFaction = campaignBase.GetFaction(
true);
607 if (!campaignBase.GetFaction())
610 campaignBase.SetFaction(defaultFaction);
616 callsignIndex = allCallsignIndexes.GetRandomIndex();
617 campaignBase.SetCallsignIndex(allCallsignIndexes[callsignIndex]);
618 allCallsignIndexes.Remove(callsignIndex);
624 distanceToHQ =
vector.DistanceSqXZ(originHQ1, campaignBase.GetOwner().GetOrigin());
626 for (
int i = 0, count = basesSorted.Count(); i < count; i++)
628 baseCheckedAgainst = basesSorted[i];
630 if (distanceToHQ <
vector.DistanceSqXZ(originHQ1, baseCheckedAgainst.GetOwner().GetOrigin()))
632 basesSorted.InsertAt(campaignBase, i);
639 basesSorted.Insert(campaignBase);
643 if (randomizeSupplies)
649 void AddRandomSupplies(notnull array<SCR_CampaignMilitaryBaseComponent> basesSorted, notnull array<SCR_CampaignMilitaryBaseComponent> selectedHQs)
651 array<int> suppliesBufferBLUFOR = {};
652 array<int> suppliesBufferOPFOR = {};
665 basePosition =
base.GetOwner().GetOrigin();
669 if (distanceToHQ1 > distanceToHQ2)
670 factionToProcess = selectedHQs[1].GetCampaignFaction().GetFactionKey();
672 factionToProcess = selectedHQs[0].GetCampaignFaction().GetFactionKey();
677 suppliesToAdd = suppliesBufferBLUFOR[0];
678 suppliesBufferBLUFOR.RemoveOrdered(0);
682 suppliesToAdd = suppliesBufferOPFOR[0];
683 suppliesBufferOPFOR.RemoveOrdered(0);
688 suppliesToAdd =
m_Campaign.GetMinStartingSupplies() + (
m_Campaign.GetStartingSuppliesInterval() *
Math.RandomIntInclusive(0, intervalMultiplier));
691 suppliesBufferOPFOR.Insert(suppliesToAdd);
693 suppliesBufferBLUFOR.Insert(suppliesToAdd);
696 base.SetStartingSupplies(suppliesToAdd);
709 SCR_MapDescriptorComponent mapDescriptorComponent;
710 int threshold =
m_Campaign.GetSupplyDepotIconThreshold();
715 depot = comp.GetOwner();
720 mapDescriptorComponent = SCR_MapDescriptorComponent.Cast(depot.
FindComponent(SCR_MapDescriptorComponent));
721 if (!mapDescriptorComponent)
724 item = mapDescriptorComponent.Item();
730 if (
vector.Distance(origin, closestBase.GetOwner().GetOrigin()) <= threshold)
732 item.SetVisible(
true);
735 props = item.GetProps();
736 props.SetIconSize(32, 0.25, 0.25);
737 props.SetFrontColor(colorFIA);
738 props.SetTextVisible(
false);
739 props.Activate(
true);
743 item.SetVisible(
false);
757 SCR_MapDescriptorComponent mapDescriptorComponent;
762 if (
base.IsInitialized())
765 mapDescriptorComponent = SCR_MapDescriptorComponent.Cast(
base.GetOwner().FindComponent(SCR_MapDescriptorComponent));
767 if (!mapDescriptorComponent)
770 item = mapDescriptorComponent.Item();
775 item.SetVisible(
false);
784 if (newSettingsDetected)
803 FactionManager factionManager =
GetGame().GetFactionManager();
804 array<Faction> factions = {};
805 factionManager.GetFactionsList(factions);
807 int controlPointsHeld;
808 int controlPointsContested;
814 foreach (
Faction faction : factions)
818 if (!fCast || !fCast.IsPlayable())
821 controlPointsHeld = 0;
822 controlPointsContested = 0;
827 if (controlPoint.IsInitialized() && controlPoint.GetFaction() == fCast && controlPoint.IsHQRadioTrafficPossible(fCast, SCR_ERadioCoverageStatus.RECEIVE))
831 if (controlPoint.GetCapturingFaction() && controlPoint.GetCapturingFaction() != fCast)
832 controlPointsContested++
836 m_Campaign.SetControlPointsHeld(fCast, controlPointsHeld);
840 int controlPointsThreshold =
m_Campaign.GetControlPointTreshold();
843 if (controlPointsHeld >= controlPointsThreshold)
845 if ((controlPointsHeld - controlPointsContested) < controlPointsThreshold)
847 if (blockPauseTimestamp == 0)
850 else if (blockPauseTimestamp != 0)
852 fCast.
SetVictoryTimestamp(currentTime.PlusMilliseconds(victoryTimestamp.DiffMilliseconds(blockPauseTimestamp)));
856 if (victoryTimestamp == 0)
870 if (!
m_aBases || !target || !target.m_Faction || !group)
879 if (
base.ContainsGroup(group))
881 base.NotifyAboutEnemyAttack(target.m_Faction);
891 float closestBaseDistance =
float.MAX;
895 if (!
base.IsInitialized())
898 if (searchedType > -1 &&
base.GetType() != searchedType)
916 if (callsign == SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN)
924 if (
base.GetCallsign() == callsign)
950 float closestDepotDistance =
float.MAX;
956 if (
distance < closestDepotDistance)
959 closestDepot = depot;
974 SCR_CampaignMobileAssemblyStandaloneComponent mobileHQ = factionC.
GetMobileAssembly();
976 if (mobileHQ && mobileHQ.GetOwner() != entity && mobileHQ.IsInRadioRange())
978 if (
vector.DistanceSq(entity.GetOrigin(), mobileHQ.GetOwner().GetOrigin()) <
Math.Pow(mobileHQ.GetRadioRange(), 2))
987 if (faction !=
base.GetFaction())
990 if (
base.GetIsEntityInMyRange(entity) &&
base.IsHQRadioTrafficPossible(factionC))
1005 if (!campaignFaction)
1009 SCR_CampaignMobileAssemblyStandaloneComponent mobileHQ = campaignFaction.
GetMobileAssembly();
1010 if (mobileHQ && mobileHQ.IsInRadioRange())
1012 if (
vector.DistanceSq(
position, mobileHQ.GetOwner().GetOrigin()) <
Math.Pow(mobileHQ.GetRadioRange() + signalRangeOffset, 2))
1021 if (faction !=
base.GetFaction())
1024 if (
vector.DistanceSq(
position,
base.GetOwner().GetOrigin()) <=
Math.Pow(
base.GetRadioRange() + signalRangeOffset, 2) &&
base.IsHQRadioTrafficPossible(campaignFaction))
1040 array<SCR_AmbientPatrolSpawnPointComponent> patrols = {};
1046 bool register =
true;
1053 foreach (SCR_AmbientPatrolSpawnPointComponent patrol : patrols)
1055 minDistance =
float.MAX;
1057 center = patrol.GetOwner().GetOrigin();
1065 dist =
vector.DistanceSqXZ(center,
base.GetOwner().GetOrigin());
1069 if (dist < distLimitHQ)
1071 patrol.SetMembersAlive(0);
1075 else if (dist < distLimitHQPatrol)
1077 AIWaypointCycle waypoint = AIWaypointCycle.Cast(patrol.GetWaypoint());
1081 patrol.SetMembersAlive(0);
1088 if (dist > distLimit || dist > minDistance)
1103 if (
register && nearestBase)
1114 if (!
base.IsInitialized())
1117 if (
base.GetCapturingFaction() &&
base.GetReconfiguredByID() == playerId)
1147 void OnServiceBuilt(SCR_EServicePointStatus state, notnull SCR_ServicePointComponent serviceComponent)
1162 SCR_CatalogEntitySpawnerComponent spawner = SCR_CatalogEntitySpawnerComponent.Cast(service);
1167 spawner.GetOnEntitySpawned().Remove(
m_Campaign.OnEntityRequested);
1181 if (!onEnemyDetected)
1186 array<SCR_MilitaryBaseComponent> bases = {};
1187 service.GetBases(bases);
1189 foreach (SCR_MilitaryBaseComponent
base : bases)
1208 array<SCR_CampaignMilitaryBaseComponent> controlPointsInRange = {};
1213 if (!
base.IsInitialized() ||
base.IsHQ())
1216 if (
base.GetFaction() == faction)
1219 if (!
base.IsHQRadioTrafficPossible(faction))
1222 controlPointsInRange.Insert(
base);
1226 int minDistance =
int.MAX;
1229 if (!controlPointsInRange.IsEmpty())
1231 array<SCR_CampaignMilitaryBaseComponent> ownedBases = {};
1236 if (!
base.IsInitialized())
1239 if (
base.GetFaction() != faction)
1242 if (!
base.IsHQRadioTrafficPossible(faction))
1245 ownedBases.Insert(
base);
1250 vector positionCP = controlPoint.GetOwner().GetOrigin();
1260 target = controlPoint;
1266 array<SCR_CampaignMilitaryBaseComponent> basesInRange = {};
1271 if (!
base.IsInitialized() ||
base.IsHQ())
1274 if (
base.GetFaction() == faction)
1277 if (!
base.IsHQRadioTrafficPossible(faction))
1280 basesInRange.Insert(
base);
1285 if (!controlPoint.IsInitialized() || controlPoint.IsHQ())
1288 if (controlPoint.GetFaction() == faction)
1291 vector positionCP = controlPoint.GetOwner().GetOrigin();
1296 bool closer =
distance < minDistance;
1297 bool coversControlPoint =
base.CanReachByRadio(controlPoint.GetOwner());
1299 if (!coversControlPoint && !closer)
1317 array<Managed> outComponents = {};
1321 Managed entityComponent = child.
FindComponent(SCR_AmbientPatrolSpawnPointComponent);
1322 if (entityComponent)
1323 outComponents.Insert(entityComponent);
1328 SCR_AmbientPatrolSpawnPointComponent component;
1329 foreach (Managed outComponent : outComponents)
1331 component = SCR_AmbientPatrolSpawnPointComponent.Cast(outComponent);
1335 component.SetMembersAlive(0);
1343 params.TransformMode = ETransformMode.WORLD;
1344 base.GetOwner().GetTransform(
params.Transform);
1346 const IEntity entity =
GetGame().SpawnEntityPrefab(
Resource.Load(
"{1391CE8C0E255636}Prefabs/Systems/MilitaryBase/ConflictMilitaryBase.et"), null,
params);
1355 const IEntity baseComposition =
base.GetOwner().GetParent();
1356 if (baseComposition)
1410 array<int> callsignsPool = {};
1416 if (!existingBase.IsInitialized())
1419 callsignsPool.RemoveItem(existingBase.GetCallsign());
1422 base.SetCallsignIndex(callsignsPool.GetRandomElement());
1423 base.OnCallsignAssigned();
1425 base.SetBuiltByPlayers(
true);
1426 base.SetBuiltFaction(
base.GetFaction());
1445 FactionKey factionKey = faction.GetFactionKey();
1455 if (newSettingsDetected)
1478 if (militaryBaseSystem)
1502 if (militaryBaseSystem)
ArmaReforgerScripted GetGame()
RplMode
Mode of replication.
ScriptInvokerBase< OnBaseStateChangedDelegate > OnBaseStateChangedInvoker
ScriptInvokerBase< OnAllBasesInitializedDelegate > OnAllBasesInitializedInvoker
func OnLocalPlayerLeftBaseDelegate
ScriptInvokerBase< OnBaseBuiltDelegate > OnBaseBuiltInvoker
ScriptInvokerBase< OnLocalPlayerEnteredBaseDelegate > OnLocalPlayerEnteredBaseInvoker
func OnSignalChangedDelegate
func OnAllBasesInitializedDelegate
func OnLocalFactionCapturedBaseDelegate
ScriptInvokerBase< OnSignalChangedDelegate > OnSignalChangedInvoker
ScriptInvokerBase< OnLocalFactionCapturedBaseDelegate > OnLocalFactionCapturedBaseInvoker
ScriptInvokerBase< OnLocalPlayerLeftBaseDelegate > OnLocalPlayerLeftBaseInvoker
func OnLocalPlayerEnteredBaseDelegate
SCR_CampaignFaction GetFaction()
void SCR_CampaignSuppliesComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_RespawnComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
proto external IEntity GetChildren()
proto external IEntity GetSibling()
Object holding reference to resource. In destructor release the resource.
ScriptInvokerBase< SCR_AIGroupPerceptionOnEnemyDetectedFiltered > GetOnEnemyDetectedFiltered()
ref SCR_AIGroupPerception m_Perception
static SCR_AmbientPatrolSystem GetInstance()
int GetPatrols(notnull out array< SCR_AmbientPatrolSpawnPointComponent > patrols)
SCR_CampaignMobileAssemblyStandaloneComponent GetMobileAssembly()
void SetVictoryTimestamp(WorldTimestamp timestamp)
WorldTimestamp GetPauseByBlockTimestamp()
void SetPauseByBlockTimestamp(WorldTimestamp timestamp)
WorldTimestamp GetVictoryTimestamp()
void RegisterRemnants(notnull SCR_AmbientPatrolSpawnPointComponent remnants)
void SetFaction(SCR_CampaignFaction faction)
void OnBaseCreatedAsFOB(Faction establishingFaction)
Event which is triggered when creating a FOB.
FactionKey GetBuiltFaction()
void SetDefendersGroup(SCR_AIGroup grp)
void SetBaseBuildingComposition(IEntity building)
void OnServiceRemoved(notnull SCR_MilitaryBaseLogicComponent service)
void CountFactionEstablishedBasesAmount()
Goes through all bases and counts the amount of established bases for each faction.
SCR_CampaignMilitaryBaseComponent FindClosestBase(vector position, SCR_ECampaignBaseType searchedType=-1)
void OnBaseFactionChanged(SCR_MilitaryBaseComponent base, Faction newFaction)
void CreateCampaignMilitaryBase(notnull SCR_MilitaryBaseComponent base)
void EvaluateControlPoints()
ref array< SCR_CampaignMilitaryBaseComponent > m_aControlPoints
void SetHQFactions(notnull array< SCR_CampaignMilitaryBaseComponent > selectedHQs)
static const int HQ_NO_REMNANTS_PATROL_RADIUS
ref map< FactionKey, int > m_mFactionEstablishedBasesAmount
void RegisterRemnantSupplyDepot(notnull SCR_CampaignSuppliesComponent comp)
void CalculateMaxAvailableCallsignAmount()
Calculates the maximum amount of available callsigns for establishing of new bases.
static const int PARENT_BASE_DISTANCE_THRESHOLD
void RecalculateRadioCoverage(notnull SCR_CampaignFaction faction)
Determine the radio coverage of all bases (no coverage / can be reached / can respond / both ways).
ref OnSignalChangedInvoker m_OnSignalChanged
OnLocalPlayerLeftBaseInvoker GetOnLocalPlayerLeftBase()
ref OnBaseBuiltInvoker m_OnBaseBuilt
ref array< SCR_CampaignMilitaryBaseComponent > m_aBases
OnSignalChangedInvoker GetOnSignalChanged()
Triggered when a base's radio coverage changes.
SCR_CampaignMilitaryBaseComponent FindBaseByPosition(vector position)
void SetLocalPlayerFaction(notnull SCR_CampaignFaction faction)
SCR_CampaignMilitaryBaseComponent FindBaseByCallsign(int callsign)
OnAllBasesInitializedInvoker GetOnAllBasesInitialized()
Triggered when all bases have been successfully initialized.
ref OnAllBasesInitializedInvoker m_OnAllBasesInitialized
static const int HQ_NO_REMNANTS_RADIUS
void OnBaseUnregistered(SCR_MilitaryBaseComponent base)
SCR_CampaignSuppliesComponent FindClosestSupplyDepot(vector position)
bool m_bAllBasesInitialized
void OnPlayerDisconnected(int playerId)
void OnBaseInitialized(notnull SCR_CampaignMilitaryBaseComponent base)
void DisablePatrolSpawn(IEntity entity)
void InitializeBases(notnull array< SCR_CampaignMilitaryBaseComponent > selectedHQs, bool randomizeSupplies)
SCR_CampaignFaction GetLocalPlayerFaction()
bool CanFactionBuildNewBase(notnull Faction faction)
int UpdateBases(bool refreshTargetCount=false)
Update the list of Conflict bases.
ref OnLocalPlayerLeftBaseInvoker m_OnLocalPlayerLeftBase
void DelayedEvaluateControlPoints(int delay)
SCR_CampaignFaction m_LocalPlayerFaction
SCR_CampaignMilitaryBaseComponent SelectAndReturnPrimaryTarget(notnull SCR_CampaignFaction faction)
static const float PARKED_LIFETIME
void OnBaseRegistered(notnull SCR_MilitaryBaseComponent base)
static OnBaseBuiltInvoker GetOnBaseDisassembled()
SCR_GameModeCampaign m_Campaign
void OnDefenderGroupSpawned(notnull SCR_MilitaryBaseLogicComponent service, notnull SCR_AIGroup group)
Called when a new AI group is spawned by Free Roam Building.
bool IsPositionInFactionRadioSignal(vector position, notnull Faction faction, float signalRangeOffset=0)
OnLocalPlayerEnteredBaseInvoker GetOnLocalPlayerEnteredBase()
OnBaseBuiltInvoker GetOnBaseBuilt()
static const float MAX_DIST_TO_BASE
void ProcessRemnantsPresence()
Clean up ambient patrols around Main Operating Bases, assign parent bases where applicable.
void SetTargetActiveBasesCount(int count)
void InitializeSupplyDepotIcons()
Show icons only for supply depots close enough to an active base.
int GetActiveBasesCount()
Bases which have been initialized.
void AddRandomSupplies(notnull array< SCR_CampaignMilitaryBaseComponent > basesSorted, notnull array< SCR_CampaignMilitaryBaseComponent > selectedHQs)
Add randomized supplies to each base, calculate batches so each side encounters similarly stacked bas...
static ref OnBaseBuiltInvoker s_OnBaseDisassembled
static const int DEPOT_PLAYER_PRESENCE_CHECK_INTERVAL
void HideUnusedBaseIcons()
static ref OnBaseStateChangedInvoker m_OnBaseCreated
void OnEnemyDetectedByDefenders(SCR_AIGroup group, SCR_AITargetInfo target, AIAgent reporter)
static const int MAX_HQ_SELECTION_ITERATIONS
void OnServiceBuilt(SCR_EServicePointStatus state, notnull SCR_ServicePointComponent serviceComponent)
int m_iMaxAvailableCallsignsAmount
ref OnLocalPlayerEnteredBaseInvoker m_OnLocalPlayerEnteredBase
int GetAvgCPDistanceSq(notnull SCR_CampaignMilitaryBaseComponent HQ, notnull array< SCR_CampaignMilitaryBaseComponent > controlPoints)
Returns squared average distance to control points - used for starting HQ location calculations.
void DisableExtraSeizingComponents(SCR_MilitaryBaseComponent base, SCR_MilitaryBaseLogicComponent logic)
void OnAllBasesInitialized()
static const float CP_AVG_DISTANCE_TOLERANCE
void OnLocalPlayerPresenceChanged(notnull SCR_CampaignMilitaryBaseComponent base, bool present)
void SetFactionBaseEstablished(Faction faction)
void SelectHQsSimple(notnull array< SCR_CampaignMilitaryBaseComponent > candidates, out notnull array< SCR_CampaignMilitaryBaseComponent > selectedHQs)
If there are only two candidates for main HQ or the main process fails, HQs are selected simply and c...
bool IsEntityInFactionRadioSignal(notnull IEntity entity, notnull Faction faction)
ref array< SCR_CampaignSuppliesComponent > m_aRemnantSupplyDepots
static const string ICON_NAME_SUPPLIES
void SelectHQs(notnull array< SCR_CampaignMilitaryBaseComponent > candidates, notnull array< SCR_CampaignMilitaryBaseComponent > controlPoints, out notnull array< SCR_CampaignMilitaryBaseComponent > selectedHQs)
Picks Main Operating Bases from a list of candidates by checking average distance to active control p...
void ~SCR_CampaignMilitaryBaseManager()
int GetTargetActiveBasesCount()
Total bases expected to be initialized.
int GetBases(notnull out array< SCR_CampaignMilitaryBaseComponent > bases, Faction faction=null)
void OnServiceRemoved(notnull SCR_MilitaryBaseComponent base, notnull SCR_MilitaryBaseLogicComponent service)
void GetSharedCallsignPool(notnull array< int > outIndexes)
void RecalculateRadioCoverageForced(notnull SCR_CampaignFaction faction)
Determine the radio coverage of all bases (no coverage / can be reached / can respond / both ways).
void SCR_CampaignMilitaryBaseManager(notnull SCR_GameModeCampaign campaign)
OnLogicPresenceChangedInvoker GetOnLogicUnregisteredInBase()
int GetBases(notnull out array< SCR_MilitaryBaseComponent > bases)
OnBaseFactionChangedInvoker GetOnBaseFactionChanged()
OnBaseRegisteredInvoker GetOnBaseRegistered()
static SCR_MilitaryBaseSystem GetInstance()
OnBaseUnregisteredInvoker GetOnBaseUnregistered()
OnLogicPresenceChangedInvoker GetOnLogicRegisteredInBase()
static bool UpdateAll(bool forceRecalculation=false)
IEntity GetOwner()
Owner entity of the fuel tank.