Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ExplosiveFuzeArmingAttribute.c
Go to the documentation of this file.
1
4{
5 //------------------------------------------------------------------------------------------------
6 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
7 {
9 if (!editableEntity)
10 return null;
11
12 IEntity owner = editableEntity.GetOwner();
13 if (!owner)
14 return null;
15
17 if (!explosiveComp)
18 return null;
19
21 }
22
23 //------------------------------------------------------------------------------------------------
24 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
25 {
26 if (!var)
27 return;
28
30 IEntity owner = editableEntity.GetOwner();
31 if (!owner)
32 return;
33
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}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_EFuzeType
Enum with all types of fuzes.
proto external Managed FindComponent(typename typeName)
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
static SCR_BaseEditorAttributeVar CreateBool(bool value)
void DisarmChargeSilent()
Callback method to ensure that charge is disarmed when transferred but with no sound.
void ArmWithTimedFuze(bool silent=false)
Arms the charge and starts the timer for the detonation.
void SetFuzeTime(float fuzeDelay, bool silent=false)
Change the time which will be used for timed fuze.
Explosive trigger attribute for manipulating the arming state.
Explosive trigger attribute for manipulating the time that remains until the detonation.