using Content.Server.Antag;
using Content.Server.Cloning;
using Content.Server.GameTicking.Rules.Components;
+using Content.Server.Medical.SuitSensors;
using Content.Server.Objectives.Components;
using Content.Shared.GameTicking.Components;
using Content.Shared.Gibbing.Components;
+using Content.Shared.Medical.SuitSensor;
using Content.Shared.Mind;
-using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Server.GameTicking.Rules;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly CloningSystem _cloning = default!;
+ [Dependency] private readonly SuitSensorSystem _sensor = default!;
public override void Initialize()
{
gibComp.SpawnProto = ent.Comp.GibProto;
gibComp.PreventGibbingObjectives = new() { "ParadoxCloneKillObjective" }; // don't gib them if they killed the original.
+ // turn their suit sensors off so they don't immediately get noticed
+ _sensor.SetAllSensors(clone.Value, SuitSensorMode.SensorOff);
+
args.Entity = clone;
ent.Comp.Original = playerToClone.Owner;
}
using Content.Shared.Examine;
using Content.Shared.GameTicking;
using Content.Shared.Interaction;
+using Content.Shared.Inventory;
using Content.Shared.Medical.SuitSensor;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
+ [Dependency] private readonly InventorySystem _inventory = default!;
public override void Initialize()
{
}
}
+ /// <summary>
+ /// Set all suit sensors on the equipment someone is wearing to the specified mode.
+ /// </summary>
+ public void SetAllSensors(EntityUid target, SuitSensorMode mode, SlotFlags slots = SlotFlags.All )
+ {
+ // iterate over all inventory slots
+ var slotEnumerator = _inventory.GetSlotEnumerator(target, slots);
+ while (slotEnumerator.NextItem(out var item, out _))
+ {
+ if (TryComp<SuitSensorComponent>(item, out var sensorComp))
+ SetSensor((item, sensorComp), mode);
+ }
+ }
+
public SuitSensorStatus? GetSensorState(EntityUid uid, SuitSensorComponent? sensor = null, TransformComponent? transform = null)
{
if (!Resolve(uid, ref sensor, ref transform))