vehicle's max health is calculated as power function of mass

This commit is contained in:
in0finite 2020-06-28 16:44:32 +02:00
parent bfdb8a5ba0
commit f865dd0051
2 changed files with 3 additions and 1 deletions

View file

@ -21,6 +21,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
public float vehicleSyncRate = 20;
[Range(0.1f, 3f)] public float massToHealthExponent = 1f;
public float explosionForceMultiplier = 700f;
public float explosionChassisForceMultiplier = 11000f;
public float explosionDamageRadius = 7f;

View file

@ -450,7 +450,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
InitializePhysics();
this.Health = this.MaxHealth = this.HandlingData.Mass;
this.Health = this.MaxHealth = Mathf.Pow(this.HandlingData.Mass, VehicleManager.Instance.massToHealthExponent);
foreach (var pair in _frames.Where(x => x.Name.StartsWith("door_")))
{