Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ResupplyTurretBeltSupportStationAction.c
Go to the documentation of this file.
2{
3 [Attribute("0", desc: "WeaponSlotComponent weapon slot index")]
4 protected int m_iWeaponSlotID;
5
6 [Attribute("15", desc: "Bullets added to belt per loop")]
7 protected int m_iAddBulletsAmount;
8
11
12 protected int m_iMaxAmmoCount;
13 protected int m_iCurrentAmmoCount;
14
15 //------------------------------------------------------------------------------------------------
16 override bool CanBeShownScript(IEntity user)
17 {
18 //~ Not valid or has no parent
19 if (!m_Magazine)
20 return false;
21
22 return super.CanBeShownScript(user);
23 }
24
25 //------------------------------------------------------------------------------------------------
26 override bool CanBePerformedScript(IEntity user)
27 {
28 if (!m_Magazine || !super.CanBePerformedScript(user))
29 return false;
30
31 m_iMaxAmmoCount = m_Magazine.GetMaxAmmoCount();
32 m_iCurrentAmmoCount = m_Magazine.GetAmmoCount();
33
35 {
36 SetCanPerform(false, ESupportStationReasonInvalid.RESUPPLY_INVENTORY_FULL);
37 return false;
38 }
39
40 return true;
41 }
42
43 //------------------------------------------------------------------------------------------------
48
49 //------------------------------------------------------------------------------------------------
51 {
53 }
54
55 //------------------------------------------------------------------------------------------------
56 protected override void DelayedInit(IEntity owner)
57 {
58 super.DelayedInit(owner);
59
60 array<Managed> slots = {};
61
63
64 WeaponSlotComponent weaponSlot;
65 array<BaseMuzzleComponent> muzzles = {};
66
67 foreach (Managed slot : slots)
68 {
69 muzzles.Clear();
70 weaponSlot = WeaponSlotComponent.Cast(slot);
71
72 if (weaponSlot.GetWeaponSlotIndex() != m_iWeaponSlotID)
73 continue;
74
75 weaponSlot.GetMuzzlesList(muzzles);
76 if (muzzles.IsEmpty())
77 return;
78
79 m_GunMuzzleComp = muzzles[0];
80
82 break;
83 }
84
85 if (!m_GunMuzzleComp)
86 return;
87
88 m_Magazine = m_GunMuzzleComp.GetMagazine();
89 }
90
91 //------------------------------------------------------------------------------------------------
92 protected override string GetActionStringParam()
93 {
94 if (!m_bCanPerform)
95 return string.Empty;
96
98 }
99}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external int FindComponents(typename typeName, notnull array< Managed > outComponents)
void SetCanPerform(bool canPerform, ESupportStationReasonInvalid reasonInvalid)
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute