From 611a0429f350c0e473ec215dd934f58c261c14d0 Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Mon, 30 Aug 2021 06:55:29 +0000 Subject: [PATCH] Calculate initial decision on Progress rotation. --- SigCrafter/src/sig/Craft.java | 5 +- SigCrafter/src/sig/SigCraft.java | 97 +++++++++++++++++++++----------- 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/SigCrafter/src/sig/Craft.java b/SigCrafter/src/sig/Craft.java index dc06c5e..d580654 100644 --- a/SigCrafter/src/sig/Craft.java +++ b/SigCrafter/src/sig/Craft.java @@ -17,7 +17,7 @@ public class Craft { public List CraftList = new ArrayList(); public Craft(int control, int level, int cp, int base_progress, int progress_goal, int quality_goal, boolean guaranteed, int durability, int craft_progress, int craft_quality, int craft_durability, int craft_cp, - double progress_mult, double quality_mult, double durability_mult, int recipe_level,Status craft_status) { + double progress_mult, double quality_mult, double durability_mult, int recipe_level,Status craft_status,Map buffs) { this.control = control; this.base_control = control; this.level = level; @@ -36,6 +36,9 @@ public class Craft { this.durability_mult = durability_mult; this.recipe_level = recipe_level; this.craft_status = craft_status; + for (Buff b : buffs.values()) { + BuffList.put(b.getName(),new Buff(b.getName(),b.getStackCount())); + } } public boolean craftFailed() { return craft_progress BUFFLIST = new ArrayList(); - public static List SKILLLIST = new ArrayList(); + public static Map BUFFLIST = new HashMap(); + public static Map SKILLLIST = new HashMap(); public static int CRAFT_PROGRESS = 0; public static int CRAFT_QUALITY = 0; public static int CRAFT_DURABILITY = 0; public static int CRAFT_CP = 0; + + public static List PROGRESS_ROTATION = new ArrayList(); public static Craft BEST_CRAFT; @@ -49,45 +53,72 @@ public class SigCraft { public static ArrayList SucceededCrafts = new ArrayList(); public static void main(String[] args) { - SKILLLIST.add(new RapidSynthesis("Rapid Synthesis",0,false,9)); - SKILLLIST.add(new BasicSynthesis("Basic Synthesis",0,true,1)); - SKILLLIST.add(new BrandOfTheElements("Brand of the Elements",6,true,37)); - SKILLLIST.add(new BasicTouch("Basic Touch",18,true,5)); - SKILLLIST.add(new HastyTouch("Hasty Touch",0,false,9)); - SKILLLIST.add(new StandardTouch("Standard Touch",32,true,18)); + SKILLLIST.put("Rapid Synthesis",new RapidSynthesis("Rapid Synthesis",0,false,9)); + SKILLLIST.put("Basic Synthesis",new BasicSynthesis("Basic Synthesis",0,true,1)); + SKILLLIST.put("Brand of the Elements",new BrandOfTheElements("Brand of the Elements",6,true,37)); + SKILLLIST.put("Basic Touch",new BasicTouch("Basic Touch",18,true,5)); + SKILLLIST.put("Hasty Touch",new HastyTouch("Hasty Touch",0,false,9)); + SKILLLIST.put("Standard Touch",new StandardTouch("Standard Touch",32,true,18)); //SKILLLIST.add(new Skill("Byregot's Blessing",24,true,50)); //TODO We don't know how this works yet. - SKILLLIST.add(new TricksOfTheTrade("Tricks of the Trade",0,true,13)); - SKILLLIST.add(new MastersMend("Master's Mend",88,true,7)); - SKILLLIST.add(new WasteNot("Waste Not",56,true,15)); - SKILLLIST.add(new WasteNotII("Waste Not II",98,true,47)); - SKILLLIST.add(new InnerQuiet("Inner Quiet",18,true,11)); - SKILLLIST.add(new Veneration("Veneration",18,true,15)); - SKILLLIST.add(new GreatStrides("Great Strides",32,true,21)); - SKILLLIST.add(new Innovation("Innovation",18,true,26)); - SKILLLIST.add(new NameOfTheElements("Name of the Elements",30,true,37)); - SKILLLIST.add(new Observe("Observe",7,true,13)); + SKILLLIST.put("Tricks of the Trade",new TricksOfTheTrade("Tricks of the Trade",0,true,13)); + SKILLLIST.put("Master's Mend",new MastersMend("Master's Mend",88,true,7)); + SKILLLIST.put("Waste Not",new WasteNot("Waste Not",56,true,15)); + SKILLLIST.put("Waste Not II",new WasteNotII("Waste Not II",98,true,47)); + SKILLLIST.put("Inner Quiet",new InnerQuiet("Inner Quiet",18,true,11)); + SKILLLIST.put("Veneration",new Veneration("Veneration",18,true,15)); + SKILLLIST.put("Great Strides",new GreatStrides("Great Strides",32,true,21)); + SKILLLIST.put("Innovation",new Innovation("Innovation",18,true,26)); + SKILLLIST.put("Name of the Elements",new NameOfTheElements("Name of the Elements",30,true,37)); + SKILLLIST.put("Observe",new Observe("Observe",7,true,13)); - BUFFLIST.add(new Buff("Inner Quiet",0)); - BUFFLIST.add(new Buff("Veneration",0)); - BUFFLIST.add(new Buff("Great Strides",0)); - BUFFLIST.add(new Buff("Innovation",0)); - BUFFLIST.add(new Buff("Name of the Elements",0)); - BUFFLIST.add(new Buff("Name of the Elements Has Been Used",0)); - BUFFLIST.add(new Buff("Inner Quiet", 0)); - BUFFLIST.add(new Buff("Waste Not",0)); - BUFFLIST.add(new Buff("Waste Not II",0)); + BUFFLIST.put("Inner Quiet",new Buff("Inner Quiet",0)); + BUFFLIST.put("Veneration",new Buff("Veneration",0)); + BUFFLIST.put("Great Strides",new Buff("Great Strides",0)); + BUFFLIST.put("Innovation",new Buff("Innovation",0)); + BUFFLIST.put("Name of the Elements",new Buff("Name of the Elements",0)); + BUFFLIST.put("Name of the Elements Has Been Used",new Buff("Name of the Elements Has Been Used",0)); + BUFFLIST.put("Inner Quiet",new Buff("Inner Quiet", 0)); + BUFFLIST.put("Waste Not",new Buff("Waste Not",0)); + BUFFLIST.put("Waste Not II",new Buff("Waste Not II",0)); SetupCraft(); } public static void SetupCraft() { - List skills = new ArrayList(); - skills.addAll(SKILLLIST); - skills.removeIf((skill)->{return skill.lvReq>LEVEL;}); - Craft c = new Craft(CONTROL,LEVEL,CP,BASE_PROGRESS,PROGRESS_GOAL,QUALITY_GOAL,GUARANTEED,DURABILITY,CRAFT_PROGRESS,CRAFT_QUALITY,DURABILITY,CP,1,1,1,RECIPE_LEVEL,Status.NORMAL); - while (c.craft_progress progress_rotation1 = new ArrayList(); + List progress_rotation2 = new ArrayList(); + List progress_rotation3 = new ArrayList(); + + Craft c1 = new Craft(CONTROL,LEVEL,CP,BASE_PROGRESS,PROGRESS_GOAL,QUALITY_GOAL,GUARANTEED,DURABILITY,CRAFT_PROGRESS,CRAFT_QUALITY,DURABILITY,CP,1,1,1,RECIPE_LEVEL,Status.NORMAL,BUFFLIST); + //Tame rotation attempt. + while (c1.craft_progress