Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignFactionManager.c
Go to the documentation of this file.
2 class SCR_RankIDCampaign : SCR_RankID
3 {
4  [Attribute("10", UIWidgets.EditBox, "How long does this rank has to wait between requests (sec).", params: "0 inf 1")]
5  protected int m_iRequestCD;
6 
7  [Attribute("30", UIWidgets.EditBox, "Respawn timer when deploying on this unit while it's carrying a radio.", params: "0 inf 1")]
8  protected int m_iRadioRespawnCooldown;
9 
10  [Attribute("300", params: "0 inf 1")]
11  protected int m_iFastTravelCooldown;
12 
13  [Attribute("0", UIWidgets.ComboBox, "ID of this reward.", enums: ParamEnumArray.FromEnum(SCR_ERadioMsg))]
14  protected SCR_ERadioMsg m_eRadioMsg;
15 
16  //------------------------------------------------------------------------------------------------
18  int GetRankRequestCooldown()
19  {
20  return m_iRequestCD * 1000;
21  }
22 
23  //------------------------------------------------------------------------------------------------
25  int GetRankRadioRespawnCooldown()
26  {
27  return m_iRadioRespawnCooldown;
28  }
29 
30  //------------------------------------------------------------------------------------------------
32  int GetRankFastTravelCooldown()
33  {
34  return m_iFastTravelCooldown;
35  }
36 
37  //------------------------------------------------------------------------------------------------
39  SCR_ERadioMsg GetRadioMsg()
40  {
41  return m_eRadioMsg;
42  }
43 };
44 
46 {
47 }
48 
49 class SCR_CampaignFactionManager : SCR_FactionManager
50 {
51  //------------------------------------------------------------------------------------------------
55  {
56  array<Faction> factions = {};
57  GetFactionsList(factions);
58 
59  for (int i = factions.Count() - 1; i >= 0; i--)
60  {
61  SCR_Faction factionCast = SCR_Faction.Cast(factions[i]);
62 
63  if (factionCast && factionCast.IsPlayable() && factionCast != alliedFaction)
64  return SCR_CampaignFaction.Cast(factionCast);
65  }
66 
67  return null;
68  }
69 
70  //------------------------------------------------------------------------------------------------
74  {
75  Faction faction = GetFactionByKey(factionKey);
76  if (faction)
77  return SCR_CampaignFaction.Cast(faction);
78 
79  return null;
80  }
81 
82  //------------------------------------------------------------------------------------------------
86  {
88  }
89 
90  //------------------------------------------------------------------------------------------------
94  {
96 
97  if (!rank)
98  return int.MAX;
99 
100  return rank.GetRankRequestCooldown();
101  }
102 
103  //------------------------------------------------------------------------------------------------
107  {
109 
110  if (!rank)
111  return int.MAX;
112 
113  return rank.GetRankRadioRespawnCooldown();
114  }
115 
116  //------------------------------------------------------------------------------------------------
120  {
122 
123  if (!rank)
124  return int.MAX;
125 
126  return rank.GetRankFastTravelCooldown();
127  }
128 }
129 
131 {
135 }
GetFactionsList
proto external int GetFactionsList(out notnull array< Faction > outFactions)
SCR_ECampaignFaction
SCR_ECampaignFaction
Definition: SCR_CampaignFactionManager.c:130
SCR_FactionManagerClass
Definition: SCR_FactionManager.c:5
SCR_ERadioMsg
SCR_ERadioMsg
Definition: SCR_CampaignRadioMsg.c:138
SCR_ECharacterRank
SCR_ECharacterRank
Definition: SCR_CharacterRankComponent.c:305
GetRankFastTravelCooldown
int GetRankFastTravelCooldown(SCR_ECharacterRank rankID)
Definition: SCR_CampaignFactionManager.c:119
GetFactionByKey
FactionManagerClass GenericEntityClass GetFactionByKey(FactionKey factionKey)
GetCampaignFactionByKey
SCR_CampaignFaction GetCampaignFactionByKey(string factionKey)
Definition: SCR_CampaignFactionManager.c:73
GetRankByID
protected SCR_CharacterRank GetRankByID(SCR_ECharacterRank rankID)
Definition: SCR_Faction.c:438
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_CampaignFactionManagerClass
Definition: SCR_CampaignFactionManager.c:45
GetEnemyFaction
SCR_CampaignFactionManagerClass SCR_FactionManagerClass GetEnemyFaction(notnull SCR_CampaignFaction alliedFaction)
Definition: SCR_CampaignFactionManager.c:54
OPFOR
@ OPFOR
Definition: SCR_CampaignFactionManager.c:134
GetCampaignFactionByIndex
SCR_CampaignFaction GetCampaignFactionByIndex(int index)
Definition: SCR_CampaignFactionManager.c:85
GetRankRadioRespawnCooldown
int GetRankRadioRespawnCooldown(SCR_ECharacterRank rankID)
Definition: SCR_CampaignFactionManager.c:106
INDFOR
@ INDFOR
Definition: SCR_CampaignFactionManager.c:132
Faction
Definition: Faction.c:12
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_CampaignFaction
Definition: SCR_CampaignFaction.c:2
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461
GetRankRequestCooldown
int GetRankRequestCooldown(SCR_ECharacterRank rankID)
Definition: SCR_CampaignFactionManager.c:93
BLUFOR
@ BLUFOR
Definition: SCR_CampaignFactionManager.c:133
SCR_Faction
Definition: SCR_Faction.c:6
GetFactionByIndex
proto external Faction GetFactionByIndex(int index)
SCR_RankIDCampaign
Definition: SCR_CampaignFactionManager.c:2
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468