Initial Infected can see each other (#25934)

initial infected icon

(cherry picked from commit 45d6c03407e41d92caa368e1db826efd6d828b66)
This commit is contained in:
Killerqu00 2024-03-18 22:57:36 +01:00 committed by NullWanderer
parent 69ab913eb1
commit f33fe79c7a
No known key found for this signature in database
GPG Key ID: 65CF92BD1D26F4AC
6 changed files with 40 additions and 1 deletions

View File

@ -22,6 +22,7 @@ public sealed class AntagStatusIconSystem : SharedStatusIconSystem
SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
}
/// <summary>

View File

@ -15,6 +15,7 @@ public sealed class ZombieSystem : EntitySystem
SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
SubscribeLocalEvent<InitialInfectedComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
}
private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
@ -36,7 +37,18 @@ public sealed class ZombieSystem : EntitySystem
/// </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))

View File

@ -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;
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -182,6 +182,9 @@
},
{
"name": "Visitor"
},
{
"name": "InitialInfected"
}
]
}