mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
* initial visual nubody * oops overlay * im so pheeming rn * conversion... * tests * comeback of the underwear * oops eyes * blabbl * zeds * yaml linted * search and visible count constraints * reordering * preserve previously selected markings colors * fix test * some ui niceties * ordering * make DB changes backwards-compatible/downgrade-friendly * fix things again * fix migration * vulpkanin markings limit increase * wrapping * code cleanup and more code cleanup and more code cleanup and more code cleanup and * fix slop ports * better sampling API * make filter work + use the method i made for its intended purpose * fix test fails real quick * magic mirror cleanup, remove TODO * don't 0-init the organ profile data * remove deltastates --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System.Linq;
|
|
using Content.Shared.Body;
|
|
using Content.Shared.Ghost;
|
|
using Content.Shared.StatusIcon;
|
|
using Content.Shared.StatusIcon.Components;
|
|
using Content.Shared.Zombies;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Zombies;
|
|
|
|
public sealed class ZombieSystem : SharedZombieSystem
|
|
{
|
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
|
[Dependency] private readonly SpriteSystem _sprite = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
|
|
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetZombieIcon);
|
|
SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetInitialInfectedIcon);
|
|
}
|
|
|
|
private void GetZombieIcon(Entity<ZombieComponent> ent, ref GetStatusIconsEvent args)
|
|
{
|
|
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
|
|
args.StatusIcons.Add(iconPrototype);
|
|
}
|
|
|
|
private void GetInitialInfectedIcon(Entity<InitialInfectedComponent> ent, ref GetStatusIconsEvent args)
|
|
{
|
|
if (HasComp<ZombieComponent>(ent))
|
|
return;
|
|
|
|
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
|
|
args.StatusIcons.Add(iconPrototype);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
|
|
{
|
|
if (HasComp<VisualBodyComponent>(uid))
|
|
return;
|
|
|
|
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
|
return;
|
|
|
|
for (var i = 0; i < sprite.AllLayers.Count(); i++)
|
|
{
|
|
_sprite.LayerSetColor((uid, sprite), i, component.SkinColor);
|
|
}
|
|
}
|
|
}
|