Respawn button (#1702)

* Add respawn action for ghosts with confirmation popup

Introduces a new respawn action for ghosts, allowing them to return to the lobby and respawn as a new character. Adds supporting systems, localization, prototype definitions, and an icon for the action. The action includes a confirmation popup to prevent accidental use.

* Prevent respawning with the same character in a round

Introduces a system to block players from rejoining a round with a character that has already died, notifying them with a localized message. Refactors and moves respawn-related localization strings to new files for both English and Russian.

* Prevent admins from character reuse restriction

Added a check in CP14RespawnSystem to allow admins to bypass the restriction that prevents the same character from re-entering the round. This ensures that admin users are not limited by the character reuse logic.
This commit is contained in:
Red
2025-08-24 18:36:24 +03:00
committed by GitHub
parent ac2eb6f51c
commit 2df523061b
11 changed files with 148 additions and 2 deletions

View File

@@ -224,18 +224,19 @@ namespace Content.Server.Ghost
// Entity can't see ghosts anymore.
_eye.RefreshVisibilityMask(uid);
_actions.RemoveAction(uid, component.BooActionEntity);
//_actions.RemoveAction(uid, component.BooActionEntity); //Dont need in CP14
}
private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent args)
{
_actions.AddAction(uid, ref component.BooActionEntity, component.BooAction);
//_actions.AddAction(uid, ref component.BooActionEntity, component.BooAction); //Dont need in CP14
//_actions.AddAction(uid, ref component.ToggleGhostHearingActionEntity, component.ToggleGhostHearingAction); //Dont need in CP14
_actions.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleLightingAction);
_actions.AddAction(uid, ref component.ToggleFoVActionEntity, component.ToggleFoVAction);
_actions.AddAction(uid, ref component.ToggleGhostsActionEntity, component.ToggleGhostsAction);
//CP14
_actions.AddAction(uid, ref component.CP14ToggleRoofActionEntity, component.CP14ToggleRoofAction);
_actions.AddAction(uid, ref component.CP14RespawnActionEntity, component.CP14RespawnAction);
//CP14 end
}