Generalize ReagentUnit into FixedPoint2 and use it for damage calculations (#5151)

* Damage units

* sum ext method
This commit is contained in:
mirrorcult
2021-11-03 16:48:03 -07:00
committed by GitHub
parent 8165d8f38c
commit 3ab4a30a0f
100 changed files with 730 additions and 601 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.FixedPoint;
using Content.Shared.MobState.State;
using Robust.Shared.GameObjects;
@@ -16,34 +17,34 @@ namespace Content.Shared.MobState
bool IsIncapacitated();
(IMobState state, int threshold)? GetEarliestIncapacitatedState(int minimumDamage);
(IMobState state, FixedPoint2 threshold)? GetEarliestIncapacitatedState(FixedPoint2 minimumDamage);
(IMobState state, int threshold)? GetEarliestCriticalState(int minimumDamage);
(IMobState state, FixedPoint2 threshold)? GetEarliestCriticalState(FixedPoint2 minimumDamage);
(IMobState state, int threshold)? GetEarliestDeadState(int minimumDamage);
(IMobState state, FixedPoint2 threshold)? GetEarliestDeadState(FixedPoint2 minimumDamage);
(IMobState state, int threshold)? GetPreviousCriticalState(int maximumDamage);
(IMobState state, FixedPoint2 threshold)? GetPreviousCriticalState(FixedPoint2 maximumDamage);
bool TryGetEarliestIncapacitatedState(
int minimumDamage,
FixedPoint2 minimumDamage,
[NotNullWhen(true)] out IMobState? state,
out int threshold);
out FixedPoint2 threshold);
bool TryGetEarliestCriticalState(
int minimumDamage,
FixedPoint2 minimumDamage,
[NotNullWhen(true)] out IMobState? state,
out int threshold);
out FixedPoint2 threshold);
bool TryGetEarliestDeadState(
int minimumDamage,
FixedPoint2 minimumDamage,
[NotNullWhen(true)] out IMobState? state,
out int threshold);
out FixedPoint2 threshold);
bool TryGetPreviousCriticalState(
int maximumDamage,
FixedPoint2 maximumDamage,
[NotNullWhen(true)] out IMobState? state,
out int threshold);
out FixedPoint2 threshold);
void UpdateState(int damage);
void UpdateState(FixedPoint2 damage);
}
}