mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Auto remove all marked stress and HP for Risk It All, if Hope value rolled covers it.
This commit is contained in:
parent
47f161a19b
commit
e2fe184833
1 changed files with 22 additions and 14 deletions
|
|
@ -64,20 +64,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleRiskItAll() {
|
async clearAllStressAndHitpoints() {
|
||||||
const config = await enrichedDualityRoll({
|
|
||||||
reaction: true,
|
|
||||||
traitValue: null,
|
|
||||||
target: null,
|
|
||||||
difficulty: null,
|
|
||||||
title: "Risk It All",
|
|
||||||
label: 'test',
|
|
||||||
actionType: null,
|
|
||||||
advantage: null
|
|
||||||
});
|
|
||||||
|
|
||||||
if (config.roll.isCritical) {
|
|
||||||
console.log("Clear all stress and HP");
|
|
||||||
await this.actor.update(
|
await this.actor.update(
|
||||||
{
|
{
|
||||||
system: {
|
system: {
|
||||||
|
|
@ -92,6 +79,23 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async handleRiskItAll() {
|
||||||
|
const config = await enrichedDualityRoll({
|
||||||
|
reaction: true,
|
||||||
|
traitValue: null,
|
||||||
|
target: null,
|
||||||
|
difficulty: null,
|
||||||
|
title: "Risk It All",
|
||||||
|
label: 'test',
|
||||||
|
actionType: null,
|
||||||
|
advantage: null
|
||||||
|
});
|
||||||
|
|
||||||
|
if (config.roll.isCritical) {
|
||||||
|
console.log("Clear all stress and HP");
|
||||||
|
this.clearAllStressAndHitpoints();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,6 +103,10 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
if (config.roll.result.duality == 1) {
|
if (config.roll.result.duality == 1) {
|
||||||
console.log("Need to clear up Stress and HP up to hope value");
|
console.log("Need to clear up Stress and HP up to hope value");
|
||||||
console.log("Hope rolled", config.roll.hope.value);
|
console.log("Hope rolled", config.roll.hope.value);
|
||||||
|
if (config.roll.hope.value >= (this.actor.system.resources.hitPoints.value + this.actor.system.resources.stress.value)) {
|
||||||
|
console.log("Hope roll value is more than the HP + Stress, auto- remove");
|
||||||
|
this.clearAllStressAndHitpoints();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue