Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionInputOnControllableDestroyed.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Checked Instigator Conditions.")]
5 ref array<ref SCR_ScenarioFrameworkInstigatorContextConditionBase> m_aInstigatorContextConditions;
6
7 [Attribute(defvalue: SCR_EScenarioFrameworkLogicOperators.AND.ToString(), UIWidgets.ComboBox, "Which Boolean Logic will be used for Damage Conditions", "", enums: SCR_EScenarioFrameworkLogicOperatorHelper.GetParamInfo(), category: "Activation")]
8 SCR_EScenarioFrameworkLogicOperators m_eActivationConditionLogic;
9
10 //------------------------------------------------------------------------------------------------
11 override void Init(SCR_ScenarioFrameworkLogicInput input)
12 {
13 super.Init(input);
14
16 if (!gameMode)
17 return;
18
19 ScriptInvokerBase<SCR_BaseGameMode_OnControllableDestroyed> instigator = gameMode.GetOnControllableDestroyed();
20 if (instigator)
21 instigator.Insert(OnControllableDestroyed);
22
23 }
24
25 //------------------------------------------------------------------------------------------------
27 {
28 if (m_aInstigatorContextConditions && !m_aInstigatorContextConditions.IsEmpty())
29 {
30 if (EvaluateConditions(insigatorData))
31 m_Input.OnActivate(1, null);
32
33 return;
34 }
35
36 //No conditions set, activate whenever controllable is killed
37 m_Input.OnActivate(1, null);
38 }
39
40 //------------------------------------------------------------------------------------------------
42 {
43 switch (m_eActivationConditionLogic)
44 {
46 return EvaluateConditionsAND(insigatorData);
47
49 return EvaluateConditionsOR(insigatorData);
50
52 return EvaluateConditionsNAND(insigatorData);
53
55 return EvaluateConditionsXOR(insigatorData);
56 }
57
58 return false;
59 }
60
61 //------------------------------------------------------------------------------------------------
63 {
64 foreach (SCR_ScenarioFrameworkInstigatorContextConditionBase action : m_aInstigatorContextConditions)
65 {
66 if (!action.Init(insigatorData))
67 return false;
68 }
69
70 return true;
71 }
72
73 //------------------------------------------------------------------------------------------------
75 {
76 foreach (SCR_ScenarioFrameworkInstigatorContextConditionBase action : m_aInstigatorContextConditions)
77 {
78 if (action.Init(insigatorData))
79 return true;
80 }
81
82 return false;
83 }
84
85 //------------------------------------------------------------------------------------------------
87 {
88 return !EvaluateConditionsAND(insigatorData);
89 }
90
91 //------------------------------------------------------------------------------------------------
93 {
94 bool priorSuccess = false;
95 foreach (SCR_ScenarioFrameworkInstigatorContextConditionBase action : m_aInstigatorContextConditions)
96 {
97 bool success = action.Init(insigatorData);
98 if (priorSuccess && success)
99 return false;
100
101 priorSuccess |= success;
102 }
103 return priorSuccess;
104 }
105
106 //------------------------------------------------------------------------------------------------
108 {
110 if (!gameMode)
111 return;
112
113 ScriptInvokerBase<SCR_BaseGameMode_OnControllableDestroyed> instigator = gameMode.GetOnControllableDestroyed();
114 if (instigator)
115 instigator.Remove(OnControllableDestroyed);
116 }
117}
override void Init()
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_BaseGameMode GetGameMode()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< SCR_BaseGameMode_OnControllableDestroyed > GetOnControllableDestroyed()
SCR_FieldOfViewSettings Attribute