Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionDominanceTriggerEntity.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/Triggers", description: "")]
5
6class 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);
50 }
51};
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
event void OnQueryFinished()
Triggered when the result of QueryAmbientSoundsBySphere query becomes available.
BaseGameTriggerEntityClass Event_OnQueryFinished