diff --git a/Benchmark/Program.cs b/Benchmark/Program.cs index ad81a72..61e8cd3 100644 --- a/Benchmark/Program.cs +++ b/Benchmark/Program.cs @@ -18,7 +18,16 @@ internal static class Program //return; var input = new SimulationInput( - new CharacterStats { Craftsmanship = 4041, Control = 3905, CP = 609, Level = 90 }, + new CharacterStats { + Craftsmanship = 4041, + Control = 3905, + CP = 609, + Level = 90, + CanUseManipulation = true, + HasSplendorousBuff = true, + IsSpecialist = true, + CLvl = 560, + }, new RecipeInfo() { IsExpert = false, @@ -32,7 +41,8 @@ internal static class Program QualityDivider = 115, ProgressModifier = 80, ProgressDivider = 130, - } + }, + 0 ); var config = new SolverConfig() diff --git a/Simulator/Actions/Manipulation.cs b/Simulator/Actions/Manipulation.cs index 06f8e99..4b0e6ba 100644 --- a/Simulator/Actions/Manipulation.cs +++ b/Simulator/Actions/Manipulation.cs @@ -10,6 +10,7 @@ internal sealed class Manipulation : BaseBuffAction public override byte Duration => 8; public override int CPCost(Simulator s) => 96; + public override bool CanUse(Simulator s) => s.Input.Stats.CanUseManipulation && base.CanUse(s); public override void Use(Simulator s) { diff --git a/Simulator/CharacterStats.cs b/Simulator/CharacterStats.cs index b8389df..6cd932e 100644 --- a/Simulator/CharacterStats.cs +++ b/Simulator/CharacterStats.cs @@ -6,6 +6,7 @@ public sealed record CharacterStats public int Control { get; init; } public int CP { get; init; } public int Level { get; init; } + public bool CanUseManipulation { get; init; } public bool HasSplendorousBuff { get; init; } public bool IsSpecialist { get; init; } public int CLvl { get; init; } diff --git a/Simulator/SimulationInput.cs b/Simulator/SimulationInput.cs index 93810e2..a496616 100644 --- a/Simulator/SimulationInput.cs +++ b/Simulator/SimulationInput.cs @@ -6,14 +6,16 @@ public sealed class SimulationInput public RecipeInfo Recipe { get; } public Random Random { get; } + public int StartingQuality { get; } public int BaseProgressGain { get; } public int BaseQualityGain { get; } - public SimulationInput(CharacterStats stats, RecipeInfo recipe, int? seed = null) + public SimulationInput(CharacterStats stats, RecipeInfo recipe, int startingQuality = 0, int? seed = null) { Stats = stats; Recipe = recipe; Random = seed == null ? new() : new(seed.Value); + StartingQuality = startingQuality; // https://github.com/NotRanged/NotRanged.github.io/blob/0f4aee074f969fb05aad34feaba605057c08ffd1/app/js/ffxivcraftmodel.js#L88 { diff --git a/Simulator/SimulationState.cs b/Simulator/SimulationState.cs index 138cf8c..126ea30 100644 --- a/Simulator/SimulationState.cs +++ b/Simulator/SimulationState.cs @@ -34,7 +34,7 @@ public struct SimulationState StepCount = 0; Progress = 0; - Quality = 0; + Quality = input.StartingQuality; Durability = Input.Recipe.MaxDurability; CP = Input.Stats.CP; Condition = Condition.Normal;