From 7fde051b1ae70b7766e5dc922c10731220131ab9 Mon Sep 17 00:00:00 2001 From: Saphire Date: Tue, 24 Sep 2024 12:37:26 +0600 Subject: [PATCH 1/2] Make minibomb explosion resistant and trigger timer on damage --- .../Thresholds/Behaviors/TimerStartBehavior.cs | 10 ++++++++++ .../Objects/Weapons/Throwable/grenades.yml | 15 +++++++++++++++ 2 files changed, 25 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 00000000000000..97a5f8b7ef5e86 --- /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 a279c56378f28b..3a04acf15efc50 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -106,6 +106,21 @@ 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: 20 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] - type: OnUseTimerTrigger delay: 5 - type: ExplodeOnTrigger From 58749a623f360ad2570f91beaf81659a15bf3da2 Mon Sep 17 00:00:00 2001 From: Saphire Date: Fri, 4 Oct 2024 17:04:58 +0600 Subject: [PATCH 2/2] Tune damage behaviour and threshold for minibomb --- .../Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index 3a04acf15efc50..8f253097abc3cd 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -117,8 +117,9 @@ - !type:TimerStartBehavior - trigger: !type:DamageTrigger - damage: 20 + damage: 45 behaviors: + - !type:TriggerBehavior - !type:DoActsBehavior acts: ["Destruction"] - type: OnUseTimerTrigger