Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_WheeledDamageManagerComponent.c
Go to the documentation of this file.
2 {
3 }
4 
5 class SCR_WheeledDamageManagerComponent : SCR_VehicleDamageManagerComponent
6 {
7  protected float m_fWheelsEfficiency = 1;
8 
9  //------------------------------------------------------------------------------------------------
12  {
13  return m_fWheelsEfficiency;
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  protected void SetWheelsEfficiency(float efficiency)
18  {
19  m_fWheelsEfficiency = efficiency;
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  // Compute current simulation state of vehicle
24  // Called when hitzone damage states change
25  override void UpdateVehicleState()
26  {
27  int wheelsCount;
28  float wheelsEfficiency;
29  SCR_WheelHitZone wheelHitZone;
30 
31  foreach (HitZone hitZone : m_aVehicleHitZones)
32  {
33  wheelHitZone = SCR_WheelHitZone.Cast(hitZone);
34  if (!wheelHitZone || wheelHitZone.GetWheelIndex() < 0)
35  continue;
36 
37  wheelsCount++;
38  wheelsEfficiency += wheelHitZone.GetEfficiency();
39  }
40 
41  if (wheelsCount > 0)
42  SetWheelsEfficiency(wheelsEfficiency / wheelsCount);
43 
44  super.UpdateVehicleState();
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  override void UpdateMovementDamage()
49  {
50  float movementDamage;
51 
53  movementDamage = 1;
54  else
56 
57  if (!float.AlmostEqual(movementDamage, GetMovementDamage()))
58  SetMovementDamage(movementDamage);
59 
60  VehicleControllerComponent controller = VehicleControllerComponent.Cast(m_Controller);
61  if (controller)
62  controller.SetCanMove(movementDamage < 1);
63  }
64 }
UpdateMovementDamage
override void UpdateMovementDamage()
Definition: SCR_WheeledDamageManagerComponent.c:48
UpdateVehicleState
override void UpdateVehicleState()
Definition: SCR_WheeledDamageManagerComponent.c:25
SCR_VehicleDamageManagerComponentClass
void SCR_VehicleDamageManagerComponentClass(BaseContainer prefab)
m_fWheelsEfficiency
SCR_WheeledDamageManagerComponentClass m_fWheelsEfficiency
m_Controller
protected CompartmentControllerComponent m_Controller
Definition: SCR_VehicleDamageManagerComponent.c:197
m_fGearboxEfficiency
protected float m_fGearboxEfficiency
Definition: SCR_VehicleDamageManagerComponent.c:203
HitZone
Definition: HitZone.c:12
SCR_VehicleDamageManagerComponent
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_VehicleDamageManagerComponent.c:1720
m_bEngineFunctional
protected bool m_bEngineFunctional
Definition: SCR_VehicleDamageManagerComponent.c:201
GetWheelsEfficiency
float GetWheelsEfficiency()
Definition: SCR_WheeledDamageManagerComponent.c:11
m_aVehicleHitZones
protected ref array< HitZone > m_aVehicleHitZones
Common vehicle features that will influence its simulation.
Definition: SCR_VehicleDamageManagerComponent.c:196
m_fEngineEfficiency
protected float m_fEngineEfficiency
Definition: SCR_VehicleDamageManagerComponent.c:200
SetWheelsEfficiency
protected void SetWheelsEfficiency(float efficiency)
Definition: SCR_WheeledDamageManagerComponent.c:17
SCR_WheeledDamageManagerComponentClass
Definition: SCR_WheeledDamageManagerComponent.c:1