JScratch
Loading...
Searching...
No Matches
com.burrbox.dndiablo.DndCharacterAPI Class Reference

Static Public Member Functions

static DndCharacterStats createLevel1Character (String name, DNDClass dndClass, int str, int dex, int con, int intel, int wis, int cha)
static void refreshCalculatedStats (DndCharacterStats stats)
static void levelUp (DndCharacterStats stats)
static int getStrengthSaveBonus (DndCharacterStats s)
static int getDexteritySaveBonus (DndCharacterStats s)
static int getConstitutionSaveBonus (DndCharacterStats s)
static int getIntelligenceSaveBonus (DndCharacterStats s)
static int getWisdomSaveBonus (DndCharacterStats s)
static int getCharismaSaveBonus (DndCharacterStats s)
static int[] getStandardArray ()
static int[] rollAbilityScores ()
static int[] getPointBuyBaseline ()

Static Private Member Functions

static int calculateModifier (int score)
static void applyClassProficiencies (DndCharacterStats stats, DNDClass dndClass)
static int rollSingleAbilityScore ()

Static Private Attributes

static final Random dice = new Random(2026)

Detailed Description

API for creating and managing D&D characters. Compatible with Java 8 and older.

Definition at line 10 of file DndCharacterAPI.java.

Member Function Documentation

◆ applyClassProficiencies()

void com.burrbox.dndiablo.DndCharacterAPI.applyClassProficiencies ( DndCharacterStats stats,
DNDClass dndClass )
staticprivate

Definition at line 77 of file DndCharacterAPI.java.

◆ calculateModifier()

int com.burrbox.dndiablo.DndCharacterAPI.calculateModifier ( int score)
staticprivate

Standard D&D Formula: (Score - 10) / 2, rounded down.

Definition at line 73 of file DndCharacterAPI.java.

◆ createLevel1Character()

DndCharacterStats com.burrbox.dndiablo.DndCharacterAPI.createLevel1Character ( String name,
DNDClass dndClass,
int str,
int dex,
int con,
int intel,
int wis,
int cha )
static

Creates a Level 1 character based on a class and raw ability scores.

Definition at line 15 of file DndCharacterAPI.java.

◆ getCharismaSaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getCharismaSaveBonus ( DndCharacterStats s)
static

Definition at line 146 of file DndCharacterAPI.java.

◆ getConstitutionSaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getConstitutionSaveBonus ( DndCharacterStats s)
static

Definition at line 134 of file DndCharacterAPI.java.

◆ getDexteritySaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getDexteritySaveBonus ( DndCharacterStats s)
static

Definition at line 130 of file DndCharacterAPI.java.

◆ getIntelligenceSaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getIntelligenceSaveBonus ( DndCharacterStats s)
static

Definition at line 138 of file DndCharacterAPI.java.

◆ getPointBuyBaseline()

int[] com.burrbox.dndiablo.DndCharacterAPI.getPointBuyBaseline ( )
static

Method 3: Point Buy (The "Fair" Method) In a real UI, you'd let players spend 27 points. For a quick "Average Hero" generation, this returns a baseline.

Definition at line 193 of file DndCharacterAPI.java.

◆ getStandardArray()

int[] com.burrbox.dndiablo.DndCharacterAPI.getStandardArray ( )
static

Method 1: The Standard Array Returns the fixed set of scores: 15, 14, 13, 12, 10, 8. Best for beginners or balanced gameplay.

Definition at line 155 of file DndCharacterAPI.java.

◆ getStrengthSaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getStrengthSaveBonus ( DndCharacterStats s)
static

Gets the total bonus for a Strength Save. Logic: Strength Mod + (Proficiency if proficient)

Definition at line 126 of file DndCharacterAPI.java.

◆ getWisdomSaveBonus()

int com.burrbox.dndiablo.DndCharacterAPI.getWisdomSaveBonus ( DndCharacterStats s)
static

Definition at line 142 of file DndCharacterAPI.java.

◆ levelUp()

void com.burrbox.dndiablo.DndCharacterAPI.levelUp ( DndCharacterStats stats)
static

Levels up the character. Increases Proficiency Bonus at levels 5, 9, 13, and 17.

Definition at line 100 of file DndCharacterAPI.java.

◆ refreshCalculatedStats()

void com.burrbox.dndiablo.DndCharacterAPI.refreshCalculatedStats ( DndCharacterStats stats)
static

Recalculates all modifiers and passive senses. Call this whenever an ability score changes (e.g., leveling up or buffs).

Definition at line 53 of file DndCharacterAPI.java.

◆ rollAbilityScores()

int[] com.burrbox.dndiablo.DndCharacterAPI.rollAbilityScores ( )
static

Method 2: 4d6 Drop Lowest (The "Classic" Roll) Rolls four 6-sided dice, discards the lowest, and sums the rest. Repeats this 6 times.

Definition at line 164 of file DndCharacterAPI.java.

◆ rollSingleAbilityScore()

int com.burrbox.dndiablo.DndCharacterAPI.rollSingleAbilityScore ( )
staticprivate

Definition at line 173 of file DndCharacterAPI.java.

Member Data Documentation

◆ dice

final Random com.burrbox.dndiablo.DndCharacterAPI.dice = new Random(2026)
staticprivate

Definition at line 94 of file DndCharacterAPI.java.


The documentation for this class was generated from the following file: