mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
* or your debil * Woop * Whoops, Missed this * Whoops, Suicide System * Hush... Extended tests... Hush * AAAAAA * No-longer jaunt whilst dead * :) * Update Content.Shared/_Lavaland/Chasm/PreventChasmFallingSystem.cs Co-authored-by: Tobias Berger <toby@tobot.dev> Signed-off-by: William Lemon <William.Lemon2@gmail.com> * Update Content.Server/_Goobstation/Possession/PossessionSystem.cs Co-authored-by: Tobias Berger <toby@tobot.dev> Signed-off-by: William Lemon <William.Lemon2@gmail.com> * Please tobysenpai forgive me --------- Signed-off-by: William Lemon <William.Lemon2@gmail.com> Co-authored-by: Tobias Berger <toby@tobot.dev>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
|
|
// SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter <solsticeofthewinter@gmail.com>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using Content.Shared._Goobstation.CheatDeath;
|
|
using Content.Shared._Goobstation.Devil.Condemned;
|
|
using Content.Shared.Mobs;
|
|
|
|
namespace Content.Server._Goobstation.Devil.Condemned;
|
|
public sealed partial class CondemnedSystem
|
|
{
|
|
public void InitializeOnDeath()
|
|
{
|
|
SubscribeLocalEvent<CondemnedComponent, MobStateChangedEvent>(OnMobStateChanged);
|
|
}
|
|
|
|
private void OnMobStateChanged(EntityUid uid, CondemnedComponent comp, MobStateChangedEvent args)
|
|
{
|
|
if (args.NewMobState != MobState.Dead
|
|
|| comp.SoulOwnedNotDevil
|
|
|| !comp.CondemnOnDeath)
|
|
return;
|
|
|
|
if (TryComp<CheatDeathComponent>(uid, out var cheatDeath)
|
|
&& cheatDeath.ReviveAmount > 0 || cheatDeath is { InfiniteRevives: true })
|
|
return;
|
|
|
|
StartCondemnation(uid, behavior: CondemnedBehavior.Delete);
|
|
}
|
|
}
|