diff --git a/Content.Server/Corvax/Elzuosa/ElzuosaColorComponent.cs b/Content.Server/Corvax/Elzuosa/ElzuosaColorComponent.cs index f76ec875f82..242a352e82a 100644 --- a/Content.Server/Corvax/Elzuosa/ElzuosaColorComponent.cs +++ b/Content.Server/Corvax/Elzuosa/ElzuosaColorComponent.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Robust.Shared.Audio; namespace Content.Server.Corvax.Elzuosa { diff --git a/Content.Server/Corvax/Elzuosa/ElzuosaColorSystem.cs b/Content.Server/Corvax/Elzuosa/ElzuosaColorSystem.cs index e0b30f322be..632708e7915 100644 --- a/Content.Server/Corvax/Elzuosa/ElzuosaColorSystem.cs +++ b/Content.Server/Corvax/Elzuosa/ElzuosaColorSystem.cs @@ -1,75 +1,37 @@ -using Content.Server.Humanoid; using Content.Shared.Humanoid; -using Content.Shared.Interaction; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Content.Server.Chat.Systems; -using Content.Shared.Light; -using Content.Shared.Light.Components; -using Content.Shared.Tools.Components; -using FastAccessors; +using Content.Shared.Preferences; using Robust.Server.GameObjects; -using Robust.Shared.Network; - +using Content.Server.GameTicking; namespace Content.Server.Corvax.Elzuosa { public sealed class ElzuosaColorSystem : EntitySystem { - [Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearance = default!; - [Dependency] private readonly SharedRgbLightControllerSystem _rgbSystem = default!; - [Dependency] private readonly SharedPointLightSystem _sharedPointLightSystem = default!; - [Dependency] private readonly INetManager _netManager = default!; + [Dependency] private readonly PointLightSystem _pointLightSystem = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnMapInit); - SubscribeLocalEvent(OnInteractUsing); - //SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnPlayerSpawn); } - private void OnMapInit(EntityUid uid, ElzuosaColorComponent comp, MapInitEvent args) + private void OnPlayerSpawn(EntityUid uid, ElzuosaColorComponent comp, PlayerSpawnCompleteEvent args) { if (!HasComp(uid)) return; - if (TryComp(uid, out var humanoid)) - { - var color = humanoid.SkinColor; - _sharedPointLightSystem.SetColor(uid, color); - } - } - /*private void OnInit(EntityUid uid, ElzuosaColorComponent comp, AfterAutoHandleStateEvent args) - { - if (!HasComp(uid)) + if (args == null) return; - if (TryComp(uid, out var humanoid)) - { - var color = humanoid.SkinColor; - _sharedPointLightSystem.SetColor(uid, color); - } - }*/ + var profile = args.Profile; + SetEntityPointLightColor(uid, profile); + } - private void OnInteractUsing(EntityUid uid, ElzuosaColorComponent comp, InteractUsingEvent args) + public void SetEntityPointLightColor(EntityUid uid, HumanoidCharacterProfile? profile) { - if (args.Handled) - return; - - if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.ContainsAny("Pulsing")) + if (profile == null) return; - args.Handled = true; - comp.Hacked = !comp.Hacked; + var color = profile.Appearance.SkinColor; + _pointLightSystem.SetColor(uid,color); - if (comp.Hacked) - { - var rgb = EnsureComp(uid); - _rgbSystem.SetCycleRate(uid, comp.CycleRate, rgb); - } - else - RemComp(uid); } } } diff --git a/Resources/Prototypes/Corvax/Entities/Mobs/Species/elzuosa.yml b/Resources/Prototypes/Corvax/Entities/Mobs/Species/elzuosa.yml index fd2073b70ca..94b628deaa1 100644 --- a/Resources/Prototypes/Corvax/Entities/Mobs/Species/elzuosa.yml +++ b/Resources/Prototypes/Corvax/Entities/Mobs/Species/elzuosa.yml @@ -4,6 +4,7 @@ name: Urist McElzuosa abstract: true components: + - type: ElzuosaColor - type: Hunger # Corvax-Frontier starvationDamage: types: