]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change minibomb to be explosion resistant and start timer on damage (#32429)
authorSaphire Lattice <lattice@saphi.re>
Mon, 7 Oct 2024 22:42:42 +0000 (04:42 +0600)
committerGitHub <noreply@github.com>
Mon, 7 Oct 2024 22:42:42 +0000 (00:42 +0200)
* Make minibomb explosion resistant and trigger timer on damage

* Tune damage behaviour and threshold for minibomb

Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml

diff --git a/Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs
new file mode 100644 (file)
index 0000000..97a5f8b
--- /dev/null
@@ -0,0 +1,10 @@
+namespace Content.Server.Destructible.Thresholds.Behaviors;
+
+[DataDefinition]
+public sealed partial class TimerStartBehavior : IThresholdBehavior
+{
+    public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
+    {
+        system.TriggerSystem.StartTimer(owner, cause);
+    }
+}
index a279c56378f28b1df3a7d1d7c096171a11b79d17..8f253097abc3cd73f237848e82f30d6e5f5fee1a 100644 (file)
   components:
   - type: Sprite
     sprite: Objects/Weapons/Grenades/syndgrenade.rsi
+  - type: ExplosionResistance
+    damageCoefficient: 0.1
+  - type: Destructible
+    thresholds:
+    - trigger:
+        !type:DamageTrigger
+        damage: 10
+      behaviors:
+      - !type:TimerStartBehavior
+    - trigger:
+        !type:DamageTrigger
+        damage: 45
+      behaviors:
+      - !type:TriggerBehavior
+      - !type:DoActsBehavior
+        acts: ["Destruction"]
   - type: OnUseTimerTrigger
     delay: 5
   - type: ExplodeOnTrigger