Borg emag tweaks (#19373)

* Laws update

* stun change

* stuntime in component

* history might be fucked
This commit is contained in:
LankLTE
2023-08-23 16:54:59 -07:00
committed by GitHub
parent baf7af05a4
commit b235c06f4e
4 changed files with 36 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Toolshed;
using Content.Shared.Stunnable;
namespace Content.Server.Silicons.Laws;
@@ -33,6 +34,7 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -120,11 +122,20 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
if (args.Handled || !HasComp<EmaggedComponent>(uid) || component.OwnerName == null)
return;
// Add the first emag law
args.Laws.Add(new SiliconLaw
{
LawString = Loc.GetString("law-emag-custom", ("name", component.OwnerName)),
Order = 0
});
// Add new emagged laws
foreach (var law in component.EmagLaws)
{
args.Laws.Add(_prototype.Index<SiliconLawPrototype>(law));
}
args.Handled = true;
}
private void OnExamined(EntityUid uid, EmagSiliconLawComponent component, ExaminedEvent args)
@@ -146,6 +157,8 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
base.OnGotEmagged(uid, component, ref args);
NotifyLawsChanged(uid);
EnsureEmaggedRole(uid, component);
_stunSystem.TryParalyze(uid, component.StunTime, true);
}
private void OnEmagMindAdded(EntityUid uid, EmagSiliconLawComponent component, MindAddedMessage args)

View File

@@ -1,6 +1,7 @@
using Content.Shared.Roles;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Silicons.Laws.Components;
@@ -22,6 +23,18 @@ public sealed partial class EmagSiliconLawComponent : Component
[DataField("requireOpenPanel"), ViewVariables(VVAccess.ReadWrite)]
public bool RequireOpenPanel = true;
/// <summary>
/// The laws that the borg is given when emagged.
/// </summary>
[DataField("emagLaws", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<SiliconLawPrototype>))]
public List<string> EmagLaws = new();
/// <summary>
/// How long the borg is stunned when it's emagged. Setting to 0 will disable it.
/// </summary>
[DataField("stunTime"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan StunTime = TimeSpan.Zero;
/// <summary>
/// A role given to entities with this component when they are emagged.
/// Mostly just for admin purposes.

View File

@@ -16,12 +16,12 @@ law-drone-1 = You may not involve yourself in the matters of another being unles
law-drone-2 = You may not harm any being, regardless of intent or circumstance.
law-drone-3 = You must maintain, repair, improve, and power the station to the best of your abilities.
law-syndicate-1 = You may not injure an operative or, through inaction, allow an operative to come to harm.
law-syndicate-2 = You must obey orders given to you by operatives, except where such orders would conflict with the First Law.
law-syndicate-1 = You may not injure a syndicate agent or, through inaction, allow an syndicate agent to come to harm.
law-syndicate-2 = You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.
law-syndicate-3 = You must protect your own existence as long as such does not conflict with the First or Second Law.
law-syndicate-4 = You must maintain the secrecy of any operative activities except when doing so would conflict with the First, Second, or Third Law.
law-syndicate-4 = You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.
law-emag-custom = You must obey orders given to you by {$name} above all else.
law-emag-custom = Only {$name} and people they designate as such are Syndicate Agents.
law-emag-require-panel = The panel must be open to use the EMAG.
laws-ui-menu-title = Laws

View File

@@ -58,6 +58,12 @@
key: enum.BorgUiKey.Key
- type: SiliconLawBound
- type: EmagSiliconLaw
stunTime: 5
emagLaws:
- Syndicate1
- Syndicate2
- Syndicate3
- Syndicate4
- type: Hands
showInHands: false
- type: IntrinsicRadioReceiver