152 - Improve Rest Options (#154)

* Fixed up downtime dialogs and data model

* Added homebrew settings without action handling for now

* Added NrChoices to homebrew
This commit is contained in:
WBHarry 2025-06-20 16:36:09 +02:00 committed by GitHub
parent f6e077b290
commit 3464717958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 799 additions and 123 deletions

View file

@ -87,6 +87,14 @@ export default class DhCharacter extends BaseDataActor {
};
}
get tier() {
return this.levelData.level.current === 1
? 1
: Object.values(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers).find(
tier => currentLevel >= tier.levels.start && currentLevel <= tier.levels.end
).tier;
}
get ancestry() {
return this.parent.items.find(x => x.type === 'ancestry') ?? null;
}
@ -134,19 +142,6 @@ export default class DhCharacter extends BaseDataActor {
: null;
}
get refreshableFeatures() {
return this.parent.items.reduce(
(acc, x) => {
if (x.type === 'feature' && x.system.refreshData?.type === 'feature' && x.system.refreshData?.type) {
acc[x.system.refreshData.type].push(x);
}
return acc;
},
{ shortRest: [], longRest: [] }
);
}
static async unequipBeforeEquip(itemToEquip) {
const primary = this.primaryWeapon,
secondary = this.secondaryWeapon;
@ -242,6 +237,14 @@ export default class DhCharacter extends BaseDataActor {
this.evasion.total = (this.class?.evasion ?? 0) + this.evasion.bonus;
this.proficiency.total = this.proficiency.value + this.proficiency.bonus;
}
getRollData() {
const data = super.getRollData();
return {
...data,
tier: this.tier
};
}
}
class DhPCLevelData extends foundry.abstract.DataModel {