2021-11-22 23:51:43 -07:00
using Content.Shared.Administration.Logs ;
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-12-03 14:20:34 +01:00
using Robust.Shared.IoC ;
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
{
public class ChemicalReactionSystem : SharedChemicalReactionSystem
{
2021-11-21 00:35:02 -07:00
protected override void OnReaction ( Solution solution , ReactionPrototype reaction , ReagentPrototype randomReagent , EntityUid ownerUid , FixedPoint2 unitReactions )
2021-01-14 01:06:23 -06:00
{
2021-11-21 00:35:02 -07:00
base . OnReaction ( solution , reaction , randomReagent , ownerUid , unitReactions ) ;
2021-01-14 01:06:23 -06:00
2021-11-22 23:51:43 -07:00
var entity = EntityManager . GetEntity ( ownerUid ) ;
_logSystem . Add ( LogType . ChemicalReaction , reaction . Impact ,
2021-12-03 14:20:34 +01:00
$"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {entity} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity.Uid).Coordinates}" ) ;
2021-11-22 23:51:43 -07:00
2021-11-09 11:51:17 +01:00
SoundSystem . Play ( Filter . Pvs ( ownerUid , entityManager : EntityManager ) , reaction . Sound . GetSound ( ) , ownerUid ) ;
2021-01-14 01:06:23 -06:00
}
}
}