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_ResupplyRocketPodSupportStationAction.c
Go to the documentation of this file.
1
class
SCR_ResupplyRocketPodSupportStationAction
:
SCR_ResupplyVehicleWeaponSupportStationAction
2
{
3
protected
RocketEjectorMuzzleComponent
m_RocketMuzzleComp
;
4
5
protected
int
m_iTotalBarrelCount
;
6
protected
int
m_iFullBarrelCount
;
7
8
//------------------------------------------------------------------------------------------------
9
override
bool
CanBeShownScript
(
IEntity
user)
10
{
11
//~ Not valid or has no parent
12
if
(!
m_RocketMuzzleComp
)
13
return
false
;
14
15
return
super.CanBeShownScript(user);
16
}
17
18
//------------------------------------------------------------------------------------------------
19
override
bool
CanBePerformedScript
(
IEntity
user)
20
{
21
if
(!super.CanBePerformedScript(user))
22
return
false
;
23
24
if
(!
m_RocketMuzzleComp
.CanReloadNextBarrel())
25
{
26
SetCanPerform
(
false
,
ESupportStationReasonInvalid
.RESUPPLY_INVENTORY_FULL);
27
return
false
;
28
}
29
30
m_iFullBarrelCount
= 0;
31
32
for
(
int
i = 0; i <
m_iTotalBarrelCount
; i++)
33
{
34
if
(!
m_RocketMuzzleComp
.CanReloadBarrel(i))
35
m_iFullBarrelCount
++;
36
}
37
38
if
(
m_iFullBarrelCount
<
m_iTotalBarrelCount
)
39
return
true
;
40
41
return
false
;
42
}
43
44
//------------------------------------------------------------------------------------------------
45
RocketEjectorMuzzleComponent
GetRocketMuzzle
()
46
{
47
return
m_RocketMuzzleComp
;
48
}
49
50
//------------------------------------------------------------------------------------------------
51
protected
override
void
DelayedInit
(
IEntity
owner)
52
{
53
super.DelayedInit(owner);
54
55
m_RocketMuzzleComp
=
RocketEjectorMuzzleComponent
.Cast(
GetOwner
().FindComponent(
RocketEjectorMuzzleComponent
));
56
if
(!
m_RocketMuzzleComp
)
57
return
;
58
59
m_iTotalBarrelCount
=
m_RocketMuzzleComp
.GetBarrelsCount();
60
}
61
62
//------------------------------------------------------------------------------------------------
63
protected
override
string
GetActionStringParam
()
64
{
65
if
(!
m_bCanPerform
||
m_iTotalBarrelCount
<= 1)
66
return
string
.Empty;
67
68
return
WidgetManager
.Translate(
X_OUTOF_Y_FORMATTING
,
m_iFullBarrelCount
,
m_iTotalBarrelCount
);
69
}
70
}
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition
ESupportStationReasonInvalid.c:4
IEntity
Definition
IEntity.c:13
RocketEjectorMuzzleComponent
Definition
RocketEjectorMuzzleComponent.c:13
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_ResupplyRocketPodSupportStationAction
Definition
SCR_ResupplyRocketPodSupportStationAction.c:2
SCR_ResupplyRocketPodSupportStationAction::DelayedInit
override void DelayedInit(IEntity owner)
Definition
SCR_ResupplyRocketPodSupportStationAction.c:51
SCR_ResupplyRocketPodSupportStationAction::CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition
SCR_ResupplyRocketPodSupportStationAction.c:19
SCR_ResupplyRocketPodSupportStationAction::m_iTotalBarrelCount
int m_iTotalBarrelCount
Definition
SCR_ResupplyRocketPodSupportStationAction.c:5
SCR_ResupplyRocketPodSupportStationAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_ResupplyRocketPodSupportStationAction.c:9
SCR_ResupplyRocketPodSupportStationAction::m_iFullBarrelCount
int m_iFullBarrelCount
Definition
SCR_ResupplyRocketPodSupportStationAction.c:6
SCR_ResupplyRocketPodSupportStationAction::GetActionStringParam
override string GetActionStringParam()
Definition
SCR_ResupplyRocketPodSupportStationAction.c:63
SCR_ResupplyRocketPodSupportStationAction::m_RocketMuzzleComp
RocketEjectorMuzzleComponent m_RocketMuzzleComp
Definition
SCR_ResupplyRocketPodSupportStationAction.c:3
SCR_ResupplyRocketPodSupportStationAction::GetRocketMuzzle
RocketEjectorMuzzleComponent GetRocketMuzzle()
Definition
SCR_ResupplyRocketPodSupportStationAction.c:45
SCR_ResupplyVehicleWeaponSupportStationAction
Definition
SCR_ResupplyVehicleWeaponSupportStationAction.c:2
SCR_ResupplyVehicleWeaponSupportStationAction::X_OUTOF_Y_FORMATTING
const LocalizedString X_OUTOF_Y_FORMATTING
Definition
SCR_ResupplyVehicleWeaponSupportStationAction.c:6
WidgetManager
Definition
WidgetManager.c:16
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
scripts
Game
UserActions
SupportStations
SCR_ResupplyRocketPodSupportStationAction.c
Generated by
1.17.0