2021-09-06 15:49:44 +02:00
using Content.Shared.Chemistry.Components ;
2021-06-09 22:19:39 +02:00
using Content.Shared.Chemistry.Reaction ;
using Content.Shared.Chemistry.Reagent ;
2021-11-28 14:56:53 +01:00
using Content.Shared.Database ;
2021-11-03 16:48:03 -07:00
using Content.Shared.FixedPoint ;
2021-03-21 09:12:03 -07:00
using Robust.Shared.Audio ;
2021-02-11 01:13:03 -08:00
using Robust.Shared.GameObjects ;
2021-03-21 09:12:03 -07:00
using Robust.Shared.Player ;
2021-01-14 01:06:23 -06:00
2021-06-09 22:19:39 +02:00
namespace Content.Server.Chemistry.EntitySystems
2021-01-14 01:06:23 -06:00
{
2022-02-16 00:23:23 -07:00
public sealed class ChemicalReactionSystem : SharedChemicalReactionSystem
2021-01-14 01:06:23 -06:00
{
2022-01-09 20:10:36 -08:00
protected override void OnReaction ( Solution solution , ReactionPrototype reaction , ReagentPrototype randomReagent , EntityUid owner , FixedPoint2 unitReactions )
2021-01-14 01:06:23 -06:00
{
2022-01-09 20:10:36 -08:00
base . OnReaction ( solution , reaction , randomReagent , owner , unitReactions ) ;
2021-12-05 18:09:01 +01:00
2022-01-09 20:10:36 -08:00
var coordinates = Transform ( owner ) . Coordinates ;
2021-01-14 01:06:23 -06:00
2021-11-22 23:51:43 -07:00
_logSystem . Add ( LogType . ChemicalReaction , reaction . Impact ,
2022-01-09 20:10:36 -08:00
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(owner):metabolizer} at {coordinates}" ) ;
2021-11-22 23:51:43 -07:00
2022-01-09 20:10:36 -08:00
SoundSystem . Play ( Filter . Pvs ( owner , entityManager : EntityManager ) , reaction . Sound . GetSound ( ) , owner ) ;
2021-01-14 01:06:23 -06:00
}
}
}