Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_GameModeCampaign.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
3 {
4 }
5 
6 //------------------------------------------------------------------------------------------------
8 {
9  [Attribute("1", desc: "Run Conflict automatically at scenario start. If disabled, use RequestStart() method on server.", category: "Campaign")]
10  protected bool m_bAutostart;
11 
12  [Attribute("1", desc: "Terminate the scenario when Conflict is finished.", category: "Campaign")]
13  protected bool m_bTerminateScenario;
14 
15  [Attribute("2", desc: "How many control points does a faction need to win", params: "1 inf 1", category: "Campaign")]
17 
18  [Attribute("300", desc: "How long does a faction need to hold the control points to win (seconds).", params: "0 inf 1", category: "Campaign")]
19  protected float m_fVictoryTimer;
20 
21  [Attribute("1000", desc: "Supplies will be autoreplenished in bases until this limit is reached.", params: "0 inf 1", category: "Campaign")]
23 
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")]
26 
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")]
29 
30  [Attribute("5", desc: "How often are supplies replenished in bases (seconds).", params: "1 inf 1", category: "Campaign")]
32 
33  [Attribute("40", desc: "How many supplies are periodically replenished in HQs.", params: "0 inf 1", category: "Campaign")]
34  protected int m_iRegularSuppliesIncome;
35 
36  [Attribute("4", desc: "How many supplies are periodically replenished in non-HQ bases.", params: "0 inf 1", category: "Campaign")]
38 
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")]
41 
42  [Attribute("600", desc: "The amount of supplies in HQs.", params: "0 inf 1", category: "Campaign")]
43  protected int m_iHQStartingSupplies;
44 
45  [Attribute("100", desc: "When randomized, the least supplies a base can hold at the start.", params: "0 inf 1", category: "Campaign")]
46  protected int m_iMinStartingSupplies;
47 
48  [Attribute("500", desc: "When randomized, the most supplies a base can hold at the start.", params: "0 inf 1", category: "Campaign")]
49  protected int m_iMaxStartingSupplies;
50 
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")]
53 
54  [Attribute("US", category: "Campaign")]
55  protected FactionKey m_sBLUFORFactionKey;
56 
57  [Attribute("USSR", category: "Campaign")]
58  protected FactionKey m_sOPFORFactionKey;
59 
60  [Attribute("FIA", category: "Campaign")]
61  protected FactionKey m_sINDFORFactionKey;
62 
63  [Attribute("1", UIWidgets.CheckBox, "Randomized starting supplies in small bases", category: "Campaign")]
64  protected bool m_bRandomizeSupplies;
65 
66  [Attribute("40", desc: "How much supplies it cost to spawn at base by default?", params: "0 inf 1", category: "Campaign")]
67  protected int m_iSpawnCost;
68 
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")]
71 
72  [Attribute("{B3E7B8DC2BAB8ACC}Prefabs/AI/Waypoints/AIWaypoint_SearchAndDestroy.et", category: "Campaign")]
73  protected ResourceName m_sSeekDestroyWaypointPrefab;
74 
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")]
77 
78  [Attribute("30", UIWidgets.EditBox, "Stacking extra deploy cooldown after suicide (seconds). Gets deducted over time.", params: "0 inf 1", category: "Campaign")]
79  protected int m_iSuicideRespawnDelay;
80 
81  [Attribute("600", UIWidgets.EditBox, "How often is the post-suicide deploy cooldown penalty deducted (seconds).", params: "0 inf 1", category: "Campaign")]
83 
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;
89 
90  protected ref ScriptInvoker m_OnFactionAssignedLocalPlayer;
91  protected ref ScriptInvoker m_OnStarted;
92  protected ref ScriptInvoker m_OnMatchSituationChanged;
93  protected ref ScriptInvoker m_OnCallsignOffsetChanged;
94 
95  protected ref map<int, Faction> m_mUnprocessedFactionAssignments = new map<int, Faction>();
96 
97  protected ref array<SCR_PlayerRadioSpawnPointCampaign> m_aRadioSpawnPoints = {};
98  protected ref array<ref SCR_CampaignClientData> m_aRegisteredClients = {};
99 
101  protected bool m_bIsTutorial;
102  protected bool m_bMatchOver;
103  protected bool m_bWorldPostProcessDone;
104  protected bool m_bRemnantsStateLoaded;
106 
108 
110 
111  [RplProp(onRplName: "OnStarted")]
112  protected bool m_bStarted;
113 
114  [RplProp(onRplName: "OnMatchSituationChanged")]
115  protected WorldTimestamp m_fVictoryTimestamp;
116 
117  [RplProp(onRplName: "OnMatchSituationChanged")]
118  protected WorldTimestamp m_fVictoryPauseTimestamp;
119 
120  [RplProp(onRplName: "OnMatchSituationChanged")]
121  protected int m_iWinningFactionId = SCR_CampaignMilitaryBaseComponent.INVALID_FACTION_INDEX;
122 
123  [RplProp(onRplName: "OnCallsignOffsetChanged")]
124  protected int m_iCallsignOffset = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN;
125 
126  //------------------------------------------------------------------------------------------------
129  {
131  m_OnFactionAssignedLocalPlayer = new ScriptInvoker();
132 
134  }
135 
136  //------------------------------------------------------------------------------------------------
138  ScriptInvoker GetOnStarted()
139  {
140  if (!m_OnStarted)
141  m_OnStarted = new ScriptInvoker();
142 
143  return m_OnStarted;
144  }
145 
146  //------------------------------------------------------------------------------------------------
149  {
151  m_OnMatchSituationChanged = new ScriptInvoker();
152 
154  }
155 
156  //------------------------------------------------------------------------------------------------
158  {
160  m_OnCallsignOffsetChanged = new ScriptInvoker();
161 
163  }
164 
165  //------------------------------------------------------------------------------------------------
167  {
169  }
170 
171  //------------------------------------------------------------------------------------------------
173  {
175  }
176 
177  //------------------------------------------------------------------------------------------------
179  {
181  }
182 
183  //------------------------------------------------------------------------------------------------
185  {
187  }
188 
189  //------------------------------------------------------------------------------------------------
191  {
193  }
194 
195  //------------------------------------------------------------------------------------------------
197  {
199  }
200 
201  //------------------------------------------------------------------------------------------------
203  {
205  }
206 
207  //------------------------------------------------------------------------------------------------
209  {
211  }
212 
213  //------------------------------------------------------------------------------------------------
215  {
216  return m_BaseManager;
217  }
218 
219  //------------------------------------------------------------------------------------------------
221  {
222  return m_fVictoryTimer;
223  }
224 
225  //------------------------------------------------------------------------------------------------
227  {
229  }
230 
231  //------------------------------------------------------------------------------------------------
233  {
234  return m_iMinStartingSupplies;
235  }
236 
237  //------------------------------------------------------------------------------------------------
239  {
240  return m_iMaxStartingSupplies;
241  }
242 
243  //------------------------------------------------------------------------------------------------
245  {
247  }
248 
249  //------------------------------------------------------------------------------------------------
251  {
252  return m_iSpawnCost;
253  }
254 
255  //------------------------------------------------------------------------------------------------
257  {
258  return m_bRemnantsStateLoaded;
259  }
260 
261  //------------------------------------------------------------------------------------------------
263  {
265  }
266 
267  //------------------------------------------------------------------------------------------------
269  {
271  }
272 
273  //------------------------------------------------------------------------------------------------
275  {
276  return m_iWinningFactionId;
277  }
278 
279  //------------------------------------------------------------------------------------------------
280  WorldTimestamp GetVictoryTimestamp()
281  {
282  return m_fVictoryTimestamp;
283  }
284 
285  //------------------------------------------------------------------------------------------------
286  WorldTimestamp GetVictoryPauseTimestamp()
287  {
289  }
290 
291  //------------------------------------------------------------------------------------------------
292  bool IsTutorial()
293  {
294  return m_bIsTutorial;
295  }
296 
297  //------------------------------------------------------------------------------------------------
299  {
300  return m_bMatchOver;
301  }
302 
303  //------------------------------------------------------------------------------------------------
304  bool HasStarted()
305  {
306  return m_bStarted;
307  }
308 
309  //------------------------------------------------------------------------------------------------
311  {
312  return m_iCallsignOffset;
313  }
314 
315  //------------------------------------------------------------------------------------------------
317  {
319  m_OnMatchSituationChanged.Invoke();
320  }
321 
322  //------------------------------------------------------------------------------------------------
323  override bool RplSave(ScriptBitWriter writer)
324  {
325  // Sync respawn radios & control points amount
326  writer.WriteInt(m_BaseManager.GetTargetActiveBasesCount());
327 
328  int controlPointsHeldBLUFOR = GetFactionByEnum(SCR_ECampaignFaction.BLUFOR).GetControlPointsHeld();
329  int controlPointsHeldOPFOR = GetFactionByEnum(SCR_ECampaignFaction.OPFOR).GetControlPointsHeld();
330 
331  RplId primaryTargetBLUFOR = Replication.FindId(GetFactionByEnum(SCR_ECampaignFaction.BLUFOR).GetPrimaryTarget());
332  RplId primaryTargetOPFOR = Replication.FindId(GetFactionByEnum(SCR_ECampaignFaction.OPFOR).GetPrimaryTarget());
333 
334  writer.WriteInt(controlPointsHeldBLUFOR);
335  writer.WriteInt(controlPointsHeldOPFOR);
336 
337  writer.WriteInt(primaryTargetBLUFOR);
338  writer.WriteInt(primaryTargetOPFOR);
339 
340  return true;
341  }
342 
343  //------------------------------------------------------------------------------------------------
344  override bool RplLoad(ScriptBitReader reader)
345  {
346  // Sync respawn radios & control points amount
347  int activeBasesTotal;
348 
349  reader.ReadInt(activeBasesTotal);
350 
351  m_BaseManager.SetTargetActiveBasesCount(activeBasesTotal);
352 
353  if (m_BaseManager.GetActiveBasesCount() == activeBasesTotal)
354  m_BaseManager.OnAllBasesInitialized();
355 
356  int controlPointsHeldBLUFOR, controlPointsHeldOPFOR, primaryTargetBLUFOR, primaryTargetOPFOR;
357 
358  reader.ReadInt(controlPointsHeldBLUFOR);
359  reader.ReadInt(controlPointsHeldOPFOR);
360 
361  reader.ReadInt(primaryTargetBLUFOR);
362  reader.ReadInt(primaryTargetOPFOR);
363 
364  GetFactionByEnum(SCR_ECampaignFaction.BLUFOR).SetControlPointsHeld(controlPointsHeldBLUFOR);
365  GetFactionByEnum(SCR_ECampaignFaction.OPFOR).SetControlPointsHeld(controlPointsHeldOPFOR);
366 
367  GetFactionByEnum(SCR_ECampaignFaction.BLUFOR).SetPrimaryTarget(SCR_CampaignMilitaryBaseComponent.Cast(Replication.FindItem(primaryTargetBLUFOR)));
368  GetFactionByEnum(SCR_ECampaignFaction.OPFOR).SetPrimaryTarget(SCR_CampaignMilitaryBaseComponent.Cast(Replication.FindItem(primaryTargetOPFOR)));
369 
370  return true;
371  }
372 
373  //------------------------------------------------------------------------------------------------
375  {
376  return SCR_GameModeCampaign.Cast(GetGame().GetGameMode());
377  }
378 
379  //------------------------------------------------------------------------------------------------
380  void SetControlPointsHeld(SCR_CampaignFaction faction, int newCount)
381  {
382  if (faction.GetControlPointsHeld() == newCount)
383  return;
384 
385  int index = GetGame().GetFactionManager().GetFactionIndex(faction);
386 
387  Rpc(RPC_DoSetControlPointsHeld, index, newCount);
389  }
390 
391  //------------------------------------------------------------------------------------------------
392  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
393  protected void RPC_DoSetControlPointsHeld(int factionIndex, int count)
394  {
395  SCR_CampaignFaction faction = SCR_CampaignFaction.Cast(GetGame().GetFactionManager().GetFactionByIndex(factionIndex));
396 
397  if (!faction)
398  return;
399 
400  faction.SetControlPointsHeld(count);
402  }
403 
404  //------------------------------------------------------------------------------------------------
406  {
407  if (faction.GetPrimaryTarget() == target)
408  return;
409 
410  int index = GetGame().GetFactionManager().GetFactionIndex(faction);
411  RplId targetId = RplId.Invalid();
412 
413  if (target)
414  targetId = Replication.FindId(target);
415 
416  Rpc(RPC_DoSetPrimaryTarget, index, targetId);
417  RPC_DoSetPrimaryTarget(index, targetId)
418  }
419 
420  //------------------------------------------------------------------------------------------------
421  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
422  protected void RPC_DoSetPrimaryTarget(int factionIndex, int targetId)
423  {
424  SCR_CampaignFaction faction = SCR_CampaignFaction.Cast(GetGame().GetFactionManager().GetFactionByIndex(factionIndex));
425 
426  if (!faction)
427  return;
428 
429  faction.SetPrimaryTarget(SCR_CampaignMilitaryBaseComponent.Cast(Replication.FindItem(targetId)));
430  }
431 
432  //------------------------------------------------------------------------------------------------
433  void BroadcastMHQFeedback(SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
434  {
435  Rpc(RpcDo_BroadcastMHQFeedback, msgID, playerID, factionID);
436 
437  if (RplSession.Mode() != RplMode.Dedicated)
438  RpcDo_BroadcastMHQFeedback(msgID, playerID, factionID);
439  }
440 
441  //------------------------------------------------------------------------------------------------
442  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
443  void RpcDo_BroadcastMHQFeedback(SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
444  {
445  SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.GetInstance();
446 
447  if (!comp)
448  return;
449 
450  comp.MobileAssemblyFeedback(msgID, playerID, factionID)
451  }
452 
453  //------------------------------------------------------------------------------------------------
455  {
456  if (IsProxy())
457  return;
458 
459  // Start the gamemode after OnWorldPostprocess so bases have time to init properly
461  Start();
462  }
463 
464  //------------------------------------------------------------------------------------------------
465  protected void Start()
466  {
467  // Compose custom bases array from header
468  SCR_MilitaryBaseSystem baseManager = SCR_MilitaryBaseSystem.GetInstance();
469 
470  if (!baseManager)
471  return;
472 
473  float customHQSupplies = m_iHQStartingSupplies;
474  bool whitelist = false;
475  array<string> customBaseList = {};
476 
477  SCR_MissionHeaderCampaign header = SCR_MissionHeaderCampaign.Cast(GetGame().GetMissionHeader());
478 
479  if (header)
480  {
481  whitelist = header.m_bCustomBaseWhitelist;
482  customHQSupplies = header.m_iStartingHQSupplies;
483 
484  foreach (SCR_CampaignCustomBase customBase : header.m_aCampaignCustomBaseList)
485  {
486  customBaseList.Insert(customBase.GetBaseName());
487  }
488  }
489 
490  array<SCR_CampaignMilitaryBaseComponent> candidatesForHQ = {};
491  array<SCR_CampaignMilitaryBaseComponent> controlPoints = {};
492  array<SCR_MilitaryBaseComponent> bases = {};
493  baseManager.GetBases(bases);
494 
495  string baseName;
497  int listIndex;
498 
499  foreach (SCR_MilitaryBaseComponent base : bases)
500  {
501  campaignBase = SCR_CampaignMilitaryBaseComponent.Cast(base);
502 
503  if (!campaignBase)
504  continue;
505 
506  // Ignore the base if it's disabled in mission header
507  if (header)
508  {
509  baseName = campaignBase.GetOwner().GetName();
510  listIndex = customBaseList.Find(baseName);
511 
512  if (listIndex != -1)
513  {
514  if (!whitelist)
515  continue;
516  }
517  else if (whitelist)
518  {
519  continue;
520  }
521 
522  if (whitelist && listIndex != -1)
523  campaignBase.ApplyHeaderSettings(header.m_aCampaignCustomBaseList[listIndex]);
524  }
525 
526  if (!campaignBase.DisableWhenUnusedAsHQ() || !campaignBase.CanBeHQ())
527  {
528  campaignBase.Initialize();
529  m_BaseManager.AddTargetActiveBase();
530  }
531 
532  if (campaignBase.CanBeHQ())
533  candidatesForHQ.Insert(campaignBase);
534 
535  if (campaignBase.IsControlPoint())
536  controlPoints.Insert(campaignBase);
537  }
538 
539  m_BaseManager.UpdateBases();
540 
541  if (candidatesForHQ.Count() < 2)
542  {
543  Print("Not enough suitable starting locations found in current setup. Check 'Can Be HQ' attributes in SCR_CampaignMilitaryBaseComponent!", LogLevel.ERROR);
544  return;
545  }
546 
547  // Process HQ selection
548  array<SCR_CampaignMilitaryBaseComponent> selectedHQs = {};
549  m_BaseManager.SelectHQs(candidatesForHQ, controlPoints, selectedHQs);
550  m_BaseManager.SetHQFactions(selectedHQs);
551 
552  foreach (SCR_CampaignMilitaryBaseComponent hq : selectedHQs)
553  {
554  hq.SetAsHQ(true);
555 
556  if (customHQSupplies == -1)
557  hq.SetStartingSupplies(m_iHQStartingSupplies);
558  else
559  hq.SetStartingSupplies(customHQSupplies);
560 
561  if (!hq.IsInitialized())
562  {
563  hq.Initialize();
564  m_BaseManager.AddTargetActiveBase();
565  }
566  }
567 
568  m_BaseManager.InitializeBases(selectedHQs, m_bRandomizeSupplies);
569 
570  if (m_iCallsignOffset == SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN)
571  {
572  int basesCount = m_BaseManager.GetTargetActiveBasesCount();
573 
574  Math.Randomize(-1);
575  m_iCallsignOffset = Math.RandomIntInclusive(0, Math.Ceil(basesCount * 0.5));
576  }
577 
578  Replication.BumpMe();
579 
580  array<SCR_SpawnPoint> spawnpoints = SCR_SpawnPoint.GetSpawnPoints();
581 
582  foreach (SCR_SpawnPoint spawnpoint : spawnpoints)
583  {
584  DisableExtraSpawnpoint(spawnpoint);
585  }
586 
587  SCR_SpawnPoint.Event_SpawnPointAdded.Insert(DisableExtraSpawnpoint);
588 
589  // Start periodical checks for winning faction
590  GetGame().GetCallqueue().CallLater(CheckForWinner, DEFAULT_DELAY, true);
591 
592  SCR_CharacterRankComponent.s_OnRankChanged.Insert(OnRankChanged);
593  SCR_AmbientVehicleSystem vehiclesManager = SCR_AmbientVehicleSystem.GetInstance();
594 
595  if (vehiclesManager)
596  vehiclesManager.GetOnVehicleSpawned().Insert(OnAmbientVehicleSpawned);
597 
598  m_bStarted = true;
599  Replication.BumpMe();
600  m_BaseManager.OnAllBasesInitialized();
601  OnStarted();
602  }
603 
604  //------------------------------------------------------------------------------------------------
605  void OnStarted()
606  {
607  SCR_SpawnPoint.Event_SpawnPointFactionAssigned.Insert(OnSpawnPointFactionAssigned);
608 
609  if (m_OnStarted)
610  m_OnStarted.Invoke();
611  }
612 
613  //------------------------------------------------------------------------------------------------
615  {
617  m_OnCallsignOffsetChanged.Invoke();
618  }
619 
620  //------------------------------------------------------------------------------------------------
621  protected void DisableExtraSpawnpoint(SCR_SpawnPoint spawnpoint)
622  {
623  if (spawnpoint.Type() != SCR_SpawnPoint)
624  return;
625 
626  spawnpoint.SetFaction(null);
627  }
628 
629  //------------------------------------------------------------------------------------------------
631  protected void CheckForWinner()
632  {
633  FactionManager factionManager = GetGame().GetFactionManager();
634  array<Faction> factions = {};
635  factionManager.GetFactionsList(factions);
636  ChimeraWorld world = GetWorld();
637  WorldTimestamp curTime = world.GetServerTimestamp();
638  WorldTimestamp lowestVictoryTimestamp;
639  WorldTimestamp blockPauseTimestamp;
640  WorldTimestamp actualVictoryTimestamp;
641  SCR_CampaignFaction winner;
642 
643  foreach (Faction faction : factions)
644  {
645  SCR_CampaignFaction fCast = SCR_CampaignFaction.Cast(faction);
646 
647  if (!fCast || !fCast.IsPlayable())
648  continue;
649 
650  blockPauseTimestamp = fCast.GetPauseByBlockTimestamp();
651 
652  if (blockPauseTimestamp == 0)
653  actualVictoryTimestamp = fCast.GetVictoryTimestamp();
654  else
655  actualVictoryTimestamp = curTime.PlusMilliseconds(
656  fCast.GetVictoryTimestamp().DiffMilliseconds(fCast.GetPauseByBlockTimestamp())
657  );
658 
659  if (actualVictoryTimestamp != 0)
660  {
661  if (!winner || actualVictoryTimestamp.Less(lowestVictoryTimestamp))
662  {
663  lowestVictoryTimestamp = actualVictoryTimestamp;
664  winner = fCast;
665  }
666  }
667  }
668 
669  if (winner)
670  {
671  if (lowestVictoryTimestamp.LessEqual(curTime))
672  {
673  GetGame().GetCallqueue().Remove(CheckForWinner);
674  int winnerId = factionManager.GetFactionIndex(winner);
675  RPC_DoEndMatch(winnerId);
676  Rpc(RPC_DoEndMatch, winnerId);
678  }
679  else if (factionManager.GetFactionIndex(winner) != m_iWinningFactionId || winner.GetVictoryTimestamp() != m_fVictoryTimestamp || winner.GetPauseByBlockTimestamp() != m_fVictoryPauseTimestamp)
680  {
681  m_iWinningFactionId = factionManager.GetFactionIndex(winner);
682  m_fVictoryTimestamp = winner.GetVictoryTimestamp();
683  m_fVictoryPauseTimestamp = winner.GetPauseByBlockTimestamp();
685  Replication.BumpMe();
686  }
687  }
688  else if (m_iWinningFactionId != -1 || m_fVictoryTimestamp != 0)
689  {
690  m_iWinningFactionId = -1;
691  m_fVictoryTimestamp = null;
694  Replication.BumpMe();
695  }
696  }
697 
698  //------------------------------------------------------------------------------------------------
699  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
700  protected void RPC_DoEndMatch(int winningFactionId)
701  {
702  m_bMatchOver = true;
703 
704  if (IsProxy())
705  return;
706 
707  FactionManager fManager = GetGame().GetFactionManager();
708  array<Faction> factions = {};
709  fManager.GetFactionsList(factions);
710  Faction winningFaction = fManager.GetFactionByIndex(winningFactionId);
711 
712  if (winningFaction)
713  {
714  foreach (Faction faction : factions)
715  {
716  SCR_CampaignFaction f = SCR_CampaignFaction.Cast(faction);
717 
718  if (!f)
719  continue;
720 
721  if (winningFaction == f)
722  f.SendHQMessage(SCR_ERadioMsg.VICTORY, param: winningFactionId);
723  else
724  f.SendHQMessage(SCR_ERadioMsg.DEFEAT, param: winningFactionId);
725  }
726  }
727 
728  // Match is over, save it so if "Continue" is selected following this the game is not loaded at an end screen
729  GetGame().GetSaveManager().Save(ESaveType.AUTO);
730 
731  // For the server end the game, replicate to all clients.
732  // listening components can react to this by e.g. showing end screen
734  {
735  SCR_GameModeEndData endData = SCR_GameModeEndData.CreateSimple(EGameOverTypes.ENDREASON_SCORELIMIT, winnerFactionId: winningFactionId);
736  EndGameMode(endData);
737  }
738  }
739  //------------------------------------------------------------------------------------------------
740  override void OnWorldPostProcess(World world)
741  {
742  super.OnWorldPostProcess(world);
743 
744  if (IsProxy() || !GetGame().InPlayMode())
745  return;
746 
747  if (m_bAutostart)
748  Start();
749 
751  }
752 
753  //------------------------------------------------------------------------------------------------
755  {
756  switch (faction)
757  {
758  case SCR_ECampaignFaction.INDFOR:
759  {
760  return m_sINDFORFactionKey;
761  };
762 
763  case SCR_ECampaignFaction.BLUFOR:
764  {
765  return m_sBLUFORFactionKey;
766  };
767 
768  case SCR_ECampaignFaction.OPFOR:
769  {
770  return m_sOPFORFactionKey;
771  };
772  }
773 
774  return FactionKey.Empty;
775  }
776 
777  //------------------------------------------------------------------------------------------------
779  {
780  FactionManager fManager = GetGame().GetFactionManager();
781 
782  if (!fManager)
783  return null;
784 
785  return SCR_CampaignFaction.Cast(fManager.GetFactionByKey(GetFactionKeyByEnum(faction)));
786  }
787 
788  //------------------------------------------------------------------------------------------------
789  bool IsProxy()
790  {
791  return (m_RplComponent && m_RplComponent.IsProxy());
792  }
793 
794  //------------------------------------------------------------------------------------------------
796  // TRUE, if rank requirement is disabled
798  {
800  }
801 
802  //------------------------------------------------------------------------------------------------
804  void StoreLoadedData(notnull SCR_CampaignStruct struct)
805  {
806  m_LoadedData = struct;
807 
808  if (m_BaseManager.IsBasesInitDone())
809  ApplyLoadedData();
810  else
811  m_BaseManager.GetOnAllBasesInitialized().Insert(ApplyLoadedData);
812  }
813 
814  //------------------------------------------------------------------------------------------------
815  protected void ApplyLoadedData()
816  {
817  m_BaseManager.GetOnAllBasesInitialized().Remove(ApplyLoadedData);
818 
819  if (!m_LoadedData)
820  return;
821 
822  // Game was saved after match was over, don't load
823  if (m_LoadedData.IsMatchOver())
824  return;
825 
826  array<ref SCR_CampaignBaseStruct>basesStructs = m_LoadedData.GetBasesStructs();
827 
828  // No bases data available for load, something is wrong - terminate
829  if (basesStructs.IsEmpty())
830  return;
831 
833  m_BaseManager.LoadBasesStates(basesStructs);
834 
835  // We need to wait for all services to spawn before switching the progress bool to false so supplies are not deducted from bases
836  GetGame().GetCallqueue().CallLater(EndSessionLoadProgress, DEFAULT_DELAY * 2);
837 
838  if (RplSession.Mode() != RplMode.Dedicated)
839  {
840  m_BaseManager.InitializeSupplyDepotIcons();
841  m_BaseManager.HideUnusedBaseIcons();
842  }
843 
844  m_BaseManager.RecalculateRadioCoverage(GetFactionByEnum(SCR_ECampaignFaction.BLUFOR));
845  m_BaseManager.RecalculateRadioCoverage(GetFactionByEnum(SCR_ECampaignFaction.OPFOR));
846 
847  SCR_TimeAndWeatherHandlerComponent timeHandler = SCR_TimeAndWeatherHandlerComponent.GetInstance();
848 
849  // Weather has to be changed after init
850  if (timeHandler)
851  {
852  GetGame().GetCallqueue().Remove(timeHandler.SetupDaytimeAndWeather);
853  GetGame().GetCallqueue().CallLater(timeHandler.SetupDaytimeAndWeather, DEFAULT_DELAY, false, m_LoadedData.GetHours(), m_LoadedData.GetMinutes(), m_LoadedData.GetSeconds(), m_LoadedData.GetWeatherState(), true);
854  }
855 
856  SCR_CampaignTutorialArlandComponent tutorial = SCR_CampaignTutorialArlandComponent.Cast(FindComponent(SCR_CampaignTutorialArlandComponent));
857 
858  if (tutorial)
859  {
860  tutorial.SetResumeStage(m_LoadedData.GetTutorialStage());
861  return;
862  }
863 
864  m_iCallsignOffset = m_LoadedData.GetCallsignOffset();
865  Replication.BumpMe();
866 
867  LoadRemnantsStates(m_LoadedData.GetRemnantsStructs());
868  LoadClientData(m_LoadedData.GetPlayersStructs());
869 
872 
873  // Delayed spawns to avoid calling them during init
874  if (factionBLUFOR && m_LoadedData.GetMHQLocationBLUFOR() != vector.Zero)
875  GetGame().GetCallqueue().CallLater(SpawnMobileHQ, DEFAULT_DELAY, false, factionBLUFOR, m_LoadedData.GetMHQLocationBLUFOR(), m_LoadedData.GetMHQRotationBLUFOR());
876 
877  if (factionOPFOR && m_LoadedData.GetMHQLocationOPFOR() != vector.Zero)
878  GetGame().GetCallqueue().CallLater(SpawnMobileHQ, DEFAULT_DELAY, false, factionOPFOR, m_LoadedData.GetMHQLocationOPFOR(), m_LoadedData.GetMHQRotationOPFOR());
879 
880  m_LoadedData = null;
881  }
882 
883  //------------------------------------------------------------------------------------------------
884  protected void EndSessionLoadProgress()
885  {
887  }
888 
889  //------------------------------------------------------------------------------------------------
890  void StoreRemnantsStates(out notnull array<ref SCR_CampaignRemnantInfoStruct> outEntries)
891  {
892  SCR_AmbientPatrolSystem manager = SCR_AmbientPatrolSystem.GetInstance();
893 
894  if (!manager)
895  return;
896 
897  array<int> remnantsInfo = {};
898 
899  for (int i = 0, count = manager.GetRemainingPatrolsInfo(remnantsInfo); i < count; i++)
900  {
902  struct.SetID(remnantsInfo[i]);
903  struct.SetMembersAlive(remnantsInfo[i + 1]);
904  struct.SetRespawnTimer(remnantsInfo[i + 2]);
905  outEntries.Insert(struct);
906  i += 2;
907  }
908  }
909 
910  //------------------------------------------------------------------------------------------------
911  void LoadRemnantsStates(notnull array<ref SCR_CampaignRemnantInfoStruct> entries)
912  {
913  SCR_AmbientPatrolSystem manager = SCR_AmbientPatrolSystem.GetInstance();
914 
915  if (!manager)
916  return;
917 
918  array<SCR_AmbientPatrolSpawnPointComponent> patrols = {};
919  manager.GetPatrols(patrols);
920  ChimeraWorld world = GetWorld();
921  WorldTimestamp curTime = world.GetServerTimestamp();
922 
923  foreach (SCR_AmbientPatrolSpawnPointComponent presence : patrols)
924  {
925  if (!presence)
926  continue;
927 
928  foreach (SCR_CampaignRemnantInfoStruct info : entries)
929  {
930  if (info.GetID() == presence.GetID())
931  {
932  presence.SetMembersAlive(info.GetMembersAlive());
933  presence.SetRespawnTimestamp(curTime.PlusMilliseconds(info.GetRespawnTimer()));
934  }
935  }
936  }
937 
938  m_bRemnantsStateLoaded = true;
939  }
940 
941  //------------------------------------------------------------------------------------------------
942  // Triggered each time player built a composition
944  {
945  if (IsTutorial())
946  {
947  SCR_CampaignTutorialArlandComponent tutorial = SCR_CampaignTutorialArlandComponent.Cast(FindComponent(SCR_CampaignTutorialArlandComponent));
948 
949  if (tutorial)
950  tutorial.OnStructureBuilt(base, entity.GetOwner());
951  else
952  SCR_CampaignTutorialArlandComponent.GetOnStructureBuilt().Invoke(base, entity.GetOwner());
953  }
954  }
955 
956  //------------------------------------------------------------------------------------------------
957  void SetIsTutorial(bool isTutorial)
958  {
959  m_bIsTutorial = isTutorial;
960 
961  if (m_bIsTutorial)
962  SCR_PopUpNotification.SetFilter(SCR_EPopupMsgFilter.TUTORIAL);
963  else
965  }
966 
967  //------------------------------------------------------------------------------------------------
968  protected void ApplyClientData(int playerId)
969  {
970  PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(playerId);
971 
972  if (!pc)
973  return;
974 
975  SCR_CampaignClientData clientData = GetClientData(playerId);
976 
977  if (!clientData)
978  return;
979 
980  bool allowFactionLoad = true;
981 
982 #ifdef ENABLE_DIAG
983  if (SCR_RespawnComponent.Diag_IsCLISpawnEnabled())
984  allowFactionLoad = false;
985 #endif
986 
987  // Automatically apply the client's previous faction
988  int forcedFaction = clientData.GetFactionIndex();
989 
990  if (allowFactionLoad && forcedFaction != -1)
991  {
993 
994  if (fac)
995  {
996  Faction faction = GetGame().GetFactionManager().GetFactionByIndex(forcedFaction);
997  fac.RequestFaction(faction);
998  }
999  }
1000 
1001  int xp;
1002  SCR_PlayerXPHandlerComponent handlerXP = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1003 
1004  if (handlerXP)
1005  xp = handlerXP.GetPlayerXP();
1006 
1007  SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1008 
1009  if (comp)
1010  comp.AwardXP(playerId, SCR_EXPRewards.UNDEFINED, 1, false, clientData.GetXP() - xp);
1011 
1012  SCR_FastTravelComponent fastTravel = SCR_FastTravelComponent.Cast(pc.FindComponent(SCR_FastTravelComponent));
1013 
1014  if (fastTravel)
1015  fastTravel.SetNextTransportTimestamp(clientData.GetNextFastTravelTimestamp());
1016  }
1017 
1018  //------------------------------------------------------------------------------------------------
1019  void LoadClientData(notnull array<ref SCR_CampaignPlayerStruct> data)
1020  {
1021  m_aRegisteredClients.Clear();
1022 
1023  foreach (SCR_CampaignPlayerStruct playerData : data)
1024  {
1026 
1027  clientData.SetID(playerData.GetID());
1028  clientData.SetXP(playerData.GetXP());
1029  clientData.SetFactionIndex(playerData.GetFactionIndex());
1030 
1031  m_aRegisteredClients.Insert(clientData);
1032  }
1033  }
1034 
1035  //------------------------------------------------------------------------------------------------
1037  {
1038  array<int> pcList = {};
1039 
1040  for (int i = 0, playersCount = GetGame().GetPlayerManager().GetPlayers(pcList); i < playersCount; i++)
1041  {
1042  PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(pcList[i]);
1043 
1044  if (!pc)
1045  continue;
1046 
1047  int ID = pc.GetPlayerId();
1048  WriteClientData(ID, pc: pc);
1049  }
1050  }
1051 
1052  //------------------------------------------------------------------------------------------------
1054  protected void WriteClientData(int playerID, bool disconnecting = false, PlayerController pc = null)
1055  {
1056  SCR_CampaignClientData clientData = GetClientData(playerID);
1057 
1058  if (!clientData)
1059  return;
1060 
1061  if (!pc)
1062  pc = GetGame().GetPlayerManager().GetPlayerController(playerID);
1063 
1064  if (!pc)
1065  return;
1066 
1067  SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1068 
1069  if (!comp)
1070  return;
1071 
1072  // Set data readable from PlayerController
1073  clientData.SetXP(comp.GetPlayerXP());
1074  }
1075 
1076  //------------------------------------------------------------------------------------------------
1077  void SpawnMobileHQ(notnull SCR_CampaignFaction faction, vector pos, vector rot)
1078  {
1079  if (faction.GetMobileAssembly())
1080  return;
1081 
1082  EntitySpawnParams params = EntitySpawnParams();
1083  GetWorldTransform(params.Transform);
1084  params.TransformMode = ETransformMode.WORLD;
1085  Math3D.AnglesToMatrix(rot, params.Transform);
1086  params.Transform[3] = pos;
1087 
1088  IEntity MHQ = GetGame().SpawnEntityPrefab(Resource.Load(faction.GetMobileHQPrefab()), null, params);
1089 
1090  if (!MHQ)
1091  return;
1092 
1093  BaseRadioComponent radioComponent = BaseRadioComponent.Cast(MHQ.FindComponent(BaseRadioComponent));
1094 
1095  if (radioComponent && radioComponent.TransceiversCount() > 0)
1096  {
1097  radioComponent.SetPower(false);
1098  radioComponent.GetTransceiver(0).SetFrequency(faction.GetFactionRadioFrequency());
1099  radioComponent.SetEncryptionKey(faction.GetFactionRadioEncryptionKey());
1100  }
1101 
1102  SlotManagerComponent slotManager = SlotManagerComponent.Cast(MHQ.FindComponent(SlotManagerComponent));
1103 
1104  if (!slotManager)
1105  return;
1106 
1107  array<EntitySlotInfo> slots = {};
1108  slotManager.GetSlotInfos(slots);
1109 
1110  foreach (EntitySlotInfo slot : slots)
1111  {
1112  IEntity truckBed = slot.GetAttachedEntity();
1113 
1114  if (!truckBed)
1115  continue;
1116 
1117  SCR_CampaignMobileAssemblyComponent mobileAssemblyComponent = SCR_CampaignMobileAssemblyComponent.Cast(truckBed.FindComponent(SCR_CampaignMobileAssemblyComponent));
1118 
1119  if (mobileAssemblyComponent)
1120  {
1121  mobileAssemblyComponent.SetParentFactionID(GetGame().GetFactionManager().GetFactionIndex(faction));
1122  mobileAssemblyComponent.UpdateRadioCoverage();
1123  mobileAssemblyComponent.Deploy(SCR_EMobileAssemblyStatus.DEPLOYED);
1124  break;
1125  }
1126  }
1127  }
1128 
1129  //------------------------------------------------------------------------------------------------
1130  int GetClientsData(notnull out array<ref SCR_CampaignClientData> dataArray)
1131  {
1132  int count;
1133 
1135  {
1136  count++;
1137  dataArray.Insert(data);
1138  }
1139 
1140  return count;
1141  }
1142 
1143  //------------------------------------------------------------------------------------------------
1146  {
1147  if (playerId == 0)
1148  return null;
1149 
1150  string playerIdentity = SCR_CampaignPlayerStruct.GetPlayerIdentity(playerId);
1151 
1152  if (playerIdentity == string.Empty)
1153  return null;
1154 
1155  SCR_CampaignClientData clientData;
1156 
1157  // Check if the client is reconnecting
1158  for (int i = 0, clientsCount = m_aRegisteredClients.Count(); i < clientsCount; i++)
1159  {
1160  if (m_aRegisteredClients[i].GetID() == playerIdentity)
1161  {
1162  clientData = m_aRegisteredClients[i];
1163  break;
1164  }
1165  }
1166 
1167  if (!clientData)
1168  {
1169  clientData = new SCR_CampaignClientData;
1170  clientData.SetID(playerIdentity);
1171  m_aRegisteredClients.Insert(clientData);
1172  }
1173 
1174  return clientData;
1175  }
1176 
1177  //------------------------------------------------------------------------------------------------
1178  protected void OnAmbientVehicleSpawned(SCR_AmbientVehicleSpawnPointComponent spawnpoint, Vehicle vehicle)
1179  {
1180  SCR_HelicopterDamageManagerComponent helicopterDamageManager = SCR_HelicopterDamageManagerComponent.Cast(vehicle.FindComponent(SCR_HelicopterDamageManagerComponent));
1181 
1182  // Ignore non-helicopter vehicles
1183  if (!helicopterDamageManager)
1184  return;
1185 
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;
1192 
1193  DamageManagerComponent damageManager;
1194 
1195  // Damage the engine and hull
1196  foreach (HitZone hitZone : hitZones)
1197  {
1198  if (!hitZone.IsInherited(SCR_EngineHitZone) && !hitZone.IsInherited(SCR_FlammableHitZone))
1199  continue;
1200 
1201  damageManager = DamageManagerComponent.Cast(hitZone.GetHitZoneContainer());
1202 
1203  SCR_DamageContext damageContext = new SCR_DamageContext(EDamageType.TRUE, hitZone.GetMaxHealth() * 0.75, transform, damageManager.GetOwner(), hitZone, Instigator.CreateInstigator(null), null, -1, -1);
1204  if (damageManager)
1205  helicopterDamageManager.HandleDamage(damageContext);
1206  }
1207 
1208  array<SCR_FuelManagerComponent> fuelManagers = {};
1209  array<BaseFuelNode> fuelNodes = {};
1210  SCR_FuelManagerComponent.GetAllFuelManagers(vehicle, fuelManagers);
1211 
1212  // Remove all fuel
1213  foreach (SCR_FuelManagerComponent fuelManager : fuelManagers)
1214  {
1215  fuelNodes.Clear();
1216  fuelManager.GetFuelNodesList(fuelNodes);
1217 
1218  foreach (BaseFuelNode fuelNode : fuelNodes)
1219  {
1220  fuelNode.SetFuel(0.0);
1221  }
1222  }
1223  }
1224 
1225  //------------------------------------------------------------------------------------------------
1226  protected void OnRankChanged(SCR_ECharacterRank oldRank, SCR_ECharacterRank newRank, notnull IEntity owner, bool silent)
1227  {
1228  if (silent)
1229  return;
1230 
1231  int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(owner);
1232  SCR_CampaignFaction faction = SCR_CampaignFaction.Cast(SCR_FactionManager.SGetPlayerFaction(playerId));
1233 
1234  if (!faction)
1235  return;
1236 
1237  SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
1238 
1239  if (!factionManager)
1240  return;
1241 
1242  SCR_RankIDCampaign rank = SCR_RankIDCampaign.Cast(factionManager.GetRankByID(newRank));
1243 
1244  if (!rank)
1245  return;
1246 
1247  SCR_ERadioMsg radio;
1248 
1249  if (newRank < oldRank && !rank.IsRankRenegade())
1250  radio = SCR_ERadioMsg.DEMOTION;
1251  else
1252  radio = rank.GetRadioMsg();
1253 
1254  faction.SendHQMessage(radio, calledID: playerId, public: false, param: newRank)
1255  }
1256 
1257  //------------------------------------------------------------------------------------------------
1258  override void OnPlayerRegistered(int playerId)
1259  {
1260  SCR_PlayerController playerController = SCR_PlayerController.Cast(GetGame().GetPlayerManager().GetPlayerController(playerId));
1261 
1262  if (playerController)
1263  {
1265 
1266  if (playerFactionAff)
1267  {
1268  playerFactionAff.GetOnPlayerFactionResponseInvoker_O().Insert(OnPlayerFactionResponse_O);
1269  playerFactionAff.GetOnPlayerFactionResponseInvoker_S().Insert(OnPlayerFactionResponse_S);
1270  }
1271  }
1272 
1273  super.OnPlayerRegistered(playerId);
1274 
1275  if (!playerController)
1276  return;
1277 
1278  // Normally this is done in OnPlayerAuditSuccess, but in SP the callback is not triggered
1279  if (RplSession.Mode() == RplMode.None && !m_bIsTutorial)
1280  ApplyClientData(playerId);
1281 
1282  // See HandleOnFactionAssigned()
1283  if (SCR_PlayerController.GetLocalPlayerId() == 0)
1284  return;
1285 
1286  int key;
1287 
1288  for (int i = 0, count = m_mUnprocessedFactionAssignments.Count(); i < count; i++)
1289  {
1290  key = m_mUnprocessedFactionAssignments.GetKey(i);
1291 
1292  if (key == SCR_PlayerController.GetLocalPlayerId())
1293  {
1296  }
1297  }
1298  }
1299 
1300  //------------------------------------------------------------------------------------------------
1301  override void OnPlayerAuditSuccess(int iPlayerID)
1302  {
1303  super.OnPlayerAuditSuccess(iPlayerID);
1304 
1305  // Apply data with a delay so client's game has time to initialize and register faction setting
1306  if (RplSession.Mode() != RplMode.None)
1307  GetGame().GetCallqueue().CallLater(ApplyClientData, MINIMUM_DELAY, false, iPlayerID);
1308  }
1309 
1310  //------------------------------------------------------------------------------------------------
1311  override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
1312  {
1313  super.OnPlayerDisconnected(playerId, cause, timeout);
1314 
1315  GetTaskManager().OnPlayerDisconnected(playerId);
1316  WriteClientData(playerId, true);
1317  m_BaseManager.OnPlayerDisconnected(playerId)
1318  }
1319 
1320  override bool CanPlayerSpawn_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, out SCR_ESpawnResult result = SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
1321  {
1322  if (!super.CanPlayerSpawn_S(requestComponent, handlerComponent, data, result))
1323  return false;
1324 
1326  SCR_SpawnPointSpawnData spawnPointData = SCR_SpawnPointSpawnData.Cast(data);
1327  if (spawnPointData)
1328  {
1329  IEntity parent = spawnPointData.GetSpawnPoint().GetParent();
1330  while (parent)
1331  {
1332  base = SCR_CampaignMilitaryBaseComponent.Cast(parent.FindComponent(SCR_CampaignMilitaryBaseComponent));
1333 
1334  if (base)
1335  break;
1336 
1337  parent = parent.GetParent();
1338  }
1339  }
1340 
1341  //Base HQ doesn't need to check supplies cost
1342  if (!base)
1343  return true;
1344 
1345  int spawnSupplyCost = 0;
1346 
1347  SCR_PlayerLoadoutComponent loadoutComp = SCR_PlayerLoadoutComponent.Cast(requestComponent.GetPlayerController().FindComponent(SCR_PlayerLoadoutComponent));
1348  if (loadoutComp)
1349  spawnSupplyCost = SCR_ArsenalManagerComponent.GetLoadoutCalculatedSupplyCost(loadoutComp.GetLoadout(), false, requestComponent.GetPlayerId(), null, base, base.GetResourceComponent());
1350 
1351  //~ Check if there are enough supplies
1352  if (base.GetSupplies() < spawnSupplyCost)
1353  {
1354  result = SCR_ESpawnResult.NOT_ALLOWED_NOT_ENOUGH_SUPPLIES;
1355  return false;
1356  }
1357 
1358  /*bool validPersonalLoadout = false;
1359  SCR_PlayerLoadoutComponent loadoutComp = SCR_PlayerLoadoutComponent.Cast(requestComponent.GetPlayerController().FindComponent(SCR_PlayerLoadoutComponent));
1360  if (loadoutComp && loadoutComp.GetLoadout())
1361  {
1362  SCR_PlayerArsenalLoadout playerArsenalLoadout = SCR_PlayerArsenalLoadout.Cast(loadoutComp.GetLoadout());
1363  if (playerArsenalLoadout)
1364  {
1365  validPersonalLoadout = true;
1366 
1367  string playerUID = GetGame().GetBackendApi().GetPlayerIdentityId(requestComponent.GetPlayerId());
1368  if (base.GetSupplies() < (playerArsenalLoadout.GetLoadoutSuppliesCost(playerUID) * base.GetBaseSpawnCostFactor()))
1369  {
1370  result = SCR_ESpawnResult.NOT_ALLOWED_NOT_ENOUGH_SUPPLIES;
1371  return false;
1372  }
1373  }
1374  }
1375 
1376  if (!validPersonalLoadout)
1377  {
1378  if (base.GetSupplies() < base.GetBaseSpawnCost())
1379  {
1380  result = SCR_ESpawnResult.NOT_ALLOWED_NOT_ENOUGH_SUPPLIES;
1381  return false;
1382  }
1383  }*/
1384 
1385  return true;
1386  }
1387 
1388  //------------------------------------------------------------------------------------------------
1389  override void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
1390  {
1391  super.OnPlayerSpawnFinalize_S(requestComponent, handlerComponent, data, entity);
1392 
1393  PlayerController pc = requestComponent.GetPlayerController();
1394 
1395  if (!pc)
1396  return;
1397 
1398  SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(pc.FindComponent(SCR_CampaignNetworkComponent));
1399 
1400  if (campaignNetworkComponent)
1401  campaignNetworkComponent.OnPlayerAliveStateChanged(true);
1402  }
1403 
1404  //------------------------------------------------------------------------------------------------
1405  override void OnPlayerSpawnOnPoint_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnPointSpawnData spawnPointData)
1406  {
1407  super.OnPlayerSpawnOnPoint_S(requestComponent, handlerComponent, entity, spawnPointData);
1408 
1409  // Award XP for the owner of the respawn radio (if applicable)
1410  SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1411 
1412  if (compXP)
1413  {
1414  SCR_SpawnPoint spawnpoint = spawnPointData.GetSpawnPoint();
1415 
1416  if (spawnpoint)
1417  {
1418  SCR_PlayerSpawnPoint playerSpawnpoint = SCR_PlayerSpawnPoint.Cast(spawnpoint);
1419  SCR_DeployableSpawnPoint radioSpawnpoint = SCR_DeployableSpawnPoint.Cast(spawnpoint);
1420 
1421  if (playerSpawnpoint)
1422  {
1423  compXP.AwardXP(playerSpawnpoint.GetPlayerID(), SCR_EXPRewards.SPAWN_PROVIDER);
1424  }
1425  else if (radioSpawnpoint)
1426  {
1427  SCR_BaseDeployableSpawnPointComponent comp = radioSpawnpoint.GetDeployableSpawnPointComponent();
1428 
1429  if (comp)
1430  {
1431  int playerId = comp.GetItemOwnerID();
1432 
1433  // Don't award XP if player respawns on their own spawnpoint
1434  if (playerId != GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(entity))
1435  compXP.AwardXP(playerId, SCR_EXPRewards.SPAWN_PROVIDER);
1436  }
1437  }
1438  }
1439  }
1440 
1441  IEntity parent = spawnPointData.GetSpawnPoint().GetParent();
1443 
1444  // Find spawnpoint's parent base, deduct supplies if applicable
1445  while (parent)
1446  {
1447  base = SCR_CampaignMilitaryBaseComponent.Cast(parent.FindComponent(SCR_CampaignMilitaryBaseComponent));
1448 
1449  if (base)
1450  break;
1451 
1452  parent = parent.GetParent();
1453  }
1454 
1455  //~ Todo: Move to SCR_BaseGameMode and make sure it also checks the Spawnpoint for Resource for having spawning cost supplies
1456  if (!base)
1457  return;
1458 
1459  SCR_PlayerLoadoutComponent loadoutComp = SCR_PlayerLoadoutComponent.Cast(requestComponent.GetPlayerController().FindComponent(SCR_PlayerLoadoutComponent));
1460 
1461  int spawnSupplyCost = 0;
1462  if (loadoutComp)
1463  spawnSupplyCost = SCR_ArsenalManagerComponent.GetLoadoutCalculatedSupplyCost(loadoutComp.GetLoadout(), false, requestComponent.GetPlayerId(), null, base, base.GetResourceComponent());
1464 
1465  if (spawnSupplyCost > 0)
1466  base.AddSupplies(spawnSupplyCost * -1);
1467 
1468  // Location popup for player
1469  PlayerController playerController = GetGame().GetPlayerManager().GetPlayerController(requestComponent.GetPlayerId());
1470 
1471  if (playerController)
1472  {
1473  SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
1474 
1475  if (campaignNetworkComponent)
1476  campaignNetworkComponent.RespawnLocationPopup(base.GetCallsign());
1477  }
1478  }
1479 
1480  //------------------------------------------------------------------------------------------------
1482  {
1483  IEntity owner = spawnpoint.GetParent();
1484 
1485  if (owner)
1486  {
1488 
1489  if (parentBase)
1490  parentBase.OnSpawnPointFactionAssigned(spawnpoint.GetFactionKey())
1491  }
1492  }
1493 
1494  //------------------------------------------------------------------------------------------------
1495  override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
1496  {
1497  super.OnPlayerKilled(playerId, playerEntity, killerEntity, killer);
1498 
1499  if (IsProxy())
1500  return;
1501 
1502  PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(playerId);
1503 
1504  if (!pc)
1505  return;
1506 
1507  SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(pc.FindComponent(SCR_CampaignNetworkComponent));
1508 
1509  if (campaignNetworkComponent)
1510  {
1511  campaignNetworkComponent.OnPlayerAliveStateChanged(false);
1512  campaignNetworkComponent.ResetSavedSupplies();
1513  }
1514 
1515  UpdateRespawnPenalty(playerId);
1516 
1517  if (playerId == killer.GetInstigatorPlayerID())
1518  OnSuicide(playerId);
1519  }
1520 
1521  //------------------------------------------------------------------------------------------------
1523  protected void UpdateRespawnPenalty(int playerId)
1524  {
1526  return;
1527 
1528  SCR_CampaignClientData clientData = GetClientData(playerId);
1529 
1530  if (!clientData)
1531  return;
1532 
1533  float respawnPenalty = clientData.GetRespawnPenalty();
1534 
1535  if (respawnPenalty == 0)
1536  return;
1537 
1538  float curTime = GetGame().GetWorld().GetWorldTime();
1539  float penaltyCooldownMs = (float)m_iSuicideForgiveCooldown * 1000;
1540  float timeSinceLastDeduction = curTime - clientData.GetLastPenaltyDeductionTimestamp();
1541  float penaltiesForgiven = Math.Floor(timeSinceLastDeduction / penaltyCooldownMs);
1542 
1543  if (penaltiesForgiven < 1)
1544  return;
1545 
1546  clientData.SetLastPenaltyDeductionTimestamp(curTime);
1547  float forgivenPenalty = (float)m_iSuicideRespawnDelay * penaltiesForgiven;
1548  clientData.SetRespawnPenalty(respawnPenalty - forgivenPenalty);
1549 
1550  array<Managed> timers = {};
1551  FindComponents(SCR_RespawnTimerComponent, timers);
1552 
1553  foreach (Managed timer : timers)
1554  {
1555  // Skip this specific type as it's handled separately for radio spawns
1556  if (timer.Type() == SCR_TimedSpawnPointComponent)
1557  continue;
1558 
1559  SCR_RespawnTimerComponent timerCast = SCR_RespawnTimerComponent.Cast(timer);
1560 
1561  if (!timerCast)
1562  continue;
1563 
1564  timerCast.SetRespawnTime(playerId, timerCast.GetRespawnTime() - respawnPenalty - forgivenPenalty);
1565  }
1566  }
1567 
1568  //------------------------------------------------------------------------------------------------
1569  protected void OnSuicide(int playerId)
1570  {
1571  // Don't issue penalties in WB so it doesn't interfere with debugging etc.
1572 #ifdef WORKBENCH
1573  return;
1574 #endif
1575 #ifdef NO_SUICIDE_PENALTY
1576  return;
1577 #endif
1578  if (m_bIsTutorial)
1579  return;
1580 
1581  if (m_iSuicideRespawnDelay == 0)
1582  return;
1583 
1584  PlayerController pc = GetGame().GetPlayerManager().GetPlayerController(playerId);
1585 
1586  // Do not process suicide if player was unconscious upon death
1587  if (pc)
1588  {
1589  SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.Cast(pc.FindComponent(SCR_CampaignFeedbackComponent));
1590 
1591  if (comp && !comp.IsConscious())
1592  return;
1593  }
1594 
1595  SCR_CampaignClientData clientData = GetClientData(playerId);
1596 
1597  if (!clientData)
1598  return;
1599 
1600  float respawnPenalty = clientData.GetRespawnPenalty();
1601  float lastSuicideTimestamp = clientData.GetLastSuicideTimestamp();
1602  float curTime = GetGame().GetWorld().GetWorldTime();
1603  clientData.SetLastSuicideTimestamp(curTime);
1604 
1605  if (lastSuicideTimestamp == 0)
1606  return;
1607 
1608  float timeSinceLastSuicide = curTime - lastSuicideTimestamp;
1609  float penaltyCooldownMs = (float)m_iSuicidePenaltyCooldown * 1000;
1610 
1611  // Last suicide happened long enough time ago, don't issue a penalty
1612  if (timeSinceLastSuicide > penaltyCooldownMs)
1613  return;
1614 
1615  float addedPenalty = m_iSuicideRespawnDelay;
1616 
1617  clientData.SetLastPenaltyDeductionTimestamp(curTime);
1618  clientData.SetRespawnPenalty(respawnPenalty + addedPenalty);
1619 
1620  array<Managed> timers = {};
1621  FindComponents(SCR_RespawnTimerComponent, timers);
1622 
1623  foreach (Managed timer : timers)
1624  {
1625  // Skip this specific type as it's handled separately for radio spawns
1626  if (timer.Type() == SCR_TimedSpawnPointComponent)
1627  continue;
1628 
1629  SCR_RespawnTimerComponent timerCast = SCR_RespawnTimerComponent.Cast(timer);
1630 
1631  if (!timerCast)
1632  continue;
1633 
1634  timerCast.SetRespawnTime(playerId, timerCast.GetRespawnTime() + respawnPenalty + addedPenalty);
1635  }
1636  }
1637 
1638  //------------------------------------------------------------------------------------------------
1640  override void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator instigator)
1641  {
1642  super.OnControllableDestroyed(entity, killerEntity, instigator);
1643 
1644  if (IsProxy())
1645  return;
1646 
1647  SCR_XPHandlerComponent compXP = SCR_XPHandlerComponent.Cast(FindComponent(SCR_XPHandlerComponent));
1648 
1649  if (!compXP)
1650  return;
1651 
1652  // Ignore AI or NONE instigators
1653  if (instigator.GetInstigatorType() != InstigatorType.INSTIGATOR_PLAYER)
1654  return;
1655 
1656  int killerId = instigator.GetInstigatorPlayerID();
1657 
1658  SCR_ChimeraCharacter victimCharacter = SCR_ChimeraCharacter.Cast(entity);
1659 
1660  if (!victimCharacter)
1661  return;
1662 
1663  SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
1664  if (!factionManager)
1665  return;
1666 
1667  Faction factionKiller = Faction.Cast(factionManager.GetPlayerFaction(killerId));
1668  if (!factionKiller)
1669  return;
1670 
1671  //Friendly kills are not to be rewarded
1672  if (factionKiller.IsFactionFriendly(victimCharacter.GetFaction()))
1673  return;
1674 
1675  vector victimPos = victimCharacter.GetOrigin();
1676 
1677  SCR_CampaignMilitaryBaseComponent nearestBase = m_BaseManager.FindClosestBase(victimPos);
1678 
1679  if (!nearestBase)
1680  return;
1681 
1682  //this awards additional XP to base defenders, so if the instigator is not in his own base, there should be no reward
1683  if (nearestBase.GetFaction() != factionKiller)
1684  return;
1685 
1686  if (vector.DistanceXZ(victimPos, nearestBase.GetOwner().GetOrigin()) > nearestBase.GetRadius())
1687  return;
1688 
1689  compXP.AwardXP(killerId, SCR_EXPRewards.CUSTOM_1);
1690  }
1691 
1692  //------------------------------------------------------------------------------------------------
1693  protected void OnPlayerFactionResponse_S(SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
1694  {
1695  if (!response)
1696  return;
1697 
1698  FactionManager factionManager = GetGame().GetFactionManager();
1699 
1700  if (!factionManager)
1701  return;
1702 
1703  SCR_Faction faction = SCR_Faction.Cast(factionManager.GetFactionByIndex(factionIndex));
1704 
1705  if (!faction)
1706  return;
1707 
1708  SCR_PlayerController playerController = SCR_PlayerController.Cast(component.GetPlayerController());
1709 
1710  if (!playerController)
1711  return;
1712 
1713  int playerID = playerController.GetPlayerId();
1714 
1715  // Save faction selected in client's data
1716  SCR_CampaignClientData clientData;
1717  clientData = GetClientData(playerID);
1718 
1719  if (clientData && faction)
1720  clientData.SetFactionIndex(factionManager.GetFactionIndex(faction));
1721  }
1722 
1723  //------------------------------------------------------------------------------------------------
1724  protected void OnPlayerFactionResponse_O(SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
1725  {
1726  if (!response)
1727  return;
1728 
1729  FactionManager factionManager = GetGame().GetFactionManager();
1730 
1731  if (!factionManager)
1732  return;
1733 
1734  SCR_Faction faction = SCR_Faction.Cast(factionManager.GetFactionByIndex(factionIndex));
1735 
1736  if (!faction)
1737  return;
1738 
1739  SCR_PlayerController playerController = SCR_PlayerController.Cast(component.GetPlayerController());
1740 
1741  if (!playerController)
1742  return;
1743 
1744  int playerID = playerController.GetPlayerId();
1745 
1746  // When a faction is being assigned to the client automatically by server, playerId might not yet be registered
1747  // In that case, this saves the connecting player's data and processes them later in local OnPlayerRegistered()
1748  if (SCR_PlayerController.GetLocalPlayerId() == playerID)
1749  ProcessFactionAssignment(faction);
1750  else
1751  m_mUnprocessedFactionAssignments.Set(playerID, faction);
1752  }
1753 
1754  //------------------------------------------------------------------------------------------------
1756  protected void ProcessFactionAssignment(Faction assignedFaction)
1757  {
1758  m_BaseManager.SetLocalPlayerFaction(SCR_CampaignFaction.Cast(assignedFaction));
1759 
1761  m_OnFactionAssignedLocalPlayer.Invoke(assignedFaction);
1762 
1763  // Delayed call so tasks are properly initialized
1764  if (IsProxy())
1765  GetGame().GetCallqueue().CallLater(m_BaseManager.UpdateTaskBases, DEFAULT_DELAY, false, assignedFaction);
1766  }
1767 
1768  //------------------------------------------------------------------------------------------------
1770  void OnEntityRequested(notnull IEntity spawnedEntity, IEntity user, SCR_Faction faction, SCR_MilitaryBaseLogicComponent service)
1771  {
1772  if (IsProxy())
1773  return;
1774 
1775  SCR_AIGroup aiGroup = SCR_AIGroup.Cast(spawnedEntity);
1776  if (aiGroup)
1777  {
1778  SCR_CampaignMilitaryBaseManager militaryBaseManager = GetBaseManager();
1779  if (!militaryBaseManager)
1780  return;
1781 
1782  militaryBaseManager.OnDefenderGroupSpawned(service, aiGroup);
1783  }
1784 
1785  if (!spawnedEntity.IsInherited(Vehicle))
1786  return;
1787 
1788  // Vehicles requested in bases without fuel depot should have only a small amount of fuel
1789  array<SCR_FuelManagerComponent> fuelManagers = {};
1790  array<BaseFuelNode> fuelNodes = {};
1791  SCR_FuelManagerComponent.GetAllFuelManagers(spawnedEntity, fuelManagers);
1792  array<SCR_MilitaryBaseComponent> serviceBases = {};
1793  service.GetBases(serviceBases);
1794  bool fuelDepotNearby;
1795 
1796  foreach (SCR_MilitaryBaseComponent serviceBase : serviceBases)
1797  {
1798  if (serviceBase.GetServiceByType(SCR_EServicePointType.FUEL_DEPOT))
1799  {
1800  fuelDepotNearby = true;
1801  break;
1802  }
1803  }
1804 
1805  if (!fuelDepotNearby)
1806  {
1807  foreach (SCR_FuelManagerComponent fuelManager : fuelManagers)
1808  {
1809  fuelNodes.Clear();
1810  fuelManager.GetFuelNodesList(fuelNodes);
1811 
1812  foreach (BaseFuelNode fuelNode : fuelNodes)
1813  {
1814  fuelNode.SetFuel(fuelNode.GetMaxFuel() * 0.3);
1815  }
1816  }
1817  }
1818 
1819  PlayerManager playerManager = GetGame().GetPlayerManager();
1820 
1821  int playerId = playerManager.GetPlayerIdFromControlledEntity(user);
1822 
1823  if (playerId == 0)
1824  return;
1825 
1826  SCR_PlayerController playerController = SCR_PlayerController.Cast(playerManager.GetPlayerController(playerId));
1827 
1828  if (!playerController)
1829  return;
1830 
1831  SCR_CampaignNetworkComponent networkComp = SCR_CampaignNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignNetworkComponent));
1832 
1833  if (!networkComp)
1834  return;
1835 
1836  ChimeraWorld world = spawnedEntity.GetWorld();
1837  networkComp.SetLastRequestTimestamp(world.GetServerTimestamp());
1838 
1839  BaseRadioComponent radioComponent = BaseRadioComponent.Cast(spawnedEntity.FindComponent(BaseRadioComponent));
1840 
1841  // Assign faction radio frequency
1842  if (radioComponent && faction)
1843  {
1844  BaseTransceiver transceiver = radioComponent.GetTransceiver(0);
1845 
1846  if (transceiver)
1847  {
1848  radioComponent.SetPower(false);
1849  transceiver.SetFrequency(faction.GetFactionRadioFrequency());
1850  radioComponent.SetEncryptionKey(faction.GetFactionRadioEncryptionKey());
1851  }
1852  }
1853 
1854  SlotManagerComponent slotManager = SlotManagerComponent.Cast(spawnedEntity.FindComponent(SlotManagerComponent));
1855 
1856  if (!slotManager)
1857  return;
1858 
1859  array<EntitySlotInfo> slots = {};
1860  slotManager.GetSlotInfos(slots);
1861 
1862  IEntity truckBed;
1863  SCR_CampaignSuppliesComponent suppliesComponent;
1864  SCR_CampaignMobileAssemblyComponent mobileAssemblyComponent;
1865  EventHandlerManagerComponent eventHandlerManager;
1866 
1867  // Handle Conflict-specific vehicles
1868  foreach (EntitySlotInfo slot : slots)
1869  {
1870  if (!slot)
1871  continue;
1872 
1873  truckBed = slot.GetAttachedEntity();
1874 
1875  if (!truckBed)
1876  continue;
1877 
1878  mobileAssemblyComponent = SCR_CampaignMobileAssemblyComponent.Cast(truckBed.FindComponent(SCR_CampaignMobileAssemblyComponent));
1879 
1880  // Mobile HQ
1881  if (mobileAssemblyComponent)
1882  {
1883  mobileAssemblyComponent.SetParentFactionID(GetGame().GetFactionManager().GetFactionIndex(faction));
1884  networkComp.SendVehicleSpawnHint(EHint.CONFLICT_MOBILE_HQ);
1885  }
1886  }
1887  }
1888 
1889 #ifdef ENABLE_DIAG
1890  //------------------------------------------------------------------------------------------------
1891  override void EOnDiag(IEntity owner, float timeSlice)
1892  {
1893  super.EOnDiag(owner, timeSlice);
1894 
1895  // Cheat menu
1896  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_UP))
1897  {
1898  DiagMenu.SetValue(SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_UP, 0);
1899  PlayerController pc = GetGame().GetPlayerController();
1900 
1901  if (pc)
1902  {
1903  SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1904 
1905  if (comp)
1906  comp.CheatRank();
1907  }
1908  }
1909 
1910  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_DOWN))
1911  {
1912  DiagMenu.SetValue(SCR_DebugMenuID.DEBUGUI_CAMPAIGN_RANK_DOWN, 0);
1913  PlayerController pc = GetGame().GetPlayerController();
1914 
1915  if (pc)
1916  {
1917  SCR_PlayerXPHandlerComponent comp = SCR_PlayerXPHandlerComponent.Cast(pc.FindComponent(SCR_PlayerXPHandlerComponent));
1918 
1919  if (comp)
1920  comp.CheatRank(true);
1921  }
1922  }
1923  }
1924 #endif
1925 
1926  //------------------------------------------------------------------------------------------------
1927  void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
1928  {
1929  // Attributes check
1930  if (m_sBLUFORFactionKey == FactionKey.Empty)
1931  Print("SCR_GameModeCampaign: Empty BLUFOR faction key!", LogLevel.ERROR);
1932 
1933  if (m_sOPFORFactionKey == FactionKey.Empty)
1934  Print("SCR_GameModeCampaign: Empty OPFOR faction key!", LogLevel.ERROR);
1935 
1936  if (m_sINDFORFactionKey == FactionKey.Empty)
1937  Print("SCR_GameModeCampaign: Empty INDFOR faction key!", LogLevel.ERROR);
1938 
1939  if (!GetGame().InPlayMode())
1940  return;
1941 
1942  // Cheat menu
1943 #ifdef ENABLE_DIAG
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();
1950 #endif
1951 
1952  // Parameters override from header
1953  SCR_MissionHeaderCampaign header = SCR_MissionHeaderCampaign.Cast(GetGame().GetMissionHeader());
1954 
1955  if (header)
1956  {
1957  m_bIgnoreMinimumVehicleRank = header.m_bIgnoreMinimumVehicleRank;
1958 
1959  int suppliesMax = header.m_iMaximumBaseSupplies;
1960  int suppliesMin = header.m_iMinimumBaseSupplies;
1961  int controlPointsLimit = header.m_iControlPointsCap;
1962  int victoryTimeout = header.m_fVictoryTimeout;
1963 
1964  if (suppliesMax != -1)
1965  m_iMaxStartingSupplies = suppliesMax;
1966 
1967  if (suppliesMin != -1)
1968  m_iMinStartingSupplies = suppliesMin;
1969 
1970  if (controlPointsLimit != -1)
1971  m_iControlPointsThreshold = controlPointsLimit;
1972 
1973  if (victoryTimeout != -1)
1974  m_fVictoryTimer = victoryTimeout;
1975  }
1976  }
1977 
1978  //------------------------------------------------------------------------------------------------
1980  {
1981  DisconnectFromDiagSystem();
1982 
1983  SCR_SpawnPoint.Event_SpawnPointFactionAssigned.Remove(OnSpawnPointFactionAssigned);
1984 
1985  SCR_AmbientVehicleSystem manager = SCR_AmbientVehicleSystem.GetInstance();
1986 
1987  if (manager)
1988  manager.GetOnVehicleSpawned().Remove(OnAmbientVehicleSpawned);
1989  }
1990 }
m_iSuicideForgiveCooldown
protected int m_iSuicideForgiveCooldown
Definition: SCR_GameModeCampaign.c:82
SCR_PlayerLoadoutComponent
Definition: SCR_PlayerLoadoutComponent.c:16
ChimeraWorld
Definition: ChimeraWorld.c:12
m_iMinStartingSupplies
protected int m_iMinStartingSupplies
Definition: SCR_GameModeCampaign.c:46
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
m_bRemnantsStateLoaded
protected bool m_bRemnantsStateLoaded
Definition: SCR_GameModeCampaign.c:104
WasRemnantsStateLoaded
bool WasRemnantsStateLoaded()
Definition: SCR_GameModeCampaign.c:256
GetOnMatchSituationChanged
ScriptInvoker GetOnMatchSituationChanged()
Triggered when an event happened which should be communicated to players (i.e. amount of control poin...
Definition: SCR_GameModeCampaign.c:148
OnSuicide
protected void OnSuicide(int playerId)
Definition: SCR_GameModeCampaign.c:1569
InstigatorType
InstigatorType
Definition: InstigatorType.c:12
OnPlayerSpawnFinalize_S
override void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
Definition: SCR_GameModeCampaign.c:1389
ApplyClientData
protected void ApplyClientData(int playerId)
Definition: SCR_GameModeCampaign.c:968
SCR_RespawnComponent
void SCR_RespawnComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_RespawnComponent.c:576
GetSuppliesArrivalInterval
int GetSuppliesArrivalInterval()
Definition: SCR_GameModeCampaign.c:184
SCR_PlayerController
Definition: SCR_PlayerController.c:31
m_sBLUFORFactionKey
protected FactionKey m_sBLUFORFactionKey
Definition: SCR_GameModeCampaign.c:55
OnCallsignOffsetChanged
void OnCallsignOffsetChanged()
Definition: SCR_GameModeCampaign.c:614
SCR_ECampaignFaction
SCR_ECampaignFaction
Definition: SCR_CampaignFactionManager.c:130
SCR_ESpawnResult
SCR_ESpawnResult
Definition: SCR_ESpawnResult.c:8
OnRankChanged
protected void OnRankChanged(SCR_ECharacterRank oldRank, SCR_ECharacterRank newRank, notnull IEntity owner, bool silent)
Definition: SCR_GameModeCampaign.c:1226
RPC_DoSetPrimaryTarget
protected void RPC_DoSetPrimaryTarget(int factionIndex, int targetId)
Definition: SCR_GameModeCampaign.c:422
UpdateRespawnPenalty
protected void UpdateRespawnPenalty(int playerId)
Handles forgiving of post-suicide deploy timer penalties.
Definition: SCR_GameModeCampaign.c:1523
~SCR_GameModeCampaign
void ~SCR_GameModeCampaign()
Definition: SCR_GameModeCampaign.c:1979
OnSpawnPointFactionAssigned
void OnSpawnPointFactionAssigned(SCR_SpawnPoint spawnpoint)
Definition: SCR_GameModeCampaign.c:1481
RPC_DoSetControlPointsHeld
protected void RPC_DoSetControlPointsHeld(int factionIndex, int count)
Definition: SCR_GameModeCampaign.c:393
m_sINDFORFactionKey
protected FactionKey m_sINDFORFactionKey
Definition: SCR_GameModeCampaign.c:61
HitZone
Definition: HitZone.c:12
GetPlayers
protected int GetPlayers(out notnull array< int > outPlayers)
Definition: SCR_DataCollectorComponent.c:233
BaseFuelNode
Definition: BaseFuelNode.c:12
m_OnCallsignOffsetChanged
protected ref ScriptInvoker m_OnCallsignOffsetChanged
Definition: SCR_GameModeCampaign.c:93
OnStructureBuilt
void OnStructureBuilt(SCR_CampaignMilitaryBaseComponent base, SCR_EditableEntityComponent entity, bool add)
Definition: SCR_GameModeCampaign.c:943
GetStartingSuppliesInterval
int GetStartingSuppliesInterval()
Definition: SCR_GameModeCampaign.c:244
GetQuickSuppliesReplenishThreshold
int GetQuickSuppliesReplenishThreshold()
Definition: SCR_GameModeCampaign.c:172
SCR_CampaignClientData
Used for storing client data to be reapplied for reconnecting clients.
Definition: SCR_CampaignClientData.c:3
GetMaxStartingSupplies
int GetMaxStartingSupplies()
Definition: SCR_GameModeCampaign.c:238
IsSessionLoadInProgress
bool IsSessionLoadInProgress()
Definition: SCR_GameModeCampaign.c:262
LoadRemnantsStates
void LoadRemnantsStates(notnull array< ref SCR_CampaignRemnantInfoStruct > entries)
Definition: SCR_GameModeCampaign.c:911
RplProp
SCR_RplTestEntityClass RplProp
Used for handling entity spawning requests for SCR_CatalogEntitySpawnerComponent and inherited classe...
m_sSeekDestroyWaypointPrefab
protected ResourceName m_sSeekDestroyWaypointPrefab
Definition: SCR_GameModeCampaign.c:73
GetInstance
SCR_TextsTaskManagerComponentClass ScriptComponentClass GetInstance()
Definition: SCR_TextsTaskManagerComponent.c:50
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
OnPlayerSpawnOnPoint_S
override void OnPlayerSpawnOnPoint_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnPointSpawnData spawnPointData)
Definition: SCR_GameModeCampaign.c:1405
GetFactionIndex
int GetFactionIndex()
Definition: SCR_EditableFactionComponent.c:57
SetIsTutorial
void SetIsTutorial(bool isTutorial)
Definition: SCR_GameModeCampaign.c:957
m_aRegisteredClients
protected ref array< ref SCR_CampaignClientData > m_aRegisteredClients
Definition: SCR_GameModeCampaign.c:98
SCR_ERadioMsg
SCR_ERadioMsg
Definition: SCR_CampaignRadioMsg.c:138
m_iMaxStartingSupplies
protected int m_iMaxStartingSupplies
Definition: SCR_GameModeCampaign.c:49
SCR_ECharacterRank
SCR_ECharacterRank
Definition: SCR_CharacterRankComponent.c:305
GetRegularSuppliesIncome
int GetRegularSuppliesIncome()
Definition: SCR_GameModeCampaign.c:190
m_bStarted
protected bool m_bStarted
Definition: SCR_GameModeCampaign.c:112
m_iRegularSuppliesIncomeBase
protected int m_iRegularSuppliesIncomeBase
Definition: SCR_GameModeCampaign.c:37
Attribute
SCR_GameModeCampaignClass SCR_BaseGameModeClass Attribute("1", desc:"Run Conflict automatically at scenario start. If disabled, use RequestStart() method on server.", category:"Campaign")] protected bool m_bAutostart
SCR_MilitaryBaseSystem
Definition: SCR_MilitaryBaseSystem.c:11
BroadcastMHQFeedback
void BroadcastMHQFeedback(SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
Definition: SCR_GameModeCampaign.c:433
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
SCR_SpawnPoint
Spawn point entity defines positions on which players can possibly spawn.
Definition: SCR_SpawnPoint.c:27
GetMinStartingSupplies
int GetMinStartingSupplies()
Definition: SCR_GameModeCampaign.c:232
Start
protected void Start()
Definition: SCR_GameModeCampaign.c:465
SCR_PopUpNotification
Takes care of dynamic and static onscreen popups.
Definition: SCR_PopupNotification.c:24
m_bIsSessionLoadInProgress
protected bool m_bIsSessionLoadInProgress
Definition: SCR_GameModeCampaign.c:105
OnMatchSituationChanged
void OnMatchSituationChanged()
Definition: SCR_GameModeCampaign.c:316
m_iCallsignOffset
protected int m_iCallsignOffset
Definition: SCR_GameModeCampaign.c:124
m_OnMatchSituationChanged
protected ref ScriptInvoker m_OnMatchSituationChanged
Definition: SCR_GameModeCampaign.c:92
KickCauseCode
KickCauseCode
Definition: KickCauseCode.c:19
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
GetFactionByEnum
SCR_CampaignFaction GetFactionByEnum(SCR_ECampaignFaction faction)
Definition: SCR_GameModeCampaign.c:778
Instigator
Definition: Instigator.c:6
StoreLoadedData
void StoreLoadedData(notnull SCR_CampaignStruct struct)
Handle the loaded struct; we want to apply it after gamemode has initialized.
Definition: SCR_GameModeCampaign.c:804
OnPlayerFactionResponse_S
protected void OnPlayerFactionResponse_S(SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
Definition: SCR_GameModeCampaign.c:1693
m_iSuicideRespawnDelay
protected int m_iSuicideRespawnDelay
Definition: SCR_GameModeCampaign.c:79
EntitySlotInfo
Adds ability to attach an object to a slot.
Definition: EntitySlotInfo.c:8
SCR_CharacterRankComponent
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CharacterRankComponent.c:209
m_iHQStartingSupplies
protected int m_iHQStartingSupplies
Definition: SCR_GameModeCampaign.c:43
RplLoad
override bool RplLoad(ScriptBitReader reader)
Definition: SCR_GameModeCampaign.c:344
m_fQuickSuppliesReplenishMultiplier
protected float m_fQuickSuppliesReplenishMultiplier
Definition: SCR_GameModeCampaign.c:28
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SCR_CampaignSuppliesComponent
void SCR_CampaignSuppliesComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CampaignSuppliesComponent.c:327
SCR_SpawnData
Definition: SCR_SpawnData.c:9
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition: SCR_GameModeCampaign.c:1927
m_iStartingSuppliesInterval
protected int m_iStartingSuppliesInterval
Definition: SCR_GameModeCampaign.c:52
IsProxy
bool IsProxy()
Definition: SCR_GameModeCampaign.c:789
DisableExtraSpawnpoint
protected void DisableExtraSpawnpoint(SCR_SpawnPoint spawnpoint)
Definition: SCR_GameModeCampaign.c:621
m_iSuppliesReplenishThreshold
protected int m_iSuppliesReplenishThreshold
Definition: SCR_GameModeCampaign.c:22
EGameOverTypes
EGameOverTypes
Definition: EGameOverTypes.c:1
m_bMatchOver
protected bool m_bMatchOver
Definition: SCR_GameModeCampaign.c:102
ESaveType
ESaveType
Definition: ESaveType.c:1
SCR_RespawnTimerComponent
void SCR_RespawnTimerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_RespawnTimerComponent.c:333
SCR_MissionHeaderCampaign
Definition: SCR_MissionHeaderCampaign.c:1
OnPlayerRegistered
override void OnPlayerRegistered(int playerId)
Register provided client's respawn timer.
Definition: SCR_GameModeCampaign.c:1258
WriteAllClientsData
void WriteAllClientsData()
Definition: SCR_GameModeCampaign.c:1036
OnControllableDestroyed
override void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator instigator)
Award additional XP for enemies killed in friendly bases.
Definition: SCR_GameModeCampaign.c:1640
OnPlayerKilled
override void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
Definition: SCR_GameModeCampaign.c:1495
ApplyLoadedData
protected void ApplyLoadedData()
Definition: SCR_GameModeCampaign.c:815
GetVictoryTimer
float GetVictoryTimer()
Definition: SCR_GameModeCampaign.c:220
GetTaskManager
SCR_BaseTaskManager GetTaskManager()
Definition: SCR_BaseTaskManager.c:7
GetID
int GetID()
Definition: SCR_AmbientPatrolSpawnPointComponent.c:65
SCR_GameModeEndData
Definition: SCR_GameModeEndData.c:4
GetClientData
SCR_CampaignClientData GetClientData(int playerId)
Get corresponding client data, create new object if not found.
Definition: SCR_GameModeCampaign.c:1145
GetVictoryTimestamp
WorldTimestamp GetVictoryTimestamp()
Definition: SCR_GameModeCampaign.c:280
SCR_AmbientPatrolSystem
Definition: SCR_AmbientPatrolSystem.c:2
RPC_DoEndMatch
protected void RPC_DoEndMatch(int winningFactionId)
Definition: SCR_GameModeCampaign.c:700
m_bRandomizeSupplies
protected bool m_bRandomizeSupplies
Definition: SCR_GameModeCampaign.c:64
SCR_SpawnPointSpawnData
Definition: SCR_SpawnPointSpawnData.c:2
GetCallsignOffset
int GetCallsignOffset()
Definition: SCR_GameModeCampaign.c:310
GetRegularSuppliesIncomeBase
int GetRegularSuppliesIncomeBase()
Definition: SCR_GameModeCampaign.c:196
GetSeekDestroyWaypointPrefab
ResourceName GetSeekDestroyWaypointPrefab()
Definition: SCR_GameModeCampaign.c:268
m_iSuppliesArrivalInterval
protected int m_iSuppliesArrivalInterval
Definition: SCR_GameModeCampaign.c:31
m_mUnprocessedFactionAssignments
protected ref map< int, Faction > m_mUnprocessedFactionAssignments
Definition: SCR_GameModeCampaign.c:95
m_bWorldPostProcessDone
protected bool m_bWorldPostProcessDone
Definition: SCR_GameModeCampaign.c:103
m_OnFactionAssignedLocalPlayer
protected ref ScriptInvoker m_OnFactionAssignedLocalPlayer
Definition: SCR_GameModeCampaign.c:90
MHQ
@ MHQ
Definition: SCR_CampaignFeedbackComponent.c:1428
RpcDo_BroadcastMHQFeedback
void RpcDo_BroadcastMHQFeedback(SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
Definition: SCR_GameModeCampaign.c:443
CanPlayerSpawn_S
override bool CanPlayerSpawn_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
Definition: SCR_GameModeCampaign.c:1320
BaseTransceiver
Definition: BaseTransceiver.c:12
GetOnStarted
ScriptInvoker GetOnStarted()
Triggered when Conflict gamemode has started.
Definition: SCR_GameModeCampaign.c:138
OnEntityRequested
void OnEntityRequested(notnull IEntity spawnedEntity, IEntity user, SCR_Faction faction, SCR_MilitaryBaseLogicComponent service)
Called when an entity is spawned by Free Roam Building.
Definition: SCR_GameModeCampaign.c:1770
EOnDiag
override void EOnDiag(IEntity owner, float timeSlice)
Definition: SCR_AIGroupUtilityComponent.c:426
SCR_EngineHitZone
Definition: SCR_EngineHitZone.c:1
m_iRegularSuppliesIncome
protected int m_iRegularSuppliesIncome
Definition: SCR_GameModeCampaign.c:34
OnPlayerFactionResponse_O
protected void OnPlayerFactionResponse_O(SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
Definition: SCR_GameModeCampaign.c:1724
m_aRadioSpawnPoints
protected ref array< SCR_PlayerRadioSpawnPointCampaign > m_aRadioSpawnPoints
Definition: SCR_GameModeCampaign.c:97
LoadClientData
void LoadClientData(notnull array< ref SCR_CampaignPlayerStruct > data)
Definition: SCR_GameModeCampaign.c:1019
m_sOPFORFactionKey
protected FactionKey m_sOPFORFactionKey
Definition: SCR_GameModeCampaign.c:58
OnWorldPostProcess
override void OnWorldPostProcess(World world)
Definition: SCR_GameModeCampaign.c:740
RequestStart
void RequestStart()
Definition: SCR_GameModeCampaign.c:454
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
GetVictoryPauseTimestamp
WorldTimestamp GetVictoryPauseTimestamp()
Definition: SCR_GameModeCampaign.c:286
SCR_BaseGameModeClass
Definition: SCR_BaseGameMode.c:12
Faction
Definition: Faction.c:12
SCR_EXPRewards
SCR_EXPRewards
Definition: SCR_XPHandlerComponent.c:403
m_RplComponent
protected RplComponent m_RplComponent
Definition: SCR_CampaignBuildingManagerComponent.c:42
SCR_FuelManagerComponent
void SCR_FuelManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_FuelManagerComponent.c:475
SCR_PlayerFactionAffiliationComponent
Definition: SCR_PlayerFactionAffiliationComponent.c:16
SetPrimaryTarget
void SetPrimaryTarget(notnull SCR_CampaignFaction faction, SCR_CampaignMilitaryBaseComponent target)
Definition: SCR_GameModeCampaign.c:405
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_CampaignPlayerStruct
Definition: SCR_CampaignStruct.c:632
SCR_DamageContext
Definition: SCR_DamageContext.c:7
RplSave
override bool RplSave(ScriptBitWriter writer)
Definition: SCR_GameModeCampaign.c:323
IsTutorial
bool IsTutorial()
Definition: SCR_GameModeCampaign.c:292
CheckForWinner
protected void CheckForWinner()
Find out if any faction has won and it's time to end the match.
Definition: SCR_GameModeCampaign.c:631
SCR_CampaignMilitaryBaseManager
Created in SCR_GameModeCampaign.
Definition: SCR_CampaignMilitaryBaseManager.c:21
m_bIsTutorial
protected bool m_bIsTutorial
Definition: SCR_GameModeCampaign.c:101
SCR_CampaignFaction
Definition: SCR_CampaignFaction.c:2
GetOnCallsignOffsetChanged
ScriptInvoker GetOnCallsignOffsetChanged()
Definition: SCR_GameModeCampaign.c:157
SCR_AIGroup
Definition: SCR_AIGroup.c:68
SCR_EPopupMsgFilter
SCR_EPopupMsgFilter
Definition: SCR_PopupNotification.c:486
m_fVictoryPauseTimestamp
protected WorldTimestamp m_fVictoryPauseTimestamp
Definition: SCR_GameModeCampaign.c:118
m_LoadedData
protected SCR_CampaignStruct m_LoadedData
Definition: SCR_GameModeCampaign.c:109
EDamageType
EDamageType
Definition: EDamageType.c:12
m_OnStarted
protected ref ScriptInvoker m_OnStarted
Definition: SCR_GameModeCampaign.c:91
WriteClientData
protected void WriteClientData(int playerID, bool disconnecting=false, PlayerController pc=null)
Save object with player's current data.
Definition: SCR_GameModeCampaign.c:1054
m_bTerminateScenario
protected bool m_bTerminateScenario
Definition: SCR_GameModeCampaign.c:13
m_BaseManager
protected ref SCR_CampaignMilitaryBaseManager m_BaseManager
Definition: SCR_GameModeCampaign.c:107
CanRequestVehicleWithoutRank
bool CanRequestVehicleWithoutRank()
Getter for "Rank required" parameter for spawning vehicles.
Definition: SCR_GameModeCampaign.c:797
EndSessionLoadProgress
protected void EndSessionLoadProgress()
Definition: SCR_GameModeCampaign.c:884
SCR_EMobileAssemblyStatus
SCR_EMobileAssemblyStatus
Definition: SCR_CampaignMobileAssemblyComponent.c:437
m_iSpawnCost
protected int m_iSpawnCost
Definition: SCR_GameModeCampaign.c:67
OnPlayerAuditSuccess
override void OnPlayerAuditSuccess(int iPlayerID)
Definition: SCR_GameModeCampaign.c:1301
GetBaseManager
SCR_CampaignMilitaryBaseManager GetBaseManager()
Definition: SCR_GameModeCampaign.c:214
m_iSuicidePenaltyCooldown
protected int m_iSuicidePenaltyCooldown
Definition: SCR_GameModeCampaign.c:76
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
GetRegularSuppliesIncomeExtra
int GetRegularSuppliesIncomeExtra()
Definition: SCR_GameModeCampaign.c:202
m_iQuickSuppliesReplenishThreshold
protected int m_iQuickSuppliesReplenishThreshold
Definition: SCR_GameModeCampaign.c:25
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_iSupplyDepotIconThreshold
protected int m_iSupplyDepotIconThreshold
Definition: SCR_GameModeCampaign.c:70
GetOnFactionAssignedLocalPlayer
ScriptInvoker GetOnFactionAssignedLocalPlayer()
Triggered when the local player picks a faction.
Definition: SCR_GameModeCampaign.c:128
ProcessFactionAssignment
protected void ProcessFactionAssignment(Faction assignedFaction)
See HandleOnFactionAssigned.
Definition: SCR_GameModeCampaign.c:1756
GetQuickSuppliesReplenishMultiplier
float GetQuickSuppliesReplenishMultiplier()
Definition: SCR_GameModeCampaign.c:178
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461
GetSuppliesReplenishThreshold
int GetSuppliesReplenishThreshold()
Definition: SCR_GameModeCampaign.c:166
GetClientsData
int GetClientsData(notnull out array< ref SCR_CampaignClientData > dataArray)
Definition: SCR_GameModeCampaign.c:1130
HasStarted
bool HasStarted()
Definition: SCR_GameModeCampaign.c:304
m_fVictoryTimer
protected float m_fVictoryTimer
Definition: SCR_GameModeCampaign.c:19
GetIsMatchOver
bool GetIsMatchOver()
Definition: SCR_GameModeCampaign.c:298
GetFactionKeyByEnum
FactionKey GetFactionKeyByEnum(SCR_ECampaignFaction faction)
Definition: SCR_GameModeCampaign.c:754
DamageManagerComponent
Definition: DamageManagerComponent.c:12
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3
SCR_GameModeCampaignClass
Definition: SCR_GameModeCampaign.c:2
SetControlPointsHeld
void SetControlPointsHeld(SCR_CampaignFaction faction, int newCount)
Definition: SCR_GameModeCampaign.c:380
OnAmbientVehicleSpawned
protected void OnAmbientVehicleSpawned(SCR_AmbientVehicleSpawnPointComponent spawnpoint, Vehicle vehicle)
Definition: SCR_GameModeCampaign.c:1178
OnStarted
void OnStarted()
Definition: SCR_GameModeCampaign.c:605
m_fVictoryTimestamp
protected WorldTimestamp m_fVictoryTimestamp
Definition: SCR_GameModeCampaign.c:115
SCR_EServicePointType
SCR_EServicePointType
Definition: SCR_ServicePointComponent.c:180
m_iControlPointsThreshold
protected int m_iControlPointsThreshold
Definition: SCR_GameModeCampaign.c:16
GetWinningFactionId
int GetWinningFactionId()
Definition: SCR_GameModeCampaign.c:274
EHint
EHint
Definition: EHint.c:10
PlayerManager
Definition: PlayerManager.c:12
OnPlayerDisconnected
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
Definition: SCR_GameModeCampaign.c:1311
StoreRemnantsStates
void StoreRemnantsStates(out notnull array< ref SCR_CampaignRemnantInfoStruct > outEntries)
Definition: SCR_GameModeCampaign.c:890
SCR_Faction
Definition: SCR_Faction.c:6
GetFactionByIndex
proto external Faction GetFactionByIndex(int index)
SCR_RankIDCampaign
Definition: SCR_CampaignFactionManager.c:2
SCR_AmbientVehicleSystem
Definition: SCR_AmbientVehicleSystem.c:8
GetSupplyDepotIconThreshold
int GetSupplyDepotIconThreshold()
Definition: SCR_GameModeCampaign.c:208
SCR_CampaignRemnantInfoStruct
Definition: SCR_CampaignStruct.c:580
GetSpawnCost
int GetSpawnCost()
Definition: SCR_GameModeCampaign.c:250
m_bIgnoreMinimumVehicleRank
protected bool m_bIgnoreMinimumVehicleRank
Definition: SCR_GameModeCampaign.c:100
m_iWinningFactionId
protected int m_iWinningFactionId
Definition: SCR_GameModeCampaign.c:121
SCR_CampaignStruct
Definition: SCR_CampaignStruct.c:3
SpawnMobileHQ
void SpawnMobileHQ(notnull SCR_CampaignFaction faction, vector pos, vector rot)
Definition: SCR_GameModeCampaign.c:1077
GetControlPointTreshold
int GetControlPointTreshold()
Definition: SCR_GameModeCampaign.c:226
SCR_CampaignMilitaryBaseComponent
Definition: SCR_CampaignMilitaryBaseComponent.c:38
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_DeployableSpawnPoint
Definition: SCR_DeployableSpawnPoint.c:11
m_iRegularSuppliesIncomeExtra
protected int m_iRegularSuppliesIncomeExtra
Definition: SCR_GameModeCampaign.c:40