Commit Graph

18 Commits

Author SHA1 Message Date
Cal Corum
0eb258d2c1 Add trained toggle to attack skills (Melee, Brawl, Ranged, Finesse)
Attack skills now have trained/untrained status like regular skills:
- Untrained: difficulty = 20 - stat
- Trained: difficulty = 20 - (stat × 2)

Includes UI toggle button, data model fields, and matching styling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:33:35 -06:00
Cal Corum
bf2cd92e93 Add Status item system and separate attack/damage rolls
Status System:
- Add StatusData model with mechanical modifiers (damageDealt, healingReceived)
- Add status item sheet with modifier configuration
- Add status-bar.hbs for displaying status chips on actor sheets
- Status chips show tooltip on hover, can be removed via click
- Add 17 status items to compendium (Blinded, Burning, Charmed, etc.)
- Frightened applies -2 damage dealt, Sickened applies -2 healing received

Attack Roll Changes:
- Separate attack and damage into two discrete rolls
- Attack hit now shows "Roll Damage" button instead of auto-rolling
- Button click rolls damage and updates the chat message in-place
- Store weapon/attack data in message flags for later damage rolling
- Fix favor/hinder and modifier preset buttons in attack dialog
- Show individual damage dice results in chat card breakdown

Mechanical Integration:
- Add _applyStatusModifiers() to VagabondActor for aggregating status effects
- Update getRollData() to include statusModifiers for roll formulas
- Update damageRoll() to automatically apply damageDealt modifier
- Update applyHealing() to respect healingReceived modifier

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 14:36:57 -06:00
Cal Corum
1a36139387 Add slotsWhenEquipped system and equipment Active Effect sync
- Add getTotalSlots() method to base-item.mjs as unified interface
- Add slotsWhenEquipped field to weapon, armor, and equipment schemas
- Implement getTotalSlots() in each item type respecting equipped state
- Update actor slot calculation to use getTotalSlots() uniformly
- Add _onUpdate hook to sync equipment effects with equipped state
- Update backpack with slotsWhenEquipped: 0 and +2 slot bonus effect

Backpack now correctly:
- Costs 1 slot when unequipped, 0 when equipped
- Grants +2 max item slots via Active Effect when equipped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 00:34:16 -06:00
Cal Corum
e8370afcc3 Review and correct all 18 class compendium JSONs
- Add skillTraining schema: supports fixed grants and player choices
  e.g., [{ type: "fixed", skills: ["arcana"], count: 1 },
         { type: "choice", skills: ["detect", "influence"], count: 3 }]
- Add weaponTraining schema: ["melee", "ranged"] or []
- Correct all class features, progressions, and descriptions from source
- Fix mana progressions (accumulating values, not flat)
- Replace fabricated D&D-style features with actual Vagabond features
- Add official flavor text from rulebook
- Mark all classes as reviewed: true
- Add reviewed: false to ancestry and perk JSONs for upcoming review
- Add castingMax formula TODO to PROJECT_ROADMAP.json (task 2.15)

Classes corrected: Alchemist, Barbarian, Bard, Dancer, Druid, Fighter,
Gunslinger, Hunter, Luminary, Magus, Merchant, Pugilist, Revelator,
Rogue, Sorcerer, Vanguard, Witch, Wizard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 16:24:59 -06:00
Cal Corum
06e0dc01c0 Complete P2-P5: Perks, Feature Choices, Ancestry Traits, Caster Progression
- P2: Perks with changes[] arrays create Active Effects on drop/delete
- P3: Feature choice UI for Fighting Style (auto-grants Situational
  Awareness + selected training perk, ignoring prerequisites)
- P4: Ancestry traits apply Active Effects (Dwarf Darksight/Tough working)
- P5: Caster progression accumulates mana from class progression table

Key patterns:
- Manual UUID construction: Compendium.${pack.collection}.Item.${entry._id}
- ignorePrereqs flag for specific choices bypassing all prerequisites
- Mode 5 (OVERRIDE) for boolean senses like darkvision
- Form data merging with direct DOM reading for reliable selection capture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 14:23:44 -06:00
Cal Corum
694b11f423 Implement movement capability system with boolean toggles
Movement types (Climb, Cling, Fly, Phase, Swim) now use boolean
toggles instead of separate speed values, matching RAW where all
special movement uses base speed.

Changes:
- Update NPC and Character data models with movement schema
- Add movement section to NPC stats template (grid layout)
- Add movement section to character biography template
- Add localization strings with tooltip hints for each type
- Style movement grid to match senses section pattern
- Add rollable # Appearing label for NPC sheets
- Fix NPC sheet scrollbar visibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 00:16:44 -06:00
Cal Corum
15fd9f684f Style Magic and Biography tabs, update senses system
Magic tab:
- Mana display matching inventory header format
- Focus status panel with active spell tracking
- Spell list with damage/effect badges and cast buttons
- Spellcasting reference guide with delivery/duration costs

Biography tab:
- Character details section with Size and Being Type dropdowns
- Senses as 3-column grid of boolean checkboxes
- Biography and Notes textareas with proper styling
- Languages section hidden (not yet implemented)

Senses system overhaul:
- Changed from mixed boolean/number to all boolean toggles
- Renamed darksight to darkvision
- Added: allsight, echolocation, seismicsense, telepathy
- Removed: tremorsense (not in system)
- Updated both character and NPC data models
- Updated NPC sheet template and hasSenses logic

Also updated PROJECT_ROADMAP.json with styling progress notes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 22:36:11 -06:00
Cal Corum
f6948dc7d6 Implement NPC morale check system
Add morale roll system for NPCs with group support and automatic triggers:
- rollMorale() method for individual NPC morale checks (2d6 vs morale score)
- rollGroupMorale() static method uses lowest morale in selected tokens
- promptMoraleCheck() posts GM-whispered chat with clickable roll button
- Auto-prompt when NPC HP drops to half or below
- Chat button click handler for morale prompts
- Morale Check macro for quick group rolls
- Comprehensive test suite for morale functionality

Morale fails when 2d6 > morale score, setting moraleStatus.broken = true.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 00:03:07 -06:00
Cal Corum
8afcf8c07b Implement class feature automation system
- Add _onCreate/_preDelete lifecycle methods to VagabondItem for automatic
  feature application and cleanup when classes are added/removed
- Add updateActor hook to apply new features when character level increases
- Implement applyClassFeatures() with idempotency to prevent duplicate effects
- Add _applyClassProgression() for mana/castingMax from class progression
- Add _applyTrainedSkills() to mark class skills as trained
- Fix getCastingMaxAtLevel() to sum values instead of taking maximum
- Add comprehensive test suite (10 tests) covering unit and integration tests

Effects are tagged with vagabond flags for easy filtering and management.
Methods calculate progression values directly for robustness with embedded items.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 21:19:26 -06:00
Cal Corum
062189e315 Add crit threshold modifier tests and fix effect application
- Add comprehensive Quench tests for crit threshold system:
  - Skill crit thresholds modified by Active Effects
  - Attack crit thresholds (melee, ranged, brawl, finesse)
  - Effect stacking, disabled effects, minimum threshold enforcement
  - Helper function validation

- Fix crit threshold clamping in CharacterData.prepareDerivedData():
  - Skills: clamp in _calculateSkillDifficulties() after effects apply
  - Attacks: new _clampAttackCritThresholds() method
  - Ensures thresholds stay within 1-20 range after Active Effects

- Note: Foundry v13 auto-prepares data after createEmbeddedDocuments,
  manual prepareData() calls cause double effect application

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 20:34:36 -06:00
Cal Corum
6247004b58 Implement spell casting system with rulebook-accurate mana costs
- Add SpellCastDialog with delivery/duration/damage configuration
- Fix mana cost calculation to match rulebook formula:
  - Effect-only or 1d6 damage-only = 0 mana
  - Both damage AND effect = 1 mana base
  - +1 per extra damage die beyond first
  - +delivery cost (Touch/Remote/Imbue=0, Cube=1, Area=2)
  - Duration has no initial cost (Focus requires maintenance)
- Add "Include Effect" toggle for damage vs effect choice
- Create spell cast chat card template
- Add 20+ i18n strings for spell casting UI
- Create comprehensive Quench tests for mana calculation
- Add Cast Spell macro for testing
- Update CLAUDE.md with NoteDiscovery access instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 20:22:20 -06:00
Cal Corum
27a5f481aa Implement attack and save roll systems with difficulty fix
Phase 2 Tasks 2.6 & 2.7: Complete roll dialog system
- Add AttackRollDialog with weapon selection, grip toggle, attack type display
- Add SaveRollDialog with save type selection, defense options (block/dodge)
- Fix Handlebars template context resolution bug ({{this.difficulty}} pattern)
- Calculate difficulty once in dialog, pass to roll function via options
- Add difficulty/critThreshold pass-through tests for skill checks
- Fix attack check tests: use embedded items, correct damageType to "slashing"
- Add i18n strings for saves, attacks, defense types
- Add chat card and dialog styles for all roll types
- Export all roll dialogs and create system macros

Key technical fix: Handlebars was resolving {{difficulty}} through context
chain to actor.system.skills.X.difficulty (schema default 20) instead of
root template data. Using {{this.difficulty}} explicitly references root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 19:52:28 -06:00
Cal Corum
463a130c18 Implement skill check system with roll dialogs and debug tools
Phase 2.5: Skill Check System Implementation

Features:
- ApplicationV2-based roll dialogs with HandlebarsApplicationMixin
- Base VagabondRollDialog class for shared dialog functionality
- SkillCheckDialog for skill checks with auto-calculated difficulty
- Favor/Hinder system using Active Effects flags (simplified from schema)
- FavorHinderDebug panel for testing flags without actor sheets
- Auto-created development macros (Favor/Hinder Debug, Skill Check)
- Custom chat cards for skill roll results

Technical Changes:
- Removed favorHinder from character schema (now uses flags)
- Updated getNetFavorHinder() to use flag-based approach
- Returns { net, favorSources, hinderSources } for transparency
- Universal form styling fixes for Foundry dark theme compatibility
- Added Macro to ESLint globals

Flag Convention:
- flags.vagabond.favor.skills.<skillId>
- flags.vagabond.hinder.skills.<skillId>
- flags.vagabond.favor.attacks
- flags.vagabond.hinder.attacks
- flags.vagabond.favor.saves.<saveType>
- flags.vagabond.hinder.saves.<saveType>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 17:31:15 -06:00
Cal Corum
517b7045c7 Add Phase 2 core system logic: document classes, dice rolling, and fixes
Implements Phase 2 foundational components:
- VagabondActor document class with item management, resource tracking,
  damage/healing, rest mechanics, and combat helpers
- VagabondItem document class with chat card generation and item usage
- Comprehensive dice rolling module (d20 checks, skill/attack/save rolls,
  damage with crit doubling, countdown dice, morale checks)
- Quench tests for all dice rolling functions

Fixes Foundry VTT v13 compatibility issues:
- Add documentTypes to system.json declaring valid Actor/Item types
- Fix StringField validation errors by using nullable/null pattern
  instead of blank string choices for optional fields
- Update actor tests to use embedded documents for slot calculations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:21:48 -06:00
Cal Corum
c06192f90f Add minor data model improvements from rulebook audit (16 items)
CharacterData additions:
- Senses (darksight, blindsight, tremorsense, elvenEyes, witchsight, sixthSense)
- Languages array (default: ["Common"])
- Rest tracking (lastRest, breathersTaken, restBonuses)
- Travel tracking (milesThisDay, pace, canForage, shiftsElapsed)
- Crafting projects (activeProjects with materials, shifts, bonuses)
- Combat tracking (isFlanked, flankingAllies, ignoresFlankingPenalty,
  currentZone, isDualWielding, mainHandWeapon, offHandWeapon)
- Casting tracking (equippedTrinket, canCastThroughWeapon/Instrument)
- Downtime activities with type and shifts
- Quest tracking (active, completed, lastQuestCompleted)
- Death state (isDead, deathCause, canBeRevived, luminaryRevivifyUsed)
- Summoned creatures (active array with type, HD, HP, command method)
- Size mechanical effects (unitsOccupied, allowsMovementThrough)
- Being type choices (humanlike, fae, cryptid, etc.)
- preferredZone for class-based positioning

NPCData additions:
- Morale status tracking (checkedThisCombat, lastTrigger, lastResult, broken)
- Senses (darksight, blindsight, tremorsense)

ArmorData additions:
- Medium armor type, hindersDodge, preventsRage flags

WeaponData additions:
- Damage type choices (blunt/piercing/slashing + elemental)
- equippedHand for dual-wielding (main/off/both)

EquipmentData additions:
- isTrinket and canCastThrough for spell component tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 16:02:23 -06:00
Cal Corum
466581efd5 Add important data model enhancements from rulebook audit
CharacterData enhancements:
- Enhanced customResources with type/subtype/resetOn/data fields for
  class-specific tracking (Alchemist Formulae, Hunter's Mark, etc.)
- Added favorHinder tracking for d20 +/- d6 modifiers with source/duration
- Added movement types (walk/fly/swim/climb/burrow) matching NPC structure
- Added focus tracking for maintained spells with manaCostPerRound
- Added progression tracking (xpPacing, perksGainedByLevel, statIncreasesByLevel)
- Enhanced itemSlots with bonuses array, auto-sum, and overburdened status
- Updated prepareDerivedData to calculate bonuses and overburdened status

WeaponData enhancements:
- Added material property (mundane/silvered/adamantine/magical)

Effects helper:
- Added effect keys for all movement types (fly/swim/climb/burrow)

Note: Difficulty auto-calculation and wealth gold/silver/copper were
already implemented in Phase 1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:55:25 -06:00
Cal Corum
b975c1070f Add critical data model omissions from rulebook audit
- CharacterData: Add ancestryId reference, studiedDice resource pool,
  and statusEffects array with Countdown Dice support (d6→d4→ends)
- PerkData: Add luckCost/grantsLuck for Luck system integration,
  isRitual/ritualDuration/ritualComponents for ritual perks
- WeaponData/ArmorData/EquipmentData: Add relic schema with tier,
  unique abilities, attunement, uses per day, and lore fields
- Effects helper: Add effect keys for luck.max and studiedDice.max

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:52:15 -06:00
Cal Corum
51f0472d99 Implement Phase 1: Complete data model system for actors and items
Actor Data Models:
- VagabondActorBase: Shared base class with biography field
- CharacterData: Full PC schema with stats, skills, saves, resources,
  custom crit thresholds, dynamic resources, item slots, wealth tracking
- NPCData: Monster stat block with HD, HP, TL, zone, morale, actions,
  abilities, immunities/weaknesses

Item Data Models:
- VagabondItemBase: Shared base with description field
- AncestryData: Being type, size, racial traits
- ClassData: Progression tables, features, mana/casting, trained skills
- SpellData: Dynamic mana cost calculation, delivery/duration types
- PerkData: Prerequisites system, stat/skill/spell requirements
- WeaponData: Damage, grip, properties, attack types, crit thresholds
- ArmorData: Armor value, type, dodge penalty
- EquipmentData: Quantity, slots, consumables
- FeatureData: Class features with Active Effect changes

Active Effects Integration:
- Helper module for creating and managing Active Effects
- Effect key mapping for stats, saves, skills, crit thresholds
- Utilities for applying/removing item effects

Derived Value Calculations (CharacterData):
- Max HP = Might × Level
- Speed by Dexterity lookup
- Item Slots = 8 + Might - Fatigue
- Save difficulties from stat pairs
- Skill difficulties (trained doubles stat contribution)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:22:09 -06:00