Space-Smash-Out/Assets/Scripts/ScriptableObjects/BaseShipProperties.cs
Jakob Feldmann 5278d5ba81 feat: ship particle effects, base properties, gravity fix
All ships now have their own properties, which are modifiers for the base ship properties.
The base behaviour of all ships can now be easily changed, while the individual differences are still respected.

Ship states now trigger particle emissions & effects. This is still messy and mixed with
sounds. Will be overhauled once ship state machine is introduced.

To calculate gravity you now need to specify the gravity source transform.
2024-05-05 17:48:27 +02:00

50 lines
2.7 KiB
C#

using ShipHandling;
using UnityEngine;
/// <summary>
/// Contains everything what makes a ship a ship, from the ship actor/3D-Model prefab to all the
/// properties which are unique to it's controls and behavior.
/// </summary>
[CreateAssetMenu(fileName = "BaseShip", menuName = "ScriptableObjects/BaseShip")]
public class BaseShipProperties : ScriptableObject
{
[Tooltip("The acceleration applied on thrust input.")]
public float thrustAcceleration = 2000;
[Tooltip("The velocity with which the character can rotate around it's center.")]
public float steerVelocity = 360;
[Tooltip("The standard limit of character velocity.")]
public float normalMaxVelocity = 15f;
[Tooltip("The absolute maximum of character velocity (enforced by drag).")]
public float absolutMaxVelocity = 25f;
[Tooltip("The amount to which the drift of the character is reduced when anti-drift is active.")]
public float antiDriftAmount = 12;
[Tooltip("The amount to which the drift of the character is always reduced.")]
public float minAntiDriftFactor = 0.03f;
[Tooltip("The drag which acts opposite to the characters movement direction normally.")]
public float normalDrag = 5f;
[Tooltip("The maximum drag which can act opposite to the characters movement direction.")]
public float maximumDrag = 10f;
[Tooltip("The drag which acts opposite to the characters rotation direction normally.")]
public float torqueDrag = 0.2f;
[Tooltip("The time which is used up when a player uses boost.")]
public float maxBoostCapacity = 3.3f;
[Tooltip("The point at which a player can boost again when boost is reloading.")]
public float minBoostCapacity = 0.15f;
[Tooltip("The factor with which the thrust is multiplied while boosting.")]
public float boostMagnitude = 1.5f;
[Tooltip("The flat tax on the boost when outside of a recharging zone (capacity -= rate * time in seconds).")]
public float outsideBoostRate = 0.0f;
[Tooltip("The factor of gravity which is eliminated by boosting (1 = no gravity).")]
public float boostAntiGravityFactor = 0.33f;
[Tooltip("The factor by which the player looses control over the character when being stunned (0 = no control).")]
public float stunLooseControlFactor = 0.1f;
[Tooltip("The time it takes for a critically stunned character to be controlable again.")]
public float tackleCriticalStunTime = 0.6f;
[Tooltip("The time it takes for a normally stunned character to be controlable again.")]
public float tackleBodyStunTime = 0.3f;
[Tooltip("The power with which the character is tackled away, when hit critically.")]
public float criticalTacklePowerFactor = 60f;
[Tooltip("The power with which the character is tackled away, when hit normally.")]
public float normalTacklePowerFactor = 40f;
}