mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-24 00:13:39 +02:00
Merge branch 'development' into feature/1383-Companion-Bonus-Levelups
This commit is contained in:
commit
2fcad0ff25
66 changed files with 1389 additions and 151 deletions
|
|
@ -669,26 +669,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
* Resets the character data and removes all embedded documents.
|
||||
*/
|
||||
static async #resetCharacter() {
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: {
|
||||
title: game.i18n.localize('DAGGERHEART.ACTORS.Character.resetCharacterConfirmationTitle')
|
||||
},
|
||||
content: game.i18n.localize('DAGGERHEART.ACTORS.Character.resetCharacterConfirmationContent')
|
||||
});
|
||||
|
||||
if (!confirmed) return;
|
||||
|
||||
await this.document.update({
|
||||
'==system': {}
|
||||
});
|
||||
await this.document.deleteEmbeddedDocuments(
|
||||
'Item',
|
||||
this.document.items.map(x => x.id)
|
||||
);
|
||||
await this.document.deleteEmbeddedDocuments(
|
||||
'ActiveEffect',
|
||||
this.document.effects.map(x => x.id)
|
||||
);
|
||||
new game.system.api.applications.dialogs.CharacterResetDialog(this.document).render({ force: true });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -753,8 +734,9 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
if (!result) return;
|
||||
|
||||
/* This could be avoided by baking config.costs into config.resourceUpdates. Didn't feel like messing with it at the time */
|
||||
const costResources = result.costs?.filter(x => x.enabled)
|
||||
.map(cost => ({ ...cost, value: -cost.value, total: -cost.total })) || {};
|
||||
const costResources =
|
||||
result.costs?.filter(x => x.enabled).map(cost => ({ ...cost, value: -cost.value, total: -cost.total })) ||
|
||||
{};
|
||||
config.resourceUpdates.addResources(costResources);
|
||||
await config.resourceUpdates.updateResources();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
|
|||
title: `${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}: ${this.actor.name}`,
|
||||
headerTitle: `Companion ${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}`,
|
||||
roll: {
|
||||
trait: partner.system.spellcastModifierTrait?.key
|
||||
trait: partner.system.spellcastModifierTrait?.key,
|
||||
companionRoll: true
|
||||
},
|
||||
hasRoll: true,
|
||||
data: partner.getRollData()
|
||||
hasRoll: true
|
||||
};
|
||||
|
||||
const result = await partner.diceRoll(config);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue