Revert "epic Respiration Rework" (#6524)

This commit is contained in:
Leon Friedrich
2022-02-07 20:13:14 +13:00
committed by GitHub
parent 35eb6f8576
commit 6e8c92d13e
32 changed files with 585 additions and 595 deletions

View File

@@ -77,8 +77,6 @@ namespace Content.Server.Body.Systems
// First step is get the solution we actually care about
Solution? solution = null;
EntityUid? solutionEntityUid = null;
EntityUid? bodyEntityUid = mech?.Body?.Owner;
SolutionContainerManagerComponent? manager = null;
if (meta.SolutionOnBody)
@@ -146,10 +144,6 @@ namespace Content.Server.Body.Systems
if (entry.MetabolismRate > mostToRemove)
mostToRemove = entry.MetabolismRate;
mostToRemove *= group.MetabolismRateModifier;
mostToRemove = FixedPoint2.Clamp(mostToRemove, 0, reagent.Quantity);
// if it's possible for them to be dead, and they are,
// then we shouldn't process any effects, but should probably
// still remove reagents
@@ -159,8 +153,7 @@ namespace Content.Server.Body.Systems
continue;
}
var actualEntity = bodyEntityUid != null ? bodyEntityUid.Value : solutionEntityUid.Value;
var args = new ReagentEffectArgs(actualEntity, (meta).Owner, solution, proto, mostToRemove,
var args = new ReagentEffectArgs(solutionEntityUid.Value, (meta).Owner, solution, proto, entry.MetabolismRate,
EntityManager, null);
// do all effects, if conditions apply
@@ -171,8 +164,9 @@ namespace Content.Server.Body.Systems
if (effect.ShouldLog)
{
var entity = args.SolutionEntity;
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
$"Metabolism effect {effect.GetType().Name:effect} of reagent {args.Reagent.Name:reagent} applied on entity {actualEntity:entity} at {Transform(actualEntity).Coordinates:coordinates}");
$"Metabolism effect {effect.GetType().Name:effect} of reagent {args.Reagent.Name:reagent} applied on entity {entity} at {Transform(entity).Coordinates:coordinates}");
}
effect.Effect(args);