Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkWeaponAmmoCondition.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to check.")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(defvalue: "0", desc: "Activation Percentage", params: "0 100 1")]
8 protected int m_iRequiredPercentage;
9
10 [Attribute("0", UIWidgets.ComboBox, "Operator", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkComparisonOperator))]
12
13 //------------------------------------------------------------------------------------------------
14 override bool Init(IEntity entity)
15 {
16 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
17 if (!entityWrapper)
18 {
19 Print(string.Format("ScenarioFramework Action: Issue with Getter detected for Action %1.", this), LogLevel.ERROR);
20
21 return false;
22 }
23
24 IEntity weaponEntity = entityWrapper.GetValue();
25 if (!weaponEntity)
26 return false;
27
28 BaseWeaponManagerComponent weaponMan = BaseWeaponManagerComponent.Cast(weaponEntity.FindComponent(BaseWeaponManagerComponent));
29 if (!weaponMan)
30 return false;
31
32 int totalAmmo;
33
34 array<IEntity> weapons = {};
35 weaponMan.GetWeaponsList(weapons);
36
37 BaseWeaponComponent weaponComp;
38 array<BaseMuzzleComponent> outMuzzles;
39 foreach (IEntity weapon : weapons)
40 {
41 weaponComp = BaseWeaponComponent.Cast(weapon.FindComponent(BaseWeaponComponent));
42 if (!weaponComp)
43 continue;
44
45 outMuzzles = {};
46 weaponComp.GetMuzzlesList(outMuzzles);
47
48 foreach (BaseMuzzleComponent muzzle : outMuzzles)
49 {
50 totalAmmo += muzzle.GetAmmoCount();
51 }
52 }
53
54 return (
60 );
61 }
62}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
SCR_EScenarioFrameworkComparisonOperator m_eComparisonOperator
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute