Files
crystall-punk-14/Content.Server/Destructible/Thresholds/Behaviors/ChangeConstructionNodeBehavior.cs
Chief-Engineer 95e35b94b5 Improve explosion logs (#13351)
* add types to explosion logs

* make explosions logged by default

* add cause parameter to IThresholdBehavior

* add cause to ExplodeBehaviors

* add cause to power cell explosions

* remove useless log

* add triggerer to triggers

* add logs for damage from explosions

* sneaky power cell update
2023-02-10 23:45:38 +00:00

21 lines
699 B
C#

using Content.Server.Construction.Components;
namespace Content.Server.Destructible.Thresholds.Behaviors
{
[Serializable]
[DataDefinition]
public sealed class ChangeConstructionNodeBehavior : IThresholdBehavior
{
[DataField("node")]
public string Node { get; private set; } = string.Empty;
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
{
if (string.IsNullOrEmpty(Node) || !system.EntityManager.TryGetComponent(owner, out ConstructionComponent? construction))
return;
system.ConstructionSystem.ChangeNode(owner, null, Node, true, construction);
}
}
}