More death moves setup/testing

This commit is contained in:
Chris Ryan 2025-12-23 14:53:57 +10:00
parent 9a3355175b
commit 25646e30d6
4 changed files with 61 additions and 2 deletions

View file

@ -2170,6 +2170,7 @@
"rollWith": "{roll} Roll",
"save": "Save",
"scalable": "Scalable",
"scars": "Scars",
"situationalBonus": "Situational Bonus",
"spent": "Spent",
"step": "Step",

View file

@ -1,4 +1,5 @@
import { enrichedFateRoll } from '../../enrichers/FateRollEnricher.mjs';
import { enrichedDualityRoll } from '../../enrichers/DualityRollEnricher.mjs';
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) {
// apply scarring - for now directly apply - later add a button.
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);
}
}
handleRiskItAll() {
async handleRiskItAll() {
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) {

View file

@ -105,4 +105,5 @@ export const enrichedDualityRoll = async (
config.source = { actor: null };
await CONFIG.Dice.daggerheart.DualityRoll.build(config);
}
return config;
};

View file

@ -113,6 +113,7 @@
</fieldset>
{{/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>
<div class="nest-inputs">
<button class="advantage-chip flex1 {{#if (eq advantage 1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="1">
@ -156,6 +157,7 @@
</select>
{{/if}}
{{/unless}}
{{/if}}
{{#if @root.rallyDie.length}}
<span class="formula-label">{{localize "DAGGERHEART.CLASS.Feature.rallyDice"}}</span>
<select name="roll.dice._rallyIndex">