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_EditableExplosiveChargeComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Editor (Editables)"
, description:
""
, icon:
"WBData/ComponentEditorProps/componentEditor.png"
)]
2
class
SCR_EditableExplosiveChargeComponentClass
:
SCR_EditableSystemComponentClass
3
{
4
[
Attribute
(
desc
:
"If charge should be armed by default when spawned by the GM."
)]
5
protected
bool
m_bArmedByDefault
;
6
7
[
Attribute
(
"120"
,
desc
:
"Default fuze time that will be used when object is spawned by GM."
)]
8
protected
float
m_fDefaultFuzeTime
;
9
10
//------------------------------------------------------------------------------------------------
11
bool
IsArmedByDefault
()
12
{
13
return
m_bArmedByDefault
;
14
}
15
16
//------------------------------------------------------------------------------------------------
17
float
GetDefaultFuzeTime
()
18
{
19
return
m_fDefaultFuzeTime
;
20
}
21
}
22
24
class
SCR_EditableExplosiveChargeComponent : SCR_EditableSystemComponent
25
{
26
//------------------------------------------------------------------------------------------------
27
override
void
OnPostInit
(
IEntity
owner)
28
{
29
super.OnPostInit(owner);
30
31
//Activate charge on server one frame later so the TriggerComponent can initialize
32
if
(
IsServer
())
33
GetGame
().GetCallqueue().CallLater(
ActivateCharge
);
34
}
35
36
//------------------------------------------------------------------------------------------------
38
protected
void
ActivateCharge
()
39
{
40
SCR_EditableExplosiveChargeComponentClass
data
=
SCR_EditableExplosiveChargeComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
41
if
(!
data
)
42
return
;
43
44
SCR_ExplosiveChargeComponent
explosiveChargeComp =
SCR_ExplosiveChargeComponent
.Cast(
GetOwner
().FindComponent(
SCR_ExplosiveChargeComponent
));
45
if
(explosiveChargeComp)
46
{
47
explosiveChargeComp.
SetFuzeTime
(
data
.GetDefaultFuzeTime(),
true
);
48
if
(
data
.IsArmedByDefault())
49
explosiveChargeComp.
ArmWithTimedFuze
(
true
);
50
}
51
}
52
53
//------------------------------------------------------------------------------------------------
54
override
bool
IsDestroyed
()
55
{
56
//~ If this component exists it is not destroyed
57
return
false
;
58
}
59
60
//------------------------------------------------------------------------------------------------
61
override
bool
CanDestroy
()
62
{
63
//~ If this component exists it can be destroyed
64
return
true
;
65
}
66
67
//------------------------------------------------------------------------------------------------
68
override
bool
Destroy
(
int
editorPlayerID)
69
{
70
if
(!
IsServer
())
71
return
false
;
72
73
SCR_ExplosiveTriggerComponent explosiveChargeTrigger = SCR_ExplosiveTriggerComponent.Cast(
GetOwner
().FindComponent(SCR_ExplosiveTriggerComponent));
74
if
(explosiveChargeTrigger)
75
{
76
explosiveChargeTrigger.SetInstigator(
Instigator
.CreateInstigatorGM(editorPlayerID));
77
explosiveChargeTrigger.UseTrigger();
78
return
true
;
79
}
80
81
return
false
;
82
}
83
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
GetComponentData
SCR_CharacterSoundComponentClass GetComponentData()
Definition
SCR_CharacterSoundComponent.c:132
CanDestroy
override bool CanDestroy()
Definition
SCR_EditableExplosiveChargeComponent.c:61
Destroy
override bool Destroy(int editorPlayerID)
Definition
SCR_EditableExplosiveChargeComponent.c:68
ActivateCharge
void ActivateCharge()
Arms the charge with 120s fuze.
Definition
SCR_EditableExplosiveChargeComponent.c:38
IsDestroyed
override bool IsDestroyed()
Definition
SCR_EditableExplosiveChargeComponent.c:54
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
IsServer
override bool IsServer()
Definition
SCR_NewSessionToolbarAction.c:35
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
enum EVehicleType IEntity
Instigator
Definition
Instigator.c:13
SCR_EditableExplosiveChargeComponentClass
Definition
SCR_EditableExplosiveChargeComponent.c:3
SCR_EditableExplosiveChargeComponentClass::IsArmedByDefault
bool IsArmedByDefault()
Definition
SCR_EditableExplosiveChargeComponent.c:11
SCR_EditableExplosiveChargeComponentClass::m_fDefaultFuzeTime
float m_fDefaultFuzeTime
Definition
SCR_EditableExplosiveChargeComponent.c:8
SCR_EditableExplosiveChargeComponentClass::m_bArmedByDefault
bool m_bArmedByDefault
Definition
SCR_EditableExplosiveChargeComponent.c:5
SCR_EditableExplosiveChargeComponentClass::GetDefaultFuzeTime
float GetDefaultFuzeTime()
Definition
SCR_EditableExplosiveChargeComponent.c:17
SCR_EditableSystemComponentClass
Definition
SCR_EditableSystemComponent.c:3
SCR_ExplosiveChargeComponent
Definition
SCR_ExplosiveChargeComponent.c:11
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
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
Editor
Components
EditableEntity
SCR_EditableExplosiveChargeComponent.c
Generated by
1.17.0