mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36: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.roll = this.roll;
|
||||||
context.rollType = this.roll?.constructor.name;
|
context.rollType = this.roll?.constructor.name;
|
||||||
context.rallyDie = this.roll.rallyChoices;
|
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 => ({
|
context.experiences = Object.keys(experiences).map(id => ({
|
||||||
id,
|
id,
|
||||||
...experiences[id]
|
...experiences[id]
|
||||||
}));
|
}));
|
||||||
|
|
||||||
context.selectedExperiences = this.config.experiences;
|
context.selectedExperiences = this.config.experiences;
|
||||||
context.advantage = this.config.roll?.advantage;
|
context.advantage = this.config.roll?.advantage;
|
||||||
context.disadvantage = this.config.roll?.disadvantage;
|
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}`,
|
title: `${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}: ${this.actor.name}`,
|
||||||
headerTitle: `Companion ${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}`,
|
headerTitle: `Companion ${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}`,
|
||||||
roll: {
|
roll: {
|
||||||
trait: partner.system.spellcastModifierTrait?.key
|
trait: partner.system.spellcastModifierTrait?.key,
|
||||||
|
companionRoll: true
|
||||||
},
|
},
|
||||||
hasRoll: true,
|
hasRoll: true
|
||||||
data: partner.getRollData()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = await partner.diceRoll(config);
|
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);
|
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();
|
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 => {
|
this.options.experiences?.forEach(m => {
|
||||||
if (this.options.data.system?.experiences?.[m])
|
if (actorExperiences[m])
|
||||||
this.options.roll.modifiers.push({
|
this.options.roll.modifiers.push({
|
||||||
label: this.options.data.system.experiences[m].name,
|
label: actorExperiences[m].name,
|
||||||
value: this.options.data.system.experiences[m].value
|
value: actorExperiences[m].value
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue