]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Adds construction effect to RCD (#22633)
authorchromiumboy <50505512+chromiumboy@users.noreply.github.com>
Sun, 17 Dec 2023 16:08:59 +0000 (10:08 -0600)
committerGitHub <noreply@github.com>
Sun, 17 Dec 2023 16:08:59 +0000 (11:08 -0500)
Content.Shared/RCD/Systems/RCDSystem.cs
Resources/Prototypes/Entities/Effects/rcd.yml [new file with mode: 0644]
Resources/Textures/Effects/rcd.rsi/construct.png [new file with mode: 0644]
Resources/Textures/Effects/rcd.rsi/meta.json [new file with mode: 0644]

index d7126716ed1268f01545d9f92a26ca28ee06e7dc..402b424fb6dcc15bbdf137dd5c5bcb3a6e8147f7 100644 (file)
@@ -38,6 +38,7 @@ public sealed class RCDSystem : EntitySystem
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly TurfSystem _turf = default!;
+    [Dependency] private readonly IGameTiming _gameTiming = default!;
 
     private readonly int RcdModeCount = Enum.GetValues(typeof(RcdMode)).Length;
 
@@ -110,7 +111,9 @@ public sealed class RCDSystem : EntitySystem
         };
 
         args.Handled = true;
-        _doAfter.TryStartDoAfter(doAfterArgs);
+
+        if (_doAfter.TryStartDoAfter(doAfterArgs) && _gameTiming.IsFirstTimePredicted)
+            Spawn("EffectRCDConstruction", location);
     }
 
     private void OnDoAfterAttempt(EntityUid uid, RCDComponent comp, DoAfterAttemptEvent<RCDDoAfterEvent> args)
diff --git a/Resources/Prototypes/Entities/Effects/rcd.yml b/Resources/Prototypes/Entities/Effects/rcd.yml
new file mode 100644 (file)
index 0000000..adc6aa5
--- /dev/null
@@ -0,0 +1,16 @@
+- type: entity
+  id: EffectRCDConstruction
+  noSpawn: true
+  components:
+  - type: Transform
+    anchored: True
+  - type: Sprite
+    drawdepth: Effects
+    sprite: /Textures/Effects/rcd.rsi
+    state: construct
+  - type: TimedDespawn
+    lifetime: 3.2
+  - type: Tag
+    tags:
+    - HideContextMenu
+  - type: AnimationPlayer
diff --git a/Resources/Textures/Effects/rcd.rsi/construct.png b/Resources/Textures/Effects/rcd.rsi/construct.png
new file mode 100644 (file)
index 0000000..f4be36c
Binary files /dev/null and b/Resources/Textures/Effects/rcd.rsi/construct.png differ
diff --git a/Resources/Textures/Effects/rcd.rsi/meta.json b/Resources/Textures/Effects/rcd.rsi/meta.json
new file mode 100644 (file)
index 0000000..5004a9c
--- /dev/null
@@ -0,0 +1,50 @@
+{
+    "version": 1,
+    "size": {
+        "x": 32,
+        "y": 32
+    },
+    "license": "CC-BY-SA-3.0",
+    "copyright": "Taken from tgStation at commit https://github.com/tgstation/tgstation/commit/d75cbd0a2900fdec4c12cd5ba986b52ccff03713/icons/effects/effects_rcd.dmi",
+    "states": [
+        {
+            "name": "construct",
+            "delays": [
+                [
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1
+                ]
+            ]
+        }
+    ]
+}