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_WeaponAmmoCountCondition.c
Go to the documentation of this file.
1
2
[
BaseContainerProps
()]
3
class
SCR_WeaponAmmoCountCondition
:
SCR_AvailableActionCondition
4
{
5
[
Attribute
(
"3"
,
UIWidgets
.ComboBox,
"Cond operator"
,
""
, ParamEnumArray.FromEnum(
SCR_ComparerOperator
) )]
6
private
SCR_ComparerOperator
m_eOperator;
7
8
[
Attribute
(
"1"
,
UIWidgets
.ComboBox,
"Should comparison be done using percentage of ammo?"
,
""
)]
9
private
bool
m_bComparePercentage;
10
11
[
Attribute
(
"2"
,
UIWidgets
.EditBox,
"Percentages are 0-100, non-percentage values are rounded to integers"
,
""
)]
12
private
float
m_fValue;
13
14
//------------------------------------------------------------------------------------------------
17
override
bool
IsAvailable(notnull
SCR_AvailableActionsConditionData
data
)
18
{
19
BaseMagazineComponent
magazine =
data
.GetCurrentMagazine();
20
if
(!magazine)
21
return
false
;
22
23
int
current = magazine.GetAmmoCount();
24
int
max = magazine.GetMaxAmmoCount();
25
bool
result =
false
;
26
if
(m_bComparePercentage)
27
{
28
if
(max > 0.0)
29
{
30
float
perc = (current/(
float
)max) * 100.0;
31
result = SCR_Comparer<float>.Compare(m_eOperator, perc, m_fValue);
32
return
GetReturnResult
(result);
33
}
34
return
GetReturnResult
(
false
);
35
}
36
37
result = SCR_Comparer<int>.Compare(m_eOperator, current, (
int
)m_fValue);
38
return
GetReturnResult
(result);
39
}
40
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_ComparerOperator
SCR_ComparerOperator
Definition
SCR_Comparer.c:3
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
BaseMagazineComponent
Definition
BaseMagazineComponent.c:13
SCR_AvailableActionCondition
A single available action condition representation.
Definition
SCR_AvailableActionCondition.c:4
SCR_AvailableActionCondition::GetReturnResult
bool GetReturnResult(bool desiredResult)
Definition
SCR_AvailableActionCondition.c:22
SCR_AvailableActionsConditionData
Definition
SCR_AvailableActionsConditionData.c:6
SCR_WeaponAmmoCountCondition
Returns true if ammo of current weapon matches the condition.
Definition
SCR_WeaponAmmoCountCondition.c:4
UIWidgets
Definition
attributes.c:40
float
Definition
float.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
AvailableActions
Conditions
Game
Weapon
SCR_WeaponAmmoCountCondition.c
Generated by
1.17.0