feat: character creator overhaul with stat rolling and ability grid #22

Merged
kevin merged 7 commits from dev/frontend into main 2026-05-11 19:17:14 +00:00
Owner

Summary

Complete overhaul of the Character Creator (Step 3) and the underlying
stat/ability system. Heroes now roll their stats on class selection,
can reroll before committing, and see live effective skill values based
on a new scaling formula.

Character Creator

Step 2

  • Stat bars now show range (e.g. 16-20) instead of fixed values
  • Show single value when min equals max
  • stat-bar-val width increased to 48px for aligned display across class cards

Step 3 — Ability Distribution

  • Replace linear skill list with 2x2 panel grid (Kampf, Verteidigung & Magie,
    Heimlichkeit & Soziales, Überleben & Handwerk)
  • Add stat rolling on class selection via rollStats() and randInt()
  • Add Reroll button — re-rolls stats and resets invested skill points
  • Show rolled stat values with range hint in stats overview
  • Update effective skill formula: invested + Math.floor(stat * 1.5)
  • Use rolledStats for bonus calculation instead of class min values
  • Fix: statstatVal in effective calculation

General

  • Increase font sizes across all steps
  • Remove obsolete attributes state and ATTR_LABELS constant
  • Remove duplicate useEffect for selectedClass
  • Remove stray statVal/effective lines from component body
  • Fix createHero to call POST /heroes/create with rolled_stats

Backend

heroes.py

  • Add import random
  • Make attributes field optional with default {}
  • Add rolled_stats field to HeroCreateWithAttributes
  • Use rolled_stats if provided, otherwise roll on backend
  • Fix typo: hero_classbase_intelligence_max
  • Remove misplaced available_skillpoints property

hero.py

  • Update effective_skill formula to int(stat_value * 1.5)
  • Fix getattr target: self instead of self.hero_class for stat lookup

CSS

  • Add .realm-bg .container { max-width: 820px } for 2-column layout
  • Add panel grid, ability panel, reroll button styles
  • Remove obsolete cc-attr-* classes
  • Fix duplicate cc-skill-row and cc-reroll-btn definitions
## Summary Complete overhaul of the Character Creator (Step 3) and the underlying stat/ability system. Heroes now roll their stats on class selection, can reroll before committing, and see live effective skill values based on a new scaling formula. ## Character Creator ### Step 2 - Stat bars now show range (e.g. `16-20`) instead of fixed values - Show single value when min equals max - `stat-bar-val` width increased to 48px for aligned display across class cards ### Step 3 — Ability Distribution - Replace linear skill list with 2x2 panel grid (Kampf, Verteidigung & Magie, Heimlichkeit & Soziales, Überleben & Handwerk) - Add stat rolling on class selection via `rollStats()` and `randInt()` - Add Reroll button — re-rolls stats and resets invested skill points - Show rolled stat values with range hint in stats overview - Update effective skill formula: `invested + Math.floor(stat * 1.5)` - Use `rolledStats` for bonus calculation instead of class min values - Fix: `stat` → `statVal` in effective calculation ### General - Increase font sizes across all steps - Remove obsolete `attributes` state and `ATTR_LABELS` constant - Remove duplicate `useEffect` for selectedClass - Remove stray `statVal`/`effective` lines from component body - Fix `createHero` to call `POST /heroes/create` with `rolled_stats` ## Backend ### heroes.py - Add `import random` - Make `attributes` field optional with default `{}` - Add `rolled_stats` field to `HeroCreateWithAttributes` - Use `rolled_stats` if provided, otherwise roll on backend - Fix typo: `hero_classbase_intelligence_max` - Remove misplaced `available_skillpoints` property ### hero.py - Update `effective_skill` formula to `int(stat_value * 1.5)` - Fix `getattr` target: `self` instead of `self.hero_class` for stat lookup ## CSS - Add `.realm-bg .container { max-width: 820px }` for 2-column layout - Add panel grid, ability panel, reroll button styles - Remove obsolete `cc-attr-*` classes - Fix duplicate `cc-skill-row` and `cc-reroll-btn` definitions
- Split 43 abilities into 4 thematic panels (Kampf, Verteidigung & Magie,
  Heimlichkeit & Soziales, Überleben & Handwerk)
- Display panels in 2x2 grid layout
- Show effective value per ability inline
- Replace SECTIONS with PANELS constant

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Split 43 abilities into 4 thematic panels (Kampf, Verteidigung & Magie,
  Heimlichkeit & Soziales, Überleben & Handwerk)
- Display panels in 2x2 grid layout
- Show effective value per ability inline
- Replace SECTIONS with PANELS constant

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Remove duplicate cc-skill-row, cc-ability-panel, cc-panel-title definitions
- Remove obsolete cc-attr-* classes from old attribute system
- Remove unused cc-skill-list class
- Fix stat-bar-val width for range display

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Add rolledStats state with rollStats() and randInt() helper functions
- Roll stats automatically when class is selected (useEffect)
- Add Reroll button in Step 3 that re-rolls stats and resets skill points
- Use rolledStats for effective skill bonus calculation in Step 3
- Remove duplicate stats grid in Step 3 (keep only cc-stats-header version)
- Show single value instead of X-X range when min equals max (StatBar + Step 3)
- Increase font sizes across character creator (skill-name, skill-tag, skill-effective, panel-title)
- Remove obsolete attributes state and ATTR_LABELS constant
- Remove duplicate useEffect for selectedClass
- Remove stray statVal/effective lines from component body
- Fix statBonus to use rolledStats instead of selectedClass min values
- Fix POST /heroes/create call (remove attributes field, add rolled_stats)
- Fix heroes.py: remove misplaced available_skillpoints property
- Fix heroes.py: add missing import random
- Fix heroes.py: typo hero_classbase_intelligence_max
- Make attributes field optional in HeroCreateWithAttributes schema

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Frontend: effective = invested + Math.floor(stat * 1.5)
- Backend: effective_skill uses int(stat_value * 1.5)
- Fresh heroes start as Lehrling in class-appropriate abilities

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
- Add rolledStats state with rollStats() and randInt() helper functions
- Roll stats automatically when class is selected via useEffect
- Add Reroll button in Step 3 that re-rolls stats and resets skill points
- Update effective skill formula to invested + Math.floor(stat * 1.5)
- Update statBonus() to use rolledStats instead of selectedClass min values
- Fix effective calculation: stat → statVal
- Update backend effective_skill to use int(stat_value * 1.5)
- Show single value instead of X-X range when min equals max in StatBar
- Increase font sizes across character creator panels
- Fix stat-bar-val width to 48px for aligned class card display
- Pass rolled_stats to POST /heroes/create instead of re-rolling on backend

Signed-off-by: kevin mika <mika.kevin@nexus-6.eu>
kevin merged commit 762b03d3b1 into main 2026-05-11 19:17:14 +00:00
kevin deleted branch dev/frontend 2026-05-11 19:17:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kevin/nexus-rpg!22
No description provided.