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

Seperate EMAG into EMAG and Authentication Disruptor #34337

Merged
merged 37 commits into from
Jan 30, 2025

Conversation

ScarKy0
Copy link
Contributor

@ScarKy0 ScarKy0 commented Jan 9, 2025

About the PR

Title. The popular emag was seperated into the regular cryptographic sequencer and authentication disruptor.
The Emag retains its original purpose of adding hidden functions to machines (gibbing recycler, locking cryopods etc) but loses the ability to break locks and airlocks.
The Authentication Disruptor has the ability to break locks and airlocks while also removing their access. Unlike the old emag, this is not permanent and can be fixed by unbolting the airlock and restoring access with the access config.

Why / Balance

The emag was always controversial due to the sheer feature bloat it had. It basically became an always-buy syndie item, which not only lets you break into places but also gives you plenty utility with other machines.
Due to all of that, emag uses were frozen as to not make it even more powerful. This PR aims to seperate the powerful airlock/lock breaking ability into a seperate item to ease the burden on the poor emag, turning it into more of an item for niche uses that it could already do anyways.

Technical details

Added EmagType flag to the EmagSystem. This is used to reference what kind of emag was used on an entity in events.
Added a new OnAccessOverriderAccessUpdatedEvent (god...) that is raised on an entity when it's AccessReader is updated by the access configurator.
Changed Vending machines to not use the EmagComponent as means of the access being broken anymore.
Changed how GotEmagged is handled.
Moved some borg code to shared.

Media

(Bit outdated, but basically same deal)

2025-01-09.21-34-48.mp4

Requirements

Breaking changes

Emag system got refactored. To EMAG an entity it now must have the GotEmagged event ran on it with the correct flag.
Removed OnAttemptEmagEvent. All checks must be done within the GotEmagged subscription.
Renamed BreakOnEmag functions in AccessReader and Lock to BreakOnAccessBreaker.
Moved borg code responsible for emagging to shared.
Removed EmagSound from components that used it, it is now stored on the EmagComponent.
All emag interactions must now check for the correct flag in the event itself.
Example:

private void OnEmagged(Entity<FunnyComponent> ent, ref GotEmaggedEvent args)
    {
        if (!_emag.CompareFlag(args.Type, EmagType.Interaction)) // Does this event have the Interaction flag?
            return;

        if (_emag.CheckFlag(ent, EmagType.Interaction)) // Is the entity already emagged with this event's flag? Do not add if the interaction is meant to be repeatable.
            return;

        args.Handled = true; // Marking as handled means the emag was successful, meaning a charge will be spent and EmaggedComponent will be added.
        args.Repeatable = true; // Alternatively, Repeatable can skip adding the EmaggedComponent as before, but now this will require additional checks as to not allow the entity to be emagged several times by accident.

TODO

  • Merge back into the EMAG system
  • Make a seperate Enum for this
  • Remove AccessBreaker related stuff
  • Update all emag interactions
    • Door Bolts + TESTED
    • Access Readers + TESTED
    • Cryopod + TESTED
    • Vape + TESTED
    • Disposals + TESTED
    • Stasis Bed + TESTED
    • Clone Machine + TESTED
    • Fire Alarm + TESTED
    • Fax + TESTED
    • Fat Extractor + TESTED
    • Apc + TESTED
    • Silicons + TESTED
    • Vending Machines + TESTED
    • Lathes + TESTED
    • UnpoweredFlashlight(???) + TESTED
    • Lock + TESTED
    • Material Reclaimer + TESTED
    • Pinpointer + TESTED
    • Medibot + TESTED
    • Singularity Gen + TESTED
    • Artifact Crusher + TESTED
  • Misc things to fix:
    • Access Wire + TESTED
    • Cargo Order System + TESTED
    • Comms Console system + TESTED
    • Medibot Injection Whatevers + TESTED
    • Research Console + TESTED
    • Borg Transponder + TESTED
    • Some whatevers in vending machines + TESTED
    • Ninja + TESTED

Changelog

🆑

  • add: Added the Authentication Disruptor to the syndicate uplink for 5TC. It removes access requirements from devices and forcefully opens airlocks and digital locks.
  • tweak: The EMAG can no longer open airlocks or break locks.
  • tweak: Price of the EMAG lowered to 4TC.
  • tweak: "Emagged" airlocks can now be fixed by unbolting and using the access configurator. Locks and similiar can now be fixed by just using the access configurator.

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/M Denotes a PR that changes 100-999 lines. labels Jan 9, 2025
@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

If anyone plans to test just know like half of the changelog still isnt implemented :godo:

@beck-thompson
Copy link
Contributor

This is done in Delta-V and it works out fine

@EthanQix
Copy link

EthanQix commented Jan 9, 2025

Good, Emag does too much stuff at the moment.

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

this might also allow for the emag to be unfrozen so we cna get more cool interactions

@SlimmSlamm
Copy link
Contributor

why is this a needed change? the emag is fine as it is right now

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

why is this a needed change? the emag is fine as it is right now

The emag does WAYY too much for a single item. It was requested several times to seperate it into several items (like how tgstation has it)
I believe a normal person won't need both functions anyways unless you're doing something niche
Also this might allow an emag unfreeze so we can get more interactions for it

@ArtisticRoomba
Copy link
Contributor

why is this a needed change? the emag is fine as it is right now

It isn't. The EMAG has a hilarious amount of interactions and as such new EMAG interactions are frozen for this exact reason.

Did you know you can EMAG a fire alarm? I didn't know you could until I wrote my guidebook entry on it, and let me tell you I hate that fact so much.

@SlimmSlamm
Copy link
Contributor

It isn't. The EMAG has a hilarious amount of interactions and as such new EMAG interactions are frozen for this exact reason.

You increase the price of it not completely ruin it. This PR is awful. Most of the interactions don't even do anything besides give you clothes or drinks. It's main purpose is emagging doors and the recycler. I rarely ever see it used for anything else and this entire PR is changing something completely uneeded soley because of useless interactions.

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

You increase the price of it not completely ruin it. This PR is awful. Most of the interactions don't even do anything besides give you clothes or drinks. It's main purpose is emagging doors and the recycler. I rarely ever see it used for anything else and this entire PR is changing something completely uneeded soley because of useless interactions.

I dunno the emag has a lot of great interactions... You know... Borgs, jamming cryopods, making people rot 10x faster on cryo beds, the recycler, syndie contra in a lot of vending machines (especially cigs machine), printing weapons on lathes
And after this PR makes it, if the maintainers agree, we can add even more to make the emag even better

@EthanQix
Copy link

EthanQix commented Jan 9, 2025

why is this a needed change? the emag is fine as it is right now

The Emag does so much stuff as one item that adding more interactions has been frozen. It's a swiss knife that needs to be split to give it some design space.

@SlimmSlamm
Copy link
Contributor

You increase the price of it not completely ruin it. This PR is awful. Most of the interactions don't even do anything besides give you clothes or drinks. It's main purpose is emagging doors and the recycler. I rarely ever see it used for anything else and this entire PR is changing something completely uneeded soley because of useless interactions.

I dunno the emag has a lot of great interactions... You know... Borgs, jamming cryopods, making people rot 10x faster on cryo beds, the recycler, syndie contra in a lot of vending machines (especially cigs machine), printing weapons on lathes And after this PR makes it, if the maintainers agree, we can add even more to make the emag even better

I dunno man. for 3 tc I can just get a jaws of life and do what this PR is proposing 10x better and cheaper without leaving a single trace.

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

I dunno man. for 3 tc I can just get a jaws of life and do what this PR is proposing 10x better and cheaper without leaving a single trace.

If you have the time to wait for jaws while wanting to break into bridge, go for it champ :godo:

@ArtisticRoomba
Copy link
Contributor

I dunno man. for 3 tc I can just get a jaws of life and do what this PR is proposing 10x better and cheaper without leaving a single trace.

Then do that. That's called player agency. If you want to wait a while exposing yourself to save some TC, then do that.

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

Code complete
Just need an art director to approve of the sprite i sent on the discord (before i animate it)

@EthanQix
Copy link

EthanQix commented Jan 9, 2025

Code complete Just need an art director to approve of the sprite i sent on the discord (before i animate it)

You might want to fill the "why/balance" and "technical details" parts of the PR while you're waiting ;)

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

You might want to fill the "why/balance" and "technical details" parts of the PR while you're waiting ;)

Lazy :(
Ill consider

@Luxzhv
Copy link

Luxzhv commented Jan 9, 2025

I can only imagine that this will lead to more baseforks aswell, because of folks being so set in their ways about the Emag.

@ScarKy0 ScarKy0 marked this pull request as ready for review January 9, 2025 23:18
@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 9, 2025

Marking as ready for review if a maintainer wants to review it. I still need the sprite before it can be merged tho

@ScarKy0 ScarKy0 added P1: High Priority: Higher priority than other items, but isn't an emergency. T: New Feature Type: New feature or content, or extending existing content T: Cleanup Type: Code clean-up, without being a full refactor or feature D2: Medium Difficulty: A good amount of codebase knowledge required. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 9, 2025
@ScarKy0 ScarKy0 marked this pull request as ready for review January 29, 2025 16:25
@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 29, 2025

Its... Its over... Im finally free...

@VerinSenpai
Copy link
Contributor

Well actually...

Changes Requested

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Jan 29, 2025

Well actually...
Changes Requested

This WILL happen and I WILL cry

@ArtisticRoomba
Copy link
Contributor

Well actually...

Changes Requested

This WILL happen and I WILL cry

The urge to assign this to PBJ is so real (godo)

Copy link
Contributor

@MilonPL MilonPL left a comment

Choose a reason for hiding this comment

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

Minor nitpicks, I'm going to blindly trust you that all of the interactions work as intended.

@ScarKy0 ScarKy0 requested a review from MilonPL January 29, 2025 20:00
Copy link
Contributor

@MilonPL MilonPL left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@keronshb
Copy link
Contributor

My only real issue is a nitpick of putting the checks on one line with OR checks. Otherwise this is fine.
Personally I still see this as a bit of bloat and adds a lil confusion vs just having one item to use.
But we can try it out and see how it goes.

@keronshb keronshb merged commit 253a9fb into space-wizards:master Jan 30, 2025
15 checks passed
@ScarKy0 ScarKy0 deleted the access-breaker branch January 30, 2025 13:54
@Cojoke-dot
Copy link
Contributor

Soooo... are EMAG interactions getting unfrozen then?

@Futuristic-OK
Copy link
Contributor

What about thief EMAG? What with it?

@ScarKy0
Copy link
Contributor Author

ScarKy0 commented Feb 5, 2025

No unfreeze, and thief gets both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Roundflow/Antag Area: Roundflow - "What happens in the game", including antagonist roles and their capabilities Changes: Sprites Changes: Might require knowledge of spriting or visual design. D2: Medium Difficulty: A good amount of codebase knowledge required. P1: High Priority: Higher priority than other items, but isn't an emergency. S: Conceptual Approval Status: Discussed by maintainers and has conceptual approval, but needs code review S: Needs Review Status: Requires additional reviews before being fully accepted size/M Denotes a PR that changes 100-999 lines. T: Balance Change Type: Balance changes through direct value changes, or changes to mechanics that affect it T: New Feature Type: New feature or content, or extending existing content T: Refactor Type: Refactor of notable amount of codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.