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)]
|
[StructLayout(LayoutKind.Auto)]
|
||||||
public record struct ActionStates
|
public record struct ActionStates
|
||||||
{
|
{
|
||||||
public byte TouchComboIdx;
|
public ActionProc Combo;
|
||||||
public byte CarefulObservationCount;
|
public byte CarefulObservationCount;
|
||||||
public bool UsedHeartAndSoul;
|
public bool UsedHeartAndSoul;
|
||||||
public bool UsedQuickInnovation;
|
public bool UsedQuickInnovation;
|
||||||
public bool UsedTrainedPerfection;
|
public bool UsedTrainedPerfection;
|
||||||
public bool ObserveCombo;
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void MutateState(BaseAction baseAction)
|
public void MutateState(BaseAction baseAction)
|
||||||
{
|
{
|
||||||
if (baseAction is BasicTouch)
|
if (baseAction is BasicTouch)
|
||||||
TouchComboIdx = 1;
|
Combo = ActionProc.UsedBasicTouch;
|
||||||
else if (TouchComboIdx == 1 && baseAction is StandardTouch)
|
else if ((Combo == ActionProc.UsedBasicTouch && baseAction is StandardTouch) || baseAction is Observe)
|
||||||
TouchComboIdx = 2;
|
Combo = ActionProc.AdvancedTouch;
|
||||||
else
|
else
|
||||||
TouchComboIdx = 0;
|
Combo = ActionProc.None;
|
||||||
|
|
||||||
if (baseAction is CarefulObservation)
|
if (baseAction is CarefulObservation)
|
||||||
CarefulObservationCount++;
|
CarefulObservationCount++;
|
||||||
@@ -35,7 +34,5 @@ public record struct ActionStates
|
|||||||
|
|
||||||
if (baseAction is TrainedPerfection)
|
if (baseAction is TrainedPerfection)
|
||||||
UsedTrainedPerfection = true;
|
UsedTrainedPerfection = true;
|
||||||
|
|
||||||
ObserveCombo = baseAction is Observe;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ internal sealed class AdvancedTouch() : BaseAction(
|
|||||||
defaultCPCost: 46, defaultEfficiency: 150)
|
defaultCPCost: 46, defaultEfficiency: 150)
|
||||||
{
|
{
|
||||||
public override int CPCost(Simulator s) =>
|
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)
|
public override void UseSuccess(Simulator s)
|
||||||
{
|
{
|
||||||
base.UseSuccess(s);
|
base.UseSuccess(s);
|
||||||
if (s.ActionStates.TouchComboIdx == 1)
|
if (s.ActionStates.Combo == ActionProc.UsedBasicTouch)
|
||||||
s.StrengthenEffect(EffectType.InnerQuiet);
|
s.StrengthenEffect(EffectType.InnerQuiet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ internal sealed class StandardTouch() : BaseAction(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
public override int CPCost(Simulator s) =>
|
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;
|
return false;
|
||||||
|
|
||||||
// don't allow combo actions if the combo is already in progress
|
// 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))
|
(action is ActionType.StandardTouchCombo or ActionType.AdvancedTouchCombo or ActionType.RefinedTouchCombo))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// only allow Advanced Touch when Observing
|
// when combo'd, only allow Advanced Touch
|
||||||
if (ActionStates.ObserveCombo && action is not ActionType.AdvancedTouch)
|
if (ActionStates.Combo == ActionProc.AdvancedTouch && action is not ActionType.AdvancedTouch)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// don't allow pure quality moves under Veneration
|
// 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
|
// don't allow Refined Touch without a combo
|
||||||
if (action is ActionType.RefinedTouch &&
|
if (action is ActionType.RefinedTouch &&
|
||||||
ActionStates.TouchComboIdx != 1)
|
ActionStates.Combo != ActionProc.UsedBasicTouch)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// don't allow Immaculate Mends that are too inefficient
|
// don't allow Immaculate Mends that are too inefficient
|
||||||
|
|||||||
Reference in New Issue
Block a user