Minor proc changes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace Craftimizer.Simulator;
|
||||
|
||||
public enum ActionProc : byte
|
||||
{
|
||||
None,
|
||||
UsedBasicTouch,
|
||||
AdvancedTouch
|
||||
}
|
||||
@@ -7,22 +7,21 @@ namespace Craftimizer.Simulator;
|
||||
[StructLayout(LayoutKind.Auto)]
|
||||
public record struct ActionStates
|
||||
{
|
||||
public byte TouchComboIdx;
|
||||
public ActionProc Combo;
|
||||
public byte CarefulObservationCount;
|
||||
public bool UsedHeartAndSoul;
|
||||
public bool UsedQuickInnovation;
|
||||
public bool UsedTrainedPerfection;
|
||||
public bool ObserveCombo;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void MutateState(BaseAction baseAction)
|
||||
{
|
||||
if (baseAction is BasicTouch)
|
||||
TouchComboIdx = 1;
|
||||
else if (TouchComboIdx == 1 && baseAction is StandardTouch)
|
||||
TouchComboIdx = 2;
|
||||
Combo = ActionProc.UsedBasicTouch;
|
||||
else if ((Combo == ActionProc.UsedBasicTouch && baseAction is StandardTouch) || baseAction is Observe)
|
||||
Combo = ActionProc.AdvancedTouch;
|
||||
else
|
||||
TouchComboIdx = 0;
|
||||
Combo = ActionProc.None;
|
||||
|
||||
if (baseAction is CarefulObservation)
|
||||
CarefulObservationCount++;
|
||||
@@ -35,7 +34,5 @@ public record struct ActionStates
|
||||
|
||||
if (baseAction is TrainedPerfection)
|
||||
UsedTrainedPerfection = true;
|
||||
|
||||
ObserveCombo = baseAction is Observe;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ internal sealed class AdvancedTouch() : BaseAction(
|
||||
defaultCPCost: 46, defaultEfficiency: 150)
|
||||
{
|
||||
public override int CPCost(Simulator s) =>
|
||||
(s.ActionStates.TouchComboIdx == 2 || s.ActionStates.ObserveCombo) ? 18 : 46;
|
||||
(s.ActionStates.Combo == ActionProc.AdvancedTouch) ? 18 : 46;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ internal sealed class RefinedTouch() : BaseAction(
|
||||
public override void UseSuccess(Simulator s)
|
||||
{
|
||||
base.UseSuccess(s);
|
||||
if (s.ActionStates.TouchComboIdx == 1)
|
||||
if (s.ActionStates.Combo == ActionProc.UsedBasicTouch)
|
||||
s.StrengthenEffect(EffectType.InnerQuiet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ internal sealed class StandardTouch() : BaseAction(
|
||||
)
|
||||
{
|
||||
public override int CPCost(Simulator s) =>
|
||||
s.ActionStates.TouchComboIdx == 1 ? 18 : 32;
|
||||
s.ActionStates.Combo == ActionProc.UsedBasicTouch ? 18 : 32;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user