Prevent zombies from using jetpacks

Introduces CanComplexInteract check from ActionBlockerSystem alongside a translation string
When Zombifying: Removes AutomaticJetpackUserComponent, calls SharedJetpackSystem.SetEnable(..., false, ...)
This commit is contained in:
TNE 2026-05-04 01:17:14 +02:00
parent 87cf1d4b03
commit d855df732f
3 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,8 @@ using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Movement.Components; // DeltaV
using Content.Shared._DV.Movement.Components; // DeltaV
using Content.Shared.NameModifier.EntitySystems;
using Content.Shared.NPC.Components; // DeltaV
using Content.Shared.NPC.Systems;
@ -73,6 +75,7 @@ public sealed partial class ZombieSystem
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!;
[Dependency] private readonly PsionicSystem _psionic = default!; // DeltaV
[Dependency] private readonly SharedJetpackSystem _jetpack = default!; // DeltaV - Prevent Jetpacks on Zombies
private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
@ -151,6 +154,14 @@ public sealed partial class ZombieSystem
if (HasComp<PsionicComponent>(target))
_psionic.MindBreakEntity(target, false, true);
// DeltaV End - Prevent Psionic Zombies
// DeltaV Start - Prevent Jetpacks on Zombies
if (TryComp<JetpackUserComponent>(target, out var jetpackUser))
{
if(TryComp<JetpackComponent>(jetpackUser.Jetpack, out var jetpack))
_jetpack.SetEnabled(jetpackUser.Jetpack, jetpack, false, target);
}
RemComp<AutomaticJetpackUserComponent>(target);
// DeltaV End - Prevent Jetpacks on Zombies
//funny voice
var accentType = "zombie";

View File

@ -1,3 +1,4 @@
using Content.Shared.ActionBlocker;
using Content.Shared._DV.Movement.Components;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
@ -7,12 +8,19 @@ namespace Content.Shared.Movement.Systems;
public abstract partial class SharedJetpackSystem
{
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
private void OnJetpackToggle(Entity<JetpackComponent> jetpack, ref ToggleJetpackEvent args)
{
if (args.Handled)
return;
if (!_actionBlocker.CanComplexInteract(args.Performer))
{
_popup.PopupClient(Loc.GetString("jetpack-too-complex"), jetpack, args.Performer);
return;
}
jetpack.Comp.AutomaticMode = !jetpack.Comp.AutomaticMode;
jetpack.Comp.AutomaticUser = args.Performer;
Dirty(jetpack);

View File

@ -2,3 +2,4 @@ jetpack-activated-on-grid = The jetpack will automatically turn on when leaving
jetpack-activated-off-grid = The jetpack turns on.
jetpack-activates-automatically = The jetpack automatically turns on.
jetpack-deactivated = The jetpack will no longer turn on.
jetpack-too-complex = The jetpack seems to be too complicated to operate.