Refactor reaction effects to use reagent effects (#5426)

* reaction effect refactor

* works now
This commit is contained in:
mirrorcult
2021-11-21 00:35:02 -07:00
committed by GitHub
parent 9b39838db7
commit 1ab7170adb
36 changed files with 83 additions and 82 deletions

View File

@@ -30,7 +30,7 @@ namespace Content.Shared.Chemistry.Reagent
[DataField("probability")]
public float Probability = 1.0f;
public abstract void Metabolize(ReagentEffectArgs args);
public abstract void Effect(ReagentEffectArgs args);
}
public static class ReagentEffectExt
@@ -41,11 +41,6 @@ namespace Content.Shared.Chemistry.Reagent
if (random == null)
random = IoCManager.Resolve<IRobustRandom>();
// Make sure we still have enough reagent to go...
if (args.Source != null && !args.Source.ContainsReagent(args.Reagent.ID))
return false;
if (effect.Probability < 1.0f && !random.Prob(effect.Probability))
return false;
@@ -74,7 +69,7 @@ namespace Content.Shared.Chemistry.Reagent
EntityUid? OrganEntity,
Solution? Source,
ReagentPrototype Reagent,
FixedPoint2 Metabolizing,
FixedPoint2 Quantity,
IEntityManager EntityManager,
ReactionMethod? Method
);