Scale other needed metabolism reagents (#12005)

Closes https://github.com/space-wizards/space-station-14/issues/7434
This commit is contained in:
Rane
2022-12-21 09:51:49 -05:00
committed by GitHub
parent 571802f75d
commit 8613d40aa1
23 changed files with 82 additions and 26 deletions

View File

@@ -152,10 +152,13 @@ namespace Content.Server.Body.Systems
if (entry.MetabolismRate > mostToRemove)
mostToRemove = entry.MetabolismRate;
mostToRemove *= group.MetabolismRateModifier;
mostToRemove = FixedPoint2.Clamp(mostToRemove, 0, reagent.Quantity);
float scale = (float) mostToRemove / (float) entry.MetabolismRate;
// 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
@@ -167,7 +170,7 @@ namespace Content.Server.Body.Systems
var actualEntity = organ?.Body ?? solutionEntityUid.Value;
var args = new ReagentEffectArgs(actualEntity, (meta).Owner, solution, proto, mostToRemove,
EntityManager, null, entry);
EntityManager, null, scale);
// do all effects, if conditions apply
foreach (var effect in entry.Effects)