Add manipulation action flag and starting quality field

This commit is contained in:
Asriel Camora
2023-06-23 03:02:03 -07:00
parent de2feb2b34
commit 37156c7f33
5 changed files with 18 additions and 4 deletions
+12 -2
View File
@@ -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()
+1
View File
@@ -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)
{
+1
View File
@@ -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; }
+3 -1
View File
@@ -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
{
+1 -1
View File
@@ -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;