using System.Runtime.InteropServices.WindowsRuntime; using ShipHandling; using UnityEngine; /// /// Scriptable Object which offers modifiers to the base ship properties /// [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 lifekind. Perchance.")] [Range(0.0f, 10.0f)] public float healthModifier = 1; [HideInInspector] public float MaximumHealth => BaseProps.MaximumHealth * healthModifier; [Tooltip("The acceleration applied on thrust input.")] [Range(0.0f, 10.0f)] public float thrustAccelerationModifier = 1; [HideInInspector] public float ThrustAcceleration => 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 => BaseProps.SteerVelocity * steerVelocityModifier; [Tooltip("The standard limit of character velocity.")] [Range(0.0f, 10.0f)] public float normalMaxVelocityModifier = 1; [HideInInspector] public float NormalMaxVelocity => 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 => BaseProps.AbsolutMaxVelocity * absolutMaxVelocityModifier; [Tooltip("The strength of gravity acting on a character.")] [Range(0.0f, 10.0f)] public float gravityStrengthModifier = 1; [HideInInspector] public float GravitStrength => BaseProps.GravityStrength * gravityStrengthModifier; [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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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; } } }