Races and Classes - xopherdeep/do-it-for-the-xp GitHub Wiki

Races & Class Evolution

๐Ÿงฌ Races: Fantasy Origin Stories

Give users a race that provides passive bonuses and flavor!

Data Model

interface Race {
  id: string;
  name: string;
  description: string;
  lore: string;
  icon: string;
  passives: RacialPassive[];
  startingStats: Partial<CharacterStats>;
}

interface RacialPassive {
  name: string;
  description: string;
  effect: PassiveEffect;
}

Race Options

Race Theme Passive Bonuses Flavor
Human Balanced +10% XP, Versatile (bonus all stats) "Adaptable and ambitious"
Elf Wisdom +20% MP regen, +2 Intelligence "Ancient knowledge seekers"
Dwarf Endurance +20% HP, +2 Vitality, +10% gold "Sturdy and hardworking"
Orc Strength +30% task speed when HP low, +3 STR "Thrive under pressure"
Gnome Efficiency +15% cooldown reduction "Tinkers and optimizers"
Fairy Support +25% party buff effectiveness "Empowers others"
Dragonkin Power 2x XP from difficult tasks "Born for challenge"
Shadow Stealth Complete tasks without notifying party "Works in the shadows"

Race Selection UI Concept

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โš”๏ธ CHOOSE YOUR ORIGIN                              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                     โ”‚
โ”‚  ๐Ÿง ELF                    ๐Ÿง” DWARF                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚   [image]   โ”‚          โ”‚   [image]   โ”‚          โ”‚
โ”‚  โ”‚ +20% MP     โ”‚          โ”‚ +20% HP     โ”‚          โ”‚
โ”‚  โ”‚ +2 INT      โ”‚          โ”‚ +10% Gold   โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                                     โ”‚
โ”‚  ๐Ÿ‘ค HUMAN                  ๐Ÿ’ช ORC                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚
โ”‚  โ”‚   [image]   โ”‚          โ”‚   [image]   โ”‚          โ”‚
โ”‚  โ”‚ +10% XP     โ”‚          โ”‚ Pressure    โ”‚          โ”‚
โ”‚  โ”‚ Versatile   โ”‚          โ”‚ Bonus       โ”‚          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚
โ”‚                                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โš”๏ธ Class Evolution System

The class tree is 4 โ†’ 8 โ†’ 3: four base classes, eight advanced classes (one parent each) and three crown classes (two advanced parents each). The shipped version is deliberately smaller than the old 28-class sketch: every class has an icon the app already bundles and a passive built from fields the loop already reads, so it never complicates play. Rule zero stands: no class completes a chore.

Class Evolution Tree

graph TD
    W[Warrior] --> K[Knight]
    W --> B[Berserker]
    M[Mage] --> WM[White Mage]
    M --> BM[Black Mage]
    T[Thief] --> AS[Assassin]
    T --> R[Ranger]
    MK[Monk] --> MA[Martial Artist]
    MK --> MY[Mystic]

    K --> P[Paladin]
    MY --> P
    AS --> N[Ninja]
    B --> N
    WM --> S[Sage]
    MY --> S
Loading

Tier 1 (always open): Warrior, Mage, Thief, Monk. Tier 2 (advanced): the eight classes in the top half of the graph. Tier 3 (crown): Paladin, Ninja, Sage, each the meeting point of two advanced classes. The Mystic feeds both Paladin and Sage.

Class Evolution Requirements

Levels are class levels (stats.classes[name].level, grown by the XP of the class the hero is playing), not the hero's level. The rule lives in JOB_UNLOCK_REQUIREMENTS (src/lib/services/stats/PlayerStatsService.ts); isClassUnlocked (ClassPassives.ts) reads it, and setJobClass refuses a sealed class.

Tier Class Grows out of Unlocks when
2 Knight Warrior Warrior is level 10
2 Berserker Warrior Warrior is level 10
2 White Mage Mage Mage is level 10
2 Black Mage Mage Mage is level 10
2 Assassin Thief Thief is level 10
2 Ranger Thief Thief is level 10
2 Martial Artist Monk Monk is level 10
2 Mystic Monk Monk is level 10
3 Paladin Knight + Mystic Knight is level 10 and Mystic is level 10
3 Ninja Assassin + Berserker Assassin is level 10 and Berserker is level 10
3 Sage White Mage + Mystic White Mage is level 10 and Mystic is level 10

A hero who already plays Paladin, Ninja or Sage keeps the class. Someone who opened one of them under the old rule (two base classes at 10) may now find it sealed again until the new parents reach 10; there is no migration.

Stats, HP and MP

  • Advanced (tier 2): the parent's 15 base stats, each 10 % higher and rounded up (raiseBaseStats: integer maths, so 10 becomes 11), and the parent's level boosts. HP/MP rows in JOB_CLASS_BASE_STATS stay close to the parent and lean the way the class does; CLASS_LEVEL_BONUSES pays HP/MP per class level (Knight 6/1, Berserker 6/0, White Mage 2/5, Black Mage 1/6, Assassin 4/2, Ranger 3/3, Martial Artist 5/2, Mystic 3/4).
  • Crown (tier 3): the average of the two advanced parents' base stats (averageBaseStats) and the union of their boosts (combineStatBoosts). Their HP/MP rows are the numbers they have always had, so no hero's maximum moves when the tree grows.
  • Pillars (primary, secondary, tertiary): Knight Body, Legend, Heart ยท Berserker Body, Legend, Spirit ยท White Mage Mind, Heart, Legend ยท Black Mage Mind, Spirit, Legend ยท Assassin Spirit, Body, Legend ยท Ranger Spirit, Heart, Legend ยท Martial Artist Body, Spirit, Mind ยท Mystic Mind, Spirit, Body. Paladin, Ninja and Sage keep the pillars they had.

Passives

Each advanced class is its parent's passive plus one nudge made only of existing ClassPassive fields (see section C of Items and Classes Contract): Knight (wall + 5 % HP back), Berserker (35 % brace + 15 % HP back), White Mage (25 % MP discount + 20 % MP back + 10 % HP back), Black Mage (35 % MP discount + 10 % MP back), Assassin (90 % run + 30 % GP), Ranger (25 % GP + 1 minute), Martial Artist (2 minutes + 1 AP), Mystic (2 AP + 10 % MP back). Paladin, Ninja and Sage keep their passives.

Class Tree Text Format

Warrior Path

Warrior (Lv 1)
โ”œโ”€โ”€ Knight (Warrior 10) โ”€โ”€โ”€ the protector
โ”‚   โ””โ”€โ”€ Paladin (Knight 10 + Mystic 10)
โ””โ”€โ”€ Berserker (Warrior 10) โ”€โ”€โ”€ the sprinter
    โ””โ”€โ”€ Ninja (Assassin 10 + Berserker 10)

Mage Path

Mage (Lv 1)
โ”œโ”€โ”€ White Mage (Mage 10) โ”€โ”€โ”€ the healer
โ”‚   โ””โ”€โ”€ Sage (White Mage 10 + Mystic 10)
โ””โ”€โ”€ Black Mage (Mage 10) โ”€โ”€โ”€ the deep-focus caster

Thief Path

Thief (Lv 1)
โ”œโ”€โ”€ Assassin (Thief 10) โ”€โ”€โ”€ in and out unseen
โ”‚   โ””โ”€โ”€ Ninja (Assassin 10 + Berserker 10)
โ””โ”€โ”€ Ranger (Thief 10) โ”€โ”€โ”€ the outdoor scout

Monk Path

Monk (Lv 1)
โ”œโ”€โ”€ Martial Artist (Monk 10) โ”€โ”€โ”€ the daily drill
โ””โ”€โ”€ Mystic (Monk 10) โ”€โ”€โ”€ the calm one
    โ”œโ”€โ”€ Paladin (Knight 10 + Mystic 10)
    โ””โ”€โ”€ Sage (White Mage 10 + Mystic 10)

Icons

All icons come from the bundled Font Awesome duotone set (src/assets/fonts/font-awesome): Knight fa-helmet-battle, Berserker fa-axe-battle, White Mage fa-hand-holding-medical, Black Mage fa-meteor, Assassin fa-dagger, Ranger fa-bow-arrow, Martial Artist fa-hand-rock, Mystic fa-eye; Paladin fa-shield-cross, Ninja fa-user-ninja, Sage fa-hat-wizard. A child never reuses its base parent's exact icon, and tests/unit/ClassTree.spec.ts checks every icon against the font files.


Existing Implementation

See src/constants/JOB_CLASS_OPTIONS.ts for current classes:

  • Warrior, Mage, Thief, Monk (base)
  • Knight, Berserker, White Mage, Black Mage, Assassin, Ranger, Martial Artist, Mystic (advanced)
  • Paladin, Ninja, Sage (crown)
  • A few more are commented out for future use

See src/app/SideMenu/SwitchProfile/AddProfile/components/JobClassSelector.vue for:

  • Class selection UI with radar charts
  • Class descriptions and abilities
  • Difficulty ratings and tags
โš ๏ธ **GitHub.com Fallback** โš ๏ธ