mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
[Feature] DualityDice DiceSoNice Animations (#1722)
* . * Fixed translation * Remove fieldset * DiceSoNice Animation Overrides (#1726) * . * . * Fixed hope/fear animation input * Visual tweaks to general tab * Move general tab to top * Fixed localizaiton --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
parent
6c7937a9ff
commit
8172e8baa7
19 changed files with 492 additions and 150 deletions
|
|
@ -630,7 +630,95 @@ export const diceSetNumbers = {
|
|||
flat: 'Flat'
|
||||
};
|
||||
|
||||
export const getDiceSoNicePreset = async (type, faces) => {
|
||||
export const diceSoNiceSFXClasses = {
|
||||
PlayAnimationBright: {
|
||||
id: 'PlayAnimationBright',
|
||||
label: 'DICESONICE.PlayAnimationBright'
|
||||
},
|
||||
PlayAnimationDark: {
|
||||
id: 'PlayAnimationDark',
|
||||
label: 'DICESONICE.PlayAnimationDark'
|
||||
},
|
||||
PlayAnimationOutline: {
|
||||
id: 'PlayAnimationOutline',
|
||||
label: 'DICESONICE.PlayAnimationOutline'
|
||||
},
|
||||
PlayAnimationImpact: {
|
||||
id: 'PlayAnimationImpact',
|
||||
label: 'DICESONICE.PlayAnimationImpact'
|
||||
},
|
||||
// PlayConfettiStrength1: {
|
||||
// id: 'PlayConfettiStrength1',
|
||||
// label: 'DICESONICE.PlayConfettiStrength1'
|
||||
// },
|
||||
// PlayConfettiStrength2: {
|
||||
// id: 'PlayConfettiStrength2',
|
||||
// label: 'DICESONICE.PlayConfettiStrength2'
|
||||
// },
|
||||
// PlayConfettiStrength3: {
|
||||
// id: 'PlayConfettiStrength3',
|
||||
// label: 'DICESONICE.PlayConfettiStrength3'
|
||||
// },
|
||||
PlayAnimationThormund: {
|
||||
id: 'PlayAnimationThormund',
|
||||
label: 'DICESONICE.PlayAnimationThormund'
|
||||
},
|
||||
PlayAnimationParticleSpiral: {
|
||||
id: 'PlayAnimationParticleSpiral',
|
||||
label: 'DICESONICE.PlayAnimationParticleSpiral'
|
||||
},
|
||||
PlayAnimationParticleSparkles: {
|
||||
id: 'PlayAnimationParticleSparkles',
|
||||
label: 'DICESONICE.PlayAnimationParticleSparkles'
|
||||
},
|
||||
PlayAnimationParticleVortex: {
|
||||
id: 'PlayAnimationParticleVortex',
|
||||
label: 'DICESONICE.PlayAnimationParticleVortex'
|
||||
},
|
||||
PlaySoundEpicWin: {
|
||||
id: 'PlaySoundEpicWin',
|
||||
label: 'DICESONICE.PlaySoundEpicWin'
|
||||
},
|
||||
PlaySoundEpicFail: {
|
||||
id: 'PlaySoundEpicFail',
|
||||
label: 'DICESONICE.PlaySoundEpicFail'
|
||||
}
|
||||
// "PlaySoundCustom",
|
||||
// "PlayMacro"
|
||||
};
|
||||
|
||||
export const daggerheartDiceAnimationEvents = {
|
||||
critical: {
|
||||
id: 'critical',
|
||||
label: 'DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.critical.name'
|
||||
},
|
||||
higher: {
|
||||
id: 'higher',
|
||||
label: 'DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.higher.name'
|
||||
}
|
||||
};
|
||||
|
||||
const getDiceSoNiceSFX = sfxOptions => {
|
||||
const diceSoNice = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).diceSoNiceData;
|
||||
const criticalAnimationData = diceSoNice.sfx.critical;
|
||||
if (sfxOptions.critical && criticalAnimationData.class) {
|
||||
return {
|
||||
specialEffect: criticalAnimationData.class,
|
||||
options: {}
|
||||
};
|
||||
}
|
||||
|
||||
if (sfxOptions.higher && sfxOptions.data.higher) {
|
||||
return {
|
||||
specialEffect: sfxOptions.data.higher.class,
|
||||
options: {}
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
export const getDiceSoNicePreset = async (type, faces, sfxOptions = {}) => {
|
||||
const system = game.dice3d.DiceFactory.systems.get(type.system).dice.get(faces);
|
||||
if (!system) {
|
||||
ui.notifications.error(
|
||||
|
|
@ -653,16 +741,33 @@ export const getDiceSoNicePreset = async (type, faces) => {
|
|||
appearance: {
|
||||
...system.appearance,
|
||||
...type
|
||||
}
|
||||
},
|
||||
sfx: getDiceSoNiceSFX(sfxOptions)
|
||||
};
|
||||
};
|
||||
|
||||
export const getDiceSoNicePresets = async (hopeFaces, fearFaces, advantageFaces = 'd6', disadvantageFaces = 'd6') => {
|
||||
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
|
||||
export const getDiceSoNicePresets = async (
|
||||
result,
|
||||
hopeFaces,
|
||||
fearFaces,
|
||||
advantageFaces = 'd6',
|
||||
disadvantageFaces = 'd6'
|
||||
) => {
|
||||
const diceSoNice = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).diceSoNiceData;
|
||||
|
||||
const { isCritical, withHope, withFear } = result;
|
||||
|
||||
return {
|
||||
hope: await getDiceSoNicePreset(diceSoNice.hope, hopeFaces),
|
||||
fear: await getDiceSoNicePreset(diceSoNice.fear, fearFaces),
|
||||
hope: await getDiceSoNicePreset(diceSoNice.hope, hopeFaces, {
|
||||
critical: isCritical,
|
||||
higher: withHope,
|
||||
data: diceSoNice.hope.sfx
|
||||
}),
|
||||
fear: await getDiceSoNicePreset(diceSoNice.fear, fearFaces, {
|
||||
critical: isCritical,
|
||||
higher: withFear,
|
||||
data: diceSoNice.fear.sfx
|
||||
}),
|
||||
advantage: await getDiceSoNicePreset(diceSoNice.advantage, advantageFaces),
|
||||
disadvantage: await getDiceSoNicePreset(diceSoNice.disadvantage, disadvantageFaces)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue