refactor: Update special effect options to use DSN v4 sfx property with lowercase IDs.

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

View file

@ -212,7 +212,9 @@ Hooks.on('diceSoNiceRollStart', (messageId, context) => {
if (roll.dice && roll.dice.length > 0) {
roll.dice.forEach(die => {
if (!die.options) die.options = {};
die.options.specialEffect = effect === 'default' ? 'Stars' : capitalize(effect);
// Use new DSN v4 API: sfx property
// Effect ID should likely be lowercase
die.options.sfx = { id: effect === 'default' ? 'stars' : effect };
});
} else {
// Determine if we need to iterate terms for Duality Rolls
@ -220,7 +222,7 @@ Hooks.on('diceSoNiceRollStart', (messageId, context) => {
roll.terms.forEach(term => {
if (term.faces) { // It's a die
if (!term.options) term.options = {};
term.options.specialEffect = effect === 'default' ? 'Stars' : capitalize(effect);
term.options.sfx = { id: effect === 'default' ? 'stars' : effect };
}
});
}