From f22f9e39c5e9af1a8f622e12eb2f916b69c6be22 Mon Sep 17 00:00:00 2001 From: Saphire Lattice Date: Tue, 8 Oct 2024 04:42:42 +0600 Subject: [PATCH] Change minibomb to be explosion resistant and start timer on damage (#32429) * Make minibomb explosion resistant and trigger timer on damage * Tune damage behaviour and threshold for minibomb --- .../Thresholds/Behaviors/TimerStartBehavior.cs | 10 ++++++++++ .../Objects/Weapons/Throwable/grenades.yml | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs diff --git a/Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs new file mode 100644 index 0000000000..97a5f8b7ef --- /dev/null +++ b/Content.Server/Destructible/Thresholds/Behaviors/TimerStartBehavior.cs @@ -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); + } +} diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index a279c56378..8f253097ab 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -106,6 +106,22 @@ 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