Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No death #741

Merged
merged 17 commits into from
Feb 17, 2024
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!;
ZoNeSRuS marked this conversation as resolved.
Show resolved Hide resolved

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
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

во всех комментах с пометками нашего кода желательно добавить и название фичи/ветки, на которой производились изменения

//SS220-respawn begin
DoStuff();
//SS220-respawn end

типа такого

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
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
}

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
});

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
[DataField]
public EntProtoId RespawnAction = "ActionRespawn";

[DataField, AutoNetworkedField]
public EntityUid? RespawnActionEntity;
//SS-220 end
// 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
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
- ActionCritFakeDeath
- ActionCritLastWords
- type: Deathgasp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
- ArtifactCrusherMachineCircuitboard
- TelecomServerCircuitboard
- MassMediaCircuitboard

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

работал с этим файлом, потом изменения откатил.(2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут также надо бы изменения убрать

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут также надо бы изменения убрать

Да понял, тут рил мой косяк.

- type: MaterialStorage
whitelist:
tags:
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
2 changes: 1 addition & 1 deletion Resources/Prototypes/SS220/Recipes/Lathes/electronics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
Steel: 100
Glass: 900
Silver: 100
Gold: 100

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все еще здесь прикол

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все еще здесь прикол

Тут убрался символ табуляции после 100. Я ХЗ как его назад вернуть.

Gold: 100
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
MedicalScannerMachineCircuitboard: null
CloningPodMachineCircuitboard: null
CloningConsoleComputerCircuitboard: null
Loading