commit e7767d12dc8bd406b6ba760621b3aafa54fdc433 Author: Jim Date: Tue Sep 21 14:07:16 2021 +0100 First commit diff --git a/nbactions.xml b/nbactions.xml new file mode 100644 index 0000000..1151928 --- /dev/null +++ b/nbactions.xml @@ -0,0 +1,32 @@ + + + + run + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.5.0:exec + + + -classpath %classpath moe.nekojimi.charactermaker.Main + java + + + + debug + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.5.0:exec + + + -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath moe.nekojimi.charactermaker.Main + java + true + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7b14c83 --- /dev/null +++ b/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + moe.nekojimi + CharacterMaker + 1.0 + jar + + + commons-beanutils + commons-beanutils + 1.9.4 + + + + UTF-8 + 11 + 11 + + \ No newline at end of file diff --git a/src/main/java/moe/nekojimi/charactermaker/Character.java b/src/main/java/moe/nekojimi/charactermaker/Character.java new file mode 100644 index 0000000..c16595e --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/Character.java @@ -0,0 +1,130 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker; + +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author jimj316 + */ +public class Character +{ + /*private int cognition; + private int coordination; + private int intuition; + private int reflexes; + private int savvy; + private int somatics; + private int willpower;*/ + + private int cp = 1000; + private final Map aptitudes = new HashMap<>(); + private final Map skills = new HashMap<>(); + + /* + public int getCognition() + { + return cognition; + } + + public void setCognition(int cognition) + { + this.cognition = cognition; + } + + public int getCoordination() + { + return coordination; + } + + public void setCoordination(int coordination) + { + this.coordination = coordination; + } + + public int getIntuition() + { + return intuition; + } + + public void setIntuition(int intuition) + { + this.intuition = intuition; + } + + public int getReflexes() + { + return reflexes; + } + + public void setReflexes(int reflexes) + { + this.reflexes = reflexes; + } + + public int getSavvy() + { + return savvy; + } + + public void setSavvy(int savvy) + { + this.savvy = savvy; + } + + public int getSomatics() + { + return somatics; + } + + public void setSomatics(int somatics) + { + this.somatics = somatics; + } + + public int getWillpower() + { + return willpower; + } + + public void setWillpower(int willpower) + { + this.willpower = willpower; + } */ + + public int getAptitude(String name) + { + return aptitudes.getOrDefault(name, 0); + } + + public void setAptitude(String name, int value) + { + int oldValue = getAptitude(name); + if (oldValue > 0) + { + int change = value - oldValue; + cp -= change/10; // 10CP = 1 aptitude + } + aptitudes.put(name, value); + } + + public int getSkill(String name) + { + return skills.getOrDefault(name, 0); + } + + public void setSkill(String name, int value) + { + int oldValue = getSkill(name); + int change = value - oldValue; + cp -= change; + skills.put(name, value); + } + + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/Main.java b/src/main/java/moe/nekojimi/charactermaker/Main.java new file mode 100644 index 0000000..19be606 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/Main.java @@ -0,0 +1,49 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker; + +import moe.nekojimi.charactermaker.steps.Step; +import java.util.Deque; +import java.util.LinkedList; +import moe.nekojimi.charactermaker.steps.AptTemplateStep; +import moe.nekojimi.charactermaker.steps.NativeToungeStep; + +/** + * + * @author jimj316 + */ +public class Main +{ + + public static Character character; + + public static UI ui; + private static final Deque steps = new LinkedList<>(); + + /** + * @param args the command line arguments + */ + public static void main(String[] args) + { + ui = new UI(); + character = new Character(); + + steps.add(new AptTemplateStep()); + steps.add(new NativeToungeStep()); + + while (!steps.isEmpty()) + { + Step nextStep = steps.pop(); + nextStep.run(); + } + } + + public static void addStepFirst(Step step) + { + steps.addFirst(step); + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/RollTable.java b/src/main/java/moe/nekojimi/charactermaker/RollTable.java new file mode 100644 index 0000000..e61f30c --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/RollTable.java @@ -0,0 +1,51 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker; + +import java.util.*; +import java.util.Map.Entry; + +/** + * + * @author jimj316 + */ +public final class RollTable +{ + private final int roll; + private final SortedMap entries = new TreeMap<>(); + + public RollTable(int roll) + { + this.roll = roll; + } + + public RollTable(int roll, Entry... entries) + { + this(roll); + for (Entry entry: entries) + { + addEntry(entry.getKey(), entry.getValue()); + } + } + + public void addEntry(int minRoll, T value) + { + entries.put(minRoll, value); + } + + public T roll() + { + Random r = new Random(); + int d = r.nextInt(roll)+1; + for (Entry e : entries.entrySet()) + { + if (e.getKey() >= d) + return e.getValue(); + } + return null; + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/UI.java b/src/main/java/moe/nekojimi/charactermaker/UI.java new file mode 100644 index 0000000..235b454 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/UI.java @@ -0,0 +1,109 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; +import java.util.stream.Collectors; + +/** + * + * @author jimj316 + */ +public class UI +{ + public final Scanner SC = new Scanner(System.in); + + public String showPrompt(String text, String prompt) + { + if (!text.isEmpty()) + System.err.println(text); + if (!prompt.isEmpty()) + { + System.err.println(prompt); + System.err.flush(); + } + return SC.nextLine(); + } + + public int showNumberPrompt(String text, int min, int max) + { + int ret = 0; + boolean done = false; + if (!text.isEmpty()) + System.err.println(text); + while (!done) + { + String prompt = "Choose number [" + min + "~" + max + "]: "; +// String resp = showPrompt(text, prompt); + try + { + System.err.println(prompt); + System.err.flush(); + String resp = SC.nextLine(); + ret = Integer.parseInt(resp); + if (ret < min) + { + System.err.println("That number is too low (less than " + min + ")"); + } + else if (ret > max) + { + System.err.println("That number is too high (more than " + max + ")"); + } + else + { + done = true; + } + } + catch (NumberFormatException ex) + { + System.err.println("That's not a number."); + } + } + return ret; + } + + public int showChoicePrompt(String text, List choices) + { + List strings = choices.stream() + .map((x)->x.toString()) + .collect(Collectors.toList()); + text += "\n"; + if (strings.size() > 1) + { + for (int i = 0; i < strings.size(); i++) + { + text += (i+1) + ": " + strings.get(i) + "\n"; + } + int resp = showNumberPrompt(text, 1, strings.size()); + return resp-1; + } + else if (strings.size()==1) + { + showPrompt(text, ""); + return 0; + } + else + return -1; + } + + public T showRollPrompt(String text, RollTable table, int rolls) + { + List strings = new ArrayList<>(); + for (int i = 0; i < rolls; i++) + { + strings.add(table.roll()); + } + if (strings.size() > 0) + { + int choice = showChoicePrompt(text, strings); + return strings.get(choice); + } + else + return strings.get(0); + } +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/AptTemplateStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/AptTemplateStep.java new file mode 100644 index 0000000..b6301f3 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/AptTemplateStep.java @@ -0,0 +1,72 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import moe.nekojimi.charactermaker.Main; + + +public class AptTemplateStep extends Step +{ + Template[] templates = + { + new Template("Brawler ",10,20,15,20,10,20,10), + new Template("Dilettante ",15,15,15,15,15,15,15), + new Template("Extrovert ",15,15,15,15,20,10,15), + new Template("Inquisitive ",20,10,20,10,20,10,15), + new Template("Researcher ",20,15,20,15,10,10,15), + new Template("Survivor ",10,15,15,15,10,20,20), + new Template("Techie ",20,15,10,15,15,15,15), + new Template("Thrill Seeker ",10,20,15,20,15,15,10), + }; + + @Override + public void run() + { + int resp = Main.ui.showChoicePrompt("Choose aptitude template", List.of(templates).stream().map((t)->t.name).collect(Collectors.toList())); + List steps = templates[resp].getSteps(); + steps.stream().forEach((step)->Main.addStepFirst(step)); + } + + private class Template + { + String name; + int cognition; + int coordination; + int intuition; + int reflexes; + int savvy; + int somatics; + int willpower; + + public Template(String name, int cognition, int coordination, int intuition, int reflexes, int savvy, int somatics, int willpower) + { + this.name = name; + this.cognition = cognition; + this.coordination = coordination; + this.intuition = intuition; + this.reflexes = reflexes; + this.savvy = savvy; + this.somatics = somatics; + this.willpower = willpower; + } + + List getSteps() + { + List ret = new ArrayList<>(); + ret.add(new ChangePropertyStep(cognition, "COG", "cognition")); + ret.add(new ChangePropertyStep(coordination, "COO", "coordination")); + ret.add(new ChangePropertyStep(intuition, "INT", "intuition")); + ret.add(new ChangePropertyStep(reflexes, "REF", "reflexes")); + ret.add(new ChangePropertyStep(savvy, "SAV", "savvy")); + ret.add(new ChangePropertyStep(somatics, "SOM", "somatics")); + ret.add(new ChangePropertyStep(willpower, "WIL", "willpower")); + return ret; + } + } +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.java new file mode 100644 index 0000000..7bb6b25 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import moe.nekojimi.charactermaker.Main; + + +public class ChangeAptitudeStep extends ChangeValueStep +{ + + public ChangeAptitudeStep(int change, String name) + { + super(change, name); + } + + @Override + protected int read() + { + return Main.character.getAptitude(name); + } + + @Override + protected void write(int val) + { + Main.character.setAptitude(name, val); + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChangePropertyStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChangePropertyStep.java new file mode 100644 index 0000000..3bfc1b4 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChangePropertyStep.java @@ -0,0 +1,50 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import java.lang.reflect.InvocationTargetException; +import moe.nekojimi.charactermaker.Main; +import org.apache.commons.beanutils.PropertyUtils; + + +public class ChangePropertyStep extends ChangeValueStep +{ + + private final String propName; + + public ChangePropertyStep(int change, String name, String propName) + { + super(change, name); + this.propName = propName; + } + + @Override + protected int read() + { + try + { + return (int) PropertyUtils.getSimpleProperty(Main.character, propName); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) + { +// Logger.getLogger(ChangePropertyStep.class.getName()).log(Level.SEVERE, null, ex); + throw new RuntimeException(ex); + } + } + + @Override + protected void write(int val) + { + try + { + PropertyUtils.setSimpleProperty(Main.character, propName, val); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException ex) + { +// Logger.getLogger(ChangePropertyStep.class.getName()).log(Level.SEVERE, null, ex); + throw new RuntimeException(ex); + } + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChangeSkillStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeSkillStep.java new file mode 100644 index 0000000..6c66f79 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeSkillStep.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import moe.nekojimi.charactermaker.Main; + + +public class ChangeSkillStep extends ChangeValueStep +{ + + public ChangeSkillStep(int change, String name) + { + super(change, name); + } + + @Override + protected int read() + { + return Main.character.getSkill(name); + } + + @Override + protected void write(int val) + { + Main.character.setSkill(name, val); + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChangeValueStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeValueStep.java new file mode 100644 index 0000000..ffea6b3 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChangeValueStep.java @@ -0,0 +1,44 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import moe.nekojimi.charactermaker.Main; + +/** + * + * @author jimj316 + */ +public abstract class ChangeValueStep extends Step +{ + private final int change; + final String name; + + public ChangeValueStep(int change, String name) + { + this.change = change; + this.name = name; + } + + @Override + public void run() + { + int oldValue = read(); + int newValue = oldValue + change; + String changeString = " (" + oldValue + " -> " + newValue + ")"; + if (change > 0) + { + Main.ui.showPrompt("+ You gain " + change + " " + name + changeString, ""); + } + else + { + Main.ui.showPrompt("- You lose " + -change + " " + name + changeString, ""); + } + write(newValue); + } + + protected abstract int read(); + protected abstract void write(int val); +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChooseMorphStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChooseMorphStep.java new file mode 100644 index 0000000..17ff9d4 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChooseMorphStep.java @@ -0,0 +1,206 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import java.util.HashMap; +import java.util.Map; +import moe.nekojimi.charactermaker.RollTable; + + +public class ChooseMorphStep extends Step +{ + + @Override + public void run() + { + + } + + private static enum MorphType + { + BIO("biomorph"), + UPLIFT("uplift biomorph"), + POD("pod biomorph"), + SYNTH("synthmorph"), + INFO("infomorph"); + + String name; + + private MorphType(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return name; + } + } + + private static final RollTable typeTable = new RollTable<>(100); + static + { + typeTable.addEntry(1, ChooseMorphStep.MorphType.BIO); + typeTable.addEntry(51, ChooseMorphStep.MorphType.UPLIFT); + typeTable.addEntry(56, ChooseMorphStep.MorphType.POD); + typeTable.addEntry(66, ChooseMorphStep.MorphType.SYNTH); + typeTable.addEntry(96, ChooseMorphStep.MorphType.UPLIFT); + } + + private static enum Morph + { + FLAT (MorphType.BIO,1,"Flat","p. 139, EP",0), + SPLICER (MorphType.BIO,4,"Splicer","p. 139, EP",10), + EXALT (MorphType.BIO,14,"Exalt","p. 139, EP",30), + MENTON (MorphType.BIO,22,"Menton","p. 139, EP",40), + OLYMPIAN (MorphType.BIO,27,"Olympian","p. 140, EP",40), + SYLPH (MorphType.BIO,35,"Sylph","p. 140, EP",40), + BOUNCER (MorphType.BIO,40,"Bouncer","p. 140, EP",40), + FURY (MorphType.BIO,47,"Fury","p. 140, EP",75), + FUTURA (MorphType.BIO,50,"Futura","p. 140, EP",40), + GHOST (MorphType.BIO,51,"Ghost","p. 140, EP",70), + HIBERNOID (MorphType.BIO,54,"Hibernoid","p. 140, EP",25), + NEOTENIC (MorphType.BIO,57,"Neotenic","p. 141, EP",25), + REMADE (MorphType.BIO,60,"Remade","p. 141, EP",60), + RUSTER (MorphType.BIO,63,"Ruster","p. 141, EP",25), + LUNAR_FLYER (MorphType.BIO,70,"Lunar Flyer","p. 162, S",35), + MARTIAN_ALPINER (MorphType.BIO,71,"Martian Alpiner","p. 162, S",30), + SALAMANDER (MorphType.BIO,73,"Salamander","p. 163, S",40), + SURYA (MorphType.BIO,74,"Surya","p. 164, S",50), + VENUSIAN_GLIDER (MorphType.BIO,75,"Venusian Glider","p. 164, S",40), + HAZER (MorphType.BIO,76,"Hazer","p. 186, R",35), + HULDER (MorphType.BIO,78,"Hulder","p. 186, R",50), + HYPERBRIGHT (MorphType.BIO,79,"Hyperbright","p. 186, R",70), + RING_FLYER (MorphType.BIO,80,"Ring Flyer","p. 187, R",70), + SELKIE (MorphType.BIO,81,"Selkie","p. 187, R",55), + AQUANAUT (MorphType.BIO,82,"Aquanaut","p. 150, G",50), + CRASHER (MorphType.BIO,83,"Crasher","p. 150, G",70), + DVERGR (MorphType.BIO,86,"Dvergr","p. 150, G",50), + ARIEL (MorphType.BIO,87,"Ariel","p. 188",50), + BRUISER (MorphType.BIO,88,"Bruiser","p. 189",60), + CLOUD_SKATE (MorphType.BIO,90,"Cloud Skate","p. 189",55), + FAUST (MorphType.BIO,91,"Faust","p. 190",85), + FREEMAN (MorphType.BIO,92,"Freeman","p. 191",10), + GREY (MorphType.BIO,93,"Grey","p. 192",25), + NOMAD (MorphType.BIO,94,"Nomad","p. 194",30), + OBSERVER (MorphType.BIO,96,"Observer","p. 194",40), + THESEUS (MorphType.BIO,100,"Theseus","p. 196",30), + NEO_AVIAN (MorphType.UPLIFT,1,"Neo-Avian","p. 141, EP",25), + NEO_HOMINID (MorphType.UPLIFT,31,"Neo-Hominid*","p. 141, EP",25), + OCTOMORPH (MorphType.UPLIFT,51,"Octomorph","p. 141, EP",50), + NEANDERTHAL (MorphType.UPLIFT,71,"Neanderthal","p. 162, S",40), + NEO_BELUGA (MorphType.UPLIFT,76,"Neo-Beluga","p. 142, P",45), + NEO_DOLPHIN (MorphType.UPLIFT,77,"Neo-Dolphin","p. 143, P",40), + NEO_GORILLA (MorphType.UPLIFT,78,"Neo-Gorilla","p. 143, P",35), + NEO_ORCA (MorphType.UPLIFT,93,"Neo-Orca","p. 143, P",60), + NEO_PIG (MorphType.UPLIFT,94,"Neo-Pig","p. 143, P",20), + NEO_PORPOISE (MorphType.UPLIFT,99,"Neo-Porpoise","p. 143, P",35), + NEO_WHALE (MorphType.UPLIFT,100,"Neo-Whale","p. 143, P",75), + PLEASURE_POD (MorphType.POD,1,"Pleasure Pod","p. 142, EP",20), + WORKER_POD (MorphType.POD,16,"Worker Pod","p. 142, EP",20), + NOVACRAB (MorphType.POD,31,"Novacrab","p. 142, EP",60), + DIGGER (MorphType.POD,34,"Digger","p. 150, G",30), + RIPWING (MorphType.POD,36,"Ripwing","p. 151, G",40), + SCURRIER (MorphType.POD,39,"Scurrier","p. 151, G",40), + WHIPLASH (MorphType.POD,40,"Whiplash","p. 151, G",50), + CHICKCHARNIE (MorphType.POD,41,"Chickcharnie","p. 142, P",35), + HYPERGIBBON (MorphType.POD,43,"Hypergibbon","p. 142, P",30), + SHAPER (MorphType.POD,45,"Shaper","p. 144, P",45), + AYAH (MorphType.POD,47,"Ayah","p. 188",25), + BASIC_POD (MorphType.POD,54,"Basic Pod","p. 188",5), + CRITTER (MorphType.POD,63,"Critter","p. 190",15), + FLYING_SQUID (MorphType.POD,68,"Flying Squid","p. 191",55), + JENKIN (MorphType.POD,71,"Jenkin","p. 193",20), + SAMSA (MorphType.POD,73,"Samsa","p. 195",60), + SECURITY_POD (MorphType.POD,76,"Security Pod","p. 195",30), + SPACE_MARINE (MorphType.POD,84,"Space Marine","p. 195",30), + SPECIALIST_POD (MorphType.POD,87,"Specialist Pod","p. 196",25), + VACUUM_POD (MorphType.POD,96,"Vacuum Pod","p. 197",30), + CASE (MorphType.SYNTH,1,"Case","p. 143, EP",5), + SYNTH (MorphType.SYNTH,21,"Synth","p. 143, EP",30), + ARACHNOID (MorphType.SYNTH,36,"Arachnoid","p. 143, EP",45), + DRAGONFLY (MorphType.SYNTH,41,"Dragonfly","p. 144, EP",20), + FLEXBOT (MorphType.SYNTH,46,"Flexbot","p. 144, EP",20), // cost=20* + REAPER (MorphType.SYNTH,50,"Reaper","p. 144, EP",100), + SLITHEROID (MorphType.SYNTH,51,"Slitheroid","p. 144, EP",40), + SWARMANOID (MorphType.SYNTH,55,"Swarmanoid","p. 144, EP",25), + Q_MORPH (MorphType.SYNTH,59,"Q Morph","p. 163, S",100), + STEEL_MORPH (MorphType.SYNTH,60,"Steel Morph","p. 163, S",50), + STEEL_MORPH_MASKED(MorphType.SYNTH,62,"Steel Morph (Masked)","p. 163, S",55), + STEEL_MORPH_LIQUID_SILVER(MorphType.SYNTH,63,"Steel Morph (Liquid Silver)","p. 163, S",70), + SUNDIVER (MorphType.SYNTH,64,"Sundiver","p. 164, S",70), + CETUS (MorphType.SYNTH,65,"Cetus","p. 185, R",45), + COURIER (MorphType.SYNTH,66,"Courier","p. 185, R",70), + FENRIR (MorphType.SYNTH,67,"Fenrir","p. 186, R",0), // cost=NA + SAVANT (MorphType.SYNTH,68,"Savant","p. 187, R",65), + KITE (MorphType.SYNTH,69,"Kite","p. 150, G",30), + SPARE (MorphType.SYNTH,70,"Spare","p. 151, G",5), + XU_FU (MorphType.SYNTH,71,"Xu Fu","p. 151, G",60), + GARGOYLE (MorphType.SYNTH,73,"Gargoyle","p. 142, P",40), + SKULKER (MorphType.SYNTH,75,"Skulker","p. 144, P",35), + TAKKO (MorphType.SYNTH,76,"Takko","p. 144, P",60), + BIOCORE (MorphType.SYNTH,78,"Biocore","p. 188",50), + BLACKBIRD (MorphType.SYNTH,79,"Blackbird","p. 189",45), + CLOUD_SKIMMER (MorphType.SYNTH,81,"Cloud Skimmer","p. 189",65), + DAITYA (MorphType.SYNTH,82,"Daitya","p. 190",80), + FIGHTING_KITE (MorphType.SYNTH,83,"Fighting Kite","p. 190",35), + GALATEA (MorphType.SYNTH,84,"Galatea","p. 192",65), + GRIEFER (MorphType.SYNTH,86,"Griefer","p. 192",5), + GUARD (MorphType.SYNTH,87,"Guard","p. 192",60), + GUARD_DELUXE (MorphType.SYNTH,89,"Guard Deluxe","p. 193",75), + MIMIC (MorphType.SYNTH,90,"Mimic","p. 193",25), + NAUTILOID (MorphType.SYNTH,91,"Nautiloid","p. 193",155), + OPTERYX (MorphType.SYNTH,92,"Opteryx","p. 194",40), + ROVER (MorphType.SYNTH,94,"Rover","p. 194",60), + SPACE_FIGHTER_ROVER(MorphType.SYNTH,96,"Space Fighter Rover","p. 194",60), + SMART_SWARM (MorphType.SYNTH,97,"Smart Swarm","p. 196",30), + SPHERE (MorphType.SYNTH,98,"Sphere","p. 196",65), + SYNTHTAUR (MorphType.SYNTH,100,"Synthtaur","p. 196",70), + INFOMORPH (MorphType.INFO,1,"Infomorph","p. 145, EP",0), + AGENT (MorphType.INFO,51,"Agent","p. 142",35), + DIGIMORPH (MorphType.INFO,58,"Digimorph","p. 142",25), + ELITE (MorphType.INFO,71,"Elite","p. 142",35), + HOT_SHOT (MorphType.INFO,75,"Hot Shot","p. 142",35), + SAGE (MorphType.INFO,82,"Sage","p. 142",40), + SCHOLAR (MorphType.INFO,86,"Scholar","p. 142",35), + SLAVE (MorphType.INFO,93,"Slave","p. 142",5), + WIREHEAD (MorphType.INFO,94,"Wirehead","p. 142",60), + ; + + private Morph(MorphType type, int rollMin, String name, String pageRef, int cpCost) + { + this.type = type; + this.rollMin = rollMin; + this.name = name; + this.pageRef = pageRef; + this.cpCost = cpCost; + } + + MorphType type; + int rollMin; + String name; + String pageRef; + int cpCost; + + @Override + public String toString() + { + return name; + } + } + + private static final Map> morphs = new HashMap<>(); + static + { + for (Morph morph: Morph.values()) + { + if (!morphs.containsKey(morph.type)) + morphs.put(morph.type, new RollTable<>(100)); + morphs.get(morph.type).addEntry(morph.rollMin, morph); + } + } +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/ChooseYouthPath.java b/src/main/java/moe/nekojimi/charactermaker/steps/ChooseYouthPath.java new file mode 100644 index 0000000..4aab2d6 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/ChooseYouthPath.java @@ -0,0 +1,41 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import moe.nekojimi.charactermaker.Main; +import moe.nekojimi.charactermaker.RollTable; + +/** + * + * @author jimj316 + */ +public class ChooseYouthPath extends Step +{ + private static final RollTable table = new RollTable<>(10); + static + { + table.addEntry(1, Path.WHOLESOME); + table.addEntry(7, Path.SPLIT); + table.addEntry(10, Path.FRACTURED); + }; + + static enum Path + { + WHOLESOME, + SPLIT, + FRACTURED; + } + @Override + public void run() + { + Path path = Main.ui.showRollPrompt("Choose youth path", table, 1); + switch (path) + { + case WHOLESOME: + + } + } +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/NativeToungeStep.java b/src/main/java/moe/nekojimi/charactermaker/steps/NativeToungeStep.java new file mode 100644 index 0000000..d3d5a33 --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/NativeToungeStep.java @@ -0,0 +1,53 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +import java.util.AbstractMap; +import moe.nekojimi.charactermaker.Main; +import moe.nekojimi.charactermaker.RollTable; + + +public class NativeToungeStep extends Step +{ + private static final RollTable table = new RollTable<>(100, + new AbstractMap.SimpleEntry<>(1,"Arabic "), + new AbstractMap.SimpleEntry<>(7,"Bengali "), + new AbstractMap.SimpleEntry<>(10,"Cantonese/Yue "), + new AbstractMap.SimpleEntry<>(15,"Dutch "), + new AbstractMap.SimpleEntry<>(16,"English "), + new AbstractMap.SimpleEntry<>(25,"Farsi/Persian "), + new AbstractMap.SimpleEntry<>(28,"French "), + new AbstractMap.SimpleEntry<>(32,"German "), + new AbstractMap.SimpleEntry<>(36,"Hindi "), + new AbstractMap.SimpleEntry<>(42,"Italian "), + new AbstractMap.SimpleEntry<>(43,"Japanese "), + new AbstractMap.SimpleEntry<>(48,"Javanese "), + new AbstractMap.SimpleEntry<>(52,"Korean "), + new AbstractMap.SimpleEntry<>(54,"Mandarin "), + new AbstractMap.SimpleEntry<>(63,"Polish "), + new AbstractMap.SimpleEntry<>(64,"Portuguese "), + new AbstractMap.SimpleEntry<>(69,"Punjabi "), + new AbstractMap.SimpleEntry<>(72,"Russian "), + new AbstractMap.SimpleEntry<>(77,"Skandinaviska "), + new AbstractMap.SimpleEntry<>(79,"Spanish "), + new AbstractMap.SimpleEntry<>(85,"Swedish "), + new AbstractMap.SimpleEntry<>(86,"Tamil "), + new AbstractMap.SimpleEntry<>(88,"Turkish "), + new AbstractMap.SimpleEntry<>(90,"Urdu "), + new AbstractMap.SimpleEntry<>(93,"Vietnwamese "), + new AbstractMap.SimpleEntry<>(95,"Wu "), + new AbstractMap.SimpleEntry<>(99,"Other ") + ); + + @Override + public void run() + { + String choice = Main.ui.showRollPrompt("Choose native tounge",table,3); + String skillName = ("Language: " + choice).trim(); + Main.addStepFirst(new ChangeSkillStep(70, skillName)); + } + +} diff --git a/src/main/java/moe/nekojimi/charactermaker/steps/Step.java b/src/main/java/moe/nekojimi/charactermaker/steps/Step.java new file mode 100644 index 0000000..05307ca --- /dev/null +++ b/src/main/java/moe/nekojimi/charactermaker/steps/Step.java @@ -0,0 +1,17 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package moe.nekojimi.charactermaker.steps; + +/** + * + * @author jimj316 + */ +public abstract class Step implements Runnable +{ + + @Override + public abstract void run(); +} diff --git a/target/CharacterMaker-1.0.jar b/target/CharacterMaker-1.0.jar new file mode 100644 index 0000000..41ee80a Binary files /dev/null and b/target/CharacterMaker-1.0.jar differ diff --git a/target/classes/.netbeans_automatic_build b/target/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/target/classes/moe/nekojimi/charactermaker/Character.class b/target/classes/moe/nekojimi/charactermaker/Character.class new file mode 100644 index 0000000..17d562b Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/Character.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/Main.class b/target/classes/moe/nekojimi/charactermaker/Main.class new file mode 100644 index 0000000..739a55f Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/Main.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/RollTable.class b/target/classes/moe/nekojimi/charactermaker/RollTable.class new file mode 100644 index 0000000..38bdd3c Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/RollTable.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/UI.class b/target/classes/moe/nekojimi/charactermaker/UI.class new file mode 100644 index 0000000..67c028d Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/UI.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep$Template.class b/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep$Template.class new file mode 100644 index 0000000..23a137f Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep$Template.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep.class b/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep.class new file mode 100644 index 0000000..8b01fba Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/AptTemplateStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.class b/target/classes/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.class new file mode 100644 index 0000000..40fc5a5 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChangeAptitudeStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChangePropertyStep.class b/target/classes/moe/nekojimi/charactermaker/steps/ChangePropertyStep.class new file mode 100644 index 0000000..07d19c9 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChangePropertyStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChangeSkillStep.class b/target/classes/moe/nekojimi/charactermaker/steps/ChangeSkillStep.class new file mode 100644 index 0000000..6d0f0c4 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChangeSkillStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChangeValueStep.class b/target/classes/moe/nekojimi/charactermaker/steps/ChangeValueStep.class new file mode 100644 index 0000000..016db51 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChangeValueStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$Morph.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$Morph.class new file mode 100644 index 0000000..736d186 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$Morph.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$MorphType.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$MorphType.class new file mode 100644 index 0000000..12bfe40 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep$MorphType.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep.class new file mode 100644 index 0000000..ed7785b Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseMorphStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$1.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$1.class new file mode 100644 index 0000000..845d91e Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$1.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$Path.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$Path.class new file mode 100644 index 0000000..1ffc3b5 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath$Path.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath.class b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath.class new file mode 100644 index 0000000..958e5c2 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/ChooseYouthPath.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/NativeToungeStep.class b/target/classes/moe/nekojimi/charactermaker/steps/NativeToungeStep.class new file mode 100644 index 0000000..bc89cfb Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/NativeToungeStep.class differ diff --git a/target/classes/moe/nekojimi/charactermaker/steps/Step.class b/target/classes/moe/nekojimi/charactermaker/steps/Step.class new file mode 100644 index 0000000..7d0b7a3 Binary files /dev/null and b/target/classes/moe/nekojimi/charactermaker/steps/Step.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..946f869 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Sun Sep 19 21:53:24 BST 2021 +groupId=moe.nekojimi +artifactId=CharacterMaker +version=1.0 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..57b3667 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +moe/nekojimi/charactermaker/Character.class +moe/nekojimi/charactermaker/Step.class +moe/nekojimi/charactermaker/UI.class +moe/nekojimi/charactermaker/Main.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..f1ca68f --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,4 @@ +/home/jimj316/ownCloud/Programming/CharacterMaker/src/main/java/moe/nekojimi/charactermaker/Step.java +/home/jimj316/ownCloud/Programming/CharacterMaker/src/main/java/moe/nekojimi/charactermaker/Character.java +/home/jimj316/ownCloud/Programming/CharacterMaker/src/main/java/moe/nekojimi/charactermaker/Main.java +/home/jimj316/ownCloud/Programming/CharacterMaker/src/main/java/moe/nekojimi/charactermaker/UI.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/target/test-classes/.netbeans_automatic_build b/target/test-classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29