mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-19 00:19:03 +01:00
Merged with main
This commit is contained in:
commit
130b2bf100
65 changed files with 1085 additions and 860 deletions
|
|
@ -494,40 +494,41 @@ export const diceSetNumbers = {
|
|||
flat: 'Flat'
|
||||
};
|
||||
|
||||
export const getDiceSoNicePresets = async (hopeFaces, fearFaces, advantageFaces = 'd6', disadvantageFaces = 'd6') => {
|
||||
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
|
||||
const getPreset = async (type, faces) => {
|
||||
const system = game.dice3d.DiceFactory.systems.get(type.system).dice.get(faces);
|
||||
if (!system) {
|
||||
ui.notifications.error(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.noDiceSystem', {
|
||||
system: game.dice3d.DiceFactory.systems.get(type.system).name,
|
||||
faces: faces
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
export const getDiceSoNicePreset = async (type, faces) => {
|
||||
const system = game.dice3d.DiceFactory.systems.get(type.system).dice.get(faces);
|
||||
if (!system) {
|
||||
ui.notifications.error(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.noDiceSystem', {
|
||||
system: game.dice3d.DiceFactory.systems.get(type.system).name,
|
||||
faces: faces
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (system.modelFile && !system.modelLoaded) {
|
||||
await system.loadModel(game.dice3d.DiceFactory.loaderGLTF);
|
||||
} else {
|
||||
await system.loadTextures();
|
||||
}
|
||||
|
||||
return {
|
||||
modelFile: system.modelFile,
|
||||
appearance: {
|
||||
...system.appearance,
|
||||
...type
|
||||
}
|
||||
};
|
||||
};
|
||||
if (system.modelFile && !system.modelLoaded) {
|
||||
await system.loadModel(game.dice3d.DiceFactory.loaderGLTF);
|
||||
} else {
|
||||
await system.loadTextures();
|
||||
}
|
||||
|
||||
return {
|
||||
hope: await getPreset(diceSoNice.hope, hopeFaces),
|
||||
fear: await getPreset(diceSoNice.fear, fearFaces),
|
||||
advantage: await getPreset(diceSoNice.advantage, advantageFaces),
|
||||
disadvantage: await getPreset(diceSoNice.disadvantage, disadvantageFaces)
|
||||
modelFile: system.modelFile,
|
||||
appearance: {
|
||||
...system.appearance,
|
||||
...type
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const getDiceSoNicePresets = async (hopeFaces, fearFaces, advantageFaces = 'd6', disadvantageFaces = 'd6') => {
|
||||
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
|
||||
|
||||
return {
|
||||
hope: await getDiceSoNicePreset(diceSoNice.hope, hopeFaces),
|
||||
fear: await getDiceSoNicePreset(diceSoNice.fear, fearFaces),
|
||||
advantage: await getDiceSoNicePreset(diceSoNice.advantage, advantageFaces),
|
||||
disadvantage: await getDiceSoNicePreset(diceSoNice.disadvantage, disadvantageFaces)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1040,16 +1040,6 @@ export const weaponFeatures = {
|
|||
key: 'system.evasion',
|
||||
mode: 2,
|
||||
value: '-1'
|
||||
},
|
||||
{
|
||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
||||
mode: 5,
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1166,18 +1156,7 @@ export const weaponFeatures = {
|
|||
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.effects.powerful.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.effects.powerful.description',
|
||||
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
||||
mode: 5,
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
changes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -1301,13 +1280,7 @@ export const weaponFeatures = {
|
|||
name: 'DAGGERHEART.CONFIG.WeaponFeature.selfCorrecting.effects.selfCorrecting.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.selfCorrecting.effects.selfCorrecting.description',
|
||||
img: 'icons/weapons/ammunition/arrow-broadhead-glowing-orange.webp',
|
||||
changes: [
|
||||
{
|
||||
key: 'system.rules.damage.flipMinDiceValue',
|
||||
mode: 5,
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
changes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -1319,13 +1292,7 @@ export const weaponFeatures = {
|
|||
name: 'DAGGERHEART.CONFIG.WeaponFeature.serrated.effects.serrated.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.serrated.effects.serrated.description',
|
||||
img: 'icons/weapons/ammunition/arrow-broadhead-glowing-orange.webp',
|
||||
changes: [
|
||||
{
|
||||
key: 'system.rules.damage.flipMinDiceValue',
|
||||
mode: 5,
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
changes: []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue