mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-14 16:27:19 +00:00
vehicle's max health is calculated as power function of mass
This commit is contained in:
parent
bfdb8a5ba0
commit
f865dd0051
2 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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_")))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue