Fuselage rust stage 2 (#629)

* the definition of insanity

* the definition of insanity

* the definition of insanity

* we have hullrot at home

* maybe the real hullrot was the friends we made along the way

* john hullrot

* i am going to hullroooooot

* it's hullrotver

* we're so hullback

* we're rotting the hull with this one

* hullmerge

* the hullrot is leaking

* never gonna rot you up

* hullfresh

* john starsector

* god i wish we had grid collision damage

* you can tell I am very tired because I stopped forcing a hullrot joke into every commit message

* hr

* this is a surprise sprite that will help us later

* motherfucker

* i have nothing good to say

* still nothing

* brb

* random letter random letter random letter dash random number random number random number

* ass

* blast

* ffs

* fcuk

* RE: ffs

* RE: RE: ffs

* гнида жестяная

* continue

* i hate tests

* i love tests

* slide to the right

* i hate tests again

* what the fuck

* ты шиз?

* ??

* bbgun
This commit is contained in:
RedFoxIV
2025-06-28 11:31:07 +03:00
committed by GitHub
parent 05f6ae2d4c
commit 0536fc8645
132 changed files with 1957 additions and 425 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Actions;
using Content.Server.Chat.Systems;
using Content.Server.DeviceLinking.Systems;
using Content.Server.Interaction;
using Content.Server.Mind;
using Content.Server.Popups;
@@ -13,11 +14,13 @@ using Content.Shared.Whitelist;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server._White.RemoteControl.Systems;
public sealed partial class RemoteControlSystem : EntitySystem
{
[Dependency] private readonly DeviceLinkSystem _link = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly ActionsSystem _action = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
@@ -27,8 +30,8 @@ public sealed partial class RemoteControlSystem : EntitySystem
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly TransformSystem _transform = default!;
public static ProtoId<SinkPortPrototype> SinkPortId = "RemoteControlOutputPort";
public static ProtoId<SourcePortPrototype> SourcePortId = "RemoteControlInputPort";
public static ProtoId<SinkPortPrototype> SinkPortId = "RemoteControlSinkPort";
public static ProtoId<SourcePortPrototype> SourcePortId = "RemoteControlSourcePort";
public override void Initialize()
{
@@ -44,7 +47,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
{
var sourceXform = Transform(args.Source);
var query = EntityQueryEnumerator<RemoteControlTargetComponent, TransformComponent>();
var query = EntityQueryEnumerator<RemoteControllableComponent, TransformComponent>();
while (query.MoveNext(out _, out var comp, out var xform))
{
var range = xform.MapID != sourceXform.MapID
@@ -61,7 +64,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
public override void Update(float frameTime)
{
var query = EntityQueryEnumerator<RemoteControlUserComponent>();
var query = EntityQueryEnumerator<RemoteControllingComponent>();
while (query.MoveNext(out var uid, out var comp))
{
if(!_actionBlocker.CanInteract(uid, comp.Console)
@@ -70,17 +73,17 @@ public sealed partial class RemoteControlSystem : EntitySystem
}
}
private bool RemoteControl(Entity<RemoteControlUserComponent?> user, Entity<RemoteControlTargetComponent?> target, Entity<RemoteControlConsoleComponent?> console, bool overlay = false)
private bool RemoteControl(EntityUid user, Entity<RemoteControllableComponent?> target, Entity<RemoteControlConsoleComponent?> console, bool overlay = false)
{
if (!Resolve(target, ref target.Comp)
|| HasComp<RemoteControlUserComponent>(user)
|| HasComp<RemoteControllingComponent>(user)
|| HasComp<VisitingMindComponent>(target)
|| _mind.GetMind(user) is not { } userMind)
return false;
user.Comp = EnsureComp<RemoteControlUserComponent>(user);
user.Comp.Target = target;
user.Comp.Console = console;
var userComp = EnsureComp<RemoteControllingComponent>(user);
userComp.Target = target;
userComp.Console = console;
target.Comp.User = user;
@@ -89,8 +92,8 @@ public sealed partial class RemoteControlSystem : EntitySystem
console.Comp.User = user;
console.Comp.Target = target;
console.Comp.LastIndex = console.Comp.LinkedEntities.IndexOf(target);
_action.AddAction(target, console.Comp.SwitchToNextActionUid, console);
DebugTools.Assert(console.Comp.SwitchToNextActionUid.HasValue);
_action.AddAction(target, console.Comp.SwitchToNextActionUid.Value, console);
}
_mind.Visit(userMind, target);
@@ -103,7 +106,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
return true;
}
private bool EndRemoteControl(Entity<RemoteControlUserComponent?> user, bool shouldAutoSwitch = false)
private bool EndRemoteControl(Entity<RemoteControllingComponent?> user, bool shouldAutoSwitch = false)
{
if (!Resolve(user, ref user.Comp))
return false;
@@ -111,11 +114,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
return EndRemoteControl(user, user.Comp.Target, user.Comp.Console, shouldAutoSwitch);
}
private bool EndRemoteControl(
Entity<RemoteControlUserComponent?> user,
Entity<RemoteControlTargetComponent?> target,
bool shouldAutoSwitch = false
)
private bool EndRemoteControl(Entity<RemoteControllingComponent?> user, Entity<RemoteControllableComponent?> target, bool shouldAutoSwitch = false)
{
if (!Resolve(user, ref user.Comp) || !Resolve(target, ref target.Comp))
return false;
@@ -123,11 +122,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
return EndRemoteControl(user, target, user.Comp.Console, shouldAutoSwitch);
}
private bool EndRemoteControl(
Entity<RemoteControlUserComponent?> user,
Entity<RemoteControlConsoleComponent?> console,
bool shouldAutoSwitch = false
)
private bool EndRemoteControl(Entity<RemoteControllingComponent?> user, Entity<RemoteControlConsoleComponent?> console, bool shouldAutoSwitch = false )
{
if (!Resolve(user, ref user.Comp) || !Resolve(console, ref console.Comp))
return false;
@@ -135,12 +130,7 @@ public sealed partial class RemoteControlSystem : EntitySystem
return EndRemoteControl(user, user.Comp.Target, console, shouldAutoSwitch);
}
private bool EndRemoteControl(
Entity<RemoteControlUserComponent?> user,
Entity<RemoteControlTargetComponent?> target,
Entity<RemoteControlConsoleComponent?> console,
bool shouldAutoSwitch = false
)
private bool EndRemoteControl(Entity<RemoteControllingComponent?> user, Entity<RemoteControllableComponent?> target, Entity<RemoteControlConsoleComponent?> console, bool shouldAutoSwitch = false )
{
if (!Resolve(user, ref user.Comp)
|| !Resolve(target, ref target.Comp)