Make Reactions conserve thermal energy (#16190)

This commit is contained in:
Leon Friedrich
2023-05-13 15:10:32 +12:00
committed by GitHub
parent 99fceaf2e4
commit 0c4002bbd3
13 changed files with 70 additions and 79 deletions

View File

@@ -1,25 +0,0 @@
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(reaction.Sound.GetSound(), Filter.Pvs(owner, entityManager:EntityManager), owner);
}
}
}

View File

@@ -34,7 +34,7 @@ public sealed class SolutionChangedEvent : EntityEventArgs
public sealed partial class SolutionContainerSystem : EntitySystem
{
[Dependency]
private readonly SharedChemicalReactionSystem _chemistrySystem = default!;
private readonly ChemicalReactionSystem _chemistrySystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;