|
JScratch
|
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) |
API for creating and managing D&D characters. Compatible with Java 8 and older.
Definition at line 10 of file DndCharacterAPI.java.
|
staticprivate |
Definition at line 77 of file DndCharacterAPI.java.
|
staticprivate |
Standard D&D Formula: (Score - 10) / 2, rounded down.
Definition at line 73 of file DndCharacterAPI.java.
|
static |
Creates a Level 1 character based on a class and raw ability scores.
Definition at line 15 of file DndCharacterAPI.java.
|
static |
Definition at line 146 of file DndCharacterAPI.java.
|
static |
Definition at line 134 of file DndCharacterAPI.java.
|
static |
Definition at line 130 of file DndCharacterAPI.java.
|
static |
Definition at line 138 of file DndCharacterAPI.java.
|
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.
|
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.
|
static |
Gets the total bonus for a Strength Save. Logic: Strength Mod + (Proficiency if proficient)
Definition at line 126 of file DndCharacterAPI.java.
|
static |
Definition at line 142 of file DndCharacterAPI.java.
|
static |
Levels up the character. Increases Proficiency Bonus at levels 5, 9, 13, and 17.
Definition at line 100 of file DndCharacterAPI.java.
|
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.
|
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.
|
staticprivate |
Definition at line 173 of file DndCharacterAPI.java.
|
staticprivate |
Definition at line 94 of file DndCharacterAPI.java.