-
Notifications
You must be signed in to change notification settings - Fork 43
Add Syndie Superfan #1031
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
Merged
EmoGarbage404
merged 8 commits into
EphemeralSpace:master
from
moonheart08:25-01-2026-superfan
Feb 7, 2026
Merged
Add Syndie Superfan #1031
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
91ea70f
Add Turncoat
moonheart08 3bef73c
typos
moonheart08 020d29a
fix debug timing. it's 10m now.
moonheart08 22e99fd
Add Syndie Superfan
moonheart08 af0e235
Cut turncoat out of the PR.
moonheart08 e161dbb
oops
moonheart08 7182eeb
use fancy new method
moonheart08 f36785c
Update Content.Server/_ES/Masks/Superfan/ESSuperfanSystem.cs
EmoGarbage404 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,13 @@ | ||
| namespace Content.Server._ES.Masks.Superfan; | ||
|
|
||
| /// <summary> | ||
| /// This is used for the syndie superfan and their conversion on traitor loss. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// Deliberately not generalized, as writing general code here is a bunch of extra tests and work that may never | ||
| /// be used. I like it when my language can do the typechecking for me instead of needing to test for it. | ||
| /// | ||
| /// If we ever need equivalents for like, nihlings, this should not be hard to rewrite. | ||
| /// </remarks> | ||
| [RegisterComponent] | ||
| public sealed partial class ESSuperfanComponent : Component; |
This file contains hidden or 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,59 @@ | ||
| using System.Linq; | ||
| using Content.Server._ES.Masks.Masquerades; | ||
| using Content.Server.KillTracking; | ||
| using Content.Server.Mind; | ||
| using Content.Shared._ES.Masks; | ||
| using Content.Shared.Mind; | ||
| using Robust.Shared.Prototypes; | ||
| using Robust.Shared.Random; | ||
| using Robust.Shared.Utility; | ||
|
|
||
| namespace Content.Server._ES.Masks.Superfan; | ||
|
|
||
| /// <seealso cref="ESSuperfanComponent"/> | ||
| public sealed class ESSuperfanSystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly ESMaskSystem _mask = default!; | ||
| [Dependency] private readonly ESMasqueradeSystem _masquerade = default!; | ||
| [Dependency] private readonly MindSystem _mind = default!; | ||
| [Dependency] private readonly IRobustRandom _random = default!; | ||
| [Dependency] private readonly IPrototypeManager _proto = default!; | ||
|
|
||
| private static readonly ProtoId<ESTroupePrototype> TraitorsTroupe = "ESTraitor"; | ||
|
|
||
| /// <inheritdoc/> | ||
| public override void Initialize() | ||
| { | ||
| SubscribeLocalEvent<KillReportedEvent>(OnKillReported); | ||
| } | ||
|
|
||
| private void OnKillReported(ref KillReportedEvent ev) | ||
| { | ||
| // TODO: This feels fishy. I'll leave the kill reporting rewrite nerds to | ||
| // figure out having a kill report for entire troupes down the line. | ||
| foreach (var member in _mask.GetTroupeMembers(TraitorsTroupe)) | ||
| { | ||
| if (!_mind.IsCharacterDeadIc(Comp<MindComponent>(member))) | ||
| return; // Well the troupe ain't dead. | ||
| } | ||
|
|
||
| if (!_masquerade.TryGetMasqueradeData(out var set)) | ||
| return; // Well, no masquerade means no conversion target. | ||
|
|
||
| if (set.SuperfanTarget is not { } entry) | ||
| { | ||
| Log.Error("Superfan has no target despite being in a masquerade!"); | ||
| return; | ||
| } | ||
moonheart08 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| var fanQuery = EntityQueryEnumerator<ESSuperfanComponent, MindComponent>(); | ||
|
|
||
| while (fanQuery.MoveNext(out var ent, out var fan, out var mind)) | ||
| { | ||
| if (_mind.IsCharacterDeadIc(mind)) | ||
| continue; // Don't assign the dead to tot masks. | ||
|
|
||
| _mask.ChangeMask((ent, mind), entry.PickMasks(_random, _proto).Single()); | ||
| } | ||
| } | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
Content.Shared/_ES/Masks/Components/ESTargetMaskBlacklistComponent.cs
This file contains hidden or 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,16 @@ | ||
| using Robust.Shared.Prototypes; | ||
|
|
||
| namespace Content.Shared._ES.Masks.Components; | ||
|
|
||
| /// <summary> | ||
| /// This is used for blacklisting certain masks from targeted objectives. | ||
| /// </summary> | ||
| [RegisterComponent] | ||
| public sealed partial class ESTargetMaskBlacklistComponent : Component | ||
| { | ||
| /// <summary> | ||
| /// A blacklist of masks that cannot be targeted. | ||
| /// </summary> | ||
| [DataField] | ||
| public HashSet<ProtoId<ESMaskPrototype>> MaskBlacklist; | ||
| } |
This file contains hidden or 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 hidden or 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._ES.Masks.Components; | ||
| using Content.Shared._ES.Objectives.Target.Components; | ||
|
|
||
| namespace Content.Shared._ES.Masks; | ||
|
|
||
| public sealed class ESTargetMaskSystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly ESSharedMaskSystem _mask = default!; | ||
|
|
||
| /// <inheritdoc/> | ||
| public override void Initialize() | ||
| { | ||
| SubscribeLocalEvent<ESTargetMaskBlacklistComponent, ESValidateObjectiveTargetCandidates>(Handler); | ||
| } | ||
|
|
||
| private void Handler(Entity<ESTargetMaskBlacklistComponent> ent, ref ESValidateObjectiveTargetCandidates args) | ||
| { | ||
| if (_mask.GetMaskOrNull(args.Candidate) is {} mask && ent.Comp.MaskBlacklist.Contains(mask)) | ||
| args.Invalidate(); | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
Content.Shared/_ES/Masks/MaskCycle/ESActionChangeMaskEvent.cs
This file contains hidden or 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,13 @@ | ||
| using Content.Shared.Actions; | ||
| using Robust.Shared.Prototypes; | ||
|
|
||
| namespace Content.Shared._ES.Masks.MaskCycle; | ||
|
|
||
| /// <summary> | ||
| /// An action event for changing to another mask. | ||
| /// </summary> | ||
| public sealed partial class ESActionChangeMaskEvent : InstantActionEvent | ||
| { | ||
| [DataField(required: true)] | ||
| public ProtoId<ESMaskPrototype> Mask; | ||
| } |
32 changes: 32 additions & 0 deletions
32
Content.Shared/_ES/Masks/MaskCycle/ESActionChangeMaskSystem.cs
This file contains hidden or 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,32 @@ | ||
| using Content.Shared.Mind; | ||
|
|
||
| namespace Content.Shared._ES.Masks.MaskCycle; | ||
|
|
||
| /// <summary> | ||
| /// This handles the mask change action. | ||
| /// </summary> | ||
| public sealed class ESActionChangeMaskSystem : EntitySystem | ||
| { | ||
| [Dependency] private readonly ESSharedMaskSystem _mask = default!; | ||
| [Dependency] private readonly SharedMindSystem _mind = default!; | ||
|
|
||
| /// <inheritdoc/> | ||
| public override void Initialize() | ||
| { | ||
| SubscribeLocalEvent<ESActionChangeMaskEvent>(Handler); | ||
| } | ||
|
|
||
| private void Handler(ESActionChangeMaskEvent args) | ||
| { | ||
| if (args.Handled) | ||
| return; | ||
|
|
||
| if (!_mind.TryGetMind(args.Performer, out var mind, out var mindComp)) | ||
| return; | ||
|
|
||
| _mask.RemoveMask((mind, mindComp)); | ||
| _mask.ApplyMask((mind, mindComp), args.Mask); | ||
|
|
||
| args.Handled = true; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.