Better Godmode (#37020)

* Commit

* Oversights oops

* breaking changes

* unbreaking changes

* Compatibility with AfterFullyEaten

* Fixed

* Update Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-05-09 22:06:19 -07:00
committed by GitHub
parent 4407eab96b
commit 62c380fc53
6 changed files with 40 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Events;
using Content.Shared.Destructible;
using Content.Shared.Rejuvenate;
using Content.Shared.Slippery;
using Content.Shared.StatusEffect;
@@ -18,6 +19,7 @@ public abstract class SharedGodmodeSystem : EntitySystem
SubscribeLocalEvent<GodmodeComponent, BeforeStatusEffectAddedEvent>(OnBeforeStatusEffect);
SubscribeLocalEvent<GodmodeComponent, BeforeStaminaDamageEvent>(OnBeforeStaminaDamage);
SubscribeLocalEvent<GodmodeComponent, SlipAttemptEvent>(OnSlipAttempt);
SubscribeLocalEvent<GodmodeComponent, DestructionAttemptEvent>(OnDestruction);
}
private void OnSlipAttempt(EntityUid uid, GodmodeComponent component, SlipAttemptEvent args)
@@ -40,6 +42,11 @@ public abstract class SharedGodmodeSystem : EntitySystem
args.Cancelled = true;
}
private void OnDestruction(Entity<GodmodeComponent> ent, ref DestructionAttemptEvent args)
{
args.Cancel();
}
public virtual void EnableGodmode(EntityUid uid, GodmodeComponent? godmode = null)
{
godmode ??= EnsureComp<GodmodeComponent>(uid);