ReviveCompletableActivity
A class in Root.Township, Township.Downed.
The revive minigame for a downed player: spawns a rotating ring of revive orbs around the grave and counts progress as orbs are consumed. Created by DownedState on the server.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
ICompletableActivity
Constructors
| Member | What it is |
|---|---|
ReviveCompletableActivity(PlayerCharacter playerCharacter, DownedStateSettings settings, Vector3 spawnPosition) | Creates a ReviveCompletableActivity from playerCharacter, settings and spawnPosition. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private float angleBetweenOrbs | Cached angle between orbs. Never set in this build, so the computed value is used. |
private HashSet<uint> consumedOrbIdentifiers | Ids of orbs that have already counted. |
private bool inProgress | True while progress is being counted. |
private List<ReviveOrbMovementModifier> orbPositionModifiers | Movement modifiers on each orb anchor, in the same order as spawnedOrbs. |
private PlayerCharacter playerCharacter | The downed player's character. |
private NetworkEntity rotatorObject | The spawned entity that spins the orb anchors. |
private DownedStateSettings settings | Downed state settings: orb count, distances, heights, speeds and time per orb. |
private readonly List<EventOrb> spawnedOrbs | The revive orbs spawned for this activity. |
private Vector3 spawnPosition | Centre of the ring, usually the grave. |
private const float TargetProgress | Progress needed to finish (1). |
private float totalProgress | Progress so far, from 0 to 1. |
Properties
1 private and internal property
Events
| Member | What it is |
|---|---|
event Action Completed | Raised when total progress reaches 1. |
event Action<float> TimeIncreased | Raised with seconds to add to the revive timer each time progress is added. |
Methods
| Member | What it is |
|---|---|
void AddProgress(float progress) | Adds progress while the activity runs, adds time to the revive timer, and raises Completed once progress reaches 1. |
void Cancel() | Stops counting progress. Spawned orbs stay. |
void DestroyReviveActivityObjects() | Server: destroys the spawned orbs and the rotator. |
void MakeOrbReachableForDownedPlayer(ReviveOrb orb) | Moves an orb's anchor in to the downed-player distance and snaps the orb there. Called when an orb is put in a beacon. |
void Restart() | Resets, then spawns a new ring and starts again. |
bool TryConsumeOrb(uint orbId) | Records an orb id as consumed. False if it was already used, so each orb counts once. |
8 private and internal methods
Used in
Members of other types that take, return or hold a ReviveCompletableActivity: