Skip to content

Commit

Permalink
Mirror: Initial Infected can see each other (#265)
Browse files Browse the repository at this point in the history
## Mirror of PR #25934: [Initial Infected can see each
other](space-wizards/space-station-14#25934)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `45d6c03407e41d92caa368e1db826efd6d828b66`

PR opened by <img
src="https://avatars.githubusercontent.com/u/47712032?v=4"
width="16"/><a href="https://github.com/Killerqu00"> Killerqu00</a> 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


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> ## 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
> <!-- If this is a code change, summarize at high level how your new
code works. This makes it easier to review. -->
> 
> ## Media
> <!-- 
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
> 
> If you're unsure whether your PR will require media, ask a maintainer.
> 
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
>
![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
> <!--
> List any breaking changes, including namespace, public
class/method/field changes, prototype renames; and provide instructions
for fixing them. This will be pasted in #codebase-changes.
> -->
> 
> **Changelog**
> <!--
> Make players aware of new features and changes that could affect how
they play the game by adding a Changelog entry. Please read the
Changelog guidelines located at:
https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
> -->
> 🆑
> - add: Initial Infected now can see each other.
> - add: Initial Infected can now see zombified entities.
> 


</details>

Co-authored-by: SimpleStation14 <Unknown>
  • Loading branch information
SimpleStation14 authored May 9, 2024
1 parent f24bca6 commit 47127bd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions Content.Client/Antag/AntagStatusIconSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public override void Initialize()
SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
}

/// <summary>
Expand Down
14 changes: 13 additions & 1 deletion Content.Client/Zombies/ZombieSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public override void Initialize()

SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
SubscribeLocalEvent<InitialInfectedComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
}

private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
Expand All @@ -36,7 +37,18 @@ private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartu
/// </summary>
private void OnCanDisplayStatusIcons(EntityUid uid, ZombieComponent component, ref CanDisplayStatusIconsEvent args)
{
if (HasComp<ZombieComponent>(args.User) || HasComp<ShowZombieIconsComponent>(args.User))
if (HasComp<ZombieComponent>(args.User) || HasComp<InitialInfectedComponent>(args.User) || HasComp<ShowZombieIconsComponent>(args.User))
return;

if (component.IconVisibleToGhost && HasComp<GhostComponent>(args.User))
return;

args.Cancelled = true;
}

private void OnCanDisplayStatusIcons(EntityUid uid, InitialInfectedComponent component, CanDisplayStatusIconsEvent args)
{
if (HasComp<InitialInfectedComponent>(args.User) && !HasComp<ZombieComponent>(args.User))
return;

if (component.IconVisibleToGhost && HasComp<GhostComponent>(args.User))
Expand Down
16 changes: 16 additions & 0 deletions Content.Shared/Zombies/InitialInfectedComponent.cs
Original file line number Diff line number Diff line change
@@ -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<StatusIconPrototype> StatusIcon { get; set; } = "InitialInfectedFaction";

[DataField]
public bool IconVisibleToGhost { get; set; } = true;
}
7 changes: 7 additions & 0 deletions Resources/Prototypes/StatusIcon/antag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Resources/Textures/Interface/Misc/job_icons.rsi/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@
},
{
"name": "Visitor"
},
{
"name": "InitialInfected"
}
]
}

0 comments on commit 47127bd

Please sign in to comment.