chore: remove debug console logs

This commit is contained in:
CPTN Cosmo 2026-02-10 03:39:09 +01:00
parent c7589a55ab
commit d3e66b8846
No known key found for this signature in database

View file

@ -129,7 +129,6 @@ function isCriticalHit(roll) {
}
if (hopeTotal !== undefined && fearTotal !== undefined) {
console.log('Duality Check:', hopeTotal, fearTotal);
return hopeTotal === fearTotal;
}
}
@ -203,38 +202,30 @@ Hooks.on('renderChatMessageHTML', (message, html, data) => {
// Hook into DiceSoNice to trigger effects
// Hook into DiceSoNice to trigger effects
Hooks.on('diceSoNiceRollStart', (messageId, context) => {
console.log('DSN Hook Fired', messageId, context);
const roll = context.roll;
if (!roll) return;
if (isCriticalHit(roll)) {
console.log('DSN: Critical Hit Detected');
const effect = game.settings.get('dh-immersive-crits', 'dsnCritEffect');
console.log('DSN Effect:', effect);
if (effect && effect !== 'none') {
// Check if roll.dice exists and has elements
if (roll.dice && roll.dice.length > 0) {
roll.dice.forEach(die => {
if (!die.options) die.options = {};
die.options.specialEffect = effect === 'default' ? 'Stars' : capitalize(effect);
console.log('Applied effect to die:', die);
});
} else {
// Determine if we need to iterate terms for Duality Rolls
console.log('No roll.dice found. Checking terms:', roll.terms);
if (roll.terms) {
roll.terms.forEach(term => {
if (term.faces) { // It's a die
if (!term.options) term.options = {};
term.options.specialEffect = effect === 'default' ? 'Stars' : capitalize(effect);
console.log('Applied effect to term:', term);
}
});
}
}
}
} else {
console.log('DSN: Not a Critical Hit', roll.constructor.name, roll);
}
});