Add spells rolls and enhance CSS styling
This commit is contained in:
+191
-96
@@ -1,110 +1,205 @@
|
||||
{{!log 'chat-message' this}}
|
||||
<div class="{{cssClass}}">
|
||||
<div class="intro-chat">
|
||||
<div class="intro-img">
|
||||
{{!log "chat-message" this}}
|
||||
{{!log "rollTarget" rollTarget}}
|
||||
{{!log "rollData" rollData}}
|
||||
<div class="{{cssClass}} prismrpg-chat-card">
|
||||
<div class="chat-header">
|
||||
<div class="chat-portrait">
|
||||
<img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" />
|
||||
</div>
|
||||
|
||||
<div class="intro-right">
|
||||
<span><STRONG>{{actingCharName}} - {{upperFirst rollName}}</STRONG></span>
|
||||
|
||||
<div class="chat-title">
|
||||
<div class="actor-name">{{actingCharName}}</div>
|
||||
<div class="roll-name">{{upperFirst rollName}}</div>
|
||||
{{#if (match rollType "attack")}}
|
||||
<span>Attack roll !</span>
|
||||
{{/if}}
|
||||
{{#if (match rollType "defense")}}
|
||||
<span>Defense roll !</span>
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq rollData.favor "favor")}}
|
||||
<span><strong>Favor roll</strong></span>
|
||||
{{/if}}
|
||||
{{#if (eq rollData.favor "disfavor")}}
|
||||
<span><strong>Disfavor roll</strong></span>
|
||||
<div class="roll-type-badge attack">Attack Roll</div>
|
||||
{{/if}}
|
||||
{{#if badResult}}
|
||||
<span><strong>{{localize "PRISMRPG.Label.otherResult"}}</strong>
|
||||
:
|
||||
{{badResult}}</span>
|
||||
<div class="bad-result">{{localize "PRISMRPG.Label.otherResult"}}: {{badResult}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollTarget.weapon}}
|
||||
<span>{{rollTarget.weapon.name}}</span>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollData.letItFly}}
|
||||
<span>Let It Fly attack ! </span>
|
||||
{{/if}}
|
||||
{{#if rollData.pointBlank}}
|
||||
<span>Point Blank Range Attack !</span>
|
||||
{{/if}}
|
||||
{{#if rollData.beyondSkill}}
|
||||
<span>Beyond Skill Range Attack !</span>
|
||||
{{/if}}
|
||||
|
||||
<span><strong>Formula</strong> : {{titleFormula}}</span>
|
||||
|
||||
{{#if (eq rollType "save")}}
|
||||
{{#if rollTarget.abilityModifier}}
|
||||
<span style="font-size: 0.9em;">
|
||||
(Ability Mod:
|
||||
{{#if
|
||||
(gt rollTarget.abilityModifier 0)
|
||||
}}+{{/if}}{{rollTarget.abilityModifier}}, Save Bonus:
|
||||
{{#if
|
||||
(gt rollTarget.saveProficiency 0)
|
||||
}}+{{/if}}{{rollTarget.saveProficiency}})
|
||||
</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#each diceResults as |result|}}
|
||||
<span>{{result.dice}} : {{result.value}}</span>
|
||||
{{/each}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{#if isSave}}
|
||||
<div class="result">
|
||||
{{#if (eq resultType "success")}}
|
||||
{{#if isPrivate}}?{{else}}{{localize "PRISMRPG.Roll.success"}}{{/if}}
|
||||
{{else}}
|
||||
{{#if isPrivate}}?{{else}}{{localize "PRISMRPG.Roll.failure"}}{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if isResource}}
|
||||
<div class="result">
|
||||
{{#if (eq resultType "success")}}
|
||||
{{#if isPrivate}}?{{else}}{{localize "PRISMRPG.Roll.success"}}{{/if}}
|
||||
{{else}}
|
||||
{{#if isPrivate}}?{{else}}{{localize "PRISMRPG.Roll.failure"}}{{#if
|
||||
isFailure
|
||||
}} ({{localize "PRISMRPG.Roll.resourceLost"}}){{/if}}{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if isDamage}}
|
||||
<div>
|
||||
{{#if (and isGM hasTarget)}}
|
||||
{{{localize
|
||||
"PRISMRPG.Roll.displayArmor"
|
||||
targetName=targetName
|
||||
targetArmor=targetArmor
|
||||
realDamage=realDamage
|
||||
}}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#unless isPrivate}}
|
||||
<div class="dice-result">
|
||||
<h4 class="dice-total">{{total}}</h4>
|
||||
</div>
|
||||
{{#if D30result}}
|
||||
<div class="dice-result">
|
||||
<h4 class="dice-total">D30 result: {{D30result}}</h4>
|
||||
<div class="chat-content">
|
||||
{{#if rollTarget.weapon}}
|
||||
<div class="weapon-info-card">
|
||||
<div class="weapon-header">
|
||||
<strong class="weapon-name">{{rollTarget.weapon.name}}</strong>
|
||||
{{#if rollTarget.weapon.system.isImplement}}
|
||||
<span class="badge implement">Implement</span>
|
||||
{{/if}}
|
||||
{{#if rollData.attackAttribute}}
|
||||
<span class="attribute-used">
|
||||
({{#if (eq rollData.attackAttribute "str")}}Strength{{else}}Dexterity{{/if}})
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="weapon-stats">
|
||||
{{#if rollTarget.weapon.system.weaponGroup}}
|
||||
<div class="stat-item">
|
||||
<i class="fas fa-shield-halved"></i>
|
||||
<span>{{rollTarget.weapon.system.weaponGroup}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if rollTarget.weapon.system.apc}}
|
||||
<div class="stat-item apc">
|
||||
<i class="fas fa-bolt"></i>
|
||||
<span>{{rollTarget.weapon.system.apc}} APC</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if rollTarget.weapon.system.damage}}
|
||||
<div class="stat-item damage">
|
||||
<i class="fas fa-dice-d20"></i>
|
||||
<span>{{rollTarget.weapon.system.damage}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if rollTarget.weapon.system.damageType}}
|
||||
<div class="stat-item">
|
||||
<i class="fas fa-burst"></i>
|
||||
<span>
|
||||
{{#if rollTarget.weapon.system.damageType.piercing}}P{{/if}}{{#if rollTarget.weapon.system.damageType.bludgeoning}}{{#if rollTarget.weapon.system.damageType.piercing}}/{{/if}}B{{/if}}{{#if rollTarget.weapon.system.damageType.slashing}}{{#if (or rollTarget.weapon.system.damageType.piercing rollTarget.weapon.system.damageType.bludgeoning)}}/{{/if}}S{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (or (gt rollTarget.weapon.system.shortRange 0) (gt rollTarget.weapon.system.longRange 0))}}
|
||||
<div class="stat-item range">
|
||||
<i class="fas fa-bow-arrow"></i>
|
||||
<span>
|
||||
{{#if (gt rollTarget.weapon.system.shortRange 0)}}{{rollTarget.weapon.system.shortRange}}{{/if}}{{#if (and (gt rollTarget.weapon.system.shortRange 0) (gt rollTarget.weapon.system.longRange 0))}}/{{/if}}{{#if (gt rollTarget.weapon.system.longRange 0)}}{{rollTarget.weapon.system.longRange}}{{/if}}ft
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (gt rollTarget.weapon.system.reloadAPC 0)}}
|
||||
<div class="stat-item reload">
|
||||
<i class="fas fa-rotate"></i>
|
||||
<span>Reload {{rollTarget.weapon.system.reloadAPC}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq rollType "spell-cast")}}
|
||||
<div class="spell-info-card">
|
||||
<div class="spell-header">
|
||||
<strong class="spell-name">Spell Cast</strong>
|
||||
{{#if (gt rollData.upcastLevel 0)}}
|
||||
<span class="badge upcast">+{{rollData.upcastLevel}} Levels</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="spell-stats">
|
||||
{{#if rollData.mentalCharacteristic}}
|
||||
<div class="stat-item characteristic">
|
||||
<i class="fas fa-brain"></i>
|
||||
<span>{{rollData.mentalCharacteristic}} ({{rollData.mentalCharValue}})</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="stat-item mana">
|
||||
<i class="fas fa-flask"></i>
|
||||
<span>{{rollData.totalManaCost}} Mana</span>
|
||||
</div>
|
||||
<div class="stat-item apc">
|
||||
<i class="fas fa-bolt"></i>
|
||||
<span>{{rollData.totalAPC}} APC</span>
|
||||
</div>
|
||||
{{#if (gt rollData.manaUpkeep 0)}}
|
||||
<div class="stat-item upkeep">
|
||||
<i class="fas fa-repeat"></i>
|
||||
<span>{{rollData.manaUpkeep}}/round</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollData.letItFly}}
|
||||
<div class="special-badge">Let It Fly!</div>
|
||||
{{/if}}
|
||||
{{#if rollData.pointBlank}}
|
||||
<div class="special-badge">Point Blank</div>
|
||||
{{/if}}
|
||||
{{#if rollData.beyondSkill}}
|
||||
<div class="special-badge">Beyond Skill Range</div>
|
||||
{{/if}}
|
||||
{{#if (and rollData.attackerAim (ne rollData.attackerAim "0"))}}
|
||||
<div class="aiming-info">
|
||||
<i class="fas fa-crosshairs"></i> Aiming: {{rollData.attackerAim}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="formula-display">
|
||||
<i class="fas fa-calculator"></i> {{titleFormula}}
|
||||
</div>
|
||||
|
||||
{{#if (eq rollType "save")}}
|
||||
{{#if rollTarget.abilityModifier}}
|
||||
<div class="modifier-info">
|
||||
<span>Ability Mod: {{#if (gt rollTarget.abilityModifier 0)}}+{{/if}}{{rollTarget.abilityModifier}}</span>
|
||||
<span>Save Bonus: {{#if (gt rollTarget.saveProficiency 0)}}+{{/if}}{{rollTarget.saveProficiency}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#each diceResults as |result|}}
|
||||
<div class="dice-breakdown">
|
||||
<i class="fas fa-dice"></i> {{result.dice}}: {{result.value}}
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{#if (eq rollType "weapon-attack")}}
|
||||
<button class="roll-damage-button" type="button" data-actor-id="{{actorId}}" data-weapon-id="{{rollTarget.weapon._id}}">
|
||||
<i class="fa-regular fa-face-head-bandage"></i>
|
||||
Roll Damage
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#unless isPrivate}}
|
||||
<div class="roll-result">
|
||||
<div class="result-total">
|
||||
<span class="total-label">Result</span>
|
||||
<span class="total-value">{{total}}</span>
|
||||
</div>
|
||||
{{#if D30result}}
|
||||
<div class="d30-result">
|
||||
<i class="fas fa-dice-d20"></i> D30: {{D30result}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#if isSave}}
|
||||
<div class="result-badge {{resultType}}">
|
||||
{{#if isPrivate}}
|
||||
?
|
||||
{{else}}
|
||||
{{#if (eq resultType "success")}}
|
||||
<i class="fas fa-check-circle"></i> {{localize "PRISMRPG.Roll.success"}}
|
||||
{{else}}
|
||||
<i class="fas fa-times-circle"></i> {{localize "PRISMRPG.Roll.failure"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if isResource}}
|
||||
<div class="result-badge {{resultType}}">
|
||||
{{#if isPrivate}}
|
||||
?
|
||||
{{else}}
|
||||
{{#if (eq resultType "success")}}
|
||||
<i class="fas fa-check-circle"></i> {{localize "PRISMRPG.Roll.success"}}
|
||||
{{else}}
|
||||
<i class="fas fa-times-circle"></i> {{localize "PRISMRPG.Roll.failure"}}{{#if isFailure}} ({{localize "PRISMRPG.Roll.resourceLost"}}){{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if isDamage}}
|
||||
{{#if (and isGM hasTarget)}}
|
||||
<div class="damage-info">
|
||||
{{{localize "PRISMRPG.Roll.displayArmor" targetName=targetName targetArmor=targetArmor realDamage=realDamage}}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
Reference in New Issue
Block a user