Skip to content

Commit

Permalink
No death (#741)
Browse files Browse the repository at this point in the history
* first

* end

* migration

* fix

* fixText

* fix2

* fix2

* fix3

* fix4

* fixC

* fixRev

* fixRev2

* Update Content.Server/Ghost/GhostSystem.cs

Co-authored-by: Dexler <[email protected]>

* fixrev3

* fix electronic.yml

---------

Co-authored-by: Dexler <[email protected]>
  • Loading branch information
ZoNeSRuS and DexlerXD authored Feb 17, 2024
1 parent 840f63e commit 6005f8e
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Server.Console;

namespace Content.Server.Ghost
{
Expand All @@ -42,6 +43,7 @@ public sealed class GhostSystem : SharedGhostSystem
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly IServerConsoleHost _host = default!;

public override void Initialize()
{
Expand All @@ -66,6 +68,7 @@ public override void Initialize()
SubscribeLocalEvent<GhostComponent, BooActionEvent>(OnActionPerform);
SubscribeLocalEvent<GhostComponent, ToggleGhostHearingActionEvent>(OnGhostHearingAction);
SubscribeLocalEvent<GhostComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
SubscribeLocalEvent<GhostComponent, RespawnActionEvent>(OnActionRespanw);

SubscribeLocalEvent<RoundEndTextAppendEvent>(_ => MakeVisible(true));
}
Expand Down Expand Up @@ -115,6 +118,15 @@ private void OnActionPerform(EntityUid uid, GhostComponent component, BooActionE
args.Handled = true;
}

//SS-220 noDeath
private void OnActionRespanw(EntityUid uid, GhostComponent component, RespawnActionEvent args)
{
if (!TryComp<ActorComponent>(uid, out var actor))
return;

_host.ExecuteCommand(actor.PlayerSession, "respawn");
}
//SS-220 end noDeath
private void OnRelayMoveInput(EntityUid uid, GhostOnMoveComponent component, ref MoveInputEvent args)
{
// If they haven't actually moved then ignore it.
Expand Down Expand Up @@ -199,6 +211,15 @@ private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent arg
_actions.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleLightingAction);
_actions.AddAction(uid, ref component.ToggleFoVActionEntity, component.ToggleFoVAction);
_actions.AddAction(uid, ref component.ToggleGhostsActionEntity, component.ToggleGhostsAction);
//SS-220 noDeath
if (_actions.AddAction(uid, ref component.RespawnActionEntity, out var actResp, component.RespawnAction)
&& actResp.UseDelay != null)
{
var start = _gameTiming.CurTime;
var end = start + actResp.UseDelay.Value;
_actions.SetCooldown(component.RespawnActionEntity.Value, start, end);
}
//SS-220 end noDeath
}

private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args)
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Mobs/CritMobActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void OnLastWords(EntityUid uid, MobStateActionsComponent component, Crit
lastWords += "...";

_chat.TrySendInGameICMessage(uid, lastWords, InGameICChatType.Whisper, ChatTransmitRange.Normal, checkRadioPrefix: false, ignoreActionBlocker: true);
_host.ExecuteCommand(actor.PlayerSession, "ghost");
_host.ExecuteCommand(actor.PlayerSession, "suicide"); //ss-220 noDeath
});

args.Handled = true;
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/Ghost/GhostComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public sealed partial class GhostComponent : Component
[DataField, AutoNetworkedField]
public EntityUid? BooActionEntity;

//SS-220 noDeath
[DataField]
public EntProtoId RespawnAction = "ActionRespawn";

[DataField, AutoNetworkedField]
public EntityUid? RespawnActionEntity;
//SS-220 end noDeath
// End actions

[ViewVariables(VVAccess.ReadWrite), DataField]
Expand Down Expand Up @@ -102,3 +109,5 @@ public sealed partial class ToggleLightingActionEvent : InstantActionEvent { }
public sealed partial class ToggleGhostHearingActionEvent : InstantActionEvent { }

public sealed partial class BooActionEvent : InstantActionEvent { }

public sealed partial class RespawnActionEvent : InstantActionEvent { } //SS-220 noDeath
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/research/technologies.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ research-technology-chemical-dispensary = Химический раздатчи
research-technology-biofabrication = Биофабрикация
research-technology-crew-monitoring = Мониторинг экипажа
research-technology-bluespace-chemistry = Блюспейс-химия
research-technology-cloning = Клонирование
research-technology-salvage-weapons = Утилизаторское оружие
research-technology-draconic-munitions = Драконьи боеприпасы
research-technology-uranium-munitions = Урановые боеприпасы
Expand Down Expand Up @@ -78,3 +77,4 @@ research-technology-honk-mech = Мех Х.О.Н.К.
research-technology-advanced-spray = Продвинутые спреи
research-technology-quantum-fiber-weaving = Плетение квантового волокна
research-technology-bluespace-cargo-transport = Блюспейс-транспортировка грузов
research-technology-cloning-technology = Технология клонирования
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Mobs/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
- type: MobStateActions
actions:
Critical:
- ActionCritSuccumb
# - ActionCritSuccumb ss-220 noDeath
- ActionCritFakeDeath
- ActionCritLastWords
- type: Deathgasp
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/SS220/Actions/Ghost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- type: entity
id: ActionRespawn
name: Возродиться
description: Возвращение в лобби. Вы обязаны выбрать другого персонажа и "забыть" все, что видели, согласно правилам сервера.
noSpawn: true
components:
- type: InstantAction
icon: SS220/Interface/actions/respawn.png
checkCanInteract: false
event: !type:RespawnActionEvent
useDelay: 1200
13 changes: 13 additions & 0 deletions Resources/Prototypes/SS220/Research/civilianservices.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- type: technology
id: CloningPodMachine
name: research-technology-cloning-technology
icon:
sprite: Structures/Machines/scanner.rsi
state: open
discipline: CivilianServices
tier: 3
cost: 10000
recipeUnlocks:
- MedicalScannerMachineCircuitboard
- CloningPodMachineCircuitboard
- CloningConsoleComputerCircuitboard
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Resources/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,8 @@ SyndiCrewMonitorEmpty: null
# 2024-02-01
YellowOxygenTank: OxygenTank
YellowOxygenTankFilled: OxygenTankFilled

#2024-02-16 ss-220 noDeath
MedicalScannerMachineCircuitboard: null
CloningPodMachineCircuitboard: null
CloningConsoleComputerCircuitboard: null

0 comments on commit 6005f8e

Please sign in to comment.