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

134 lines
4.4 KiB
Handlebars

{{!-- Attack Roll Chat Card Template --}}
{{!-- Displays attack results with weapon info, hit/miss, and damage --}}
<div class="vagabond chat-card attack-roll">
{{!-- Header with Weapon Info --}}
<header class="card-header">
<img src="{{weapon.img}}" alt="{{weapon.name}}" class="weapon-icon">
<div class="header-text">
<h3 class="weapon-name">{{weapon.name}}</h3>
<span class="attack-type-badge">{{attackLabel}}</span>
</div>
</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.CriticalHit"}}</span>
{{else if isFumble}}
<span class="status fumble">{{localize "VAGABOND.Fumble"}}</span>
{{else if success}}
<span class="status success">{{localize "VAGABOND.Hit"}}</span>
{{else}}
<span class="status failure">{{localize "VAGABOND.Miss"}}</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">{{this.difficulty}}</span>
</div>
{{#if (lt this.critThreshold 20)}}
<div class="crit-threshold">
<span class="label">{{localize "VAGABOND.CritThreshold"}}:</span>
<span class="value">{{this.critThreshold}}+</span>
</div>
{{/if}}
</div>
{{!-- Damage Section (if damage was rolled) --}}
{{#if hasDamage}}
<div class="damage-section {{#if isCrit}}critical{{/if}}">
<div class="damage-header">
<i class="fa-solid fa-burst"></i>
<span>{{localize "VAGABOND.Damage"}}</span>
{{#if isCrit}}
<span class="crit-label">({{localize "VAGABOND.Critical"}}!)</span>
{{/if}}
</div>
<div class="damage-result">
<span class="damage-total">{{damageTotal}}</span>
<span class="damage-type">{{weapon.damageTypeLabel}}</span>
</div>
<div class="damage-breakdown">
{{#each damageDiceResults}}
<span class="damage-die" data-tooltip="d{{this.faces}}">
<i class="fa-solid fa-dice-d{{this.faces}}"></i> {{this.result}}
</span>
{{/each}}
</div>
<div class="damage-formula">
{{damageFormula}}
{{#if twoHanded}}
<span class="grip-indicator">({{localize "VAGABOND.TwoHanded"}})</span>
{{/if}}
</div>
</div>
{{/if}}
{{!-- Roll Damage Button (if hit but damage not yet rolled) --}}
{{#if showDamageButton}}
<div class="card-buttons">
<button type="button" class="roll-damage-btn {{#if isCrit}}critical{{/if}}">
<i class="fa-solid fa-burst"></i>
{{localize "VAGABOND.RollDamage"}}
{{#if isCrit}}
<span class="crit-label">({{localize "VAGABOND.Critical"}}!)</span>
{{/if}}
<span class="damage-preview">({{pendingDamageFormula}})</span>
</button>
</div>
{{/if}}
{{!-- Weapon Properties --}}
{{#if weapon.properties.length}}
<div class="weapon-properties">
{{#each weapon.properties}}
<span class="property-tag">{{this}}</span>
{{/each}}
</div>
{{/if}}
{{!-- 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>