Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableMineComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor (Editables)", description: "", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3 {
4 }
5 
7 
9 class SCR_EditableMineComponent : SCR_EditableSystemComponent
10 {
11  //------------------------------------------------------------------------------------------------
12  override void OnPostInit(IEntity owner)
13  {
14  super.OnPostInit(owner);
15 
16  //~ Activate Mine on server one frame later so the SCR_PressureTriggerComponent can initialize
17  if (IsServer())
18  GetGame().GetCallqueue().CallLater(ActivateMine);
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  //~ Make sure the mine is activated so it explodes when a vehicle drives over it
23  protected void ActivateMine()
24  {
25  SCR_PressureTriggerComponent pressureTriggerComponent = SCR_PressureTriggerComponent.Cast(GetOwner().FindComponent(SCR_PressureTriggerComponent));
26  if (pressureTriggerComponent)
27  pressureTriggerComponent.ActivateTrigger();
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override bool IsDestroyed()
32  {
33  //~ If this component exists it is not destroyed
34  return false;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override bool CanDestroy()
39  {
40  //~ If this component exists it can be destroyed
41  return true;
42  }
43 
44  //------------------------------------------------------------------------------------------------
45  override bool Destroy()
46  {
47  if (!IsServer())
48  return false;
49 
50  SCR_PressureTriggerComponent pressureTriggerComponent = SCR_PressureTriggerComponent.Cast(GetOwner().FindComponent(SCR_PressureTriggerComponent));
51  if (pressureTriggerComponent)
52  {
53  pressureTriggerComponent.TriggerManuallyServer();
54  return true;
55  }
56 
57  return false;
58  }
59 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
OnPostInit
SCR_EditableMineComponentClass SCR_EditableSystemComponentClass OnPostInit(IEntity owner)
Editable Mine.
Definition: SCR_EditableMineComponent.c:12
IsDestroyed
override bool IsDestroyed()
Definition: SCR_EditableMineComponent.c:31
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
CanDestroy
override bool CanDestroy()
Definition: SCR_EditableMineComponent.c:38
Destroy
override bool Destroy()
Definition: SCR_EditableMineComponent.c:45
SCR_EditableMineComponentClass
Definition: SCR_EditableMineComponent.c:2
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SCR_EditableSystemComponentClass
Definition: SCR_EditableSystemComponent.c:2
ActivateMine
protected void ActivateMine()
Definition: SCR_EditableMineComponent.c:23
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180