mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Fixed Check Rolls, Attack Rolls and Damage Rolls for PCs
This commit is contained in:
parent
707e47bc1b
commit
5a501d6769
16 changed files with 204 additions and 95 deletions
|
|
@ -735,9 +735,13 @@
|
||||||
},
|
},
|
||||||
"Chat": {
|
"Chat": {
|
||||||
"DualityRoll": {
|
"DualityRoll": {
|
||||||
"AdvantageChooseTitle": "Select Hope Dice"
|
"AbilityCheckTitle": "{ability} Check"
|
||||||
|
},
|
||||||
|
"AttackRoll": {
|
||||||
|
"Title": "Attack - {attack}"
|
||||||
},
|
},
|
||||||
"DamageRoll": {
|
"DamageRoll": {
|
||||||
|
"Title": "Damage - {damage}",
|
||||||
"DealDamageToTargets": "Damage Hit Targets",
|
"DealDamageToTargets": "Damage Hit Targets",
|
||||||
"DealDamage": "Deal Damage"
|
"DealDamage": "Deal Damage"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -367,6 +367,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
type: 'adversaryRoll',
|
type: 'adversaryRoll',
|
||||||
sound: CONFIG.sounds.dice,
|
sound: CONFIG.sounds.dice,
|
||||||
system: {
|
system: {
|
||||||
|
title: button.dataset.name,
|
||||||
origin: this.document.id,
|
origin: this.document.id,
|
||||||
roll: roll._formula,
|
roll: roll._formula,
|
||||||
advantageState,
|
advantageState,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import DhpDowntime from '../downtime.mjs';
|
||||||
import DhpLevelup from '../levelup.mjs';
|
import DhpLevelup from '../levelup.mjs';
|
||||||
import AncestrySelectionDialog from '../ancestrySelectionDialog.mjs';
|
import AncestrySelectionDialog from '../ancestrySelectionDialog.mjs';
|
||||||
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
||||||
|
import { abilities } from '../../config/actorConfig.mjs';
|
||||||
|
|
||||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||||
export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
|
|
@ -480,9 +481,9 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async rollAttribute(event, target) {
|
static async rollAttribute(event, button) {
|
||||||
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll(
|
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll(
|
||||||
{ title: 'Attribute Bonus', value: event.target.dataset.value },
|
{ title: 'Attribute Bonus', value: button.dataset.value },
|
||||||
event.shiftKey
|
event.shiftKey
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -490,6 +491,10 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
const msgData = {
|
const msgData = {
|
||||||
type: 'dualityRoll',
|
type: 'dualityRoll',
|
||||||
system: {
|
system: {
|
||||||
|
title: game.i18n.format('DAGGERHEART.Chat.DualityRoll.AbilityCheckTitle', {
|
||||||
|
ability: game.i18n.localize(abilities[button.dataset.attribute].label)
|
||||||
|
}),
|
||||||
|
origin: this.document.id,
|
||||||
roll: roll._formula,
|
roll: roll._formula,
|
||||||
modifiers: modifiers,
|
modifiers: modifiers,
|
||||||
hope: hope,
|
hope: hope,
|
||||||
|
|
@ -550,8 +555,8 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
await this.document.update({ [update]: newValue });
|
await this.document.update({ [update]: newValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
static async attackRoll(_, event) {
|
static async attackRoll(event, button) {
|
||||||
const weapon = await fromUuid(event.currentTarget.dataset.weapon);
|
const weapon = await fromUuid(button.dataset.weapon);
|
||||||
const damage = {
|
const damage = {
|
||||||
value: `${this.document.system.proficiency.value}${weapon.system.damage.value}`,
|
value: `${this.document.system.proficiency.value}${weapon.system.damage.value}`,
|
||||||
type: weapon.system.damage.type,
|
type: weapon.system.damage.type,
|
||||||
|
|
@ -579,7 +584,10 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
const msg = new cls({
|
const msg = new cls({
|
||||||
type: 'dualityRoll',
|
type: 'dualityRoll',
|
||||||
|
sound: CONFIG.sounds.dice,
|
||||||
system: {
|
system: {
|
||||||
|
title: weapon.name,
|
||||||
|
origin: this.document.id,
|
||||||
roll: roll._formula,
|
roll: roll._formula,
|
||||||
modifiers: modifiers,
|
modifiers: modifiers,
|
||||||
hope: hope,
|
hope: hope,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ export default class DhpAdversaryRoll extends foundry.abstract.TypeDataModel {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
title: new fields.StringField(),
|
||||||
origin: new fields.StringField({ required: true }),
|
origin: new fields.StringField({ required: true }),
|
||||||
roll: new fields.StringField({}),
|
roll: new fields.StringField({}),
|
||||||
total: new fields.NumberField({ integer: true }),
|
total: new fields.NumberField({ integer: true }),
|
||||||
|
|
@ -37,18 +38,31 @@ export default class DhpAdversaryRoll extends foundry.abstract.TypeDataModel {
|
||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
const diceKeys = Object.keys(this.dice.rolls);
|
const diceKeys = Object.keys(this.dice.rolls);
|
||||||
const highestIndex = 0;
|
const highestDiceIndex =
|
||||||
for (var index in diceKeys) {
|
diceKeys.length < 2
|
||||||
const resultIndex = Number.parseInt(index);
|
? null
|
||||||
if (highestIndex === resultIndex) continue;
|
: this.dice.rolls[diceKeys[0]].value > this.dice.rolls[diceKeys[1]].value
|
||||||
|
? 0
|
||||||
const current = this.dice.rolls[resultIndex];
|
: 1;
|
||||||
const highest = this.dice.rolls[highestIndex];
|
if (highestDiceIndex !== null) {
|
||||||
|
this.dice.rolls = this.dice.rolls.map((roll, index) => ({
|
||||||
if (current.value > highest.value) this.dice.rolls[highestIndex].discarded = true;
|
...roll,
|
||||||
else this.dice.rolls[resultIndex].discarded = true;
|
discarded: this.advantageState === 1 ? index !== highestDiceIndex : index === highestDiceIndex
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const highestIndex = 0;
|
||||||
|
// for (var index in diceKeys) {
|
||||||
|
// const resultIndex = Number.parseInt(index);
|
||||||
|
// if (highestIndex === resultIndex) continue;
|
||||||
|
|
||||||
|
// const current = this.dice.rolls[resultIndex];
|
||||||
|
// const highest = this.dice.rolls[highestIndex];
|
||||||
|
|
||||||
|
// if (current.value > highest.value) this.dice.rolls[highestIndex].discarded = true;
|
||||||
|
// else this.dice.rolls[resultIndex].discarded = true;
|
||||||
|
// }
|
||||||
|
|
||||||
this.targets.forEach(target => {
|
this.targets.forEach(target => {
|
||||||
target.hit = target.difficulty ? this.total >= target.difficulty : this.total >= target.evasion;
|
target.hit = target.difficulty ? this.total >= target.difficulty : this.total >= target.evasion;
|
||||||
});
|
});
|
||||||
|
|
@ -71,6 +85,6 @@ class DhpAdversaryRollDice extends foundry.abstract.DataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
get rollTotal() {
|
get rollTotal() {
|
||||||
return this.rolls.reduce((acc, roll) => acc + roll.value, 0);
|
return this.rolls.reduce((acc, roll) => acc + (!roll.discarded ? roll.value : 0), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ export default class DhpDamageRoll extends foundry.abstract.TypeDataModel {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
title: new fields.StringField(),
|
||||||
roll: new fields.StringField({ required: true }),
|
roll: new fields.StringField({ required: true }),
|
||||||
damage: new fields.SchemaField({
|
damage: new fields.SchemaField({
|
||||||
total: new fields.NumberField({ required: true, integer: true }),
|
total: new fields.NumberField({ required: true, integer: true }),
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ const diceField = () =>
|
||||||
export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
return {
|
return {
|
||||||
|
title: new fields.StringField(),
|
||||||
|
origin: new fields.StringField({ required: true }),
|
||||||
roll: new fields.StringField({}),
|
roll: new fields.StringField({}),
|
||||||
modifiers: new fields.ArrayField(
|
modifiers: new fields.ArrayField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
|
|
@ -20,7 +22,6 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
||||||
fear: diceField(),
|
fear: diceField(),
|
||||||
advantage: diceField(),
|
advantage: diceField(),
|
||||||
disadvantage: diceField(),
|
disadvantage: diceField(),
|
||||||
advantageSelected: new fields.NumberField({ initial: 0 }),
|
|
||||||
targets: new fields.ArrayField(
|
targets: new fields.ArrayField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
id: new fields.StringField({}),
|
id: new fields.StringField({}),
|
||||||
|
|
@ -57,8 +58,16 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
||||||
|
|
||||||
get total() {
|
get total() {
|
||||||
const modifiers = this.modifiers.reduce((acc, x) => acc + x.value, 0);
|
const modifiers = this.modifiers.reduce((acc, x) => acc + x.value, 0);
|
||||||
const advantage = (this.advantage.value ?? this.disadvantage.value) ? -this.disadvantage.value : 0;
|
const advantage = this.advantage.value
|
||||||
return this.hope.value + this.fear.value + advantage + modifiers;
|
? this.advantage.value
|
||||||
|
: this.disadvantage.value
|
||||||
|
? -this.disadvantage.value
|
||||||
|
: 0;
|
||||||
|
return this.highestRoll + advantage + modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
|
get highestRoll() {
|
||||||
|
return Math.max(this.hope.value, this.fear.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
get totalLabel() {
|
get totalLabel() {
|
||||||
|
|
@ -75,6 +84,9 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
const total = this.total;
|
const total = this.total;
|
||||||
|
|
||||||
|
this.hope.discarded = this.hope.value < this.fear.value;
|
||||||
|
this.fear.discarded = this.fear.value < this.hope.value;
|
||||||
|
|
||||||
this.targets.forEach(target => {
|
this.targets.forEach(target => {
|
||||||
target.hit = target.difficulty ? total >= target.difficulty : total >= target.evasion;
|
target.hit = target.difficulty ? total >= target.difficulty : total >= target.evasion;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,9 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
const hope = rollResult.dice[0].results[0].result;
|
const hope = rollResult.dice[0].results[0].result;
|
||||||
const advantage = advantageDice ? rollResult.dice[1].results[0].result : null;
|
const fear = rollResult.dice[1].results[0].result;
|
||||||
const disadvantage = disadvantageDice ? rollResult.dice[1].results[0].result : null;
|
const advantage = advantageDice ? rollResult.dice[2].results[0].result : null;
|
||||||
const fear =
|
const disadvantage = disadvantageDice ? rollResult.dice[2].results[0].result : null;
|
||||||
advantage || disadvantage ? rollResult.dice[2].results[0].result : rollResult.dice[1].results[0].result;
|
|
||||||
|
|
||||||
if (disadvantage) {
|
if (disadvantage) {
|
||||||
rollResult = { ...rollResult, total: rollResult.total - Math.max(hope, disadvantage) };
|
rollResult = { ...rollResult, total: rollResult.total - Math.max(hope, disadvantage) };
|
||||||
|
|
@ -250,7 +249,7 @@ export default class DhpActor extends Actor {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async damageRoll(damage, targets, shiftKey) {
|
async damageRoll(title, damage, targets, shiftKey) {
|
||||||
let rollString = damage.value;
|
let rollString = damage.value;
|
||||||
let bonusDamage = damage.bonusDamage?.filter(x => x.initiallySelected) ?? [];
|
let bonusDamage = damage.bonusDamage?.filter(x => x.initiallySelected) ?? [];
|
||||||
if (!shiftKey) {
|
if (!shiftKey) {
|
||||||
|
|
@ -291,6 +290,7 @@ export default class DhpActor extends Actor {
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
sound: CONFIG.sounds.dice,
|
sound: CONFIG.sounds.dice,
|
||||||
system: {
|
system: {
|
||||||
|
title: game.i18n.format('DAGGERHEART.Chat.DamageRoll.Title', { damage: title }),
|
||||||
roll: rollString,
|
roll: rollString,
|
||||||
damage: {
|
damage: {
|
||||||
total: rollResult.total,
|
total: rollResult.total,
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
if (!actor || !game.user.isGM) return true;
|
if (!actor || !game.user.isGM) return true;
|
||||||
|
|
||||||
await actor.damageRoll(
|
await actor.damageRoll(
|
||||||
|
message.system.title,
|
||||||
message.system.damage,
|
message.system.damage,
|
||||||
message.system.targets.filter(x => x.hit).map(x => ({ id: x.id, name: x.name, img: x.img })),
|
message.system.targets.filter(x => x.hit).map(x => ({ id: x.id, name: x.name, img: x.img })),
|
||||||
event.shiftKey
|
event.shiftKey
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.roll {
|
&.roll {
|
||||||
|
.dice-flavor {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.dice-tooltip {
|
.dice-tooltip {
|
||||||
.dice-rolls.duality {
|
.dice-rolls.duality {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
|
||||||
|
|
||||||
.dice-hope-container {
|
.dice-hope-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -57,12 +60,18 @@
|
||||||
-webkit-text-stroke-color: @hope;
|
-webkit-text-stroke-color: @hope;
|
||||||
-webkit-text-stroke-width: 1.5px;
|
-webkit-text-stroke-width: 1.5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
&:not(.discarded) {
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.fear {
|
&.fear {
|
||||||
color: white;
|
color: white;
|
||||||
-webkit-text-stroke-color: @fear;
|
-webkit-text-stroke-color: @fear;
|
||||||
-webkit-text-stroke-width: 1.5px;
|
-webkit-text-stroke-width: 1.5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
&:not(.discarded) {
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.disadvantage {
|
&.disadvantage {
|
||||||
color: white;
|
color: white;
|
||||||
|
|
|
||||||
|
|
@ -1760,10 +1760,13 @@
|
||||||
.daggerheart.chat.downtime .downtime-refresh-container .refresh-title {
|
.daggerheart.chat.downtime .downtime-refresh-container .refresh-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.daggerheart.chat.roll .dice-flavor {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality {
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
|
||||||
}
|
}
|
||||||
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .dice-hope-container {
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .dice-hope-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -1783,12 +1786,18 @@
|
||||||
-webkit-text-stroke-width: 1.5px;
|
-webkit-text-stroke-width: 1.5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.hope:not(.discarded) {
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.fear {
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.fear {
|
||||||
color: white;
|
color: white;
|
||||||
-webkit-text-stroke-color: #430070;
|
-webkit-text-stroke-color: #430070;
|
||||||
-webkit-text-stroke-width: 1.5px;
|
-webkit-text-stroke-width: 1.5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.fear:not(.discarded) {
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.disadvantage {
|
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.disadvantage {
|
||||||
color: white;
|
color: white;
|
||||||
-webkit-text-stroke-color: #b30000;
|
-webkit-text-stroke-color: #b30000;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
|
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-formula">{{roll}}</div>
|
<div class="dice-formula">{{roll}}</div>
|
||||||
<div class="dice-tooltip">
|
<div class="dice-tooltip">
|
||||||
|
|
@ -7,7 +8,7 @@
|
||||||
<div class="dice">
|
<div class="dice">
|
||||||
<header class="part-header flexrow">
|
<header class="part-header flexrow">
|
||||||
<span class="part-formula">{{this.dice.rolls.length}}{{this.dice.type}}</span>
|
<span class="part-formula">{{this.dice.rolls.length}}{{this.dice.type}}</span>
|
||||||
<span class="part-total">{{this.total}}</span>
|
<span class="part-total">{{this.dice.rollTotal}}</span>
|
||||||
</header>
|
</header>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<ol class="dice-rolls">
|
<ol class="dice-rolls">
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dice-total">
|
<div class="dice-total">
|
||||||
<div class="dice-total-value">{{total}}</div>
|
<div class="dice-total-value">{{this.total}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{#if (gt targets.length 0)}}
|
{{#if (gt targets.length 0)}}
|
||||||
<div class="target-section">
|
<div class="target-section">
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,64 @@
|
||||||
<div class="dice-roll daggerheart chat roll">
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
|
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-formula">{{roll}}</div>
|
<div class="dice-formula">{{roll}}</div>
|
||||||
<div class="dice-tooltip {{#if advantage.value}}expanded{{/if}}">
|
|
||||||
<ol class="dice-rolls">
|
<div class="dice-tooltip">
|
||||||
<div class="dice-hope-container">
|
<div class="wrapper">
|
||||||
<li id="hope" class="roll die {{hope.dice}} hope {{#if (or (eq advantageSelected 2) (and disadvantage.value (gt hope.value disadvantage.value)))}}unused{{/if}} {{#if (and advantage.value (eq advantageSelected 0))}}advantage{{/if}}">{{hope.value}}</li>
|
<section class="tooltip-part">
|
||||||
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{hope.dice}}</span>
|
||||||
|
|
|
||||||
|
<span>1{{fear.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{this.highestRoll}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls duality">
|
||||||
|
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
||||||
|
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{#if advantage.value}}
|
{{#if advantage.value}}
|
||||||
<li class="roll die {{advantage.dice}} hope {{#if (eq advantageSelected 1)}}unused{{/if}} {{#if (eq advantageSelected 0)}}advantage{{/if}}">{{ advantage.value}}</li>
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{advantage.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{advantage.value}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls">
|
||||||
|
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if disadvantage.value}}
|
{{#if disadvantage.value}}
|
||||||
<li class="roll die {{disadvantage.dice}} disadvantage {{#if (gte disadvantage.value hope.value)}}unused{{/if}}">{{disadvantage.value}}</li>
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{disadvantage.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{disadvantage.value}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls">
|
||||||
|
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</section>
|
||||||
<li class="roll die {{fear.dice}} fear">{{fear.value}}</li>
|
</div>
|
||||||
<div class="modifiers-container">
|
|
||||||
{{#each modifiers}}
|
|
||||||
<li class="modifier-value" data-value="{{this.value}}" title="{{this.title}}">{{this.label}}</li>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</ol>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="dice-total">
|
<div class="dice-total">
|
||||||
<div class="dice-total-label">{{totalLabel}}</div>
|
<div class="dice-total-label">{{totalLabel}}</div>
|
||||||
<div class="dice-total-value">
|
<div class="dice-total-value">
|
||||||
{{#if total.alternate}}
|
{{this.total}}
|
||||||
{{#with dualityDiceStates}}
|
|
||||||
<span class="{{this.hope}}">{{../total.normal}}</span> - <span class="{{this.alternate}}">{{../total.alternate}}</span>
|
|
||||||
{{/with}}
|
|
||||||
{{else}}
|
|
||||||
{{total.normal}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#if (gt targets.length 0)}}
|
{{#if (gt targets.length 0)}}
|
||||||
|
|
@ -44,6 +73,8 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<button class="roll-damage-button" data-value="{{this.total.normal}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
<div class="flexrow">
|
||||||
|
<button class="roll-damage-button" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
|
<div class="dice-flavor">{{this.title}}</div>
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-formula">{{this.roll}}</div>
|
<div class="dice-formula">{{this.roll}}</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,62 @@
|
||||||
<div class="dice-roll daggerheart chat roll">
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
|
<div class="dice-flavor">{{this.title}}</div>
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-formula">{{roll}}</div>
|
<div class="dice-formula">{{roll}}</div>
|
||||||
<div class="dice-tooltip {{#if advantage.value}}expanded{{/if}}">
|
|
||||||
|
<div class="dice-tooltip">
|
||||||
|
<div class="wrapper">
|
||||||
|
<section class="tooltip-part">
|
||||||
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{hope.dice}}</span>
|
||||||
|
|
|
||||||
|
<span>1{{fear.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{this.highestRoll}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls duality">
|
||||||
|
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
||||||
|
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{#if advantage.value}}
|
||||||
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{advantage.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{advantage.value}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls">
|
||||||
|
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{#if disadvantage.value}}
|
||||||
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{disadvantage.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{disadvantage.value}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls">
|
||||||
|
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{!-- <div class="dice-tooltip {{#if advantage.value}}expanded{{/if}}">
|
||||||
<ol class="dice-rolls duality">
|
<ol class="dice-rolls duality">
|
||||||
<div class="dice-hope-container">
|
<div class="dice-hope-container">
|
||||||
<li id="hope" class="roll die {{hope.dice}} hope" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
<li id="hope" class="roll die {{hope.dice}} hope" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
||||||
|
|
@ -19,7 +74,7 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="dice-total">
|
<div class="dice-total">
|
||||||
<div class="dice-total-label">{{totalLabel}}</div>
|
<div class="dice-total-label">{{totalLabel}}</div>
|
||||||
<div class="dice-total-value">
|
<div class="dice-total-value">
|
||||||
|
|
@ -27,42 +82,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{!-- V1.3 --}}
|
|
||||||
{{!-- <div class="dice-roll daggerheart chat roll">
|
|
||||||
<div class="dice-result">
|
|
||||||
<div class="dice-formula">{{roll}}</div>
|
|
||||||
<div class="dice-tooltip {{#if advantage.value}}expanded{{/if}}">
|
|
||||||
<ol class="dice-rolls">
|
|
||||||
<div class="dice-hope-container">
|
|
||||||
<li id="hope" class="roll die {{hope.dice}} hope {{#if (or (eq advantageSelected 2) (and disadvantage.value (gt hope.value disadvantage.value)))}}unused{{/if}} {{#if (and advantage.value (eq advantageSelected 0))}}advantage{{/if}}">{{hope.value}}</li>
|
|
||||||
{{#if advantage.value}}
|
|
||||||
<li class="roll die {{advantage.dice}} hope {{#if (eq advantageSelected 1)}}unused{{/if}} {{#if (eq advantageSelected 0)}}advantage{{/if}}">{{ advantage.value}}</li>
|
|
||||||
{{/if}}
|
|
||||||
{{#if disadvantage.value}}
|
|
||||||
<li class="roll die {{disadvantage.dice}} disadvantage {{#if (gte disadvantage.value hope.value)}}unused{{/if}}">{{disadvantage.value}}</li>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
<li class="roll die {{fear.dice}} fear">{{fear.value}}</li>
|
|
||||||
<div class="modifiers-container">
|
|
||||||
{{#each modifiers}}
|
|
||||||
<li class="modifier-value" data-value="{{this.value}}" title="{{this.title}}">{{this.label}}</li>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
<div class="dice-total">
|
|
||||||
<div class="dice-total-label">{{totalLabel}}</div>
|
|
||||||
<div class="dice-total-value">
|
|
||||||
{{#if total.alternate}}
|
|
||||||
{{#with dualityDiceStates}}
|
|
||||||
<span class="{{this.hope}}">{{../total.normal}}</span> - <span class="{{this.alternate}}">{{../total.alternate}}</span>
|
|
||||||
{{/with}}
|
|
||||||
{{else}}
|
|
||||||
{{total.normal}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> --}}
|
|
||||||
|
|
@ -175,7 +175,7 @@
|
||||||
<div class="statistic-row">
|
<div class="statistic-row">
|
||||||
<label class="statistic-title">{{localize "DAGGERHEART.Sheets.Adversary.Attack.Modifier"}}:</label>
|
<label class="statistic-title">{{localize "DAGGERHEART.Sheets.Adversary.Attack.Modifier"}}:</label>
|
||||||
<span class="statistic-value">+{{this.data.attack.attackModifier}}</span>
|
<span class="statistic-value">+{{this.data.attack.attackModifier}}</span>
|
||||||
<img class="adversary-roll" data-action="attackRoll" data-value="{{this.data.attack.attackModifier}}" data-damage="{{this.data.attack.damage.value}}" data-damage-type="{{this.data.attack.damage.type}}" src="icons/svg/d20-grey.svg" />
|
<img class="adversary-roll" data-action="attackRoll" data-value="{{this.data.attack.attackModifier}}" data-name="{{this.data.attack.name}}" data-damage="{{this.data.attack.damage.value}}" data-damage-type="{{this.data.attack.damage.type}}" src="icons/svg/d20-grey.svg" />
|
||||||
</div>
|
</div>
|
||||||
<div class="statistic-row">
|
<div class="statistic-row">
|
||||||
<label class="statistic-title">{{localize this.data.attack.name}}</label>
|
<label class="statistic-title">{{localize this.data.attack.name}}</label>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
{{#each this.attributes as |attribute key|}}
|
{{#each this.attributes as |attribute key|}}
|
||||||
<div class="attribute">
|
<div class="attribute">
|
||||||
<div class="attribute-banner">
|
<div class="attribute-banner">
|
||||||
<img class="attribute-roll" data-action="attributeRoll" data-value="{{attribute.data.value}}" src="icons/svg/d12-grey.svg" />
|
<img class="attribute-roll" data-action="attributeRoll" data-attribute="{{key}}" data-value="{{attribute.data.value}}" src="icons/svg/d12-grey.svg" />
|
||||||
<div class="attribute-text">{{key}}</div>
|
<div class="attribute-text">{{key}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="attribute-mark {{#if (and (not attribute.levelMark) (and (not (includes attribute.levelMarks ../document.system.levelData.currentLevel)) (gt ../document.system.availableAttributeMarks.length 0)))}}selectable{{/if}}" data-action="toggleAttributeMark" data-attribute="{{key}}">
|
<div class="attribute-mark {{#if (and (not attribute.levelMark) (and (not (includes attribute.levelMarks ../document.system.levelData.currentLevel)) (gt ../document.system.availableAttributeMarks.length 0)))}}selectable{{/if}}" data-action="toggleAttributeMark" data-attribute="{{key}}">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue