3 [
Attribute(defvalue:
"1", uiwidget: UIWidgets.Auto,
desc:
"Fuel Tank ID",
category:
"Fuel Damage Config")]
4 protected int m_iFuelTankID;
9 protected SCR_FuelNode m_FuelTank;
12 override EHitZoneGroup GetHitZoneGroup()
18 override void OnInit(IEntity pOwnerEntity, GenericComponent pManagerComponent)
20 super.OnInit(pOwnerEntity, pManagerComponent);
26 void UpdateFuelTankState()
32 float health = GetDamageStateThreshold(state);
33 m_FuelTank.SetHealth(health);
37 SCR_FuelNode GetFuelTank()
50 void SetFuelNodeID(
int fuelNodeID)
54 FuelManagerComponent fuelManager = FuelManagerComponent.Cast(
GetOwner().FindComponent(FuelManagerComponent));
58 SCR_FuelNode scrFuelNode;
59 array<BaseFuelNode> fuelNodes = {};
60 fuelManager.GetFuelNodesList(fuelNodes);
63 scrFuelNode = SCR_FuelNode.Cast(fuelNode);
64 if (scrFuelNode && scrFuelNode.GetFuelTankID() ==
m_iFuelTankID)
66 m_FuelTank = scrFuelNode;
71 UpdateFuelTankState();
75 override void OnDamageStateChanged()
77 super.OnDamageStateChanged();
79 UpdateFuelTankState();
84 override float GetSecondaryExplosionScale()
88 if (GetBaseDamageMultiplier() == 0 && GetHitZoneContainer().GetDefaultHitZone() ==
this)
91 damage = 1 - GetDamageStateThreshold(GetDamageState());
94 return m_FuelTank.GetFuel() * damage;