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_ExplosiveFuzeArmingAttribute.c
Go to the documentation of this file.
1
2
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
3
class
SCR_ExplosiveFuzeArmingAttribute
:
SCR_BaseEditorAttribute
4
{
5
//------------------------------------------------------------------------------------------------
6
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
7
{
8
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
9
if
(!editableEntity)
10
return
null;
11
12
IEntity
owner = editableEntity.GetOwner();
13
if
(!owner)
14
return
null;
15
16
SCR_ExplosiveChargeComponent
explosiveComp =
SCR_ExplosiveChargeComponent
.Cast(owner.
FindComponent
(
SCR_ExplosiveChargeComponent
));
17
if
(!explosiveComp)
18
return
null;
19
20
return
SCR_BaseEditorAttributeVar
.
CreateBool
(explosiveComp.
GetUsedFuzeType
() !=
SCR_EFuzeType
.NONE);
21
}
22
23
//------------------------------------------------------------------------------------------------
24
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
25
{
26
if
(!var)
27
return
;
28
29
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
30
IEntity
owner = editableEntity.GetOwner();
31
if
(!owner)
32
return
;
33
34
SCR_ExplosiveChargeComponent
explosiveComp =
SCR_ExplosiveChargeComponent
.Cast(owner.
FindComponent
(
SCR_ExplosiveChargeComponent
));
35
if
(!explosiveComp)
36
return
;
37
38
if
(var.
GetBool
())
39
{
40
float
fuzeTime;
41
42
//~ Get fuze timer attribute
43
SCR_BaseEditorAttributeVar
fuzeTimerVar;
44
if
(manager.GetAttributeVariable(
SCR_ExplosiveFuzeTimerAttribute
, fuzeTimerVar))
45
fuzeTime = fuzeTimerVar.
GetFloat
();
46
47
//~ Fall back if no fuze timer attribute was found
48
if
(fuzeTime <= 0)
49
fuzeTime = explosiveComp.
GetFuzeTime
();
50
51
explosiveComp.
SetFuzeTime
(fuzeTime,
true
);
52
explosiveComp.
ArmWithTimedFuze
(
true
);
53
}
54
else
55
{
56
if
(explosiveComp.
GetUsedFuzeType
() !=
SCR_EFuzeType
.NONE)
57
explosiveComp.
DisarmChargeSilent
();
58
}
59
}
60
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_EFuzeType
SCR_EFuzeType
Enum with all types of fuzes.
Definition
SCR_EFuzeType.c:3
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateBool
static SCR_BaseEditorAttributeVar CreateBool(bool value)
Definition
SCR_BaseEditorAttributeVar.c:119
SCR_BaseEditorAttributeVar::GetBool
bool GetBool()
Definition
SCR_BaseEditorAttributeVar.c:56
SCR_BaseEditorAttributeVar::GetFloat
float GetFloat()
Definition
SCR_BaseEditorAttributeVar.c:38
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_ExplosiveChargeComponent
Definition
SCR_ExplosiveChargeComponent.c:11
SCR_ExplosiveChargeComponent::GetUsedFuzeType
SCR_EFuzeType GetUsedFuzeType()
Definition
SCR_ExplosiveChargeComponent.c:69
SCR_ExplosiveChargeComponent::DisarmChargeSilent
void DisarmChargeSilent()
Callback method to ensure that charge is disarmed when transferred but with no sound.
Definition
SCR_ExplosiveChargeComponent.c:265
SCR_ExplosiveChargeComponent::GetFuzeTime
float GetFuzeTime()
Definition
SCR_ExplosiveChargeComponent.c:99
SCR_ExplosiveChargeComponent::ArmWithTimedFuze
void ArmWithTimedFuze(bool silent=false)
Arms the charge and starts the timer for the detonation.
Definition
SCR_ExplosiveChargeComponent.c:135
SCR_ExplosiveChargeComponent::SetFuzeTime
void SetFuzeTime(float fuzeDelay, bool silent=false)
Change the time which will be used for timed fuze.
Definition
SCR_ExplosiveChargeComponent.c:106
SCR_ExplosiveFuzeArmingAttribute
Explosive trigger attribute for manipulating the arming state.
Definition
SCR_ExplosiveFuzeArmingAttribute.c:4
SCR_ExplosiveFuzeTimerAttribute
Explosive trigger attribute for manipulating the time that remains until the detonation.
Definition
SCR_ExplosiveFuzeTimerAttribute.c:4
scripts
Game
Editor
Containers
Attributes
SCR_ExplosiveFuzeArmingAttribute.c
Generated by
1.17.0