Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singularity and Tesla now require generator access to activate #32684

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using Content.Server.ParticleAccelerator.Components;
using Content.Server.Singularity.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Singularity.Components;
using Content.Shared.Lock;
using Content.Shared.Popups;
using Robust.Shared.Physics.Events;

namespace Content.Server.Singularity.EntitySystems;
Expand All @@ -9,6 +12,8 @@ public sealed class SingularityGeneratorSystem : EntitySystem
{
#region Dependencies
[Dependency] private readonly IViewVariablesManager _vvm = default!;
[Dependency] private readonly LockSystem _lock= default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
#endregion Dependencies

public override void Initialize()
Expand Down Expand Up @@ -42,6 +47,12 @@ private void OnPassThreshold(EntityUid uid, SingularityGeneratorComponent? comp)
{
if (!Resolve(uid, ref comp))
return;
if (_lock.IsLocked(uid))
{
_popup.PopupEntity(Loc.GetString("singularity-generator-component-locked"), uid);
SetPower(uid, 0, comp);
return;
}

Comment on lines 49 to 56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hugboxing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the main idea is to try to lower the amount of both raider loosing by adding more friction to the process, and also engi loosing roundstart by trying to get someone vaguely experienced to okay a generator setup, since immediate evacs due to looses just aren't particularly fun and are for all intents and purposes unrecoverable, which can lead to feelsbads for a lot of people (e.g. nukies loosing their roll, or honestly any actual antag)

SetPower(uid, 0, comp);
EntityManager.SpawnEntity(comp.SpawnPrototype, Transform(uid).Coordinates);
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<Acc
"Cryogenics",
"Engineering",
"External",
"Generator",
"HeadOfPersonnel",
"HeadOfSecurity",
"Hydroponics",
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/prototypes/access/accesses.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ id-card-access-level-detective = Detective
id-card-access-level-chief-engineer = Chief Engineer
id-card-access-level-engineering = Engineering
id-card-access-level-atmospherics = Atmospherics
id-card-access-level-generator = Generator

id-card-access-level-research-director = Research Director
id-card-access-level-research = Research
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
singularity-generator-component-locked = The generator is locked!
5 changes: 5 additions & 0 deletions Resources/Prototypes/Access/engineering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
id: Atmospherics
name: id-card-access-level-atmospherics

- type: accessLevel
id: Generator
name: id-card-access-level-generator

- type: accessGroup
id: Engineering
tags:
- ChiefEngineer
- Engineering
- Atmospherics
- Generator
1 change: 1 addition & 0 deletions Resources/Prototypes/Access/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@
- Chapel
- Hydroponics
- Atmospherics
- Generator
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
boardName: wires-board-name-pa
layoutId: ParticleAccelerator
- type: AccessReader
access: [["Engineering"]]
access: [["Generator"]]

# Unfinished

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
- type: LockedAnchorable
- type: LockedWiresPanel
- type: AccessReader
access: [[ "Engineering" ]]
access: [[ "Generator" ]]
- type: Machine
board: EmitterCircuitboard
- type: GuideHelp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
- type: Pullable
- type: GuideHelp
guides: [ Singularity, Power ]

- type: Lock
locked: true
breakOnEmag: false
- type: AccessReader
access: [["Generator"]]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- type: Sprite
noRot: true
sprite: Structures/Power/Generation/Tesla/generator.rsi
state: icon
state: icon
- type: SingularityGenerator # TODO: rename the generator
spawnId: TeslaEnergyBall
- type: InteractionOutline
Expand All @@ -25,5 +25,10 @@
layer:
- Opaque
- type: Anchorable
- type: Lock
locked: true
breakOnEmag: false
- type: AccessReader
access: [ [ "Generator" ] ]
#- type: GuideHelp # TODO - add Tesla Guide

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
- Cargo
- Atmospherics
- Medical
- Generator
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Engineering
- External
- Atmospherics
- Generator

- type: startingGear
id: AtmosphericTechnicianGear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Atmospherics
- Brig
- Cryogenics
- Generator
special:
- !type:AddImplantSpecial
implants: [ MindShieldImplant ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Maintenance
- Engineering
- External
- Generator
extendedAccess:
- Atmospherics

Expand Down
Loading