Fix macro durations and trained perfection

This commit is contained in:
Asriel Camora
2024-07-04 09:18:35 -07:00
parent 06ff82a8ca
commit 65d01aeed0
11 changed files with 27 additions and 25 deletions
+3 -10
View File
@@ -17,7 +17,7 @@ public record struct Effects
public byte MuscleMemory;
public byte Manipulation;
public byte Expedience;
public byte TrainedPerfection;
public bool TrainedPerfection;
public bool HeartAndSoul;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -57,7 +57,7 @@ public record struct Effects
Expedience = duration;
break;
case EffectType.TrainedPerfection:
TrainedPerfection = duration;
TrainedPerfection = duration != 0;
break;
case EffectType.HeartAndSoul:
HeartAndSoul = duration != 0;
@@ -87,16 +87,11 @@ public record struct Effects
EffectType.MuscleMemory => MuscleMemory,
EffectType.Manipulation => Manipulation,
EffectType.Expedience => Expedience,
EffectType.TrainedPerfection => TrainedPerfection,
EffectType.TrainedPerfection => (byte)(TrainedPerfection ? 1 : 0),
EffectType.HeartAndSoul => (byte)(HeartAndSoul ? 1 : 0),
_ => 0
};
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsIndefinite(EffectType effect) =>
effect is EffectType.InnerQuiet or EffectType.HeartAndSoul;
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly byte GetStrength(EffectType effect) =>
@@ -129,7 +124,5 @@ public record struct Effects
Manipulation--;
if (Expedience > 0)
Expedience--;
if (TrainedPerfection > 0)
TrainedPerfection--;
}
}