-
Notifications
You must be signed in to change notification settings - Fork 43
Block jesters from killing people #1268
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 5 commits into
EphemeralSpace:master
from
EmoGarbage404:feat/jester-do-no-harm
Feb 28, 2026
+176
−8
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6cef1cf
Expand kill tracking API
EmoGarbage404 37ea123
The Fool mask
EmoGarbage404 36a2dec
Add the objective for kills
EmoGarbage404 afaed6f
Update message
EmoGarbage404 4a698ad
Update Content.Server/_ES/Masks/Jester/Components/ESChangeMaskOnKillO…
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
20 changes: 20 additions & 0 deletions
20
Content.Server/_ES/Masks/Jester/Components/ESChangeMaskOnKillObjectiveComponent.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,20 @@ | ||
| using Content.Shared._ES.Masks; | ||
| using Robust.Shared.Prototypes; | ||
|
|
||
| namespace Content.Server._ES.Masks.Jester.Components; | ||
|
|
||
| /// <summary> | ||
| /// Used for a mask that becomes another mask when they kill someone. | ||
| /// </summary> | ||
| [RegisterComponent] | ||
| public sealed partial class ESChangeMaskOnKillObjectiveComponent : Component | ||
| { | ||
| [DataField] | ||
| public LocId Message = "es-fool-conversion-notification"; | ||
|
|
||
| [DataField(required: true)] | ||
| public ProtoId<ESMaskPrototype> Mask; | ||
|
|
||
| [DataField] | ||
| public float DefaultProgress = 1f; | ||
| } |
53 changes: 53 additions & 0 deletions
53
Content.Server/_ES/Masks/Jester/ESChangeMaskOnKillObjectiveSystem.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,53 @@ | ||
| using Content.Server._ES.Masks.Jester.Components; | ||
| using Content.Server._ES.Masks.Objectives.Relays.Components; | ||
| using Content.Server.Chat.Managers; | ||
| using Content.Shared._ES.KillTracking.Components; | ||
| using Content.Shared._ES.Objectives; | ||
| using Content.Shared._ES.Objectives.Components; | ||
| using Content.Shared.Chat; | ||
| using Robust.Server.Player; | ||
|
|
||
| namespace Content.Server._ES.Masks.Jester; | ||
|
|
||
| public sealed class ESChangeMaskOnKillObjectiveSystem : ESBaseObjectiveSystem<ESChangeMaskOnKillObjectiveComponent> | ||
| { | ||
| [Dependency] private readonly IChatManager _chat = default!; | ||
| [Dependency] private readonly IPlayerManager _player = default!; | ||
|
|
||
| public override Type[] RelayComponents => [typeof(ESKilledRelayComponent)]; | ||
|
|
||
| /// <inheritdoc/> | ||
| public override void Initialize() | ||
| { | ||
| base.Initialize(); | ||
|
|
||
| SubscribeLocalEvent<ESChangeMaskOnKillObjectiveComponent, ESKilledPlayerEvent>(OnKilledPlayer); | ||
| } | ||
|
|
||
| private void OnKilledPlayer(Entity<ESChangeMaskOnKillObjectiveComponent> ent, ref ESKilledPlayerEvent args) | ||
| { | ||
| if (args.Suicide) | ||
| return; | ||
|
|
||
| // Only matters if you kill a real player with a mind | ||
| if (!MindSys.TryGetMind(args.Killed, out _)) | ||
| return; | ||
|
|
||
| if (!MindSys.TryGetMind(args.Killer, out var mind)) | ||
| return; | ||
|
|
||
| if (_player.TryGetSessionByEntity(args.Killer, out var session)) | ||
| { | ||
| var msg = Loc.GetString(ent.Comp.Message); | ||
| var wrappedMsg = Loc.GetString("chat-manager-server-wrap-message", ("message", msg)); | ||
| _chat.ChatMessageToOne(ChatChannel.Server, msg, wrappedMsg, default, false, session.Channel, Color.Red); | ||
| } | ||
|
|
||
| MaskSys.ChangeMask(mind.Value, ent.Comp.Mask); | ||
| } | ||
|
|
||
| protected override void GetObjectiveProgress(Entity<ESChangeMaskOnKillObjectiveComponent> ent, ref ESGetObjectiveProgressEvent args) | ||
| { | ||
| args.Progress = ent.Comp.DefaultProgress; | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| es-fool-conversion-notification = You've violated the comedic code of the jester's and have been sentenced to become a fool for your crimes. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| - type: entity | ||
| parent: ESBaseMaskObjective | ||
| id: ESObjectiveTheFoolMisery | ||
| name: Wallow in misery | ||
| description: Revel in your failure after violating the comedic sanctity of the jester troupe. Pray for forgiveness you'll never receive. | ||
| components: | ||
| - type: ESObjective | ||
| icon: | ||
| sprite: Clothing/Mask/clown.rsi | ||
| state: icon |
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,12 @@ | ||
| - type: entity | ||
| parent: ESBaseMaskObjective | ||
| id: ESObjectiveJesterDoNoHarm | ||
| name: Do no harm | ||
| description: While your job is to drive others to violence, by the jester's code, you must not take the life of another. | ||
| components: | ||
| - type: ESObjective | ||
| icon: | ||
| sprite: Clothing/Mask/clown.rsi | ||
| state: icon | ||
| - type: ESChangeMaskOnKillObjective | ||
| mask: ESFool |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels subjective enough it shouldn't be here OR should be a method on a system somewhere so it can become more subjective later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there should probably be a shared interface between the kill report events and then the system can have a method that evaluates them. Rn it's kinda just lazily duped between the two events which is Whatever but obviously not ideal.