forked from WWhiteDreamProject/wwdpublic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Port] Anti Grinch (WWhiteDreamProject#200)
* A very killsign christmas (#1045) * migrate --------- Co-authored-by: Piras314 <[email protected]>
- Loading branch information
1 parent
a4d7b75
commit 62b2728
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Content.Server/_White/Destructible/Thresholds/Behaviors/KillSignCauseBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}."); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters