Class NPCGenerator

java.lang.Object
NPCGenerator

public class NPCGenerator extends Object
Generates random NPCs to user specification. Optionally take name of output file, so we can see user prompts in console, while final output goes to text file.
Since:
2018-12-04
  • Field Details

    • PCT_MAGIC_PER_LEVEL

      static final int PCT_MAGIC_PER_LEVEL
      Percent chance for magic per level.
      See Also:
    • CHAR_SHEET_FILE

      static final String CHAR_SHEET_FILE
      Name of PDF character sheet source file.
      See Also:
    • inputProfile

      Profile input by user.
    • numNPCs

      int numNPCs
      Number of NPCs to create.
    • printPDFs

      boolean printPDFs
      Print PDF character sheets
    • lineBreaks

      int lineBreaks
      Line breaks between NPCs
    • exitAfterArgs

      boolean exitAfterArgs
      Flag to escape after parsing arguments.
  • Constructor Details

    • NPCGenerator

      NPCGenerator()
      Constructor.
  • Method Details

    • printBanner

      void printBanner()
      Print program banner.
    • printUsage

      void printUsage()
      Print usage.
    • parseArgs

      void parseArgs(String[] args)
      Parse arguments.
    • getParamInt

      int getParamInt(String s)
      Get integer following equals sign in command parameter.
    • parseRace

      void parseRace(String s)
      Parse the race command-line parameter.
    • parseClass

      void parseClass(String s)
      Parse the class command-line parameter.
    • parseAlignment

      void parseAlignment(String s)
      Parse the alignment command-line parameter.
    • rollRace

      String rollRace()
      Roll for a race.
    • rollClass

      String rollClass()
      Roll for a class.
    • rollElfClass

      String rollElfClass()
      Roll for elf non-wizard class.
    • fillProfile

      Create one fully-formed profile from incomplete source.
    • fillElfProfile

      void fillElfProfile(NPCGenerator.GenProfile p)
      Fill in 2nd class & level for an Elf profile.
    • makeNPCFromProfile

      Character makeNPCFromProfile(NPCGenerator.GenProfile p)
      Make one NPC from a fully-formed profile.
    • makeAllNPCs

      void makeAllNPCs()
      Make multiple NPCs as per input profile.
    • printToConsole

      void printToConsole(Character c)
      Print a character to the console.
    • printToPDF

      void printToPDF(Character c)
      Print a character to a PDF file.
    • main

      public static void main(String[] args)
      Main test method.