186 lines
6.6 KiB
C#
186 lines
6.6 KiB
C#
using System.Runtime.InteropServices.WindowsRuntime;
|
|
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 main color of the ship.")]
|
|
public Color shipHullColor = Color.magenta;
|
|
|
|
[Tooltip("The acceleration applied on thrust input.")]
|
|
[Range(0.0f, 10.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, 10.0f)]
|
|
public float steerVelocityModifier = 1;
|
|
[HideInInspector]
|
|
public float steerVelocity
|
|
{ get => baseProps.steerVelocity * steerVelocityModifier; }
|
|
|
|
[Tooltip("The standard limit of character velocity.")]
|
|
[Range(0.0f, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.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, 10.0f)]
|
|
public float stunLooseControlFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float stunLooseControlFactor
|
|
{ get => baseProps.stunLooseControlFactor * stunLooseControlFactorModifier; }
|
|
|
|
[Tooltip("Time until the tackling player can be tackled again")]
|
|
[Range(0.0f, 10.0f)]
|
|
public float tacklingGraceTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tacklingGraceTime
|
|
{ get => baseProps.tacklingGraceTime * tacklingGraceTimeModifier; }
|
|
[Tooltip("Time until the tackled player can be tackled again")]
|
|
|
|
[Range(0.0f, 10.0f)]
|
|
public float tackledGraceTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tackledGraceTime
|
|
{ get => baseProps.tackledGraceTime * tackledGraceTimeModifier; }
|
|
|
|
[Tooltip("The time it takes for a critically stunned character to be controlable again.")]
|
|
[Range(0.0f, 10.0f)]
|
|
public float tackleCriticalStunTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tackledCriticalStunTime
|
|
{ get => baseProps.tackledCriticalStunTime * tackleCriticalStunTimeModifier; }
|
|
|
|
[Tooltip("The time it takes for a normally stunned character to be controlable again.")]
|
|
[Range(0.0f, 10.0f)]
|
|
public float tackleBodyStunTimeModifier = 1;
|
|
[HideInInspector]
|
|
public float tackledBodyStunTime
|
|
{ get => baseProps.tackledBodyStunTime * tackleBodyStunTimeModifier; }
|
|
|
|
[Tooltip("The power with which the character is tackled away, when hit critically.")]
|
|
[Range(0.0f, 10.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, 10.0f)]
|
|
public float normalTacklePowerFactorModifier = 1;
|
|
[HideInInspector]
|
|
public float normalTacklePowerFactor
|
|
{ get => baseProps.normalTacklePowerFactor * normalTacklePowerFactorModifier; }
|
|
|
|
[Tooltip("Overwrite the default ship sounds or leave empty")]
|
|
public ShipAudio alternativeShipSounds;
|
|
[HideInInspector]
|
|
public ShipAudio audio
|
|
{
|
|
get
|
|
{
|
|
if (alternativeShipSounds == null)
|
|
{
|
|
return baseProps.audio;
|
|
}
|
|
return alternativeShipSounds;
|
|
}
|
|
|
|
}
|
|
}
|