The Hitpoint dependency system (currently only used on infantry in vanilla) works, but it has some usability problems. If a Hitpoint needs to be dependant on many other hitpoints, all those classe have to be daisy chained together in terms of class inheritance, just so that one hitpoint can be dependant on them.
Also, accessing it via scripting has issues (dependent hitpoints not updating properly). https://feedback.bistudio.com/T120705
The reason why we need the dependency in the first place is, that the "damage states" are hardcoded to certain Hitpoint class names. With "damage states" i mean Death, FuelExplosion, Limping State, Arm Shaking, Tank Track disabled, Engine disabled, Instrument Malfunction on Helicopters, etc etc
Currently for a car, a Hitpoint with name HitFuel is hardcoded to cause an explosion at damage >= 0.9 (iirc).
Infantry currently has 2 death "damage states" hardcoded - one for HitHead and one for HitBody.
It would be much better (and alot more future proof) to define the "damage states" seperately from Hitpoint classes. That way we do not need Hitpoint interdependency and the messy class structure it requires for the dependency to work, and will not have handling issues with scripts. In addition, such a seperate system provides a base for further expansion of damage state functionality (e.g. additional damage states, non-binary damage states, ...)
Arbitrary Example (using some nonvanilla hitpoints just for the sake of conveying the idea).
```
//for Infantry
class DamageStates {
class Limping {depends = "HitFoot + 2*HitLeg";}; //causes limping in case the "depends" formula is >= 1
class Death {depends= "(HitFace + HitNeck) max (HitBody + 0.5*HitLeg + 0.25*HitArms)";};
class AimShake {depends= "0.75*HitArms";};
};
//for Car
class DamageStates {
class Engine {depends="HitEngine + HitGearbox";};
class Explosion {depends= "HitFuel";};
class WheelFL {depends="HitWheelFL";};
//etc
};
//for Tank
class DamageStates {
class Explosion {depends = "HitBody + HitAmmo";};
class Turret1 {depends= "HitTurret + HitAuxPowerUnit";};
class Engine {depends= "HitEngine";};
class TrackL {depends= "HitTrackL + HitSteeringunit";};
//etc
};
```