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.
154 lines
5.7 KiB
C#
154 lines
5.7 KiB
C#
using ShipHandling;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Scriptable Object which offers modifiers to the base ship properties
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "Ship", menuName = "ScriptableObjects/Ship", order = 2)]
|
|
public class ShipProperties : ScriptableObject
|
|
{
|
|
[Tooltip("The base properties for all ships.")]
|
|
public BaseShipProperties baseProps;
|
|
[Tooltip("Prefab which contains the whole ship gameobject.")]
|
|
public GameObject shipPrefab = null;
|
|
[Tooltip("Object which relays the user input to the ships state.")]
|
|
public ShipInputHandler shipInput = null;
|
|
[Tooltip("Name of the ship (relevant to UI and lore context).")]
|
|
public string shipName = "SpaceyMcShipface";
|
|
|
|
[Tooltip("The acceleration applied on thrust input.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float thrustAccelerationModifier = 1;
|
|
[HideInInspector]
|
|
public float thrustAcceleration
|
|
{ get => baseProps.thrustAcceleration * thrustAccelerationModifier; }
|
|
|
|
[Tooltip("The velocity with which the character can rotate around it's center.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float steerVelocityModifier = 1;
|
|
[HideInInspector]
|
|
public float steerVelocity
|
|
{ get => baseProps.steerVelocity * steerVelocityModifier; }
|
|
|
|
[Tooltip("The standard limit of character velocity.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float normalMaxVelocityModifier = 1;
|
|
[HideInInspector]
|
|
public float normalMaxVelocity
|
|
{ get => baseProps.normalMaxVelocity * normalMaxVelocityModifier; }
|
|
|
|
[Tooltip("The absolute maximum of character velocity (enforced by drag).")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float absolutMaxVelocityModifier = 1;
|
|
[HideInInspector]
|
|
public float absolutMaxVelocity
|
|
{ get => baseProps.absolutMaxVelocity * absolutMaxVelocityModifier; }
|
|
|
|
[Tooltip("The amount to which the drift of the character is reduced when anti-drift is active.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float antiDriftAmountModifier = 1;
|
|
[HideInInspector]
|
|
public float antiDriftAmount
|
|
{ get => baseProps.antiDriftAmount * antiDriftAmountModifier; }
|
|
|
|
[Tooltip("The amount to which the drift of the character is always reduced.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float minAntiDriftFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float minAntiDriftFactor
|
|
{ get => baseProps.minAntiDriftFactor * minAntiDriftFactorModifier; }
|
|
|
|
[Tooltip("The drag which acts opposite to the characters movement direction normally.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float normalDragModifier = 1;
|
|
[HideInInspector]
|
|
public float normalDrag
|
|
{ get => baseProps.normalDrag * normalDragModifier; }
|
|
|
|
[Tooltip("The maximum drag which can act opposite to the characters movement direction.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float maximumDragModifier = 1;
|
|
[HideInInspector]
|
|
public float maximumDrag
|
|
{ get => baseProps.maximumDrag * maximumDragModifier; }
|
|
|
|
[Tooltip("The drag which acts opposite to the characters rotation direction normally.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float torqueDragModifier = 1;
|
|
[HideInInspector]
|
|
public float torqueDrag
|
|
{ get => baseProps.torqueDrag * torqueDragModifier; }
|
|
|
|
[Tooltip("The time which is used up when a player uses boost.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float maxBoostCapacityModifier = 1;
|
|
[HideInInspector]
|
|
public float maxBoostCapacity
|
|
{ get => baseProps.maxBoostCapacity * maxBoostCapacityModifier; }
|
|
|
|
[Tooltip("The point at which a player can boost again when boost is reloading.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float minBoostCapacityModifier = 1;
|
|
[HideInInspector]
|
|
public float minBoostCapacity
|
|
{ get => baseProps.minBoostCapacity * minBoostCapacityModifier; }
|
|
|
|
[Tooltip("The factor with which the thrust is multiplied while boosting.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float boostMagnitudeModifier = 1;
|
|
[HideInInspector]
|
|
public float boostMagnitude
|
|
{ get => baseProps.boostMagnitude * boostMagnitudeModifier; }
|
|
|
|
[Tooltip("The flat tax on the boost when outside of a recharging zone (capacity -= rate * time in seconds).")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float outsideBoostRateModifier = 1;
|
|
[HideInInspector]
|
|
public float outsideBoostRate
|
|
{ get => baseProps.outsideBoostRate * outsideBoostRateModifier; }
|
|
|
|
|
|
[Tooltip("The factor of gravity which is eliminated by boosting (1 = no gravity).")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float boostAntiGravityFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float boostAntiGravityFactor
|
|
{ get => baseProps.boostAntiGravityFactor * boostAntiGravityFactorModifier; }
|
|
|
|
[Tooltip("The factor by which the player looses control over the character when being stunned (0 = no control).")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float stunLooseControlFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float stunLooseControlFactor
|
|
{ get => baseProps.stunLooseControlFactor * stunLooseControlFactorModifier; }
|
|
|
|
[Tooltip("The time it takes for a critically stunned character to be controlable again.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float tackleCriticalStunTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tackleCriticalStunTime
|
|
{ get => baseProps.tackleCriticalStunTime * tackleCriticalStunTimeModifier; }
|
|
|
|
[Tooltip("The time it takes for a normally stunned character to be controlable again.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float tackleBodyStunTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tackleBodyStunTime
|
|
{ get => baseProps.tackleBodyStunTime * tackleBodyStunTimeModifier; }
|
|
|
|
[Tooltip("The power with which the character is tackled away, when hit critically.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float criticalTacklePowerFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float criticalTacklePowerFactor
|
|
{ get => baseProps.criticalTacklePowerFactor * criticalTacklePowerFactorModifier; }
|
|
|
|
[Tooltip("The power with which the character is tackled away, when hit normally.")]
|
|
[Range(0.0f, 2.0f)]
|
|
public float normalTacklePowerFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float normalTacklePowerFactor
|
|
{ get => baseProps.normalTacklePowerFactor * normalTacklePowerFactorModifier; }
|
|
|
|
}
|