Skip to content

Commit

Permalink
[Port] Anti Grinch (WWhiteDreamProject#200)
Browse files Browse the repository at this point in the history
* A very killsign christmas (#1045)

* migrate

---------

Co-authored-by: Piras314 <[email protected]>
  • Loading branch information
PuroSlavKing and Piras314 authored Dec 25, 2024
1 parent a4d7b75 commit 62b2728
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<KillSignComponent>(causeVal, out var killsignComp))
{
system.EntityManager.AddComponent<KillSignComponent>(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}.");
}
}
}
}
26 changes: 26 additions & 0 deletions Resources/Prototypes/Entities/Objects/Decoration/flora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,32 @@
receivedPopup: christmas-tree-got-gift
deniedPopup: christmas-tree-no-gift
requiredHoliday: FestiveSeason
- type: Destructible # WWDP
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 # Very funny, ho-ho-ho!
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:SpawnEntitiesBehavior
spawn:
Log:
min: 2
max: 8

- type: entity
parent: BaseTreeConifer
Expand Down

0 comments on commit 62b2728

Please sign in to comment.