character_class
Registers under Classes · source: modules/character_class/v1
Registers a minimal Class record: `proficiency_weapon_category` is the WeaponCategory id this class gets ProficiencyBase% = 100% with (see engine/combat/pipeline.py → proficiency_base_percent). `favored_stat_id`, if set, is the stat this class boosts the growth rate of (see engine/progression.py → apply_stat_exp). `skill_tree`, if given, is a list of this class's Class-branch SkillNode specs, each a dict with keys `id`, `tier`, `cost`, `effect_kind`, `effect_payload`, and optionally `parent_id`/ `description` — the same fields skill_node/v1 itself takes, just without `branch`/`class_id` (auto-supplied as "class"/`id` here) and without the `skill_tree_` prefix (redundant once it's already inside a `skill_tree=[...]` list). Defaults to None (no tree registered), so every pre-existing caller that doesn't pass it is unaffected — additive, not a breaking change.
Example Usage
# Migrated from content/classes/ranger.py (2026-10-14 cleanup pass) --
# skill_tree isn't community-settable (a list of dicts, see
# modules/character_class/v1's own COMMUNITY_SCHEMA comment) but ranger
# never used it anyway (no Class-branch tree authored yet).
resource "ranger" {
source: modules/character_class/v1
id: "ranger"
name: "Ranger"
proficiency_weapon_category: "ranged"
favored_stat_id: "strength"
description: "A ranged specialist, at home with a bow."
}
Arguments Reference
The following arguments are supported:
-
id- (Required) The unique id this record is registered and referenced under — what a `.resource` file's own filename-independent identity is, and what any other content's foreign-key-style field (a dungeon node's `next`, a skill node's `parent_id`, and so on) points at. community -
name- (Required) The player-facing display label — shown everywhere a player sees this record (shop listings, inventory, character sheet, etc.); the raw id is never shown directly. community -
proficiency_weapon_category- (Required) Currently registered:magic,meleeandranged. community -
favored_stat_id- (Optional) `favored_stat_id`, if set, is the stat this class boosts the growth rate of (see engine/progression.py → apply_stat_exp). Currently registered:strength,agility,evasiveness,luck,vitality,wisdomandcharisma. Defaults toNone. community -
skill_tree- (Optional) `skill_tree`, if given, is a list of this class's Class-branch SkillNode specs, each a dict with keys `id`, `tier`, `cost`, `effect_kind`, `effect_payload`, and optionally `parent_id`/ `description` — the same fields skill_node/v1 itself takes, just without `branch`/`class_id` (auto-supplied as "class"/`id` here) and without the `skill_tree_` prefix (redundant once it's already inside a `skill_tree=[...]` list). Defaults toNone. developer -
description- (Optional) Flavor text shown to players — pure display data with no effect on game mechanics. community