mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
p
This commit is contained in:
parent
faa32c1fba
commit
56e11943b7
9 changed files with 72 additions and 79 deletions
|
|
@ -1874,6 +1874,7 @@
|
||||||
"multiclass": "Multiclass",
|
"multiclass": "Multiclass",
|
||||||
"newCategory": "New Category",
|
"newCategory": "New Category",
|
||||||
"none": "None",
|
"none": "None",
|
||||||
|
"noTarget": "No current target",
|
||||||
"partner": "Partner",
|
"partner": "Partner",
|
||||||
"proficiency": "Proficiency",
|
"proficiency": "Proficiency",
|
||||||
"quantity": "Quantity",
|
"quantity": "Quantity",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
this.roll = roll;
|
this.roll = roll;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.config.experiences = [];
|
this.config.experiences = [];
|
||||||
this.reactionOverride = config.roll.type === 'reaction';
|
this.reactionOverride = config.roll?.type === 'reaction';
|
||||||
|
|
||||||
if (config.source?.action) {
|
if (config.source?.action) {
|
||||||
this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent;
|
this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent;
|
||||||
|
|
@ -149,16 +149,16 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
static toggleReaction() {
|
static toggleReaction() {
|
||||||
if (this.config.roll) {
|
if (this.config.roll) {
|
||||||
this.reactionOverride = !this.reactionOverride;
|
this.reactionOverride = !this.reactionOverride;
|
||||||
|
this.config.roll.type = this.reactionOverride
|
||||||
|
? CONFIG.DH.ITEM.actionTypes.reaction.id
|
||||||
|
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
|
||||||
|
? null
|
||||||
|
: this.config.roll.type;
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async submitRoll() {
|
static async submitRoll() {
|
||||||
this.config.roll.type = this.reactionOverride
|
|
||||||
? CONFIG.DH.ITEM.actionTypes.reaction.id
|
|
||||||
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
|
|
||||||
? null
|
|
||||||
: this.config.roll.type;
|
|
||||||
await this.close({ submitted: true });
|
await this.close({ submitted: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ export default class D20Roll extends DHRoll {
|
||||||
|
|
||||||
static postEvaluate(roll, config = {}) {
|
static postEvaluate(roll, config = {}) {
|
||||||
const data = super.postEvaluate(roll, config);
|
const data = super.postEvaluate(roll, config);
|
||||||
|
data.type = config.roll?.type;
|
||||||
if (config.targets?.length) {
|
if (config.targets?.length) {
|
||||||
config.targetSelection = true;
|
config.targetSelection = true;
|
||||||
config.targets.forEach(target => {
|
config.targets.forEach(target => {
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,7 @@ export default class DamageRoll extends DHRoll {
|
||||||
for (const roll of config.roll) await roll.roll.evaluate();
|
for (const roll of config.roll) await roll.roll.evaluate();
|
||||||
}
|
}
|
||||||
roll._evaluated = true;
|
roll._evaluated = true;
|
||||||
const parts = [];
|
const parts = config.roll.map(r => this.postEvaluate(r));
|
||||||
for (let r of config.roll) {
|
|
||||||
const part = this.postEvaluate(r);
|
|
||||||
parts.push(part);
|
|
||||||
}
|
|
||||||
|
|
||||||
config.roll = this.unifyDamageRoll(parts);
|
config.roll = this.unifyDamageRoll(parts);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,7 @@ export default class DHRoll extends Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
static postEvaluate(roll, config = {}) {
|
static postEvaluate(roll, config = {}) {
|
||||||
console.log(roll, config)
|
|
||||||
return {
|
return {
|
||||||
type: config.roll.type,
|
|
||||||
total: roll.total,
|
total: roll.total,
|
||||||
formula: roll.formula,
|
formula: roll.formula,
|
||||||
dice: roll.dice.map(d => ({
|
dice: roll.dice.map(d => ({
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.roll-target {
|
.roll-target {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -2,70 +2,59 @@
|
||||||
<div class="roll-part-header"><div><span>Damage</span></div></div>
|
<div class="roll-part-header"><div><span>Damage</span></div></div>
|
||||||
<div class="roll-part-extra on-reduced">
|
<div class="roll-part-extra on-reduced">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="roll-formula">Hit Points: 10</div>
|
{{#each damage.roll as | roll index | }}
|
||||||
<div class="roll-formula">Stress: 10</div>
|
<div class="roll-formula">{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.name')}}: {{total}}</div>
|
||||||
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="roll-part-content dice-result">
|
<div class="roll-part-content dice-result">
|
||||||
<div class="dice-tooltip">
|
<div class="dice-tooltip">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<fieldset>
|
{{#each damage.roll as | roll index | }}
|
||||||
<legend>
|
<fieldset>
|
||||||
Hit Points <div class="roll-formula">Total: 10</div>
|
<legend>
|
||||||
</legend>
|
{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.name')}} <div class="roll-formula">{{localize "DAGGERHEART.GENERAL.total"}}: {{roll.total}}</div>
|
||||||
<label class="roll-part-header"><span>Physical <div class="roll-formula">10</div></span></label>
|
</legend>
|
||||||
<div class="roll-dice">
|
{{#each roll.parts}}
|
||||||
<div class="roll-die">
|
{{#if damageTypes.length}}
|
||||||
<div>4 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt=""></div>
|
<label class="roll-part-header"><span>
|
||||||
</div>
|
{{#each damageTypes}}
|
||||||
<div class="roll-die">
|
{{localize (concat 'DAGGERHEART.CONFIG.ArmorFeature.' this '.name')}}
|
||||||
<div>+</div>
|
{{#unless @last}}/{{/unless}}
|
||||||
</div>
|
{{/each}}
|
||||||
<div class="roll-die">
|
<div class="roll-formula">{{total}}</div></span></label>
|
||||||
<div>6</div>
|
{{/if}}
|
||||||
</div>
|
<div class="roll-dice">
|
||||||
</div>
|
{{#each dice}}
|
||||||
<label class="roll-part-header"><span>Magical <div class="roll-formula">10</div></span></label>
|
<div class="roll-die">
|
||||||
<div class="roll-dice">
|
{{!-- <div>{{total}} <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/{{dice}}.svg" alt=""></div> --}}
|
||||||
<div class="roll-die">
|
<div>{{total}} <li class="roll die {{dice}} min"></li></div>
|
||||||
<div>4 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt=""></div>
|
</div>
|
||||||
</div>
|
{{#unless @last}}
|
||||||
<div class="roll-die">
|
<div class="roll-die">
|
||||||
<div>+</div>
|
<div>+</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="roll-die">
|
{{/unless}}
|
||||||
<div>6</div>
|
{{/each}}
|
||||||
</div>
|
{{#if modifierTotal}}
|
||||||
</div>
|
{{#if (gt modifierTotal 0)}}
|
||||||
<label class="roll-part-header"><span>Phy/Mag <div class="roll-formula">10</div></span></label>
|
<div class="roll-die">
|
||||||
<div class="roll-dice">
|
<div>+</div>
|
||||||
<div class="roll-die">
|
</div>
|
||||||
<div>4 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt=""></div>
|
{{/if}}
|
||||||
</div>
|
<div class="roll-die">
|
||||||
<div class="roll-die">
|
<div>{{modifierTotal}}</div>
|
||||||
<div>+</div>
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
<div class="roll-die">
|
{{#unless dice.length}}
|
||||||
<div>6</div>
|
<div class="roll-die">
|
||||||
</div>
|
<div>{{total}}</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
{{/unless}}
|
||||||
<fieldset>
|
</div>
|
||||||
<legend>
|
{{/each}}
|
||||||
Stress <div class="roll-formula">Total: 10</div>
|
</fieldset>
|
||||||
</legend>
|
{{/each}}
|
||||||
<div class="roll-dice">
|
|
||||||
<div class="roll-die">
|
|
||||||
<div>4 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt=""></div>
|
|
||||||
</div>
|
|
||||||
<div class="roll-die">
|
|
||||||
<div>+</div>
|
|
||||||
</div>
|
|
||||||
<div class="roll-die">
|
|
||||||
<div>6</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,13 @@
|
||||||
<div class="roll-part-content dice-result">
|
<div class="roll-part-content dice-result">
|
||||||
<div class="dice-tooltip">
|
<div class="dice-tooltip">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="target-selector">
|
{{#if targets.length}}
|
||||||
<div class="roll-part-header"><div></div></div>
|
<div class="target-selector">
|
||||||
<div class="target-choice"><div {{#if targetSelection}}class="target-selected"{{/if}} data-target-hit="true">{{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}</div><div {{#unless targetSelection}}class="target-selected"{{/unless}}>{{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}</div></div>
|
<div class="roll-part-header"><div></div></div>
|
||||||
<div class="roll-part-header"><div></div></div>
|
<div class="target-choice"><div {{#if targetSelection}}class="target-selected"{{/if}} data-target-hit="true">{{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}</div><div {{#unless targetSelection}}class="target-selected"{{/unless}}>{{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}</div></div>
|
||||||
</div>
|
<div class="roll-part-header"><div></div></div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{#if roll.hasSave}}<div class="roll-part-extra">Reaction Roll All Targets<i class="fa-solid fa-shield fa-lg"></i></div>{{/if}}
|
{{#if roll.hasSave}}<div class="roll-part-extra">Reaction Roll All Targets<i class="fa-solid fa-shield fa-lg"></i></div>{{/if}}
|
||||||
{{#each currentTargets}}
|
{{#each currentTargets}}
|
||||||
<div class="roll-target" data-token="{{id}}">
|
<div class="roll-target" data-token="{{id}}">
|
||||||
|
|
@ -34,6 +36,8 @@
|
||||||
</div>
|
</div>
|
||||||
{{#if ../roll.hasSave}}<i class="fa-solid fa-shield fa-lg"></i>{{/if}}
|
{{#if ../roll.hasSave}}<i class="fa-solid fa-shield fa-lg"></i>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<i>{{localize "DAGGERHEART.GENERAL.noTarget"}}</i>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="chat-roll">{{log this}}
|
<div class="chat-roll">{{log this}}
|
||||||
{{#if hasRoll}}{{> 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs'}}{{/if}}
|
{{#if hasRoll}}{{> 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs'}}{{/if}}
|
||||||
{{#if (or hasDamage hasHealing)}}{{> 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs'}}{{/if}}
|
{{#if (and damage.roll (or hasDamage hasHealing))}}{{> 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs'}}{{/if}}
|
||||||
{{> 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs'}}
|
{{> 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs'}}
|
||||||
<div class="roll-part-header"><div></div></div>
|
<div class="roll-part-header"><div></div></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue