@@ -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>
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
16
Content.Shared/Zombies/InitialInfectedComponent.cs
Normal file
16
Content.Shared/Zombies/InitialInfectedComponent.cs
Normal 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;
|
||||||
|
}
|
||||||
@@ -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 |
@@ -182,6 +182,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Visitor"
|
"name": "Visitor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "InitialInfected"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user