refactor: Update special effect options to use DSN v4 sfx property with lowercase IDs.
This commit is contained in:
parent
d3e66b8846
commit
c8727fd7bb
1 changed files with 4 additions and 2 deletions
|
|
@ -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 };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue