NPC Generator
- Requirements
- Getting Started
NPC Gen
Generate NPC
characters with optimal attributes based on Class
(and
Race
?).
Requirements
We need to generate (9) Ability Scores
for our character. In the physical
world, we roll dice. Here, we'll mimick that process by generating random
numbers.
To generate these Ability Scores
for our character, we will perform the
following steps for each Ability Score
.
Ability Scores
Generating To generate an Ability Score
, follow these steps:
- generate four random numbers between 1 and 6
- drop a single result that is the lowest
- add the three remaining values
Once we have generated (9) Ability Scores
, we can begin assigning them.
Assigning Scores
- assign the resulting scores to
Ability Scores
according toClass
priorities or custom user configuration, with highest scores assigned to lower priority (e.g. scores: 24, 11 -> Priority 1 = 24, Priority 2 = 11) - Since there are (9)
Ability Scores
to assign, if there are less than (9)Ability Scores
configured with a priority, after assigning highest scores based on priorities, randomly assign the remaining scores toAbility Scores
missing a configured priority - support
undefined
Class
,Race
. SomeNPC
s have noClass
orRace
Ability Scores
Melee
Ranged
Strength
Dexterity
Constitution
Intelligence
Wisdom
Charisma
Luck
Input Needs
Allow the user to rank the priority of the Ability Scores
. When a user
selects a Class
, the current Ability
assignments should clear/reset. The
Ability
s should update to reflect the new Class
priority configuration.
The Class
Ability
priorities should be user modifiable after selecting a
Class
.
The user chosen Race
should support adding a bonus to Ability
score(s).
Future Requirements
Automatically calculate and add a bonus to the rolls based on
Race
Background
Culture
Support a user-configurable bonus
field for adding bonuses to the Ability
scores.
- The bonus will be applied to all rolls.
- The bonus adds to any
Racial
,Background
, orCulture
bonuses.
Ability Score Priorities
- First
- Second
- Third
- All other roll results are assigned randomly to the remaining
Ability
s.
Class
Assassin
Dexterity
Melee
Charisma
Barbarian
Strength
Constitution
Wisdom
Bard
Charisma
Dexterity
Intelligence
Cleric
Wisdom
Constitution
Strength
Druid
Wisdom
Constitution
Charisma
Fighter
Melee
Strength
Constitution
Monk
Dexterity
Wisdom
Melee
Paladin
Strength
Charisma
Melee
Ranger
Ranged
Dexterity
Wisdom
Shaman
Wisdom
Intelligence
Melee
Sorcerer
Charisma
Constitution
Ranged
Thief
Dexterity
Intelligence
Charisma
Warlock
Charisma
Wisdom
Constitution
Wizard
Intelligence
Wisdom
Constitution
Ability
Score Bonuses
Race
Human
+1 All Ability
scores
Elf
+2 Dexterity
Dwarf
+2 Constitution
Gnome
+2 Intelligence
Halfling
+2 Luck
Orc
+2 Strength
Goblin
+2 Dexterity
Minotaur
+2 Strength
Satyr
+2 Charisma
Firbolg
+2 Wisdom
Miscellaneous
Background
Ability
Score Bonuses: None (yet)Culture
Ability
Score Bonuses: None (yet)
Getting Started
This project uses deno
.
Usage
To use this project, use:
bash $ deno run src/roll.ts ...