diff --git a/Content.Client/ADT/NovakidFeatures/NovakidFeaturesSystem.cs b/Content.Client/ADT/NovakidFeatures/NovakidFeaturesSystem.cs new file mode 100644 index 00000000000..9db37abafca --- /dev/null +++ b/Content.Client/ADT/NovakidFeatures/NovakidFeaturesSystem.cs @@ -0,0 +1,31 @@ +using Content.Shared.ADT.NovakidFeatures; +using Robust.Client.GameObjects; + +namespace Content.Client.ADT.NovakidFeatures; +public sealed partial class NovakidFeaturesSystem : EntitySystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly PointLightSystem _lights = default!; + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnEntityInit); + } + /// + /// Makes Novakid to glow with color of his skin — layer number 0 of SpriteComponent. + /// + /// Novakid + /// Компонент отвечающий за свечение новакида. Вообще-то говоря он нужен пока только для того, чтобы не пришлось перебирать сущности в поисках новакида. + /// + private void OnEntityInit(EntityUid uid, NovakidGlowingComponent component, ComponentInit args) + { + _entityManager.GetComponent(uid).TryGetLayer(0, out var layer); + + component.GlowingColor = _entityManager.GetComponent(uid).Color; + if (layer == null) return; + _lights.SetColor(uid, layer.Color); + //_lights.SetEnergy(uid, 0.6f); + _entityManager.Dirty(_entityManager.GetComponent(uid)); + } +} diff --git a/Content.Shared/ADT/NovakidFeatures/NovakidGlowingComponent.cs b/Content.Shared/ADT/NovakidFeatures/NovakidGlowingComponent.cs new file mode 100644 index 00000000000..b39ddf42cb2 --- /dev/null +++ b/Content.Shared/ADT/NovakidFeatures/NovakidGlowingComponent.cs @@ -0,0 +1,13 @@ +namespace Content.Shared.ADT.NovakidFeatures; + +[RegisterComponent] +public sealed partial class NovakidGlowingComponent : Component +{ + [DataField] + public Color GlowingColor; + + NovakidGlowingComponent(Color color) + { + GlowingColor = color; + } +} diff --git a/Resources/Changelog/ChangelogADT.yml b/Resources/Changelog/ChangelogADT.yml index ea5f2f245c7..99604632792 100644 --- a/Resources/Changelog/ChangelogADT.yml +++ b/Resources/Changelog/ChangelogADT.yml @@ -664,3 +664,10 @@ Entries: - {message: Колесо эмоций., type: Add} id: 55621 #костыль отображения в Обновлениях time: '2023-12-05T04:20:00.0000000+00:00' + +- author: modern.df + changes: + - {message: Исправление свечения новакидов, type: Add} + - {message: Теперь они светятся оттенком их собственного цвета кожи, как и задумывалось., type: Fix} + id: 55615 #костыль отображения в Обновлениях + time: '2023-12-06T22:20:00.0000000+00:00' diff --git a/Resources/Prototypes/ADT/Novakid/Mobs/Species/novakid.yml b/Resources/Prototypes/ADT/Novakid/Mobs/Species/novakid.yml index fad0500a4c6..f56d23f4f23 100644 --- a/Resources/Prototypes/ADT/Novakid/Mobs/Species/novakid.yml +++ b/Resources/Prototypes/ADT/Novakid/Mobs/Species/novakid.yml @@ -12,6 +12,7 @@ bloodReagent: Plasma - type: ZombieImmune - type: Thirst + - type: NovakidGlowing # see NovakidFeaturesSystem.cs - type: PointLight color: "#ffffff" energy: 0.6