mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
More death moves setup/testing
This commit is contained in:
parent
9a3355175b
commit
25646e30d6
4 changed files with 61 additions and 2 deletions
|
|
@ -2170,6 +2170,7 @@
|
||||||
"rollWith": "{roll} Roll",
|
"rollWith": "{roll} Roll",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"scalable": "Scalable",
|
"scalable": "Scalable",
|
||||||
|
"scars": "Scars",
|
||||||
"situationalBonus": "Situational Bonus",
|
"situationalBonus": "Situational Bonus",
|
||||||
"spent": "Spent",
|
"spent": "Spent",
|
||||||
"step": "Step",
|
"step": "Step",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { enrichedFateRoll } from '../../enrichers/FateRollEnricher.mjs';
|
import { enrichedFateRoll } from '../../enrichers/FateRollEnricher.mjs';
|
||||||
|
import { enrichedDualityRoll } from '../../enrichers/DualityRollEnricher.mjs';
|
||||||
|
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
@ -56,13 +57,67 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
if (config.roll.fate.value <= this.actor.system.levelData.level.current) {
|
if (config.roll.fate.value <= this.actor.system.levelData.level.current) {
|
||||||
// apply scarring - for now directly apply - later add a button.
|
// apply scarring - for now directly apply - later add a button.
|
||||||
console.log("Adding a scar...", this.actor.system.scars);
|
console.log("Adding a scar...", this.actor.system.scars);
|
||||||
this.actor.system.scars.push({id:"1", name: "scar1", description: "description1"});
|
const scar = {
|
||||||
|
[foundry.utils.randomID()]: {
|
||||||
|
name: "A scar " + this.actor.system.scars.length,
|
||||||
|
description: "A description"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("scar", scar);
|
||||||
|
|
||||||
|
console.log('something goes here to update the scars data...');
|
||||||
|
|
||||||
|
|
||||||
|
await this.actor.update(
|
||||||
|
{
|
||||||
|
system: {
|
||||||
|
scars: {
|
||||||
|
scar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ overwrite: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
console.log("Adding a scar result", this.actor.system.scars);
|
console.log("Adding a scar result", this.actor.system.scars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRiskItAll() {
|
async handleRiskItAll() {
|
||||||
console.log("Risk It All!");
|
console.log("Risk It All!");
|
||||||
|
|
||||||
|
const config = await enrichedDualityRoll({
|
||||||
|
reaction: true,
|
||||||
|
traitValue: null,
|
||||||
|
target: null,
|
||||||
|
difficulty: null,
|
||||||
|
title: "Risk It All",
|
||||||
|
label: 'test',
|
||||||
|
actionType: null,
|
||||||
|
advantage: null
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("config", config);
|
||||||
|
|
||||||
|
if (config.roll.isCritical) {
|
||||||
|
console.log("Clear all stress and HP");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hope
|
||||||
|
if (config.roll.result.duality == 1) {
|
||||||
|
console.log("Need to clear up Stress and HP up to hope value");
|
||||||
|
console.log("Hope rolled", config.roll.hope.value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Fear
|
||||||
|
if (config.roll.result.duality == -1) {
|
||||||
|
console.log("You have died...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static selectMove(_, button) {
|
static selectMove(_, button) {
|
||||||
|
|
|
||||||
|
|
@ -105,4 +105,5 @@ export const enrichedDualityRoll = async (
|
||||||
config.source = { actor: null };
|
config.source = { actor: null };
|
||||||
await CONFIG.Dice.daggerheart.DualityRoll.build(config);
|
await CONFIG.Dice.daggerheart.DualityRoll.build(config);
|
||||||
}
|
}
|
||||||
|
return config;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<fieldset class="modifier-container {{#if (eq @root.rollType 'DualityRoll')}}two-columns{{else}}one-column{{/if}}">
|
<fieldset class="modifier-container {{#if (eq @root.rollType 'DualityRoll')}}two-columns{{else}}one-column{{/if}}">
|
||||||
|
{{#if @root.advantage}}
|
||||||
<legend>{{localize "DAGGERHEART.GENERAL.Modifier.plural"}}</legend>
|
<legend>{{localize "DAGGERHEART.GENERAL.Modifier.plural"}}</legend>
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
<button class="advantage-chip flex1 {{#if (eq advantage 1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="1">
|
<button class="advantage-chip flex1 {{#if (eq advantage 1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="1">
|
||||||
|
|
@ -156,6 +157,7 @@
|
||||||
</select>
|
</select>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
{{#if @root.rallyDie.length}}
|
{{#if @root.rallyDie.length}}
|
||||||
<span class="formula-label">{{localize "DAGGERHEART.CLASS.Feature.rallyDice"}}</span>
|
<span class="formula-label">{{localize "DAGGERHEART.CLASS.Feature.rallyDice"}}</span>
|
||||||
<select name="roll.dice._rallyIndex">
|
<select name="roll.dice._rallyIndex">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue