Update the gun macros

This commit is contained in:
Oliver-Akins 2025-05-16 18:53:59 -06:00
parent 9d4704897f
commit 9cee87b81e
6 changed files with 403 additions and 6 deletions

View file

@ -36,12 +36,17 @@ async function main() {
},
],
});
const { statBase, extraDice } = answers;
const { extraDice } = answers;
let { statBase } = answers;
let rollMode = game.settings.get(`core`, `rollMode`);
let diceCount = statBase;
diceCount += extraDice;
if (statBase === 6) {
diceCount += 6;
};
let statGain = 0;
let gunLoss = 0;
let successes = 0;
let critsOnly = 0;
@ -68,9 +73,16 @@ async function main() {
classes += ` success`;
}
if (statBase === 6 && i <= 6) {
if (i === 6) {
statBase -= 1;
};
continue
}
if (succeeded) {
try {
const { holdTheTrigger } = await DialogManager.ask({
const { holdTheTrigger, ventHeat } = await DialogManager.ask({
id: `mini-gun-hold-the-trigger`,
question: `Hold The Trigger?`,
inputs: [
@ -102,16 +114,17 @@ async function main() {
heatMeter += (holdTheTrigger ? 1 : -1);
if (holdTheTrigger) {
diceCount += 1;
}
};
if (heatMeter >= 6) {
heatMeter = 0;
gunLoss += 2;
}
statBase -= 2;
};
} catch {};
}
// Save dice stats if present
WorldAPI?.saveRollValue?.(sidesOnDice, total);
WorldAPI?.saveRollValue?.(6, total);
results.push(`<li class="${classes}">${total}</li>`);
};