- Requirements
- Getting Started
Generate NPC
characters with optimal attributes based on Class
(and
Race
?).
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
.
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.
- 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
Melee
Ranged
Strength
Dexterity
Constitution
Intelligence
Wisdom
Charisma
Luck
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).
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.
- First
- Second
- Third
- All other roll results are assigned randomly to the remaining
Ability
s.
Dexterity
Melee
Charisma
Strength
Constitution
Wisdom
Charisma
Dexterity
Intelligence
Wisdom
Constitution
Strength
Wisdom
Constitution
Charisma
Melee
Strength
Constitution
Dexterity
Wisdom
Melee
Strength
Charisma
Melee
Ranged
Dexterity
Wisdom
Wisdom
Intelligence
Melee
Charisma
Constitution
Ranged
Dexterity
Intelligence
Charisma
Charisma
Wisdom
Constitution
Intelligence
Wisdom
Constitution
+1 All Ability
scores
+2 Dexterity
+2 Constitution
+2 Intelligence
+2 Luck
+2 Strength
+2 Dexterity
+2 Strength
+2 Charisma
+2 Wisdom
Background
Ability
Score Bonuses: None (yet)Culture
Ability
Score Bonuses: None (yet)
This project uses deno
.
To use this project, use:
bash $ deno run src/roll.ts ...