From 47127bdb23bc2a2898e4187684e536f8c16d4faa Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Wed, 8 May 2024 21:00:48 -0700 Subject: [PATCH] Mirror: Initial Infected can see each other (#265) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Mirror of PR #25934: [Initial Infected can see each other](https://github.com/space-wizards/space-station-14/pull/25934) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `45d6c03407e41d92caa368e1db826efd6d828b66` PR opened by Killerqu00 at 2024-03-08 19:28:04 UTC --- PR changed 6 files with 40 additions and 1 deletions. The PR had the following labels: - Changes: Sprites - Status: Needs Review ---

Original Body

> > > > ## About the PR > Initial Infected now have an icon that is visible to other initial infected. This allows for better communication. > Also, Initial Infected can now see other zombies(just a slight QoL). > > ## Why / Balance > This is a slight zombie buff and also encourages teamwork between II. Most of the zombie outbreaks are ruined because II turned alone/in a bad situation. With this PR, they will be able to recognise themselves and communicate. > > ## Technical details > > > ## Media > > ![image](https://github.com/space-wizards/space-station-14/assets/47712032/d74926d6-97c9-4749-bcd5-7d42fe886c37) > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > **Changelog** > > 🆑 > - add: Initial Infected now can see each other. > - add: Initial Infected can now see zombified entities. >
Co-authored-by: SimpleStation14 --- Content.Client/Antag/AntagStatusIconSystem.cs | 1 + Content.Client/Zombies/ZombieSystem.cs | 14 +++++++++++++- .../Zombies/InitialInfectedComponent.cs | 16 ++++++++++++++++ Resources/Prototypes/StatusIcon/antag.yml | 7 +++++++ .../Misc/job_icons.rsi/InitialInfected.png | Bin 0 -> 4268 bytes .../Interface/Misc/job_icons.rsi/meta.json | 3 +++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/Zombies/InitialInfectedComponent.cs create mode 100644 Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png diff --git a/Content.Client/Antag/AntagStatusIconSystem.cs b/Content.Client/Antag/AntagStatusIconSystem.cs index 5d87837893..804ae21ad4 100644 --- a/Content.Client/Antag/AntagStatusIconSystem.cs +++ b/Content.Client/Antag/AntagStatusIconSystem.cs @@ -22,6 +22,7 @@ public override void Initialize() SubscribeLocalEvent(GetRevIcon); SubscribeLocalEvent(GetIcon); SubscribeLocalEvent(GetIcon); + SubscribeLocalEvent(GetIcon); } /// diff --git a/Content.Client/Zombies/ZombieSystem.cs b/Content.Client/Zombies/ZombieSystem.cs index bd89e978c7..7c1fb38e74 100644 --- a/Content.Client/Zombies/ZombieSystem.cs +++ b/Content.Client/Zombies/ZombieSystem.cs @@ -15,6 +15,7 @@ public override void Initialize() SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnCanDisplayStatusIcons); + SubscribeLocalEvent(OnCanDisplayStatusIcons); } private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args) @@ -36,7 +37,18 @@ private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartu /// private void OnCanDisplayStatusIcons(EntityUid uid, ZombieComponent component, ref CanDisplayStatusIconsEvent args) { - if (HasComp(args.User) || HasComp(args.User)) + if (HasComp(args.User) || HasComp(args.User) || HasComp(args.User)) + return; + + if (component.IconVisibleToGhost && HasComp(args.User)) + return; + + args.Cancelled = true; + } + + private void OnCanDisplayStatusIcons(EntityUid uid, InitialInfectedComponent component, CanDisplayStatusIconsEvent args) + { + if (HasComp(args.User) && !HasComp(args.User)) return; if (component.IconVisibleToGhost && HasComp(args.User)) diff --git a/Content.Shared/Zombies/InitialInfectedComponent.cs b/Content.Shared/Zombies/InitialInfectedComponent.cs new file mode 100644 index 0000000000..3200dd7f5e --- /dev/null +++ b/Content.Shared/Zombies/InitialInfectedComponent.cs @@ -0,0 +1,16 @@ +using Content.Shared.Antag; +using Content.Shared.StatusIcon; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Zombies; + +[RegisterComponent, NetworkedComponent] +public sealed partial class InitialInfectedComponent : Component, IAntagStatusIconComponent +{ + [DataField("initialInfectedStatusIcon")] + public ProtoId StatusIcon { get; set; } = "InitialInfectedFaction"; + + [DataField] + public bool IconVisibleToGhost { get; set; } = true; +} diff --git a/Resources/Prototypes/StatusIcon/antag.yml b/Resources/Prototypes/StatusIcon/antag.yml index 3b64517530..41bb095741 100644 --- a/Resources/Prototypes/StatusIcon/antag.yml +++ b/Resources/Prototypes/StatusIcon/antag.yml @@ -5,6 +5,13 @@ sprite: /Textures/Interface/Misc/job_icons.rsi state: Zombie +- type: statusIcon + id: InitialInfectedFaction + priority: 11 + icon: + sprite: /Textures/Interface/Misc/job_icons.rsi + state: InitialInfected + - type: statusIcon id: RevolutionaryFaction priority: 11 diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png b/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png new file mode 100644 index 0000000000000000000000000000000000000000..3684fc448892d31bcbec4e9ed4eae0ae169c16e0 GIT binary patch literal 4268 zcmeH~eQ*=#(X-y~v0l`}Ak}_7bn|;emcc-D$CbTI{jio{>V0p6pBwb0e>F%~k zi!V%poAdMlWq7LJ>#+r093c73=m z(mSE!^J^`8-o>`etL@shwA@y<<+bxS{e9ztoqw)q`YdbZrS5vzMtW zr-|j2i&`>4x50C)?#L78Ccfs(eRTc3#@qwO8I#VReWO!y>^~6x-tdim+4Sy>*S=c$ zdCR7r>k~iDSRb4`BL}~l_?qp}( z>5jSXhK3m{j8h)TUpi++dt+l{X6n(*se!aS*R1(pJnG)lMSGI?t;8sRB!8vO)IvqeB|N^rRM#e({i8QmA7%~FG-+u6!zx1E1n|){fUAOFeE4z5Y;xf|>)0j{8K4&n}_gkwf zI;5h$4|1BW&R0%;*tPaaA;r3Pb9T{pIamAsm0#(3*}c2q^nmZ(oEH|ZnpJNN4h)?8 z>+-y{|GVYjKl$tTPv3EEUiXU-)x!hCF?(yb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