Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FactionDominanceTriggerEntity.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Triggers", description: "")]
3 {
4 }
5 
6 class SCR_FactionDominanceTriggerEntity : SCR_FactionControlTriggerEntity
7 {
8  //------------------------------------------------------------------------------------------------
9  override protected void OnQueryFinished(bool bIsEmpty)
10  {
11  //--- Finished evaluation round. Reset variables and start again.
12  if (m_bEvaluateResult)
13  {
14  m_iFriendlyCount = 0;
15  m_iEnemyCount = 0;
16  m_bEvaluateResult = false;
17  return;
18  }
19 
20  m_bResult = false;
21  m_bEvaluateResult = true;
22 
23  float friendlyRatio;
24  if (m_iEnemyCount == 0)
25  friendlyRatio = 1;
26  else
27  friendlyRatio = m_iFriendlyCount / Math.Max(m_iFriendlyCount + m_iEnemyCount, 1);
28 
29  switch (m_iRatioMethod)
30  {
31  case 0:
32  {
33  m_bResult = friendlyRatio > m_fFriendlyRatioLimit;
34  break;
35  }
36  case 1:
37  {
38  m_bResult = float.AlmostEqual(friendlyRatio, m_fFriendlyRatioLimit);
39  break;
40  }
41  case 2:
42  {
43  m_bResult = friendlyRatio < m_fFriendlyRatioLimit;
44  break;
45  }
46  }
47 
48  Event_OnQueryFinished.Invoke(this);
49  Event_OnQueryFinished.Clear();
50  }
51 };
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_FactionControlTriggerEntityClass
Definition: SCR_FactionControlTriggerEntity.c:2
OnQueryFinished
SCR_FactionDominanceTriggerEntityClass SCR_FactionControlTriggerEntityClass OnQueryFinished(bool bIsEmpty)
Definition: SCR_FactionDominanceTriggerEntity.c:9
SCR_FactionDominanceTriggerEntityClass
Definition: SCR_FactionDominanceTriggerEntity.c:2
SCR_FactionControlTriggerEntity
Definition: SCR_FactionControlTriggerEntity.c:5
Event_OnQueryFinished
BaseGameTriggerEntityClass Event_OnQueryFinished
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180