SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
+ SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
}
/// <summary>
SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
+ SubscribeLocalEvent<InitialInfectedComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
}
private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
/// </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))
--- /dev/null
+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;
+}
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
},
{
"name": "Visitor"
+ },
+ {
+ "name": "InitialInfected"
}
]
}