Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_GearboxHitZone.c
Go to the documentation of this file.
2 {
3  [Attribute("0.25", UIWidgets.EditBox, desc: "Minimum gearbox efficiency ratio", params: "0 1 0.01")]
4  protected float m_fMinimumGearboxEfficiencyRatio;
5 
6  //------------------------------------------------------------------------------------------------
7  float GetEfficiency()
8  {
9  EDamageState state = GetDamageState();
10  float efficiency = GetDamageStateThreshold(state);
11  return Math.Lerp(m_fMinimumGearboxEfficiencyRatio, 1, efficiency);
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  override void OnInit(IEntity pOwnerEntity, GenericComponent pManagerComponent)
16  {
17  super.OnInit(pOwnerEntity, pManagerComponent);
18 
19  Vehicle vehicle = Vehicle.Cast(pOwnerEntity.GetRootParent());
20  if (!vehicle)
21  return;
22 
24  if (damageManager)
25  damageManager.RegisterVehicleHitZone(this);
26  }
27 
28  //------------------------------------------------------------------------------------------------
29  override void OnDamageStateChanged()
30  {
31  super.OnDamageStateChanged();
32 
33  UpdateGearboxState();
34  }
35  //------------------------------------------------------------------------------------------------
36  void UpdateGearboxState()
37  {
38  Vehicle vehicle = Vehicle.Cast(GetOwner().GetRootParent());
39  if (!vehicle)
40  return;
41 
42  SCR_VehicleDamageManagerComponent damageManager = SCR_VehicleDamageManagerComponent.Cast(vehicle.GetDamageManager());
43  if (damageManager)
44  damageManager.UpdateVehicleState();
45  }
46 }
SCR_VehicleDamageManagerComponent
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_VehicleDamageManagerComponent.c:1720
EDamageState
EDamageState
Definition: EDamageState.c:12
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_VehicleHitZone
Definition: SCR_VehicleHitZone.c:1
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_GearboxHitZone
Definition: SCR_GearboxHitZone.c:1