]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
add: Dragon rift color changes based on charge (#36216)
authorqwerltaz <msmarcinpl@gmail.com>
Wed, 2 Apr 2025 18:37:34 +0000 (20:37 +0200)
committerGitHub <noreply@github.com>
Wed, 2 Apr 2025 18:37:34 +0000 (14:37 -0400)
* use dragon rift sprite colours

* Entity<T>

Content.Server/Dragon/DragonRiftSystem.cs

index 998834835effd10a4b0fdb4365ac0e3fd5a68d6c..9cab018fd79935eaaf4efe9eafdefa11147c16f1 100644 (file)
@@ -13,6 +13,7 @@ using Robust.Shared.Serialization.Manager;
 using System.Numerics;
 using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
+using Robust.Shared.GameStates;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Dragon;
@@ -33,11 +34,20 @@ public sealed class DragonRiftSystem : EntitySystem
     {
         base.Initialize();
 
+        SubscribeLocalEvent<DragonRiftComponent, ComponentGetState>(OnGetState);
         SubscribeLocalEvent<DragonRiftComponent, ExaminedEvent>(OnExamined);
         SubscribeLocalEvent<DragonRiftComponent, AnchorStateChangedEvent>(OnAnchorChange);
         SubscribeLocalEvent<DragonRiftComponent, ComponentShutdown>(OnShutdown);
     }
 
+    private void OnGetState(Entity<DragonRiftComponent> ent, ref ComponentGetState args)
+    {
+        args.State = new DragonRiftComponentState
+        {
+            State = ent.Comp.State,
+        };
+    }
+
     public override void Update(float frameTime)
     {
         base.Update(frameTime);