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_ExplosiveFuzeTimerAttribute.c
Go to the documentation of this file.
1
2
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
3
class
SCR_ExplosiveFuzeTimerAttribute
:
SCR_BaseValueListEditorAttribute
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
ChimeraWorld
world =
ChimeraWorld
.CastFrom(
GetGame
().GetWorld());
21
if
(!world)
22
return
null;
23
24
TimeAndWeatherManagerEntity
timeAndWeatherManager = world.GetTimeAndWeatherManager();
25
if
(!timeAndWeatherManager)
26
return
null;
27
28
int
fuzeTime;
29
if
(explosiveComp.
GetUsedFuzeType
() ==
SCR_EFuzeType
.TIMED)
30
fuzeTime = explosiveComp.
GetTimeOfDetonation
() - timeAndWeatherManager.GetEngineTime();
31
32
//~ No current timer so use default
33
if
(fuzeTime <= 0)
34
fuzeTime = explosiveComp.
GetFuzeTime
();
35
36
//~ No fuze time so do not show attribute
37
if
(fuzeTime <= 0)
38
return
null;
39
40
return
SCR_BaseEditorAttributeVar
.
CreateFloat
(fuzeTime);
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
45
{
46
if
(!var)
47
return
;
48
49
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
50
if
(!editableEntity)
51
return
;
52
53
IEntity
owner = editableEntity.GetOwner();
54
if
(!owner)
55
return
;
56
57
SCR_ExplosiveChargeComponent
explosiveComp =
SCR_ExplosiveChargeComponent
.Cast(owner.
FindComponent
(
SCR_ExplosiveChargeComponent
));
58
if
(!explosiveComp)
59
return
;
60
61
if
(explosiveComp.
GetUsedFuzeType
() !=
SCR_EFuzeType
.NONE)
62
explosiveComp.
DisarmChargeSilent
();
63
64
explosiveComp.
SetFuzeTime
(var.
GetFloat
(),
true
);
65
explosiveComp.
ArmWithTimedFuze
(
true
);
66
}
67
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
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
ChimeraWorld
Definition
ChimeraWorld.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::GetFloat
float GetFloat()
Definition
SCR_BaseEditorAttributeVar.c:38
SCR_BaseEditorAttributeVar::CreateFloat
static SCR_BaseEditorAttributeVar CreateFloat(float value)
Definition
SCR_BaseEditorAttributeVar.c:113
SCR_BaseValueListEditorAttribute
Definition
SCR_BaseValueListEditorAttribute.c:6
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::GetTimeOfDetonation
float GetTimeOfDetonation()
Definition
SCR_ExplosiveChargeComponent.c:63
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_ExplosiveFuzeTimerAttribute
Explosive trigger attribute for manipulating the time that remains until the detonation.
Definition
SCR_ExplosiveFuzeTimerAttribute.c:4
TimeAndWeatherManagerEntity
Definition
TimeAndWeatherManagerEntity.c:26
scripts
Game
Editor
Containers
Attributes
SCR_ExplosiveFuzeTimerAttribute.c
Generated by
1.17.0