]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Wearable Wet Floor Sign and 'Janitorial Suicide Vest' (#20311)
authorPsychpsyo <60073468+Psychpsyo@users.noreply.github.com>
Thu, 28 Sep 2023 04:09:44 +0000 (06:09 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Sep 2023 04:09:44 +0000 (00:09 -0400)
* Explosive wet floor sign & janitorial suicide vest

* fix attributions

* Remove name & desc from explosive wet floor sign

* Make wet floor sign chameleonable

Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs
Resources/Audio/Items/Janitor/floor_sign_beep.ogg [new file with mode: 0644]
Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl
Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/caution.png [deleted file]
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/equipped-OUTERCLOTHING.png [new file with mode: 0644]
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-left.png
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-right.png
Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/meta.json

index 008bbbe284b517b2bb7be149af212ff8758bd61e..f2e94239a03392d565edf6ea133010ea55fd2649 100644 (file)
@@ -29,6 +29,12 @@ namespace Content.Server.Explosion.Components
         [DataField("beepInterval")]
         public float BeepInterval = 1;
 
+        /// <summary>
+        ///     Whether the timer should instead be activated through a verb in the right-click menu
+        /// </summary>
+        [DataField("useVerbInstead")]
+        public bool UseVerbInstead = false;
+
         /// <summary>
         ///     Should timer be started when it was stuck to another entity.
         ///     Used for C4 charges and similar behaviour.
index 1a3323b1ce21097b65204a3b43f8ccb699806877..fb1f72eb445be10feeb8b4509ea710531652a675 100644 (file)
@@ -48,6 +48,32 @@ public sealed partial class TriggerSystem
         if (!args.CanInteract || !args.CanAccess)
             return;
 
+        if (component.UseVerbInstead)
+        {
+            args.Verbs.Add(new AlternativeVerb()
+            {
+                Text = Loc.GetString("verb-start-detonation"),
+                Act = () => HandleTimerTrigger(
+                    uid,
+                    args.User,
+                    component.Delay,
+                    component.BeepInterval,
+                    component.InitialBeepDelay,
+                    component.BeepSound
+                ),
+                Priority = 2
+            });
+        }
+
+        if (component.AllowToggleStartOnStick)
+        {
+            args.Verbs.Add(new AlternativeVerb()
+            {
+                Text = Loc.GetString("verb-toggle-start-on-stick"),
+                Act = () => ToggleStartOnStick(uid, args.User, component)
+            });
+        }
+
         if (component.DelayOptions == null || component.DelayOptions.Count == 1)
             return;
 
@@ -86,15 +112,6 @@ public sealed partial class TriggerSystem
                 },
             });
         }
-
-        if (component.AllowToggleStartOnStick)
-        {
-            args.Verbs.Add(new AlternativeVerb()
-            {
-                Text = Loc.GetString("verb-toggle-start-on-stick"),
-                Act = () => ToggleStartOnStick(uid, args.User, component)
-            });
-        }
     }
 
     private void CycleDelay(OnUseTimerTriggerComponent component, EntityUid user)
@@ -140,7 +157,7 @@ public sealed partial class TriggerSystem
 
     private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args)
     {
-        if (args.Handled || HasComp<AutomatedTimerComponent>(uid))
+        if (args.Handled || HasComp<AutomatedTimerComponent>(uid) || component.UseVerbInstead)
             return;
 
         HandleTimerTrigger(
diff --git a/Resources/Audio/Items/Janitor/floor_sign_beep.ogg b/Resources/Audio/Items/Janitor/floor_sign_beep.ogg
new file mode 100644 (file)
index 0000000..25f68be
Binary files /dev/null and b/Resources/Audio/Items/Janitor/floor_sign_beep.ogg differ
index 76861c8b4febc83fb8247cca5f17f6b65b40f49a..77e2dd938d6e00c6ff3b4bdb9095e627ca9a2ae6 100644 (file)
@@ -7,6 +7,8 @@ examine-trigger-timer = The timer is set to {$time} seconds.
 
 popup-trigger-timer-set = Timer set to {$time} seconds.
 
+verb-start-detonation = Start detonation
+
 verb-toggle-start-on-stick = Toggle auto-activation
 popup-start-on-stick-off = The device will no longer activate automatically when planted
 popup-start-on-stick-on = The device will now activate automatically when planted
index 13bd6d1665074ef67f77a37054a9769808972d98..3ae89e0d1c02fda62f8a7199806e255d0377f40f 100644 (file)
 - type: entity
   name: wet floor sign
   id: WetFloorSign
-  parent: BaseItem
+  parent: ClothingOuterBase
   description: Caution! Wet Floor!
   components:
   - type: Sprite
     sprite: Objects/Specific/Janitorial/wet_floor_sign.rsi
-    state: caution
   - type: Item
     sprite: Objects/Specific/Janitorial/wet_floor_sign.rsi
     size: 15
+  - type: Armor
+    modifiers:
+      coefficients:
+        Blunt: 0.95
+        Slash: 0.95
   - type: Tag
     tags:
       - WetFloorSign
+      - WhitelistChameleon
 
 
 - type: entity
-  name: wet floor sign
   suffix: Explosive
-  description: Caution! Wet Floor!
-  parent: BaseItem
+  parent: WetFloorSign
   id: WetFloorSignMineExplosive
   components:
-  - type: Sprite
-    sprite: Objects/Specific/Janitorial/wet_floor_sign.rsi
-    state: caution
-  - type: Item
-    sprite: Objects/Specific/Janitorial/wet_floor_sign.rsi
-    size: 15
   - type: StepTrigger
     intersectRatio: 0.2
     requiredTriggeredSpeed: 0
     totalIntensity: 60 # about a ~3 tile radius
     canCreateVacuum: false
   - type: DeleteOnTrigger
+  - type: OnUseTimerTrigger
+    useVerbInstead: true
+    beepInterval: .25
+    beepSound: /Audio/Items/Janitor/floor_sign_beep.ogg
+    params:
+      volume: 1
+    examinable: false
+  - type: Tag
+    tags: # ignore "WhitelistChameleon" tag
+      - WetFloorSign
 
 - type: entity
   name: janitorial trolley
diff --git a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/caution.png b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/caution.png
deleted file mode 100644 (file)
index fdd5c1d..0000000
Binary files a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/caution.png and /dev/null differ
diff --git a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/equipped-OUTERCLOTHING.png b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/equipped-OUTERCLOTHING.png
new file mode 100644 (file)
index 0000000..96667a7
Binary files /dev/null and b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/equipped-OUTERCLOTHING.png differ
diff --git a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/icon.png b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/icon.png
new file mode 100644 (file)
index 0000000..204e8b8
Binary files /dev/null and b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/icon.png differ
index aa3d9fc9c14305c8351f12b5b8e2d8f169c51440..ed1e8946e7c2fee658d9809091e2fc75de989e08 100644 (file)
Binary files a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-left.png and b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-left.png differ
index 286dec22cd18ee027898194451cfc531f3449254..355d215fcd7cf13eddc7539386a45d99aea9d687 100644 (file)
Binary files a/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-right.png and b/Resources/Textures/Objects/Specific/Janitorial/wet_floor_sign.rsi/inhand-right.png differ
index bc202f443a95610eaf78eff3888beb9280a7bf4d..75c381313e4e90d955c9bcad25e2823502845eae 100644 (file)
@@ -1,14 +1,18 @@
 {
   "version": 1,
   "license": "CC-BY-SA-3.0",
-  "copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/f8f4aeda930fcd0805ca4cc76d9bc9412a5b3428",
+  "copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/da42afcbaeaa04e5ba288ade027c011efb3ef0ab, modified by Skarlet and Psychpsyo",
   "size": {
     "x": 32,
     "y": 32
   },
   "states": [
     {
-      "name": "caution"
+      "name": "icon"
+    },
+    {
+      "name": "equipped-OUTERCLOTHING",
+      "directions": 4
     },
     {
       "name": "inhand-left",