vagabond-rpg-foundryvtt/templates/chat/skill-roll.hbs
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

80 lines
2.6 KiB
Handlebars

{{!-- Skill Check Chat Card Template --}}
{{!-- Displays skill check results with roll details, success/fail, and modifiers --}}
<div class="vagabond chat-card skill-roll">
{{!-- Header --}}
<header class="card-header">
<h3 class="skill-name">{{skillLabel}}</h3>
{{#if trained}}
<span class="trained-badge">{{localize "VAGABOND.Trained"}}</span>
{{/if}}
</header>
{{!-- Roll Result --}}
<div class="roll-result {{#if isCrit}}critical{{else if isFumble}}fumble{{else if success}}success{{else}}failure{{/if}}">
<div class="roll-total">{{total}}</div>
<div class="roll-status">
{{#if isCrit}}
<span class="status critical">{{localize "VAGABOND.Critical"}}</span>
{{else if isFumble}}
<span class="status fumble">{{localize "VAGABOND.Fumble"}}</span>
{{else if success}}
<span class="status success">{{localize "VAGABOND.Success"}}</span>
{{else}}
<span class="status failure">{{localize "VAGABOND.Failure"}}</span>
{{/if}}
</div>
</div>
{{!-- Roll Details --}}
<div class="roll-details">
<div class="roll-formula">
<span class="label">{{localize "VAGABOND.Formula"}}:</span>
<span class="value">{{formula}}</span>
</div>
<div class="roll-breakdown">
<span class="d20-result">
<i class="fa-solid fa-dice-d20"></i> {{d20Result}}
</span>
{{#if favorDie}}
<span class="favor-die {{#if (gt netFavorHinder 0)}}favor{{else}}hinder{{/if}}">
<i class="fa-solid fa-dice-d6"></i> {{favorDie}}
</span>
{{/if}}
{{#if modifier}}
<span class="modifier">
{{#if (gt modifier 0)}}+{{/if}}{{modifier}}
</span>
{{/if}}
</div>
</div>
{{!-- Target Info --}}
<div class="target-info">
<div class="difficulty">
<span class="label">{{localize "VAGABOND.Difficulty"}}:</span>
<span class="value">{{difficulty}}</span>
</div>
{{#if (lt critThreshold 20)}}
<div class="crit-threshold">
<span class="label">{{localize "VAGABOND.CritThreshold"}}:</span>
<span class="value">{{critThreshold}}+</span>
</div>
{{/if}}
</div>
{{!-- Favor/Hinder Sources --}}
{{#if favorSources.length}}
<div class="favor-sources">
<i class="fa-solid fa-arrow-up"></i>
<span>{{localize "VAGABOND.Favor"}}: {{#each favorSources}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}</span>
</div>
{{/if}}
{{#if hinderSources.length}}
<div class="hinder-sources">
<i class="fa-solid fa-arrow-down"></i>
<span>{{localize "VAGABOND.Hinder"}}: {{#each hinderSources}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}</span>
</div>
{{/if}}
</div>