private void ApplyRespawnDebuffs() | Server: if the player was revived, applies the settings' respawn debuffs for RespawnDebuffDurationInSeconds. |
private void CalculateSpawnPosition() | Server: sets the downed spot to the ground under the player's feet (raycast down up to about 10 m). |
private bool CanPlayPooledParticleEffect(PooledObjectDefinition pooledObjectDefinition) | True when not headless and the effect definition is set. |
private bool CanPlaySfx(SoundEffectSet downedStateSfx) | True when the sound set exists and the player has a controller. |
private void ClearActivityListeners() | Unhooks the revive activity's time increased and completed events. |
private void DestroyGravestone() | Server: destroys the gravestone entity, if one was spawned. |
private void DestroyRespawnOrb() | Local player: force drops the respawn orb if held and returns it to the pool. |
private void DropDownedStateEntity(Interactor interactor) | Makes a hand let go if it holds the revive orb or respawn orb. |
private void ForceDropLocalEntities(Interactor interactor) | Makes a hand let go of anything that isn't networked. |
private void ForceGrabEntity(Interactor interactor, NetworkEntity entity) | Puts a restored held item back into a hand, dropping any downed state orb first. |
private async Task<Result<RespawnOrb>> GetRespawnOrb() | Gets a respawn orb from the pool in front of the player at the settings' height and distance. |
private void GrabInteractables() | Puts the restored left and right held items back into the hands. |
private void IncreaseTime(float timeIncreaseInSeconds) | Server: adds time to the downed countdown (from the revive activity) and tells the downed player. |
private bool IsHoldingDownedStateEntity(Interactor interactor) | Whether a hand holds the revive orb or respawn orb, matched by prefab name. |
private bool IsHoldingLocalEntity(Interactor interactor) | Whether a hand holds a non networked interactable. |
private void LoadInteractables() | Server: respawns the items the hands held when the player went down. |
private void LoadInteractablesOnStateExit() | Server: respawns held items and puts them back in hand if revived or drop on death is off. |
private void OnActivateActions() | Server: starts the downed state, or kills the player at once if DownedStateDuration is 0. Saves held items, spawns the gravestone and starts the countdown. |
private void OnActivateRemoteActions() | Client: hides the body and docks, disables body colliders and limits the hands to the downed interaction channel. |
private void OnActivityCompleted() | Server: when the revive activity completes, stops the countdown and moves the player back to playing. |
private void OnPlayerControllerSetRemote(PlayerController setPlayerController) | Client: runs the remote setup once this player's controller links. |
private void OnPlayerControllerSetServer(PlayerController controller) | Server: runs the downed setup once the player's controller has loaded. |
private async void PlayParticleEffectForPlayer(PooledObjectDefinition pooledObjectDefinition) | Plays a pooled particle effect at half the player's height above the downed spot, then releases it. |
private void PlaySoundEffectForPlayer(SoundEffectSet downedStateSfx) | Plays a sound on the player's head. |
private void SaveHeldInteractables() | Server: saves and despawns what each hand holds so it can come back when the state ends. |
private void SetBodyCollidersAndParticlesActiveState(bool isActive) | Turns the player's body colliders and on death effect controllers on or off. |
private void SetBodyVisibility(bool isVisible) | Shows or hides the body. The head shows only for other players who aren't downed. |
private void SetDockVisibility(bool isVisible) | Shows or hides the belt and back docks. |
private void SetNaturalHealthRegenerationEnabledState(bool isEnabled) | Turns the hunger stat (the settings' HungerStat) on or off, which stops natural regeneration while downed. |
private void SetPlayerVisibility(bool isVisible) | Sets body and dock visibility together. |
private void SharedSetup() | Creates the four network syncs on the player character entity, if not made yet. |
private void SpawnGravestone() | Server: spawns the gravestone at the downed spot, facing the player's look direction, and assigns the player to it. |
private void SpawnInteractableFromSave(SavedDynamicObject saveData, out NetworkEntity entity) | Spawns an entity from a saved held item, or returns null when there's no save. |
private async void SpawnRespawnOrb() | Local player: spawns the respawn orb with the countdown. Releasing it asks the server to respawn early. |
private async void StartPlayerDeath() | Server: starts the revive activity and the death countdown. |
private IEnumerator StartPlayerDeathCountdown() (iterator) | Server coroutine: waits timeToRevive seconds, then kills the player. |
private void StartReviveActivity() | Server: creates or restarts the revive activity and hooks its events. |
private void StopParticleEffect(PooledParticleSystem particleSystem) | Hides and releases a pooled particle effect. |
private void SyncActivateActions(IPlayer player, Stream stream) | Sends the countdown and downed spot to clients, which play the enter effects. The local player also gets the respawn orb. |
private void SyncDeactivateActions(IPlayer player, Stream stream) | Tells clients to play the exit effects. |
private void SyncRespawnEarly(IPlayer player, Stream stream) | Network handler: when the server reads it (the player released the respawn orb), the player is killed. |
private void SyncTimerIncreaseToDownedPlayer(IPlayer player, Stream stream, float timeIncreaseInSeconds) | Network handler that adds the extra seconds to the downed player's respawn orb timer. |
private void TryRestoreHealthToPlayer() | Server: if revived, sets health to PercentageOfHealthToReturnToRevivedPlayers of the maximum. |
private void TrySaveInteractable(Interactor interactor, out SavedDynamicObject save) | Saves and despawns a held item if it's a prefab root that saves. Otherwise outputs null. |