Files
tbd-station-14/Content.Server/Chemistry/EntitySystems/ChemicalReactionSystem.cs
2021-12-05 18:09:01 +01:00

27 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.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.Chemistry.EntitySystems
{
public 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 = EntityManager.GetComponent<TransformComponent>(Owner);
_logSystem.Add(LogType.ChemicalReaction, reaction.Impact,
$"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {Owner} at {coordinates}");
SoundSystem.Play(Filter.Pvs(Owner, entityManager:EntityManager), reaction.Sound.GetSound(), Owner);
}
}
}