Turn ReagentEffects into generic EntityEffects (#28168)

* Oh the possibilities

* Merge fixes

* Forgot to remote LavaSystem oops

* Changed EntityEffectArgs to EntityEffectBaseArgs and EntityEffectReagentArgs

* Throw exception for unimplemented effectargs

* Remove Json and overrideable datafields

* Fix test issues

* Actually fix the compiling issue

* Fix comments and remove EntityEffectArgs (no longer used, replaced with EntityEffectBaseArgs)
This commit is contained in:
SlamBamActionman
2024-06-30 05:43:43 +02:00
committed by GitHub
parent 250109f0b4
commit b9fa941ca6
127 changed files with 2199 additions and 1978 deletions

View File

@@ -2,6 +2,7 @@ using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Database;
using Content.Shared.EntityEffects;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
@@ -197,9 +198,7 @@ namespace Content.Shared.Chemistry.Reaction
private void OnReaction(Entity<SolutionComponent> soln, ReactionPrototype reaction, ReagentPrototype? reagent, FixedPoint2 unitReactions)
{
var args = new ReagentEffectArgs(soln, null, soln.Comp.Solution,
reagent,
unitReactions, EntityManager, null, 1f);
var args = new EntityEffectReagentArgs(soln, EntityManager, null, soln.Comp.Solution, unitReactions, reagent, null, 1f);
var posFound = _transformSystem.TryGetMapOrGridCoordinates(soln, out var gridPos);
@@ -213,7 +212,7 @@ namespace Content.Shared.Chemistry.Reaction
if (effect.ShouldLog)
{
var entity = args.SolutionEntity;
var entity = args.TargetEntity;
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
$"Reaction effect {effect.GetType().Name:effect} of reaction {reaction.ID:reaction} applied on entity {ToPrettyString(entity):entity} at Pos:{(posFound ? $"{gridPos:coordinates}" : "[Grid or Map not Found")}");
}