- 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 Scoresaccording toClasspriorities 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 Scoresto assign, if there are less than (9)Ability Scoresconfigured with a priority, after assigning highest scores based on priorities, randomly assign the remaining scores toAbility Scoresmissing a configured priority - support
undefinedClass,Race. SomeNPCs have noClassorRace
MeleeRangedStrengthDexterityConstitutionIntelligenceWisdomCharismaLuck
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
Abilitys 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
RaceBackgroundCulture
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, orCulturebonuses.
- First
- Second
- Third
- All other roll results are assigned randomly to the remaining
Abilitys.
DexterityMeleeCharisma
StrengthConstitutionWisdom
CharismaDexterityIntelligence
WisdomConstitutionStrength
WisdomConstitutionCharisma
MeleeStrengthConstitution
DexterityWisdomMelee
StrengthCharismaMelee
RangedDexterityWisdom
WisdomIntelligenceMelee
CharismaConstitutionRanged
DexterityIntelligenceCharisma
CharismaWisdomConstitution
IntelligenceWisdomConstitution
+1 All Ability scores
+2 Dexterity
+2 Constitution
+2 Intelligence
+2 Luck
+2 Strength
+2 Dexterity
+2 Strength
+2 Charisma
+2 Wisdom
BackgroundAbilityScore Bonuses: None (yet)CultureAbilityScore Bonuses: None (yet)
This project uses deno.
To use this project, use:
bash $ deno run src/roll.ts ...