From d630b63163c577c1b441c1737f64f13787d83ca8 Mon Sep 17 00:00:00 2001 From: Piras314 Date: Mon, 2 Dec 2024 16:31:27 -0500 Subject: [PATCH 1/2] A very killsign christmas (#1045) --- .../Behaviors/KillSignCauseBehavior.cs | 24 +++++++++++++++++ .../Entities/Objects/Decoration/flora.yml | 26 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs diff --git a/Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs b/Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs new file mode 100644 index 0000000000..8c47f8e8cf --- /dev/null +++ b/Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs @@ -0,0 +1,24 @@ +using Content.Server.Administration.Components; +using Content.Shared.Database; + +namespace Content.Server.Destructible.Thresholds.Behaviors +{ + [Serializable] + [DataDefinition] + public sealed partial class KillSignCauseBehavior : IThresholdBehavior + { + public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null) + { + if (cause == null) + return; + + var causeVal = cause.Value; + + if (!system.EntityManager.TryGetComponent(causeVal, out var killsignComp)) + { + system.EntityManager.AddComponent(causeVal); + system._adminLogger.Add(LogType.Trigger, LogImpact.High, $"{system.EntityManager.ToPrettyString(causeVal):entity} was Killsigned because they broke a Christmas tree: {system.EntityManager.ToPrettyString(owner):entity}."); + } + } + } +} diff --git a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml index 1bd86bf349..60c4d44d7d 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml @@ -490,6 +490,32 @@ receivedPopup: christmas-tree-got-gift deniedPopup: christmas-tree-no-gift requiredHoliday: FestiveSeason + - type: Destructible # Goobstation + thresholds: + - trigger: + !type:DamageTrigger + damage: 400 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:PlaySoundBehavior + sound: + path: /Audio/Effects/tree_fell.ogg + params: + volume: 5 + variation: 0.05 + - !type:KillSignCauseBehavior + - !type:DoActsBehavior + acts: [ "Destruction" ] + - !type:SpawnEntitiesBehavior + spawn: + Log: + min: 2 + max: 8 - type: entity parent: BaseTreeConifer From fa36c3306a5f8f478cbf8a587b9d43fe24881c65 Mon Sep 17 00:00:00 2001 From: PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com> Date: Wed, 25 Dec 2024 13:18:28 +0300 Subject: [PATCH 2/2] migrate --- .../Thresholds/Behaviors/KillSignCauseBehavior.cs | 0 Resources/Prototypes/Entities/Objects/Decoration/flora.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename Content.Server/{_Goobstation => _White}/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs (100%) diff --git a/Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs b/Content.Server/_White/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs similarity index 100% rename from Content.Server/_Goobstation/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs rename to Content.Server/_White/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs diff --git a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml index 60c4d44d7d..855789cb01 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml @@ -490,7 +490,7 @@ receivedPopup: christmas-tree-got-gift deniedPopup: christmas-tree-no-gift requiredHoliday: FestiveSeason - - type: Destructible # Goobstation + - type: Destructible # WWDP thresholds: - trigger: !type:DamageTrigger @@ -508,7 +508,7 @@ params: volume: 5 variation: 0.05 - - !type:KillSignCauseBehavior + - !type:KillSignCauseBehavior # Very funny, ho-ho-ho! - !type:DoActsBehavior acts: [ "Destruction" ] - !type:SpawnEntitiesBehavior