Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MineDamageManager.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/Mines", description: "Damage manager for land mines.")]
5
6class SCR_MineDamageManager : SCR_DamageManagerComponent
7{
8 //------------------------------------------------------------------------------------------------
10 override bool HijackDamageHandling(notnull BaseDamageContext damageContext)
11 {
12 if (damageContext.damageType != EDamageType.MELEE)
13 return false;
14
15 // Inactive mines don't take melee damage, activated mines can be destroyed using melee and explode
16 SCR_PressureTriggerComponent triggerComponent = SCR_PressureTriggerComponent.Cast(GetOwner().FindComponent(SCR_PressureTriggerComponent));
17 if (triggerComponent && !triggerComponent.IsActivated())
18 damageContext.damageValue = 0;
19
20 return false;
21 }
22
23 //------------------------------------------------------------------------------------------------
24 override event protected void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
25 {
26 if (newState != EDamageState.DESTROYED)
27 return;
28
29 IEntity owner = GetOwner();
30
31 bool isProxy = false;
32 RplComponent rplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
33 if (rplComponent && rplComponent.IsProxy())
34 isProxy = true;
35
36 if (!isProxy)
37 GetGame().GetCallqueue().CallLater(ExplodeWrapper, 1);
38 else
40 }
41
42 //------------------------------------------------------------------------------------------------
45 {
46 // Can be called from CallLater. Therefore, we need to check if the entity still exists.
47 IEntity owner = GetOwner();
48 if (!owner)
49 return;
50
52 if (!triggerComponent)
53 return;
54
55 triggerComponent.SetLive();
56 triggerComponent.OnUserTriggerOverrideInstigator(owner, GetInstigator());
57 }
58}
ArmaReforgerScripted GetGame()
Definition game.c:1398
override bool HijackDamageHandling(notnull BaseDamageContext damageContext)
We hijack damage on armor, and use it to damage the character. Always return true on the hijack to en...
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
override void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
void ExplodeWrapper()
proto external Managed FindComponent(typename typeName)
IEntity GetOwner()
Owner entity of the fuel tank.
EDamageType
Definition EDamageType.c:13
EDamageState
BaseProjectileComponentClass GameComponentClass GetInstigator()