Fixed DSN rolling; removed console messages; chat message clean up

This commit is contained in:
Chris Ryan 2025-12-04 21:18:09 +10:00
parent bfc84bdb2d
commit 2e6a17d787
9 changed files with 11 additions and 21 deletions

View file

@ -50,7 +50,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
}),
damage: new fields.ObjectField(),
costs: new fields.ArrayField(new fields.ObjectField()),
successConsumed: new fields.BooleanField({ initial: false }),
successConsumed: new fields.BooleanField({ initial: false })
};
}

View file

@ -119,7 +119,6 @@ export default class DualityRoll extends D20Roll {
/** @inheritDoc */
static fromData(data) {
console.log("data", data);
data.terms[0].class = foundry.dice.terms.Die.name;
data.terms[2].class = foundry.dice.terms.Die.name;
return super.fromData(data);
@ -175,9 +174,6 @@ export default class DualityRoll extends D20Roll {
static async buildEvaluate(roll, config = {}, message = {}) {
await super.buildEvaluate(roll, config, message);
console.log("roll", config);
console.log("config", config);
console.log("message", message);
await setDiceSoNiceForDualityRoll(
roll,

View file

@ -49,7 +49,6 @@ export default class FateRoll extends D20Roll {
get fateDie() {
console.log("fateRoll this", this);
return this.data.fateType;
}
@ -59,7 +58,6 @@ export default class FateRoll extends D20Roll {
/** @inheritDoc */
static fromData(data) {
console.log("data", data);
data.terms[0].class = foundry.dice.terms.Die.name;
return super.fromData(data);
}
@ -74,9 +72,6 @@ export default class FateRoll extends D20Roll {
static async buildEvaluate(roll, config = {}, message = {}) {
await super.buildEvaluate(roll, config, message);
console.log("roll", config);
console.log("config", config);
console.log("message", message);
if (roll.fateDie === "Hope") {
await setDiceSoNiceForHopeFateRoll(

View file

@ -89,7 +89,6 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
}
if (this.type === 'fateRoll') {
html.classList.add('fate');
html.classList.add('hope');
}
const autoExpandRoll = game.settings.get(

View file

@ -9,16 +9,15 @@ export default function DhFateRollEnricher(match, _options) {
function getFateMessage(roll, flavor) {
const label = flavor ?? 'Fate';
console.log("ROLL", roll);
const dataLabel = game.i18n.localize('DAGGERHEART.GENERAL.fate');
const fateElement = document.createElement('span');
fateElement.innerHTML = `
<button type="button" class="fate-roll-button${roll?.inline ? ' inline' : ''}"
<button type="button" class="fate-roll-button${roll?.inline ? ' inline' : ''}"
data-title="${label}"
data-label="${dataLabel}"
data-hope="${roll?.hope ?? 'd12'}"
data-hope="${roll?.hope ?? 'd12'}"
${label}
</button>
`;

View file

@ -73,14 +73,14 @@ export const setDiceSoNiceForHopeFateRoll = async (rollResult, hopeFaces) => {
if (!game.modules.get('dice-so-nice')?.active) return;
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
const diceSoNicePresets = await getDiceSoNicePreset(diceSoNice.hope, hopeFaces);
rollResult.dice[0].options = diceSoNicePresets.hope;
rollResult.dice[0].options = diceSoNicePresets;
};
export const setDiceSoNiceForFearFateRoll = async (rollResult, fearFaces) => {
if (!game.modules.get('dice-so-nice')?.active) return;
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
const diceSoNicePresets = await getDiceSoNicePreset(diceSoNice.fear, fearFaces);
rollResult.dice[0].options = diceSoNicePresets.fear;
rollResult.dice[0].options = diceSoNicePresets;
};
export const chunkify = (array, chunkSize, mappingFunc) => {