-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fake mindshield componentry and Implanter (#34079)
* Fake Mindshield (With some bad sprites) - Add FakeMindshield System and Component - Add FakeMindsheildImplantSystem and Component - modify ShowMindShieldIconsSystem to check for FakeMindshields - add all supporting yaml for the Implants, action and uplink - add loc file stuff - add unfinished sprites * Cleanup, add to thief toolbox, remove metagame - Move Implant sameness check to AFTER the implant DoAfter to prevent instant identification of Deception Implants - cleanup the systems and components - add the fake mindshield to the Thief toolbox * part 1 of fixing the folder problem * Make the fakemindshield sprite folder lowercase * CR - Move ImplantCheck into shared, cleanup - Moved ImplantCheck and eventsubscription into Shared - Remove Client/Server extensions of FakeMindshieldImplantSystem and FakeMindShieldSystem and make shared Sealed - make OnToggleMindshield Private, use the event! * CR - Cleanup extra lines, fix some Prototype - cleaned up extra liens in ImplanterSystem and SharedFakeMindshieldSystem from when i was developing - Uplink catalog no longer lists the implant in 2 spots, only implants now, also uses the On state action icon - added a comment about why it's reraising the action event rather than directly interacting with the FakeMindshield Component * Fake Mindshield CR: - Added a comment about IsEnabled - moved OnFakeMindShieldToggle to Entity<> from Uid, Comp - fixed some formatting in uplink_catalog * CR - Add a bit more comment
- Loading branch information
Showing
17 changed files
with
183 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Content.Shared/Mindshield/Components/FakeMindShieldImplantComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Mindshield.Components; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class FakeMindShieldImplantComponent : Component | ||
{ | ||
} |
22 changes: 22 additions & 0 deletions
22
Content.Shared/Mindshield/Components/FakeMindshieldComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Content.Shared.StatusIcon; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared.Mindshield.Components; | ||
|
||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class FakeMindShieldComponent : Component | ||
{ | ||
|
||
/// <summary> | ||
/// The state of the Fake mindshield, if true the owning entity will display a mindshield effect on their job icon | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public bool IsEnabled { get; set; } = false; | ||
|
||
/// <summary> | ||
/// The Security status icon displayed to the security officer. Should be a duplicate of the one the mindshield uses since it's spoofing that | ||
/// </summary> | ||
[DataField, AutoNetworkedField] | ||
public ProtoId<SecurityIconPrototype> MindShieldStatusIcon = "MindShieldIcon"; | ||
} |
36 changes: 36 additions & 0 deletions
36
Content.Shared/Mindshield/FakeMindShield/SharedFakeMindShieldImplantSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.Implants; | ||
using Content.Shared.Implants.Components; | ||
using Content.Shared.Mindshield.Components; | ||
|
||
namespace Content.Shared.Mindshield.FakeMindShield; | ||
|
||
public sealed class SharedFakeMindShieldImplantSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<SubdermalImplantComponent, FakeMindShieldToggleEvent>(OnFakeMindShieldToggle); | ||
SubscribeLocalEvent<FakeMindShieldImplantComponent, ImplantImplantedEvent>(ImplantCheck); | ||
} | ||
/// <summary> | ||
/// Raise the Action of a Implanted user toggling their implant to the FakeMindshieldComponent on their entity | ||
/// </summary> | ||
private void OnFakeMindShieldToggle(Entity<SubdermalImplantComponent> entity, ref FakeMindShieldToggleEvent ev) | ||
{ | ||
ev.Handled = true; | ||
if (entity.Comp.ImplantedEntity is not { } ent) | ||
return; | ||
|
||
if (!TryComp<FakeMindShieldComponent>(ent, out var comp)) | ||
return; | ||
_actionsSystem.SetToggled(ev.Action, !comp.IsEnabled); // Set it to what the Mindshield component WILL be after this | ||
RaiseLocalEvent(ent, ev); //this reraises the action event to support an eventual future Changeling Antag which will also be using this component for it's "mindshield" ability | ||
} | ||
private void ImplantCheck(EntityUid uid, FakeMindShieldImplantComponent component ,ref ImplantImplantedEvent ev) | ||
{ | ||
if (ev.Implanted != null) | ||
EnsureComp<FakeMindShieldComponent>(ev.Implanted.Value); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Content.Shared/Mindshield/FakeMindShield/SharedFakeMindshieldSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.Mindshield.Components; | ||
|
||
namespace Content.Shared.Mindshield.FakeMindShield; | ||
|
||
public sealed class SharedFakeMindShieldSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<FakeMindShieldComponent, FakeMindShieldToggleEvent>(OnToggleMindshield); | ||
} | ||
|
||
private void OnToggleMindshield(EntityUid uid, FakeMindShieldComponent comp, FakeMindShieldToggleEvent toggleEvent) | ||
{ | ||
comp.IsEnabled = !comp.IsEnabled; | ||
Dirty(uid, comp); | ||
} | ||
} | ||
|
||
public sealed partial class FakeMindShieldToggleEvent : InstantActionEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.99 KB
Resources/Textures/Interface/Actions/actions_fakemindshield.rsi/icon-on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.99 KB
Resources/Textures/Interface/Actions/actions_fakemindshield.rsi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
Resources/Textures/Interface/Actions/actions_fakemindshield.rsi/meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"version": 1, | ||
"license": "CC-BY-SA-3.0", | ||
"copyright": "Created by Ubaser (Discord) for SS14, Modified for purpose by brassicaprime69 (Discord)", | ||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "icon" | ||
}, | ||
{ | ||
"name": "icon-on" | ||
} | ||
] | ||
} |