Files
tbd-station-14/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs
wrexbe 1e0babbd50 Make AdminLogsSystem an IoC manager (#8492)
* Make log not entity system

* Fixes
2022-05-28 23:41:17 -07:00

26 lines
1.1 KiB
C#

using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.Player;
namespace Content.Server.Chemistry.EntitySystems
{
public sealed class ChemicalReactionSystem : SharedChemicalReactionSystem
{
protected override void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid owner, FixedPoint2 unitReactions)
{
base.OnReaction(solution, reaction, randomReagent, owner, unitReactions);
var coordinates = Transform(owner).Coordinates;
_adminLogger.Add(LogType.ChemicalReaction, reaction.Impact,
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(owner):metabolizer} at {coordinates}");
SoundSystem.Play(Filter.Pvs(owner, entityManager:EntityManager), reaction.Sound.GetSound(), owner);
}
}
}