Class NPCGenerator
java.lang.Object
NPCGenerator
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
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Record for user NPC specification. -
Field Summary
Modifier and TypeFieldDescription(package private) static final String
Name of PDF character sheet source file.(package private) boolean
Flag to escape after parsing arguments.(package private) NPCGenerator.GenProfile
Profile input by user.(package private) int
Line breaks between NPCs(package private) int
Number of NPCs to create.(package private) static final int
Percent chance for magic per level.(package private) boolean
Print PDF character sheets -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
Fill in 2nd class & level for an Elf profile.(package private) NPCGenerator.GenProfile
Create one fully-formed profile from incomplete source.(package private) int
Get integer following equals sign in command parameter.static void
Main test method.(package private) void
Make multiple NPCs as per input profile.(package private) Character
Make one NPC from a fully-formed profile.(package private) void
Parse the alignment command-line parameter.(package private) void
Parse arguments.(package private) void
parseClass
(String s) Parse the class command-line parameter.(package private) void
Parse the race command-line parameter.(package private) void
Print program banner.(package private) void
Print a character to the console.(package private) void
Print a character to a PDF file.(package private) void
Print usage.(package private) String
Roll for a class.(package private) String
Roll for elf non-wizard class.(package private) String
rollRace()
Roll for a race.
-
Field Details
-
PCT_MAGIC_PER_LEVEL
static final int PCT_MAGIC_PER_LEVELPercent chance for magic per level.- See Also:
-
CHAR_SHEET_FILE
Name of PDF character sheet source file.- See Also:
-
inputProfile
NPCGenerator.GenProfile inputProfileProfile input by user. -
numNPCs
int numNPCsNumber of NPCs to create. -
printPDFs
boolean printPDFsPrint PDF character sheets -
lineBreaks
int lineBreaksLine breaks between NPCs -
exitAfterArgs
boolean exitAfterArgsFlag to escape after parsing arguments.
-
-
Constructor Details
-
NPCGenerator
NPCGenerator()Constructor.
-
-
Method Details
-
printBanner
void printBanner()Print program banner. -
printUsage
void printUsage()Print usage. -
parseArgs
Parse arguments. -
getParamInt
Get integer following equals sign in command parameter. -
parseRace
Parse the race command-line parameter. -
parseClass
Parse the class command-line parameter. -
parseAlignment
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
Fill in 2nd class & level for an Elf profile. -
makeNPCFromProfile
Make one NPC from a fully-formed profile. -
makeAllNPCs
void makeAllNPCs()Make multiple NPCs as per input profile. -
printToConsole
Print a character to the console. -
printToPDF
Print a character to a PDF file. -
main
Main test method.
-