DownedStateSettings
A class in Root.Township, ATT.PlayerStates.
Asset with the tuning for the downed state: gravestone, revive orbs other players collect, respawn orb, effects, and the health and debuffs a revived player gets back. Read by DownedState and the revive activity.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
PlayerStateSettings - Attributes
CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
DownedStateSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
25 private and internal fields
| Member | What it is |
|---|---|
private float angleToRotatePerSecond | Spin speed of the ring of revive orbs. |
private float distanceBeforeOrbIsForceReleased | How far a revive orb can be pulled from its spot before it is forced out of the hand. |
private SoundEffectSet enterDownedStateSfx | Sound played when a player goes down. |
private PooledObjectDefinition enterDownedStateVfx | Effect spawned when a player goes down. |
private SoundEffectSet exitDownedStateSfx | Sound played when a player leaves the downed state. |
private PooledObjectDefinition exitDownedStateVfx | Effect spawned when a player leaves the downed state. |
private NetworkPrefab gravestone | Prefab spawned at the spot where the player went down. |
private float healthPercentageForRevivedPlayers | Share of maximum health (0 to 1) a revived player gets back. |
private StatDefinition healthStat | The player's health stat. |
private float heightOfRespawnOrb | Height of the respawn orb above its spawn point. |
private float heightOfReviveOrbs | Height of the revive orb ring above the downed spot. |
private StatDefinition hungerStat | Stat that is disabled while downed to stop natural health regeneration. |
private int numberOfRevivalOrbsToSpawn | How many revive orbs spawn around a downed player; each adds an equal share of revive progress. |
private Vector3 orbMovementRange | Range of the idle bobbing movement of each revive orb. |
private float orbMovementSpeed | Speed of the idle bobbing movement of each revive orb. |
private float respawnDebuffDurationInSeconds | How long the respawn debuffs last. |
private StatModifierConstructor[] respawnDebuffs | Stat modifiers applied to the player after respawning. |
private PooledObjectDefinition respawnOrbDefinition | Pooled object used for the respawn orb the downed player can grab. |
private float respawnOrbDistanceFromPlayer | How far from the player the respawn orb appears. |
private float revivalOrbDistanceFromDownedPlayer | Ring radius an orb moves to when it is made reachable for the downed player. |
private float revivalOrbDistanceFromGrave | Radius of the revive orb ring around the grave. |
private NetworkPrefab reviveOrb | Prefab of the orbs other players use to revive. |
private NetworkPrefab rotatingObject | Prefab spawned as the spinning parent of the revive orbs. |
private float secondsAddedToRevivalTimerPerOrb | Seconds added to the revive timer for each orb used. |
private LayerMask spawnableLayers | Layers the gravestone placement raycast can land on. |
Properties
| Member | What it is |
|---|---|
float AngleToRotatePerSecond { get; } | Spin speed of the object the revive orbs circle on. |
float DistanceBeforeOrbIsForceReleased { get; } | How far a revive orb can be pulled from its spot before it is dropped. |
SoundEffectSet EnterDownedStateSfx { get; } | Sound when a player goes down. |
PooledObjectDefinition EnterDownedStateVfx { get; } | Effect when a player goes down. |
SoundEffectSet ExitDownedStateSfx { get; } | Sound when a player leaves the downed state. |
PooledObjectDefinition ExitDownedStateVfx { get; } | Effect when a player leaves the downed state. |
NetworkPrefab Gravestone { get; } | Prefab spawned as the downed player's gravestone. |
StatDefinition HealthStat { get; } | The health stat set on revive. |
float HeightOfRespawnOrb { get; } | Height of the respawn orb above where the player went down. |
float HeightOfReviveOrbs { get; } | Height above the spawn point of the spinning object the revive orbs sit on. |
StatDefinition HungerStat { get; } | The hunger stat, turned off while downed (it drives natural health regen). |
int NumberOfRevivalOrbsToSpawn { get; } | How many revive orbs spawn around the grave; each one is that share of the revive. |
Vector3 OrbMovementRange { get; } | Movement range passed to each revive orb's movement modifier (probably how far it drifts). |
float OrbMovementSpeed { get; } | Movement speed passed to each revive orb's movement modifier. |
float PercentageOfHealthToReturnToRevivedPlayers { get; } | Share of max health (0 to 1) a revived player gets. |
float RespawnDebuffDurationInSeconds { get; } | How long the respawn debuffs last on a revived player. |
PooledObjectDefinition RespawnOrbDefinition { get; } | Pooled object for the respawn orb shown to the downed player. |
float RespawnOrbDistanceFromPlayer { get; } | How far in front of the player the respawn orb is placed. |
float RevivalOrbDistanceFromDownedPlayer { get; } | Distance from the downed player an orb moves to when made reachable for them. |
float RevivalOrbDistanceFromGrave { get; } | Radius of the ring of revive orbs around the grave. |
NetworkPrefab ReviveOrb { get; } | Prefab for each revive orb. |
NetworkPrefab RotatingObject { get; } | Prefab the revive orbs are placed on, which spins. |
float SecondsAddedToRevivalTimerPerOrb { get; } | Seconds added to the downed timer for each revive orb collected. |
LayerMask SpawnableLayers { get; } | Layers the gravestone can be placed on (raycast down from the player). |
override Type StateType { get; } | The state class these settings are for: DownedState. |
Methods
| Member | What it is |
|---|---|
IEnumerable<StatModifier> GetRespawnDebuffs() | Builds new stat modifiers from the respawn debuff list. Applied to revived players. |
Used in
Members of other types that take, return or hold a DownedStateSettings: