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;
|
||||
}
|
||||
|
||||
+4
-4
@@ -84,12 +84,12 @@ internal sealed class Simulator : SimulatorNoRandom
|
||||
return false;
|
||||
|
||||
// don't allow combo actions if the combo is already in progress
|
||||
if (ActionStates.TouchComboIdx != 0 &&
|
||||
if (ActionStates.Combo != ActionProc.None &&
|
||||
(action is ActionType.StandardTouchCombo or ActionType.AdvancedTouchCombo or ActionType.RefinedTouchCombo))
|
||||
return false;
|
||||
|
||||
// only allow Advanced Touch when Observing
|
||||
if (ActionStates.ObserveCombo && action is not ActionType.AdvancedTouch)
|
||||
// when combo'd, only allow Advanced Touch
|
||||
if (ActionStates.Combo == ActionProc.AdvancedTouch && action is not ActionType.AdvancedTouch)
|
||||
return false;
|
||||
|
||||
// don't allow pure quality moves under Veneration
|
||||
@@ -140,7 +140,7 @@ internal sealed class Simulator : SimulatorNoRandom
|
||||
|
||||
// don't allow Refined Touch without a combo
|
||||
if (action is ActionType.RefinedTouch &&
|
||||
ActionStates.TouchComboIdx != 1)
|
||||
ActionStates.Combo != ActionProc.UsedBasicTouch)
|
||||
return false;
|
||||
|
||||
// don't allow Immaculate Mends that are too inefficient
|
||||
|
||||
Reference in New Issue
Block a user