Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Server.Speech.EntitySystems;
using Content.Shared.Speech.Hushing; // DeltaV
using Content.Server.Nyanotrasen.Chat;
using Content.Server.Speech.Components; // DeltaV
using Content.Server.Speech.Prototypes;
using Content.Server.Station.Systems;
using Content.Shared.ActionBlocker;
Expand Down Expand Up @@ -889,6 +890,7 @@ private Dictionary<ICommonSession, ICChatRecipientData> GetRecipients(EntityUid
var recipients = new Dictionary<ICommonSession, ICChatRecipientData>();
var ghostHearing = GetEntityQuery<GhostHearingComponent>();
var xforms = GetEntityQuery<TransformComponent>();
var blockListening = GetEntityQuery<BlockListeningComponent>(); // DeltaV - block listening

var transformSource = xforms.GetComponent(source);
var sourceMapId = transformSource.MapID;
Expand All @@ -904,6 +906,11 @@ private Dictionary<ICommonSession, ICChatRecipientData> GetRecipients(EntityUid
if (transformEntity.MapID != sourceMapId)
continue;

// Begin DeltaV - block listening
if (blockListening.HasComponent(playerEntity))
continue;
// End DeltaV - block listening

var observer = ghostHearing.HasComponent(playerEntity);

// even if they are a ghost hearer, in some situations we still need the range
Expand Down
23 changes: 23 additions & 0 deletions Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public void UpdateTransponder(float frameTime)
var query = EntityQueryEnumerator<BorgTransponderComponent, BorgChassisComponent, DeviceNetworkComponent, MetaDataComponent>();
while (query.MoveNext(out var uid, out var comp, out var chassis, out var device, out var meta))
{
// DeltaV Begin
if (!comp.Active)
return;
// DeltaV End

if (comp.NextDisable is { } nextDisable && now >= nextDisable)
DoDisable((uid, comp, chassis, meta));

Expand Down Expand Up @@ -83,6 +88,11 @@ private void DoDisable(Entity<BorgTransponderComponent, BorgChassisComponent, Me

private void OnPacketReceived(Entity<BorgTransponderComponent> ent, ref DeviceNetworkPacketEvent args)
{
// DeltaV Begin
if (!ent.Comp.Active)
return;
// DeltaV End

var payload = args.Data;
if (!payload.TryGetValue(DeviceNetworkConstants.Command, out string? command))
return;
Expand Down Expand Up @@ -197,4 +207,17 @@ private bool CheckBrain(EntityUid? brainEntity)

return true;
}

// DeltaV Begin
/// <summary>
/// DeltaV - sets if the borg transponder is active
/// </summary>
public void SetTransponderActive(Entity<BorgTransponderComponent?> ent, bool active)
{
if (!Resolve(ent, ref ent.Comp))
return;

ent.Comp.Active = active;
}
// DeltaV End
}
2 changes: 2 additions & 0 deletions Content.Server/Speech/Components/SpeechWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ public override void Initialize()
public override bool Cut(EntityUid user, Wire wire, SpeechComponent component)
{
_speech.SetSpeech(wire.Owner, false, component);
EntityManager.GetComponentOrNull<Components.UnblockableSpeechComponent>(user)?.Active = false; // DeltaV - we need this to override unblockable speech
return true;
}

public override bool Mend(EntityUid user, Wire wire, SpeechComponent component)
{
_speech.SetSpeech(wire.Owner, true, component);
EntityManager.GetComponentOrNull<Components.UnblockableSpeechComponent>(user)?.Active = true; // DeltaV - we need this to override unblockable speech
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ namespace Content.Server.Speech.Components
[RegisterComponent]
public sealed partial class UnblockableSpeechComponent : Component
{
// Begin DeltaV
[DataField]
public bool Active = true;
// End DeltaV
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override void Initialize()

private void OnCheck(EntityUid uid, UnblockableSpeechComponent component, CheckIgnoreSpeechBlockerEvent args)
{
args.IgnoreBlocker = true;
args.IgnoreBlocker = component.Active; // DeltaV
}
}
}
39 changes: 39 additions & 0 deletions Content.Server/_DV/Silicons/BorgIdChipWireAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using Content.Server.Wires;
using Content.Shared._DV.Silicons.Borgs;
using Content.Shared._DV.Silicons;
using Content.Shared.Wires;

namespace Content.Server._DV.Silicons;

/// <summary>
/// Controls whether the cyborg's ID chip slot is active
/// </summary>
public sealed partial class BorgIdChipWireAction : ComponentWireAction<IdChipSlotComponent>
{
public override string Name { get; set; } = "wire-name-borg-id-chip";
public override Color Color { get; set; } = Color.Thistle;
public override object StatusKey => BorgWireActionKey.ChipKey;

public override StatusLightState? GetLightState(Wire wire, IdChipSlotComponent component)
{
return component.Active ? StatusLightState.On : StatusLightState.Off;
}

public override bool Cut(EntityUid user, Wire wire, IdChipSlotComponent component)
{
EntityManager.System<IdChipSlotSystem>()
.SetActive((wire.Owner, component), false);
return true;
}

public override bool Mend(EntityUid user, Wire wire, IdChipSlotComponent component)
{
EntityManager.System<IdChipSlotSystem>()
.SetActive((wire.Owner, component), true);
return true;
}

public override void Pulse(EntityUid user, Wire wire, IdChipSlotComponent component)
{
}
}
40 changes: 40 additions & 0 deletions Content.Server/_DV/Silicons/BorgTransponderWireAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Server.Silicons.Borgs;
using Content.Server.Wires;
using Content.Shared._DV.Silicons;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.Wires;

namespace Content.Server._DV.Silicons;

/// <summary>
/// Controls whether the cyborg's transponder is active
/// </summary>
public sealed partial class BorgTransponderWireAction : ComponentWireAction<BorgTransponderComponent>
{
public override string Name { get; set; } = "wire-name-borg-transponder";
public override Color Color { get; set; } = Color.YellowGreen;
public override object StatusKey => BorgWireActionKey.TransponderKey;

public override StatusLightState? GetLightState(Wire wire, BorgTransponderComponent component)
{
return component.Active ? StatusLightState.On : StatusLightState.Off;
}

public override bool Cut(EntityUid user, Wire wire, BorgTransponderComponent component)
{
EntityManager.System<BorgSystem>()
.SetTransponderActive((wire.Owner, component), false);
return true;
}

public override bool Mend(EntityUid user, Wire wire, BorgTransponderComponent component)
{
EntityManager.System<BorgSystem>()
.SetTransponderActive((wire.Owner, component), true);
return true;
}

public override void Pulse(EntityUid user, Wire wire, BorgTransponderComponent component)
{
}
}
33 changes: 30 additions & 3 deletions Content.Server/_DV/Silicons/Laws/SlavedBorgSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Content.Server._DV.Silicons.Laws;
public sealed class SlavedBorgSystem : SharedSlavedBorgSystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedSiliconLawSystem _siliconLaws = default!;

public override void Initialize()
{
Expand All @@ -24,12 +25,12 @@ public override void Initialize()

private void OnGetSiliconLaws(Entity<SlavedBorgComponent> ent, ref GetSiliconLawsEvent args)
{
if (ent.Comp.Added || !TryComp<SiliconLawProviderComponent>(ent, out var provider))
if (ent.Comp.HasBeenAdded || !TryComp<SiliconLawProviderComponent>(ent, out var provider))
return;

if (provider.Lawset is {} lawset)
if (provider.Lawset is {} lawset && ent.Comp.ShouldBeAdded)
AddLaw(lawset, ent.Comp.Law);
ent.Comp.Added = true; // prevent opening the ui adding more law 0's
ent.Comp.HasBeenAdded = true; // prevent opening the ui adding more law 0's
}

/// <summary>
Expand All @@ -39,4 +40,30 @@ public void AddLaw(SiliconLawset lawset, ProtoId<SiliconLawPrototype> law)
{
lawset.Laws.Insert(0, _proto.Index(law).ShallowClone());
}

/// <summary>
/// Sets whether the slaving is active.
/// </summary>
public void SetShouldBeAdded(Entity<SlavedBorgComponent?> ent, bool active)
{
if (!Resolve(ent, ref ent.Comp))
return;

if (!TryComp<SiliconLawProviderComponent>(ent, out var provider) || provider.Lawset is not { } lawset)
return;

if (!ent.Comp.ShouldBeAdded && active)
{
AddLaw(lawset, ent.Comp.Law);
ent.Comp.HasBeenAdded = true;
_siliconLaws.NotifyLawsChanged(ent);
}
else if (ent.Comp.ShouldBeAdded && !active)
{
lawset.Laws.Remove(_proto.Index(ent.Comp.Law));
ent.Comp.HasBeenAdded = false;
_siliconLaws.NotifyLawsChanged(ent);
}
ent.Comp.ShouldBeAdded = active;
}
}
40 changes: 40 additions & 0 deletions Content.Server/_DV/Silicons/PowerCellSlotWireAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Server.Wires;
using Content.Shared._DV.Silicons;
using Content.Shared.PowerCell;
using Content.Shared.PowerCell.Components;
using Content.Shared.Wires;

namespace Content.Server._DV.Silicons;

/// <summary>
/// Controls whether the power cell slot is active
/// </summary>
public sealed partial class PowerCellSlotWireAction : ComponentWireAction<PowerCellSlotComponent>
{
public override string Name { get; set; } = "wire-name-power-cell";
public override Color Color { get; set; } = Color.BurlyWood;
public override object StatusKey => BorgWireActionKey.CellKey;

public override StatusLightState? GetLightState(Wire wire, PowerCellSlotComponent component)
{
return component.Active ? StatusLightState.On : StatusLightState.Off;
}

public override bool Cut(EntityUid user, Wire wire, PowerCellSlotComponent component)
{
EntityManager.System<PowerCellSystem>()
.SetSlotActive((wire.Owner, component), false);
return true;
}

public override bool Mend(EntityUid user, Wire wire, PowerCellSlotComponent component)
{
EntityManager.System<PowerCellSystem>()
.SetSlotActive((wire.Owner, component), true);
return true;
}

public override void Pulse(EntityUid user, Wire wire, PowerCellSlotComponent component)
{
}
}
41 changes: 41 additions & 0 deletions Content.Server/_DV/Silicons/SlavedBorgWireAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Server._DV.Silicons.Laws;
using Content.Server.Wires;
using Content.Shared.Doors;
using Content.Shared._DV.Silicons.Laws;
using Content.Shared._DV.Silicons;
using Content.Shared.Wires;

namespace Content.Server._DV.Silicons;

/// <summary>
/// Controls whether the cyborg's transponder is active
/// </summary>
public sealed partial class SlavedBorgWireAction : ComponentWireAction<SlavedBorgComponent>
{
public override string Name { get; set; } = "wire-name-slaved-borg";
public override Color Color { get; set; } = Color.Coral;
public override object StatusKey => BorgWireActionKey.SlavedKey;

public override StatusLightState? GetLightState(Wire wire, SlavedBorgComponent component)
{
return component.ShouldBeAdded ? StatusLightState.On : StatusLightState.Off;
}

public override bool Cut(EntityUid user, Wire wire, SlavedBorgComponent component)
{
EntityManager.System<SlavedBorgSystem>()
.SetShouldBeAdded((wire.Owner, component), false);
return true;
}

public override bool Mend(EntityUid user, Wire wire, SlavedBorgComponent component)
{
EntityManager.System<SlavedBorgSystem>()
.SetShouldBeAdded((wire.Owner, component), true);
return true;
}

public override void Pulse(EntityUid user, Wire wire, SlavedBorgComponent component)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ public sealed partial class PowerCellSlotComponent : Component
[DataField, AutoNetworkedField]
public bool FitsInCharger = true;

// Begin DeltaV
/// <summary>
/// DeltaV - power cell slots
/// </summary>
[DataField, AutoNetworkedField]
public bool Active = true;
// End DeltaV
}

Loading
Loading