CombatStateSettings
A class in Root.Township, Alta.PlayerStates.
Settings asset for CombatState: how long a player stays in combat, and the shell effect and sound shown when entering it.
- Listed in Players and characters
- Inherits or implements
PlayerStateSettings - Derived types
CombatStateSettings.Create - Nested types
Create
Constructors
| Member | What it is |
|---|---|
CombatStateSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private ShellSetting combatShell | Shell effect shown around a player entering or leaving combat. |
private CrippleStatDefinition crippleStatDefinition | Cripple stat that is reset to its maximum when combat ends. |
private float delayBetweenHitAndSound | Seconds after entering combat before the local player hears the enter combat sound (default 0.5). |
private AnimationCurve distanceTimeMultiplierOutOfCombat | Scales the out of combat timer by squared distance between fighters divided by maxDistanceInCombatSquared. |
private float maxDistanceInCombat | Plain distance version of the combat range (default 50). The code reads the squared field instead. |
private float maxDistanceInCombatSquared | Squared distance beyond which a tool hit does not put the target in combat. |
private DurationCurve shellAnimationCurve | Timing curve for the combat shell fade in and out. |
private AnimationCurve teleporterVelocityOverTime | Velocity curve for teleporting while in combat; not read elsewhere in this build. |
private float timeForOutOfCombat | Seconds without new combat before a player leaves combat (default 15). |
Properties
| Member | What it is |
|---|---|
ShellSetting CombatShell { get; } | Shell effect animated on the character when entering and leaving combat. |
CrippleStatDefinition CrippleStatDefinition { get; } | The cripple stat. It is reset to its maximum when the player leaves combat. |
float DelayBetweenHitAndSound { get; } | Seconds between entering combat and the local player hearing the enter-combat sound. |
AnimationCurve DistanceTimeMultiplierOutOfCombat { get; } | Curve that scales TimeForOutOfCombat when a hit resets the timer, keyed by squared attacker distance over MaxDistanceInCombatSquared. |
float MaxDistanceInCombatSquared { get; } | Squared distance (default 250). A tool hit from a wielder further away than this doesn't start combat. |
DurationCurve ShellAnimationCurve { get; } | Timing curve for the combat shell animation. |
override Type StateType { get; } | Always typeof(CombatState). |
AnimationCurve TeleporterVelocityOverTime { get; } | Not read anywhere else in this build. |
float TimeForOutOfCombat { get; } | Seconds (default 15) without a new hit before the player drops out of combat. |
Used in
Members of other types that take, return or hold a CombatStateSettings: