1package com.burrbox.dndiablo;
3import java.util.Arrays;
4import java.util.Random;
16 int str,
int dex,
int con,
17 int intel,
int wis,
int cha) {
21 stats.dndclass = dndClass;
23 stats.proficiency = 2;
26 stats.strengthScore = str;
27 stats.dexterityScore = dex;
28 stats.constitutionScore = con;
29 stats.intelligenceScore = intel;
30 stats.wisdomScore = wis;
31 stats.charismaScore = cha;
38 stats.hp = stats.
maxHp;
74 return (
int) Math.floor((score - 10) / 2.0);
79 stats.profStrengthSave =
false;
80 stats.profDexteritySave =
false;
81 stats.profConstitutionSave =
false;
82 stats.profIntelligenceSave =
false;
83 stats.profWisdomSave =
false;
84 stats.profCharismaSave =
false;
94 private static final Random
dice =
new Random(2026);
104 if (stats.
level >= 17) stats.proficiency = 6;
105 else if (stats.
level >= 13) stats.proficiency = 5;
106 else if (stats.
level >= 9) stats.proficiency = 4;
107 else if (stats.
level >= 5) stats.proficiency = 3;
108 else stats.proficiency = 2;
112 if (hpGain < 1) hpGain = 1;
114 stats.maxHp += hpGain;
127 return s.strengthModifier + (s.profStrengthSave ? s.proficiency : 0);
131 return s.dexterityModifier + (s.profDexteritySave ? s.proficiency : 0);
135 return s.constitutionModifier + (s.profConstitutionSave ? s.proficiency : 0);
139 return s.intelligenceModifier + (s.profIntelligenceSave ? s.proficiency : 0);
143 return s.wisdomModifier + (s.profWisdomSave ? s.proficiency : 0);
147 return s.charismaModifier + (s.profCharismaSave ? s.proficiency : 0);
156 return new int[]{15, 14, 13, 12, 10, 8};
165 int[] scores =
new int[6];
166 for (
int i = 0; i < 6; i++) {
174 int[] rolls =
new int[4];
178 for (
int i = 0; i < 4; i++) {
179 rolls[i] =
dice.nextInt(6) + 1;
181 if (rolls[i] < lowest) {
194 return new int[]{13, 13, 13, 12, 12, 12};
List< String > savingThrowProficiencies
static int getStrengthSaveBonus(DndCharacterStats s)
static int getIntelligenceSaveBonus(DndCharacterStats s)
static int[] rollAbilityScores()
static void refreshCalculatedStats(DndCharacterStats stats)
static void levelUp(DndCharacterStats stats)
static int calculateModifier(int score)
static void applyClassProficiencies(DndCharacterStats stats, DNDClass dndClass)
static int getCharismaSaveBonus(DndCharacterStats s)
static int getWisdomSaveBonus(DndCharacterStats s)
static int getDexteritySaveBonus(DndCharacterStats s)
static int[] getStandardArray()
static int[] getPointBuyBaseline()
static int rollSingleAbilityScore()
static int getConstitutionSaveBonus(DndCharacterStats s)
static DndCharacterStats createLevel1Character(String name, DNDClass dndClass, int str, int dex, int con, int intel, int wis, int cha)