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
This commit is contained in:
Chief-Engineer
2023-02-10 17:45:38 -06:00
committed by GitHub
parent 57275d97d3
commit 95e35b94b5
27 changed files with 71 additions and 46 deletions

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
[DataField("solution", required: true)]
public string Solution = default!;
public void Execute(EntityUid owner, DestructibleSystem system)
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
{
if (system.SolutionContainerSystem.TryGetSolution(owner, Solution, out var explodingSolution)
&& system.EntityManager.TryGetComponent(owner, out ExplosiveComponent? explosiveComponent))
@@ -39,7 +39,7 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
// Don't delete the object here - let other processes like physical damage from the
// explosion clean up the exploding object(s)
var explosiveTotalIntensity = explosiveComponent.TotalIntensity * explosionScaleFactor;
system.ExplosionSystem.TriggerExplosive(owner, explosiveComponent, false, explosiveTotalIntensity);
system.ExplosionSystem.TriggerExplosive(owner, explosiveComponent, false, explosiveTotalIntensity, user:cause);
}
}
}