mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
level sync fixes
This commit is contained in:
parent
29c6cc60c3
commit
3333a9e00a
2 changed files with 6 additions and 1 deletions
|
|
@ -51,8 +51,8 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
}
|
||||
|
||||
async onPartnerChange(event) {
|
||||
const partner = game.actors.find(a => a.uuid === event.target.value);
|
||||
if (event.target.value) {
|
||||
const partner = game.actors.find(a => a.uuid === event.target.value);
|
||||
await partner.update({ 'system.companion': this.document.uuid });
|
||||
} else {
|
||||
const update = { 'system.companion': null };
|
||||
|
|
@ -74,6 +74,7 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
}
|
||||
|
||||
await this.document.update({ 'system.partner': event.target.value });
|
||||
await this.document.updateLevel(partner ? partner.system.levelData.level.current : 1);
|
||||
}
|
||||
|
||||
static async attackRoll(event) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ export default class DhCompanion extends BaseDataActor {
|
|||
};
|
||||
}
|
||||
|
||||
get attackBonus() {
|
||||
return this.attack.roll.bonus ?? 0;
|
||||
}
|
||||
|
||||
prepareBaseData() {
|
||||
const partnerSpellcastingModifier = this.partner?.system?.spellcastingModifiers?.main;
|
||||
const spellcastingModifier = this.partner?.system?.traits?.[partnerSpellcastingModifier]?.total;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue