Skip to main content

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.

Constructors​

MemberWhat it is
CombatStateSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

9 private and internal fields
MemberWhat it is
private ShellSetting combatShellShell effect shown around a player entering or leaving combat.
private CrippleStatDefinition crippleStatDefinitionCripple stat that is reset to its maximum when combat ends.
private float delayBetweenHitAndSoundSeconds after entering combat before the local player hears the enter combat sound (default 0.5).
private AnimationCurve distanceTimeMultiplierOutOfCombatScales the out of combat timer by squared distance between fighters divided by maxDistanceInCombatSquared.
private float maxDistanceInCombatPlain distance version of the combat range (default 50). The code reads the squared field instead.
private float maxDistanceInCombatSquaredSquared distance beyond which a tool hit does not put the target in combat.
private DurationCurve shellAnimationCurveTiming curve for the combat shell fade in and out.
private AnimationCurve teleporterVelocityOverTimeVelocity curve for teleporting while in combat; not read elsewhere in this build.
private float timeForOutOfCombatSeconds without new combat before a player leaves combat (default 15).

Properties​

MemberWhat 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: