9 [
Attribute(
"1",
desc:
"Run Conflict automatically at scenario start. If disabled, use RequestStart() method on server.",
category:
"Campaign")]
10 protected bool m_bAutostart;
18 [
Attribute(
"300",
desc:
"How long does a faction need to hold the control points to win (seconds).",
params:
"0 inf 1",
category:
"Campaign")]
21 [
Attribute(
"1000",
desc:
"Supplies will be autoreplenished in bases until this limit is reached.",
params:
"0 inf 1",
category:
"Campaign")]
24 [
Attribute(
"200",
desc:
"Supplies will be autoreplenished in bases quickly until this limit is reached (HQs are not affected).",
params:
"0 inf 1",
category:
"Campaign")]
27 [
Attribute(
"2",
desc:
"Supplies income will be multiplied by this number unless the quick replenish threshold has been reached.",
params:
"1 inf 0.05",
category:
"Campaign")]
39 [
Attribute(
"4",
desc:
"How many extra supplies are periodically replenished in non-HQ bases per base connected via radio.",
params:
"0 inf 1",
category:
"Campaign")]
45 [
Attribute(
"100",
desc:
"When randomized, the least supplies a base can hold at the start.",
params:
"0 inf 1",
category:
"Campaign")]
48 [
Attribute(
"500",
desc:
"When randomized, the most supplies a base can hold at the start.",
params:
"0 inf 1",
category:
"Campaign")]
51 [
Attribute(
"25",
desc:
"The step by which randomized supplies will be added in randomization. Min and Max limits should be divisible by this.",
params:
"1 inf 1",
category:
"Campaign")]
63 [
Attribute(
"1", UIWidgets.CheckBox,
"Randomized starting supplies in small bases",
category:
"Campaign")]
69 [
Attribute(
"1200", UIWidgets.EditBox,
"The furthest an independent supply depot can be from the nearest base to still be visible in the map.",
params:
"0 inf 1",
category:
"Campaign")]
72 [
Attribute(
"{B3E7B8DC2BAB8ACC}Prefabs/AI/Waypoints/AIWaypoint_SearchAndDestroy.et",
category:
"Campaign")]
75 [
Attribute(
"1800", UIWidgets.EditBox,
"If suicide is committed more than once in this time (seconds), a respawn penalty is issued.",
params:
"0 inf 1",
category:
"Campaign")]
78 [
Attribute(
"30", UIWidgets.EditBox,
"Stacking extra deploy cooldown after suicide (seconds). Gets deducted over time.",
params:
"0 inf 1",
category:
"Campaign")]
81 [
Attribute(
"600", UIWidgets.EditBox,
"How often is the post-suicide deploy cooldown penalty deducted (seconds).",
params:
"0 inf 1",
category:
"Campaign")]
84 static const int MINIMUM_DELAY = 100;
85 static const int UI_UPDATE_DELAY = 250;
86 static const int MEDIUM_DELAY = 1000;
87 static const int DEFAULT_DELAY = 2000;
88 static const int BACKEND_DELAY = 25000;
111 [
RplProp(onRplName:
"OnStarted")]
114 [
RplProp(onRplName:
"OnMatchSituationChanged")]
117 [
RplProp(onRplName:
"OnMatchSituationChanged")]
120 [
RplProp(onRplName:
"OnMatchSituationChanged")]
123 [
RplProp(onRplName:
"OnCallsignOffsetChanged")]
334 writer.WriteInt(controlPointsHeldBLUFOR);
335 writer.WriteInt(controlPointsHeldOPFOR);
337 writer.WriteInt(primaryTargetBLUFOR);
338 writer.WriteInt(primaryTargetOPFOR);
347 int activeBasesTotal;
349 reader.ReadInt(activeBasesTotal);
356 int controlPointsHeldBLUFOR, controlPointsHeldOPFOR, primaryTargetBLUFOR, primaryTargetOPFOR;
358 reader.ReadInt(controlPointsHeldBLUFOR);
359 reader.ReadInt(controlPointsHeldOPFOR);
361 reader.ReadInt(primaryTargetBLUFOR);
362 reader.ReadInt(primaryTargetOPFOR);
382 if (faction.GetControlPointsHeld() == newCount)
385 int index =
GetGame().GetFactionManager().GetFactionIndex(faction);
392 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
400 faction.SetControlPointsHeld(count);
407 if (faction.GetPrimaryTarget() == target)
410 int index =
GetGame().GetFactionManager().GetFactionIndex(faction);
411 RplId targetId = RplId.Invalid();
414 targetId = Replication.FindId(target);
421 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
437 if (RplSession.Mode() != RplMode.Dedicated)
442 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
445 SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.GetInstance();
450 comp.MobileAssemblyFeedback(msgID, playerID, factionID)
474 bool whitelist =
false;
475 array<string> customBaseList = {};
481 whitelist = header.m_bCustomBaseWhitelist;
482 customHQSupplies = header.m_iStartingHQSupplies;
484 foreach (SCR_CampaignCustomBase customBase : header.m_aCampaignCustomBaseList)
486 customBaseList.Insert(customBase.GetBaseName());
490 array<SCR_CampaignMilitaryBaseComponent> candidatesForHQ = {};
491 array<SCR_CampaignMilitaryBaseComponent> controlPoints = {};
492 array<SCR_MilitaryBaseComponent> bases = {};
493 baseManager.GetBases(bases);
499 foreach (SCR_MilitaryBaseComponent base : bases)
509 baseName = campaignBase.GetOwner().GetName();
510 listIndex = customBaseList.Find(baseName);
522 if (whitelist && listIndex != -1)
523 campaignBase.ApplyHeaderSettings(header.m_aCampaignCustomBaseList[listIndex]);
526 if (!campaignBase.DisableWhenUnusedAsHQ() || !campaignBase.CanBeHQ())
528 campaignBase.Initialize();
532 if (campaignBase.CanBeHQ())
533 candidatesForHQ.Insert(campaignBase);
535 if (campaignBase.IsControlPoint())
536 controlPoints.Insert(campaignBase);
541 if (candidatesForHQ.Count() < 2)
543 Print(
"Not enough suitable starting locations found in current setup. Check 'Can Be HQ' attributes in SCR_CampaignMilitaryBaseComponent!", LogLevel.ERROR);
548 array<SCR_CampaignMilitaryBaseComponent> selectedHQs = {};
549 m_BaseManager.SelectHQs(candidatesForHQ, controlPoints, selectedHQs);
556 if (customHQSupplies == -1)
559 hq.SetStartingSupplies(customHQSupplies);
561 if (!hq.IsInitialized())
578 Replication.BumpMe();
580 array<SCR_SpawnPoint> spawnpoints =
SCR_SpawnPoint.GetSpawnPoints();
599 Replication.BumpMe();
626 spawnpoint.SetFaction(
null);
633 FactionManager factionManager =
GetGame().GetFactionManager();
634 array<Faction> factions = {};
635 factionManager.GetFactionsList(factions);
637 WorldTimestamp curTime = world.GetServerTimestamp();
638 WorldTimestamp lowestVictoryTimestamp;
639 WorldTimestamp blockPauseTimestamp;
640 WorldTimestamp actualVictoryTimestamp;
643 foreach (
Faction faction : factions)
647 if (!fCast || !fCast.IsPlayable())
650 blockPauseTimestamp = fCast.GetPauseByBlockTimestamp();
652 if (blockPauseTimestamp == 0)
653 actualVictoryTimestamp = fCast.GetVictoryTimestamp();
655 actualVictoryTimestamp = curTime.PlusMilliseconds(
656 fCast.GetVictoryTimestamp().DiffMilliseconds(fCast.GetPauseByBlockTimestamp())
659 if (actualVictoryTimestamp != 0)
661 if (!winner || actualVictoryTimestamp.Less(lowestVictoryTimestamp))
663 lowestVictoryTimestamp = actualVictoryTimestamp;
671 if (lowestVictoryTimestamp.LessEqual(curTime))
674 int winnerId = factionManager.GetFactionIndex(winner);
685 Replication.BumpMe();
694 Replication.BumpMe();
699 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
707 FactionManager fManager =
GetGame().GetFactionManager();
708 array<Faction> factions = {};
709 fManager.GetFactionsList(factions);
710 Faction winningFaction = fManager.GetFactionByIndex(winningFactionId);
714 foreach (
Faction faction : factions)
721 if (winningFaction == f)
722 f.SendHQMessage(
SCR_ERadioMsg.VICTORY, param: winningFactionId);
724 f.SendHQMessage(
SCR_ERadioMsg.DEFEAT, param: winningFactionId);
736 EndGameMode(endData);
742 super.OnWorldPostProcess(world);
774 return FactionKey.Empty;
780 FactionManager fManager =
GetGame().GetFactionManager();
826 array<ref SCR_CampaignBaseStruct>basesStructs =
m_LoadedData.GetBasesStructs();
829 if (basesStructs.IsEmpty())
838 if (RplSession.Mode() != RplMode.Dedicated)
847 SCR_TimeAndWeatherHandlerComponent timeHandler = SCR_TimeAndWeatherHandlerComponent.GetInstance();
852 GetGame().GetCallqueue().Remove(timeHandler.SetupDaytimeAndWeather);
856 SCR_CampaignTutorialArlandComponent tutorial = SCR_CampaignTutorialArlandComponent.Cast(FindComponent(SCR_CampaignTutorialArlandComponent));
860 tutorial.SetResumeStage(
m_LoadedData.GetTutorialStage());
865 Replication.BumpMe();
874 if (factionBLUFOR &&
m_LoadedData.GetMHQLocationBLUFOR() != vector.Zero)
877 if (factionOPFOR &&
m_LoadedData.GetMHQLocationOPFOR() != vector.Zero)
897 array<int> remnantsInfo = {};
899 for (
int i = 0, count = manager.GetRemainingPatrolsInfo(remnantsInfo); i < count; i++)
902 struct.SetID(remnantsInfo[i]);
903 struct.SetMembersAlive(remnantsInfo[i + 1]);
904 struct.SetRespawnTimer(remnantsInfo[i + 2]);
905 outEntries.Insert(
struct);
918 array<SCR_AmbientPatrolSpawnPointComponent> patrols = {};
919 manager.GetPatrols(patrols);
921 WorldTimestamp curTime = world.GetServerTimestamp();
923 foreach (SCR_AmbientPatrolSpawnPointComponent presence : patrols)
930 if (info.GetID() == presence.GetID())
932 presence.SetMembersAlive(info.GetMembersAlive());
933 presence.SetRespawnTimestamp(curTime.PlusMilliseconds(info.GetRespawnTimer()));
947 SCR_CampaignTutorialArlandComponent tutorial = SCR_CampaignTutorialArlandComponent.Cast(FindComponent(SCR_CampaignTutorialArlandComponent));
950 tutorial.OnStructureBuilt(base, entity.GetOwner());
952 SCR_CampaignTutorialArlandComponent.GetOnStructureBuilt().Invoke(base, entity.GetOwner());
970 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(playerId);
980 bool allowFactionLoad =
true;
984 allowFactionLoad =
false;
988 int forcedFaction = clientData.GetFactionIndex();
990 if (allowFactionLoad && forcedFaction != -1)
996 Faction faction =
GetGame().GetFactionManager().GetFactionByIndex(forcedFaction);
997 fac.RequestFaction(faction);
1002 SCR_PlayerXPHandlerComponent handlerXP = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1005 xp = handlerXP.GetPlayerXP();
1007 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1010 comp.AwardXP(playerId,
SCR_EXPRewards.UNDEFINED, 1,
false, clientData.GetXP() - xp);
1012 SCR_FastTravelComponent fastTravel = SCR_FastTravelComponent.Cast(pc.FindComponent(SCR_FastTravelComponent));
1015 fastTravel.SetNextTransportTimestamp(clientData.GetNextFastTravelTimestamp());
1027 clientData.SetID(playerData.GetID());
1028 clientData.SetXP(playerData.GetXP());
1029 clientData.SetFactionIndex(playerData.GetFactionIndex());
1038 array<int> pcList = {};
1040 for (
int i = 0, playersCount =
GetGame().GetPlayerManager().
GetPlayers(pcList); i < playersCount; i++)
1042 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(pcList[i]);
1047 int ID = pc.GetPlayerId();
1054 protected void WriteClientData(
int playerID,
bool disconnecting =
false, PlayerController pc =
null)
1062 pc =
GetGame().GetPlayerManager().GetPlayerController(playerID);
1067 SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1073 clientData.SetXP(comp.GetPlayerXP());
1079 if (faction.GetMobileAssembly())
1082 EntitySpawnParams
params = EntitySpawnParams();
1083 GetWorldTransform(
params.Transform);
1084 params.TransformMode = ETransformMode.WORLD;
1085 Math3D.AnglesToMatrix(rot,
params.Transform);
1086 params.Transform[3] = pos;
1088 IEntity
MHQ =
GetGame().SpawnEntityPrefab(Resource.Load(faction.GetMobileHQPrefab()),
null,
params);
1093 BaseRadioComponent radioComponent = BaseRadioComponent.Cast(
MHQ.FindComponent(BaseRadioComponent));
1095 if (radioComponent && radioComponent.TransceiversCount() > 0)
1097 radioComponent.SetPower(
false);
1098 radioComponent.GetTransceiver(0).SetFrequency(faction.GetFactionRadioFrequency());
1099 radioComponent.SetEncryptionKey(faction.GetFactionRadioEncryptionKey());
1102 SlotManagerComponent slotManager = SlotManagerComponent.Cast(
MHQ.FindComponent(SlotManagerComponent));
1107 array<EntitySlotInfo> slots = {};
1108 slotManager.GetSlotInfos(slots);
1112 IEntity truckBed = slot.GetAttachedEntity();
1117 SCR_CampaignMobileAssemblyComponent mobileAssemblyComponent = SCR_CampaignMobileAssemblyComponent.Cast(truckBed.FindComponent(SCR_CampaignMobileAssemblyComponent));
1119 if (mobileAssemblyComponent)
1122 mobileAssemblyComponent.UpdateRadioCoverage();
1137 dataArray.Insert(
data);
1152 if (playerIdentity ==
string.Empty)
1170 clientData.SetID(playerIdentity);
1180 SCR_HelicopterDamageManagerComponent helicopterDamageManager = SCR_HelicopterDamageManagerComponent.Cast(vehicle.FindComponent(SCR_HelicopterDamageManagerComponent));
1183 if (!helicopterDamageManager)
1186 array<HitZone> hitZones = {};
1187 helicopterDamageManager.GetAllHitZones(hitZones);
1188 vector transform[3];
1189 transform[0] = vehicle.GetOrigin();
1190 transform[1] = vector.Forward;
1191 transform[2] = vector.Up;
1196 foreach (
HitZone hitZone : hitZones)
1198 if (!hitZone.IsInherited(
SCR_EngineHitZone) && !hitZone.IsInherited(SCR_FlammableHitZone))
1205 helicopterDamageManager.HandleDamage(damageContext);
1208 array<SCR_FuelManagerComponent> fuelManagers = {};
1209 array<BaseFuelNode> fuelNodes = {};
1216 fuelManager.GetFuelNodesList(fuelNodes);
1220 fuelNode.SetFuel(0.0);
1231 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(owner);
1239 if (!factionManager)
1249 if (newRank < oldRank && !rank.IsRankRenegade())
1252 radio = rank.GetRadioMsg();
1254 faction.SendHQMessage(radio, calledID: playerId,
public:
false, param: newRank)
1262 if (playerController)
1266 if (playerFactionAff)
1273 super.OnPlayerRegistered(playerId);
1275 if (!playerController)
1303 super.OnPlayerAuditSuccess(iPlayerID);
1306 if (RplSession.Mode() != RplMode.None)
1313 super.OnPlayerDisconnected(playerId, cause, timeout);
1322 if (!super.CanPlayerSpawn_S(requestComponent, handlerComponent,
data, result))
1329 IEntity parent = spawnPointData.GetSpawnPoint().GetParent();
1337 parent = parent.GetParent();
1345 int spawnSupplyCost = 0;
1349 spawnSupplyCost = SCR_ArsenalManagerComponent.GetLoadoutCalculatedSupplyCost(loadoutComp.GetLoadout(),
false, requestComponent.GetPlayerId(),
null, base, base.GetResourceComponent());
1352 if (base.GetSupplies() < spawnSupplyCost)
1391 super.OnPlayerSpawnFinalize_S(requestComponent, handlerComponent,
data, entity);
1393 PlayerController pc = requestComponent.GetPlayerController();
1398 SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(pc.FindComponent(SCR_CampaignNetworkComponent));
1400 if (campaignNetworkComponent)
1401 campaignNetworkComponent.OnPlayerAliveStateChanged(
true);
1407 super.OnPlayerSpawnOnPoint_S(requestComponent, handlerComponent, entity, spawnPointData);
1410 SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1418 SCR_PlayerSpawnPoint playerSpawnpoint = SCR_PlayerSpawnPoint.Cast(spawnpoint);
1421 if (playerSpawnpoint)
1423 compXP.AwardXP(playerSpawnpoint.GetPlayerID(),
SCR_EXPRewards.SPAWN_PROVIDER);
1425 else if (radioSpawnpoint)
1427 SCR_BaseDeployableSpawnPointComponent comp = radioSpawnpoint.GetDeployableSpawnPointComponent();
1431 int playerId = comp.GetItemOwnerID();
1434 if (playerId !=
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(entity))
1441 IEntity parent = spawnPointData.GetSpawnPoint().GetParent();
1452 parent = parent.GetParent();
1461 int spawnSupplyCost = 0;
1463 spawnSupplyCost = SCR_ArsenalManagerComponent.GetLoadoutCalculatedSupplyCost(loadoutComp.GetLoadout(),
false, requestComponent.GetPlayerId(),
null, base, base.GetResourceComponent());
1465 if (spawnSupplyCost > 0)
1466 base.AddSupplies(spawnSupplyCost * -1);
1469 PlayerController playerController =
GetGame().GetPlayerManager().GetPlayerController(requestComponent.GetPlayerId());
1471 if (playerController)
1473 SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
1475 if (campaignNetworkComponent)
1476 campaignNetworkComponent.RespawnLocationPopup(base.GetCallsign());
1483 IEntity owner = spawnpoint.GetParent();
1490 parentBase.OnSpawnPointFactionAssigned(spawnpoint.GetFactionKey())
1497 super.OnPlayerKilled(playerId, playerEntity, killerEntity, killer);
1502 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(playerId);
1507 SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(pc.FindComponent(SCR_CampaignNetworkComponent));
1509 if (campaignNetworkComponent)
1511 campaignNetworkComponent.OnPlayerAliveStateChanged(
false);
1512 campaignNetworkComponent.ResetSavedSupplies();
1517 if (playerId == killer.GetInstigatorPlayerID())
1533 float respawnPenalty = clientData.GetRespawnPenalty();
1535 if (respawnPenalty == 0)
1538 float curTime =
GetGame().GetWorld().GetWorldTime();
1540 float timeSinceLastDeduction = curTime - clientData.GetLastPenaltyDeductionTimestamp();
1541 float penaltiesForgiven = Math.Floor(timeSinceLastDeduction / penaltyCooldownMs);
1543 if (penaltiesForgiven < 1)
1546 clientData.SetLastPenaltyDeductionTimestamp(curTime);
1548 clientData.SetRespawnPenalty(respawnPenalty - forgivenPenalty);
1550 array<Managed> timers = {};
1553 foreach (Managed timer : timers)
1556 if (timer.Type() == SCR_TimedSpawnPointComponent)
1564 timerCast.SetRespawnTime(playerId, timerCast.GetRespawnTime() - respawnPenalty - forgivenPenalty);
1575 #ifdef NO_SUICIDE_PENALTY
1584 PlayerController pc =
GetGame().GetPlayerManager().GetPlayerController(playerId);
1589 SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.Cast(pc.FindComponent(SCR_CampaignFeedbackComponent));
1591 if (comp && !comp.IsConscious())
1600 float respawnPenalty = clientData.GetRespawnPenalty();
1601 float lastSuicideTimestamp = clientData.GetLastSuicideTimestamp();
1602 float curTime =
GetGame().GetWorld().GetWorldTime();
1603 clientData.SetLastSuicideTimestamp(curTime);
1605 if (lastSuicideTimestamp == 0)
1608 float timeSinceLastSuicide = curTime - lastSuicideTimestamp;
1612 if (timeSinceLastSuicide > penaltyCooldownMs)
1617 clientData.SetLastPenaltyDeductionTimestamp(curTime);
1618 clientData.SetRespawnPenalty(respawnPenalty + addedPenalty);
1620 array<Managed> timers = {};
1623 foreach (Managed timer : timers)
1626 if (timer.Type() == SCR_TimedSpawnPointComponent)
1634 timerCast.SetRespawnTime(playerId, timerCast.GetRespawnTime() + respawnPenalty + addedPenalty);
1642 super.OnControllableDestroyed(entity, killerEntity, instigator);
1647 SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1653 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
1656 int killerId = instigator.GetInstigatorPlayerID();
1658 SCR_ChimeraCharacter victimCharacter = SCR_ChimeraCharacter.Cast(entity);
1660 if (!victimCharacter)
1664 if (!factionManager)
1667 Faction factionKiller =
Faction.Cast(factionManager.GetPlayerFaction(killerId));
1672 if (factionKiller.IsFactionFriendly(victimCharacter.GetFaction()))
1675 vector victimPos = victimCharacter.GetOrigin();
1683 if (nearestBase.GetFaction() != factionKiller)
1686 if (vector.DistanceXZ(victimPos, nearestBase.GetOwner().GetOrigin()) > nearestBase.GetRadius())
1698 FactionManager factionManager =
GetGame().GetFactionManager();
1700 if (!factionManager)
1710 if (!playerController)
1713 int playerID = playerController.GetPlayerId();
1719 if (clientData && faction)
1720 clientData.SetFactionIndex(factionManager.GetFactionIndex(faction));
1729 FactionManager factionManager =
GetGame().GetFactionManager();
1731 if (!factionManager)
1741 if (!playerController)
1744 int playerID = playerController.GetPlayerId();
1765 GetGame().GetCallqueue().CallLater(
m_BaseManager.UpdateTaskBases, DEFAULT_DELAY,
false, assignedFaction);
1779 if (!militaryBaseManager)
1782 militaryBaseManager.OnDefenderGroupSpawned(service, aiGroup);
1785 if (!spawnedEntity.IsInherited(Vehicle))
1789 array<SCR_FuelManagerComponent> fuelManagers = {};
1790 array<BaseFuelNode> fuelNodes = {};
1792 array<SCR_MilitaryBaseComponent> serviceBases = {};
1793 service.GetBases(serviceBases);
1794 bool fuelDepotNearby;
1796 foreach (SCR_MilitaryBaseComponent serviceBase : serviceBases)
1800 fuelDepotNearby =
true;
1805 if (!fuelDepotNearby)
1810 fuelManager.GetFuelNodesList(fuelNodes);
1814 fuelNode.SetFuel(fuelNode.GetMaxFuel() * 0.3);
1821 int playerId = playerManager.GetPlayerIdFromControlledEntity(user);
1828 if (!playerController)
1831 SCR_CampaignNetworkComponent networkComp = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
1837 networkComp.SetLastRequestTimestamp(world.GetServerTimestamp());
1839 BaseRadioComponent radioComponent = BaseRadioComponent.Cast(spawnedEntity.FindComponent(BaseRadioComponent));
1842 if (radioComponent && faction)
1848 radioComponent.SetPower(
false);
1849 transceiver.SetFrequency(faction.GetFactionRadioFrequency());
1850 radioComponent.SetEncryptionKey(faction.GetFactionRadioEncryptionKey());
1854 SlotManagerComponent slotManager = SlotManagerComponent.Cast(spawnedEntity.FindComponent(SlotManagerComponent));
1859 array<EntitySlotInfo> slots = {};
1860 slotManager.GetSlotInfos(slots);
1864 SCR_CampaignMobileAssemblyComponent mobileAssemblyComponent;
1865 EventHandlerManagerComponent eventHandlerManager;
1873 truckBed = slot.GetAttachedEntity();
1878 mobileAssemblyComponent = SCR_CampaignMobileAssemblyComponent.Cast(truckBed.FindComponent(SCR_CampaignMobileAssemblyComponent));
1881 if (mobileAssemblyComponent)
1884 networkComp.SendVehicleSpawnHint(
EHint.CONFLICT_MOBILE_HQ);
1891 override void EOnDiag(IEntity owner,
float timeSlice)
1893 super.EOnDiag(owner, timeSlice);
1899 PlayerController pc =
GetGame().GetPlayerController();
1903 SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1913 PlayerController pc =
GetGame().GetPlayerController();
1917 SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1920 comp.CheatRank(
true);
1931 Print(
"SCR_GameModeCampaign: Empty BLUFOR faction key!", LogLevel.ERROR);
1934 Print(
"SCR_GameModeCampaign: Empty OPFOR faction key!", LogLevel.ERROR);
1937 Print(
"SCR_GameModeCampaign: Empty INDFOR faction key!", LogLevel.ERROR);
1944 DiagMenu.RegisterMenu(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_MENU,
"Conflict",
"");
1945 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_INSTANT_BUILDING,
"",
"Instant composition spawning",
"Conflict");
1946 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_UP,
"",
"Promotion",
"Conflict");
1947 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_DOWN,
"",
"Demotion",
"Conflict");
1948 SetFlags(EntityFlags.ACTIVE,
false);
1949 ConnectToDiagSystem();
1959 int suppliesMax = header.m_iMaximumBaseSupplies;
1960 int suppliesMin = header.m_iMinimumBaseSupplies;
1961 int controlPointsLimit = header.m_iControlPointsCap;
1962 int victoryTimeout = header.m_fVictoryTimeout;
1964 if (suppliesMax != -1)
1967 if (suppliesMin != -1)
1970 if (controlPointsLimit != -1)
1973 if (victoryTimeout != -1)
1981 DisconnectFromDiagSystem();