Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FireModeManagerComponent.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
2void OnTurretFireModeValuesChanged(EWeaponGroupFireMode fireMode, int quantity, int weaponGroupId);
4typedef ScriptInvokerBase<OnTurretFireModeValuesChanged> OnTurretFireModeValuesChangedInvoker;
5
9
10class SCR_FireModeManagerComponent : FireModeManagerComponent
11{
14
15 protected int m_iCurrentWeaponGroup;
16 protected int m_iCurrentRippleIndex;
17
19 protected int m_iRippleQuantity = 0;
20 protected float m_fRippleInterval = 100.0;
21
22 protected const string EVENT_NAME_ENTER_COMPARTMENT = "OnCompartmentEntered";
23
24 protected const string ACTION_NAME_RIPPLE_QUANTITY = "TurretWeaponNextRippleQuantity";
25 protected const string ACTION_NAME_FIRE_MODE = "TurretWeaponNextFireMode";
26 protected const string ACTION_NAME_WEAPON_GROUP = "TurretNextWeapon";
27
28 //------------------------------------------------------------------------------------------------
37
38 //------------------------------------------------------------------------------------------------
40 protected override void OnWeaponsGroupChanged(int weaponsGroupIndex, int rippleModeIndex)
41 {
42 m_iCurrentWeaponGroup = weaponsGroupIndex;
43 m_iCurrentRippleIndex = rippleModeIndex;
44
46
47 array<int> ripples = {};
48 if (prefab.GetAvailableRippleQuantities(m_iCurrentWeaponGroup, ripples))
49 {
50 m_iRippleQuantity = ripples[rippleModeIndex];
51 }
52 m_eFireMode = prefab.GetFireMode(m_iCurrentWeaponGroup);
53
56 }
57
58 //------------------------------------------------------------------------------------------------
60 {
61 IEntity owner = GetOwner();
62
63 EntityPrefabData prefab = owner.GetPrefabData();
64
65 return FireModeManagerComponentClass.Cast(prefab.FindComponentData(FireModeManagerComponentClass));
66 }
67 //------------------------------------------------------------------------------------------------
70 {
72 return prefab.GetNumberOfWeaponsGroups();
73 }
74 //------------------------------------------------------------------------------------------------
77 {
79 return prefab.GetNumberOfRippleCounts(m_iCurrentWeaponGroup);
80 }
81 //------------------------------------------------------------------------------------------------
84 {
86 array<int> ints = {};
87 return SCR_Enum.BitToIntArray(prefab.GetFireMode(m_iCurrentWeaponGroup), ints);
88 }
89
90 //------------------------------------------------------------------------------------------------
92 void GetAvailableFireModes(notnull out array<int> availableFireModes)
93 {
94 availableFireModes.Clear();
96 prefab.GetAvailableFireModes(availableFireModes);
97 }
98
99 //------------------------------------------------------------------------------------------------
100 int GetAvailableRippleQuantities(notnull out array<int> availableRippleQuantities)
101 {
102 availableRippleQuantities.Clear();
104 return prefab.GetAvailableRippleQuantities(m_iCurrentWeaponGroup, availableRippleQuantities);
105 }
106
107 //------------------------------------------------------------------------------------------------
110 int GetWeaponGroupID(out string name)
111 {
113 if (prefab)
114 name = prefab.GetWeaponsGroupName(m_iCurrentWeaponGroup);
115
117 }
118
119 //------------------------------------------------------------------------------------------------
120
121 int GetCurrentWeaponIndices(notnull out array<int> weaponIndices)
122 {
123 weaponIndices.Clear();
125 return prefab.GetWeaponIndices(m_iCurrentWeaponGroup, weaponIndices);
126 }
127
128 //------------------------------------------------------------------------------------------------
131 EWeaponGroupFireMode GetFireMode(out string name = string.Empty)
132 {
133 name = SCR_Enum.GetEnumName(EWeaponGroupFireMode, m_eFireMode);
134 return m_eFireMode;
135 }
136
137 //------------------------------------------------------------------------------------------------
140 {
141 return m_iRippleQuantity;
142 }
143
144 //------------------------------------------------------------------------------------------------
147 {
148 return m_fRippleInterval;
149 }
150
151 //------------------------------------------------------------------------------------------------
156 protected void ReplicatedNextWeaponGroup(float value = 0.0, EActionTrigger reason = 0, string actionName = string.Empty)
157 {
159 {
161 return;
162 }
163
164 NextWeaponsGroup();
165 }
166 //------------------------------------------------------------------------------------------------
171 protected void ReplicatedNextFireMode(float value = 0.0, EActionTrigger reason = 0, string actionName = string.Empty)
172 {
174 {
176 return;
177 }
178
179 NextFireMode();
180 }
181
182 //------------------------------------------------------------------------------------------------
187 protected void ReplicatedNextRippleQuantity(float value = 0.0, EActionTrigger reason = 0, string actionName = string.Empty)
188 {
190 {
192 return;
193 }
194
195 NextRippleCount();
196 }
197
198 //------------------------------------------------------------------------------------------------
207
208 //------------------------------------------------------------------------------------------------
209 void SetRippleInterval(float value)
210 {
211 }
212
213 //------------------------------------------------------------------------------------------------
215 {
216 InputManager inputMgr = GetGame().GetInputManager();
217 inputMgr.AddActionListener(ACTION_NAME_WEAPON_GROUP, EActionTrigger.DOWN, ReplicatedNextWeaponGroup);
218 }
219
220 //------------------------------------------------------------------------------------------------
222 {
223 InputManager inputMgr = GetGame().GetInputManager();
224 array<int> intValues = {};
225 inputMgr.AddActionListener(ACTION_NAME_FIRE_MODE, EActionTrigger.DOWN, ReplicatedNextFireMode);
226 }
227
228 //------------------------------------------------------------------------------------------------
230 {
231 InputManager inputMgr = GetGame().GetInputManager();
233 }
234
235 //------------------------------------------------------------------------------------------------
238 {
240 InputManager inputMgr = GetGame().GetInputManager();
241 inputMgr.RemoveActionListener(ACTION_NAME_WEAPON_GROUP, EActionTrigger.DOWN, ReplicatedNextWeaponGroup);
242 inputMgr.RemoveActionListener(ACTION_NAME_FIRE_MODE, EActionTrigger.DOWN, ReplicatedNextFireMode);
243 inputMgr.RemoveActionListener(ACTION_NAME_RIPPLE_QUANTITY, EActionTrigger.DOWN, ReplicatedNextRippleQuantity);
244 }
245
246}
ArmaReforgerScripted GetGame()
Definition game.c:1398
int GetWeaponGroupID(out string name)
const string ACTION_NAME_FIRE_MODE
int m_iCurrentWeaponGroup
SCR_FireModeManagerComponentClass m_ControllingCharacter
int GetNumberOfAvailableFireModes()
func OnTurretFireModeValuesChanged
void ReplicatedNextWeaponGroup(float value=0.0, EActionTrigger reason=0, string actionName=string.Empty)
int GetCurrentWeaponIndices(notnull out array< int > weaponIndices)
int GetRippleInterval()
int GetRippleQuantity()
const string ACTION_NAME_WEAPON_GROUP
void GetAvailableFireModes(notnull out array< int > availableFireModes)
void RemoveActionListeners()
void SetUpRippleQuantityActionListeners()
float m_fRippleInterval
void SetUpAllActionListeners(notnull ChimeraCharacter controllingCharacter)
EWeaponGroupFireMode GetFireMode(out string name=string.Empty)
const string ACTION_NAME_RIPPLE_QUANTITY
void SetRippleInterval(float value)
const string EVENT_NAME_ENTER_COMPARTMENT
void ReplicatedNextRippleQuantity(float value=0.0, EActionTrigger reason=0, string actionName=string.Empty)
int m_iCurrentRippleIndex
EWeaponGroupFireMode m_eFireMode
void SetUpWeaponGroupActionListeners()
int GetNumberOfAvailableRippleQuantities()
void SetUpFireModeActionListeners()
ref OnTurretFireModeValuesChangedInvoker m_OnTurretFireModeValuesChanged
ScriptInvokerBase< OnTurretFireModeValuesChanged > OnTurretFireModeValuesChangedInvoker
OnTurretFireModeValuesChangedInvoker GetOnTurretFireModeValuesChanged()
int GetNumberOfAvailableWeaponGroups()
void ReplicatedNextFireMode(float value=0.0, EActionTrigger reason=0, string actionName=string.Empty)
int GetAvailableRippleQuantities(notnull out array< int > availableRippleQuantities)
SCR_VehicleDamageManagerComponentClass GetPrefabData()
void OnWeaponsGroupChanged(int weaponsGroupIndex, int rippleModeIndex)
proto external EntityPrefabData GetPrefabData()
Input management system for user interactions.
IEntity GetOwner()
Owner entity of the fuel tank.
EActionTrigger
EWeaponGroupFireMode