mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
I hate companions. Should work now (#1576)
This commit is contained in:
parent
37ae40be8b
commit
d43a4994ad
4 changed files with 18 additions and 7 deletions
|
|
@ -109,11 +109,17 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
context.roll = this.roll;
|
||||
context.rollType = this.roll?.constructor.name;
|
||||
context.rallyDie = this.roll.rallyChoices;
|
||||
const experiences = this.config.data?.system?.experiences || {};
|
||||
|
||||
const actorExperiences = this.config.data?.system?.experiences || {};
|
||||
const companionExperiences = this.config.roll.companionRoll
|
||||
? (this.config.data?.companion?.system.experiences ?? {})
|
||||
: null;
|
||||
const experiences = companionExperiences ?? actorExperiences;
|
||||
context.experiences = Object.keys(experiences).map(id => ({
|
||||
id,
|
||||
...experiences[id]
|
||||
}));
|
||||
|
||||
context.selectedExperiences = this.config.experiences;
|
||||
context.advantage = this.config.roll?.advantage;
|
||||
context.disadvantage = this.config.roll?.disadvantage;
|
||||
|
|
|
|||
|
|
@ -71,10 +71,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);
|
||||
|
|
|
|||
|
|
@ -677,6 +677,8 @@ export default class DhCharacter extends BaseDataActor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.companion.system.attack.roll.bonus = this.traits.instinct.value;
|
||||
}
|
||||
|
||||
this.resources.hope.value = Math.min(baseHope, this.resources.hope.max);
|
||||
|
|
|
|||
|
|
@ -99,11 +99,14 @@ export default class D20Roll extends DHRoll {
|
|||
|
||||
this.options.roll.modifiers = this.applyBaseBonus();
|
||||
|
||||
const actorExperiences = this.options.roll.companionRoll
|
||||
? (this.options.data?.companion?.system.experiences ?? {})
|
||||
: (this.options.data.system?.experiences ?? {});
|
||||
this.options.experiences?.forEach(m => {
|
||||
if (this.options.data.system?.experiences?.[m])
|
||||
if (actorExperiences[m])
|
||||
this.options.roll.modifiers.push({
|
||||
label: this.options.data.system.experiences[m].name,
|
||||
value: this.options.data.system.experiences[m].value
|
||||
label: actorExperiences[m].name,
|
||||
value: actorExperiences[m].value
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue