Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_ResupplyTurretBeltSupportStationAction.c
Go to the documentation of this file.
1
class
SCR_ResupplyTurretBeltSupportStationAction
:
SCR_ResupplyVehicleWeaponSupportStationAction
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
9
protected
BaseMuzzleComponent
m_GunMuzzleComp
;
10
protected
BaseMagazineComponent
m_Magazine
;
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
34
if
(
m_iCurrentAmmoCount
>=
m_iMaxAmmoCount
)
35
{
36
SetCanPerform
(
false
,
ESupportStationReasonInvalid
.RESUPPLY_INVENTORY_FULL);
37
return
false
;
38
}
39
40
return
true
;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
BaseMagazineComponent
GetCurrentMagazine
()
45
{
46
return
m_Magazine
;
47
}
48
49
//------------------------------------------------------------------------------------------------
50
int
GetAddedBulletsAmount
()
51
{
52
return
m_iAddBulletsAmount
;
53
}
54
55
//------------------------------------------------------------------------------------------------
56
protected
override
void
DelayedInit
(
IEntity
owner)
57
{
58
super.DelayedInit(owner);
59
60
array<Managed> slots = {};
61
62
GetOwner
().
FindComponents
(
WeaponSlotComponent
, slots);
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
81
if
(
m_GunMuzzleComp
)
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
97
return
WidgetManager
.Translate(
X_OUTOF_Y_FORMATTING
,
m_iCurrentAmmoCount
,
m_iMaxAmmoCount
);
98
}
99
}
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition
ESupportStationReasonInvalid.c:4
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseMagazineComponent
Definition
BaseMagazineComponent.c:13
BaseMuzzleComponent
Definition
BaseMuzzleComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponents
proto external int FindComponents(typename typeName, notnull array< Managed > outComponents)
SCR_BaseUseSupportStationAction::m_bCanPerform
bool m_bCanPerform
Definition
SCR_BaseUseSupportStationAction.c:54
SCR_BaseUseSupportStationAction::SetCanPerform
void SetCanPerform(bool canPerform, ESupportStationReasonInvalid reasonInvalid)
Definition
SCR_BaseUseSupportStationAction.c:247
SCR_ResupplyTurretBeltSupportStationAction
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:2
SCR_ResupplyTurretBeltSupportStationAction::DelayedInit
override void DelayedInit(IEntity owner)
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:56
SCR_ResupplyTurretBeltSupportStationAction::m_GunMuzzleComp
BaseMuzzleComponent m_GunMuzzleComp
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:9
SCR_ResupplyTurretBeltSupportStationAction::GetActionStringParam
override string GetActionStringParam()
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:92
SCR_ResupplyTurretBeltSupportStationAction::CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:26
SCR_ResupplyTurretBeltSupportStationAction::GetCurrentMagazine
BaseMagazineComponent GetCurrentMagazine()
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:44
SCR_ResupplyTurretBeltSupportStationAction::m_iAddBulletsAmount
int m_iAddBulletsAmount
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:7
SCR_ResupplyTurretBeltSupportStationAction::m_iWeaponSlotID
int m_iWeaponSlotID
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:4
SCR_ResupplyTurretBeltSupportStationAction::GetAddedBulletsAmount
int GetAddedBulletsAmount()
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:50
SCR_ResupplyTurretBeltSupportStationAction::m_Magazine
BaseMagazineComponent m_Magazine
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:10
SCR_ResupplyTurretBeltSupportStationAction::m_iMaxAmmoCount
int m_iMaxAmmoCount
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:12
SCR_ResupplyTurretBeltSupportStationAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:16
SCR_ResupplyTurretBeltSupportStationAction::m_iCurrentAmmoCount
int m_iCurrentAmmoCount
Definition
SCR_ResupplyTurretBeltSupportStationAction.c:13
SCR_ResupplyVehicleWeaponSupportStationAction
Definition
SCR_ResupplyVehicleWeaponSupportStationAction.c:2
SCR_ResupplyVehicleWeaponSupportStationAction::X_OUTOF_Y_FORMATTING
const LocalizedString X_OUTOF_Y_FORMATTING
Definition
SCR_ResupplyVehicleWeaponSupportStationAction.c:6
WeaponSlotComponent
Definition
WeaponSlotComponent.c:13
WidgetManager
Definition
WidgetManager.c:16
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UserActions
SupportStations
SCR_ResupplyTurretBeltSupportStationAction.c
Generated by
1.17.0