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_BatteryHitZone.c
Go to the documentation of this file.
1
class
SCR_BatteryHitZone
:
SCR_VehicleHitZone
2
{
3
//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
4
// TODO: Collider ID retrieval is obsolete
5
//------------------------------------------------------------------------------------------------
7
override
void
OnInit
(
IEntity
pOwnerEntity,
GenericComponent
pManagerComponent)
8
{
9
super.OnInit(pOwnerEntity, pManagerComponent);
10
11
array<string> colliderNames = {};
12
GetAllColliderNames(colliderNames);
13
if
(colliderNames.IsEmpty())
14
return
;
15
16
Physics
physics = pOwnerEntity.
GetPhysics
();
17
if
(!physics)
18
return
;
19
20
SCR_PowerComponent powerComp = SCR_PowerComponent.Cast(pOwnerEntity.
FindComponent
(SCR_PowerComponent));
21
if
(!powerComp)
22
return
;
23
24
// Only register battery hitzones that have colliders.
25
// Logical hitzones are not supported.
26
foreach
(
string
colliderName: colliderNames)
27
{
28
if
(physics.GetGeom(colliderName) == -1)
29
continue
;
30
31
powerComp.RegisterBatteryHitZone(
this
);
32
return
;
33
}
34
}
35
//---- REFACTOR NOTE END ----
36
37
//------------------------------------------------------------------------------------------------
41
override
void
OnDamageStateChanged(
EDamageState
newState,
EDamageState
previousDamageState,
bool
isJIP)
42
{
43
SCR_PowerComponent powerComp = SCR_PowerComponent.Cast(
GetOwner
().FindComponent(SCR_PowerComponent));
44
if
(powerComp)
45
powerComp.UpdatePowerState();
46
}
47
};
GenericComponent
Definition
GenericComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetPhysics
proto external Physics GetPhysics()
Physics
Definition
Physics.c:22
SCR_BatteryHitZone
Definition
SCR_BatteryHitZone.c:2
SCR_HitZone::GetOwner
IEntity GetOwner()
Definition
SCR_HitZone.c:42
SCR_VehicleHitZone
Definition
SCR_VehicleHitZone.c:2
EDamageState
EDamageState
Definition
EDamageState.c:13
OnInit
@ OnInit
Definition
SndComponentCallbacks.c:17
scripts
Game
HitZone
SCR_BatteryHitZone.c
Generated by
1.17.0