Initial Infected can see each other (#25934)

initial infected icon
This commit is contained in:
Killerqu00
2024-03-18 22:57:36 +01:00
committed by GitHub
parent d5e7951d5a
commit 45d6c03407
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<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon); SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon); SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
} }
/// <summary> /// <summary>

View File

@@ -15,6 +15,7 @@ public sealed class ZombieSystem : EntitySystem
SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup); SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons); SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
SubscribeLocalEvent<InitialInfectedComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
} }
private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args) private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
@@ -36,7 +37,18 @@ public sealed class ZombieSystem : EntitySystem
/// </summary> /// </summary>
private void OnCanDisplayStatusIcons(EntityUid uid, ZombieComponent component, ref CanDisplayStatusIconsEvent args) 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; return;
if (component.IconVisibleToGhost && HasComp<GhostComponent>(args.User)) 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 sprite: /Textures/Interface/Misc/job_icons.rsi
state: Zombie state: Zombie
- type: statusIcon
id: InitialInfectedFaction
priority: 11
icon:
sprite: /Textures/Interface/Misc/job_icons.rsi
state: InitialInfected
- type: statusIcon - type: statusIcon
id: RevolutionaryFaction id: RevolutionaryFaction
priority: 11 priority: 11

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

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