mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Added homebrew for armor and weapon fatures (#1166)
Co-authored-by: Chris Ryan <chrisr@blackhole>
This commit is contained in:
parent
f1b6d3851d
commit
2176038ec6
20 changed files with 560 additions and 77 deletions
|
|
@ -452,6 +452,34 @@ export const armorFeatures = {
|
|||
}
|
||||
};
|
||||
|
||||
export const allArmorFeatures = () => {
|
||||
const homebrewFeatures = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).itemFeatures
|
||||
.armorFeatures;
|
||||
return {
|
||||
...armorFeatures,
|
||||
...Object.keys(homebrewFeatures).reduce((acc, key) => {
|
||||
const feature = homebrewFeatures[key];
|
||||
acc[key] = { ...feature, label: feature.name };
|
||||
return acc;
|
||||
}, {})
|
||||
};
|
||||
};
|
||||
|
||||
export const orderedArmorFeatures = () => {
|
||||
const homebrewFeatures = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).itemFeatures
|
||||
.armorFeatures;
|
||||
const allFeatures = { ...armorFeatures, ...homebrewFeatures };
|
||||
const all = Object.keys(allFeatures).map(key => {
|
||||
const feature = allFeatures[key];
|
||||
return {
|
||||
...feature,
|
||||
id: key,
|
||||
label: feature.label ?? feature.name
|
||||
};
|
||||
});
|
||||
return Object.values(all).sort((a, b) => game.i18n.localize(a.label).localeCompare(game.i18n.localize(b.label)));
|
||||
};
|
||||
|
||||
export const weaponFeatures = {
|
||||
barrier: {
|
||||
label: 'DAGGERHEART.CONFIG.WeaponFeature.barrier.name',
|
||||
|
|
@ -1383,6 +1411,34 @@ export const weaponFeatures = {
|
|||
}
|
||||
};
|
||||
|
||||
export const allWeaponFeatures = () => {
|
||||
const homebrewFeatures = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).itemFeatures
|
||||
.weaponFeatures;
|
||||
return {
|
||||
...weaponFeatures,
|
||||
...Object.keys(homebrewFeatures).reduce((acc, key) => {
|
||||
const feature = homebrewFeatures[key];
|
||||
acc[key] = { ...feature, label: feature.name };
|
||||
return acc;
|
||||
}, {})
|
||||
};
|
||||
};
|
||||
|
||||
export const orderedWeaponFeatures = () => {
|
||||
const homebrewFeatures = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).itemFeatures
|
||||
.weaponFeatures;
|
||||
const allFeatures = { ...weaponFeatures, ...homebrewFeatures };
|
||||
const all = Object.keys(allFeatures).map(key => {
|
||||
const feature = allFeatures[key];
|
||||
return {
|
||||
...feature,
|
||||
id: key,
|
||||
label: feature.label ?? feature.name
|
||||
};
|
||||
});
|
||||
return Object.values(all).sort((a, b) => game.i18n.localize(a.label).localeCompare(game.i18n.localize(b.label)));
|
||||
};
|
||||
|
||||
export const featureTypes = {
|
||||
ancestry: {
|
||||
id: 'ancestry',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue