Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Collections;
- public class GearOptimizer{
- /***** BEGIN SETTINGS *****/
- private static boolean mwExotic = false;
- private static boolean mwHelmet = true;
- private static boolean mwGlove = true;
- private static boolean mwChest = true;
- private static boolean mwBoot = true;
- private static Gear gearMinimum = new Gear("min", 0, 0, 30, 60, 30, 40);
- private static int minStatPoints = 24;
- private static int minWasted = 20;
- /***** END SETTINGS *****/
- public static void main(String []args) {
- /***** BEGIN EXOTICS *****/
- Gear nezarac = new Gear("Nezarac", 10, 7, 7, 6, 6, 10);
- if(mwExotic) nezarac.masterwork();
- Gear tempest = new Gear("Tempest", 13, 6, 7, 6, 12, 6);
- if(mwExotic) tempest.masterwork();
- Gear contraverse = new Gear("Contraverse", 6, 6, 12, 12, 6, 6);
- if(mwExotic) contraverse.masterwork();
- Gear ophidian = new Gear("Ophidian", 11, 6, 7, 6, 6, 12);
- if(mwExotic) ophidian.masterwork();
- /***** END EXOTICS *****/
- //setup the list of gear
- ArrayList<Gear> helmets = mwHelmet ? masterworkedSlot(getHelmets()) : getHelmets();
- ArrayList<Gear> gloves = mwGlove ? masterworkedSlot(getGloves()) : getGloves();
- ArrayList<Gear> chests = mwChest ? masterworkedSlot(getChests()) : getChests();
- ArrayList<Gear> boots = mwBoot ? masterworkedSlot(getBoots()) : getBoots();
- ArrayList<Set> set = new ArrayList<>();
- System.out.println("Tempest");
- for(Gear glove : gloves) {
- for(Gear chest : chests) {
- for(Gear boot : boots) {
- Set tempestSet = new Set(tempest, glove, chest, boot);
- if(qualifiedSet(tempestSet)) {
- set.add(tempestSet);
- }
- }
- }
- }
- Collections.sort(set);
- for(Set setItem : set) {
- System.out.println(setItem.toString());
- }
- set.clear();
- System.out.println("Tempest Revised");
- for(Gear glove : gloves) {
- for(Gear chest : chests) {
- for(Gear boot : boots) {
- Set tempestSet = new Set(tempest, glove, chest, boot);
- if(qualifiedSet(tempestSet) && chest.getName().equals("C5") && boot.getName().equals("B7")) {
- set.add(tempestSet);
- }
- }
- }
- }
- Collections.sort(set);
- for(Set setItem : set) {
- System.out.println(setItem.toString());
- }
- set.clear();
- System.out.println("Contraverse");
- for(Gear helmet : helmets) {
- for(Gear chest : chests) {
- for(Gear boot : boots) {
- Set contraverseSet = new Set(helmet, contraverse, chest, boot);
- if(qualifiedSet(contraverseSet)) {
- set.add(contraverseSet);
- }
- }
- }
- }
- Collections.sort(set);
- for(Set setItem : set) {
- System.out.println(setItem.toString());
- }
- set.clear();
- System.out.println("Ophidian Revised");
- for(Gear helmet : helmets) {
- for(Gear chest : chests) {
- for(Gear boot : boots) {
- Set ophidianSet = new Set(helmet, ophidian, chest, boot);
- if(qualifiedSet(ophidianSet) && helmet.getName().equals("H3") && chest.getName().equals("C5") && boot.getName().equals("B7")) {
- set.add(ophidianSet);
- }
- }
- }
- }
- Collections.sort(set);
- for(Set setItem : set) {
- System.out.println(setItem.toString());
- }
- set.clear();
- }
- public static boolean qualifiedSet(Set setItem) {
- return (setItem.getMobility() >= gearMinimum.getMobility() &&
- setItem.getResilience() >= gearMinimum.getResilience() &&
- setItem.getRecovery() >= gearMinimum.getRecovery() &&
- setItem.getDiscipline() >= gearMinimum.getDiscipline() &&
- setItem.getIntellect() >= gearMinimum.getIntellect() &&
- setItem.getStrength() >= gearMinimum.getStrength() &&
- setItem.getTotal() >= minStatPoints &&
- setItem.getWasted() <= minWasted);
- }
- public static ArrayList<Gear> masterworkedSlot(ArrayList<Gear> gearList) {
- for(Gear gear : gearList) {
- gear.masterwork();
- }
- return gearList;
- }
- public static ArrayList<Gear> getHelmets() {
- ArrayList<Gear> helmets = new ArrayList<>();
- helmets.add(new Gear("H1", 2, 8, 18, 12, 7, 10));
- helmets.add(new Gear("H2", 2, 2, 22, 7, 13, 7));
- helmets.add(new Gear("H3", 9, 12, 6, 12, 7, 8));
- helmets.add(new Gear("H4", 14, 2, 14, 2, 12, 17));
- helmets.add(new Gear("H5", 6, 6, 15, 13, 6, 12));
- return helmets;
- }
- public static ArrayList<Gear> getGloves() {
- ArrayList<Gear> gloves = new ArrayList<>();
- gloves.add(new Gear("G1", 7, 8, 15, 11, 8, 9));
- gloves.add(new Gear("G2", 11, 2, 15, 6, 16, 10));
- gloves.add(new Gear("G3", 2, 22, 6, 2, 10, 18));
- gloves.add(new Gear("G4", 17, 7, 2, 2, 13, 13));
- gloves.add(new Gear("G5", 13, 2, 16, 7, 13, 7));
- gloves.add(new Gear("G6", 14, 2, 10, 18, 6, 2));
- gloves.add(new Gear("G7", 10, 6, 12, 9, 13, 6));
- gloves.add(new Gear("G8", 20, 2, 6, 8, 16, 2));
- return gloves;
- }
- public static ArrayList<Gear> getChests() {
- ArrayList<Gear> chests = new ArrayList<>();
- chests.add(new Gear("C1", 7, 6, 15, 9, 12, 11));
- chests.add(new Gear("C2", 8, 8, 10, 13, 14, 2));
- chests.add(new Gear("C3", 10, 8, 7, 8, 6, 12));
- chests.add(new Gear("C4", 2, 2, 22, 6, 12, 8));
- chests.add(new Gear("C5", 10, 8, 7, 6, 7, 16));
- chests.add(new Gear("C6", 7, 7, 13, 15, 8, 6));
- chests.add(new Gear("C7", 2, 12, 13, 10, 16, 2));
- chests.add(new Gear("C8", 7, 6, 11, 13, 10, 2));
- return chests;
- }
- public static ArrayList<Gear> getBoots() {
- ArrayList<Gear> boots = new ArrayList<>();
- boots.add(new Gear("B1", 6, 8, 13, 19, 2, 8));
- boots.add(new Gear("B2", 7, 7, 14, 21, 8, 2));
- boots.add(new Gear("B3", 6, 2, 22, 11, 7, 8));
- boots.add(new Gear("B4", 9, 2, 19, 7, 17, 2));
- boots.add(new Gear("B5", 12, 8, 6, 2, 12, 13));
- boots.add(new Gear("B6", 13, 7, 6, 17, 7, 2));
- boots.add(new Gear("B7", 6, 18, 7, 22, 2, 2));
- boots.add(new Gear("B8", 6, 2, 21, 16, 8, 6));
- boots.add(new Gear("B9", 14, 7, 9, 14, 2, 12));
- boots.add(new Gear("B10", 8, 13, 7, 18, 9, 2));
- boots.add(new Gear("B11", 8, 13, 7, 13, 13, 2));
- boots.add(new Gear("B12", 17, 2, 7, 8, 6, 12));
- boots.add(new Gear("B13", 2, 10, 19, 8, 8, 10));
- boots.add(new Gear("B14", 6, 16, 6, 17, 9, 2));
- boots.add(new Gear("B15", 7, 12, 8, 24, 2, 2));
- return boots;
- }
- }
- class Set implements Comparable {
- private Gear helmet;
- private Gear glove;
- private Gear chest;
- private Gear boot;
- private Gear classItem;
- public Set(Gear h, Gear g, Gear c, Gear b) {
- helmet = h;
- glove = g;
- chest = c;
- boot = b;
- classItem = new Gear("bond", 2, 2, 2, 2, 2, 2);
- }
- public Gear getHelmet() {
- return helmet;
- }
- public Gear getGlove() {
- return glove;
- }
- public Gear getChest() {
- return chest;
- }
- public Gear getBoot() {
- return boot;
- }
- public int getMobility() {
- return helmet.getMobility() + glove.getMobility() + chest.getMobility() + boot.getMobility() + classItem.getMobility() + 5; //traction
- }
- public int getResilience() {
- return helmet.getResilience() + glove.getResilience() + chest.getResilience() + boot.getResilience() + classItem.getResilience();
- }
- public int getRecovery() {
- return helmet.getRecovery() + glove.getRecovery() + chest.getRecovery() + boot.getRecovery() + classItem.getRecovery();
- }
- public int getDiscipline() {
- return helmet.getDiscipline() + glove.getDiscipline() + chest.getDiscipline() + boot.getDiscipline() + classItem.getDiscipline();
- }
- public int getIntellect() {
- return helmet.getIntellect() + glove.getIntellect() + chest.getIntellect() + boot.getIntellect() + classItem.getIntellect();
- }
- public int getStrength() {
- return helmet.getStrength() + glove.getStrength() + chest.getStrength() + boot.getStrength() + classItem.getStrength();
- }
- public int getTotal() {
- return getMobility()/10 + getResilience()/10 + getRecovery()/10 +
- getDiscipline()/10 + getIntellect()/10 + getStrength()/10;
- }
- public int getWasted() {
- return getMobility()%10 + getResilience()%10 + getRecovery()%10 +
- getDiscipline()%10 + getIntellect()%10 + getStrength()%10;
- }
- @Override
- public int compareTo(Object set) {
- return ((Set)set).getTotal() - getTotal();
- }
- public String getName() {
- return helmet.getName() + ":" + glove.getName() + ":" + chest.getName() + ":" + boot.getName();
- }
- public String getStats() {
- return "(" + getMobility() + ", " + getResilience() + ", " + getRecovery() + ", " + getDiscipline() + ", " + getIntellect() + ", " + getStrength() + ")";
- }
- public String toString() {
- return getName() + " [" + getTotal() + "] " + getStats() + " [" + getWasted() + "]";
- }
- }
- class Gear {
- private String name;
- private int mobility;
- private int resilience;
- private int recovery;
- private int discipline;
- private int intellect;
- private int strength;
- public Gear() {
- name = "";
- mobility = 0;
- resilience = 0;
- recovery = 0;
- discipline = 0;
- intellect = 0;
- strength = 0;
- }
- public Gear(String nm, int mob, int res, int rec, int dis, int intl, int str) {
- name = nm;
- mobility = mob;
- resilience = res;
- recovery = rec;
- discipline = dis;
- intellect = intl;
- strength = str;
- }
- public String getName() {
- return name;
- }
- public int getMobility() {
- return mobility;
- }
- public int getResilience() {
- return resilience;
- }
- public int getRecovery() {
- return recovery;
- }
- public int getDiscipline() {
- return discipline;
- }
- public int getIntellect() {
- return intellect;
- }
- public int getStrength() {
- return strength;
- }
- public void masterwork() {
- mobility += 2;
- resilience += 2;
- recovery += 2;
- discipline += 2;
- intellect += 2;
- strength += 2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement