feat: replace spell category by spell groups
This also allows to assign a spell to multiple spell groups, which is the case for many spells in the SRD. Additionally, this makes many small improvements and fixes to the provided spell compendium.
This commit is contained in:
parent
ab31450dd8
commit
9d7c570553
20 changed files with 3615 additions and 466 deletions
|
@ -32,17 +32,19 @@ export class DS4Spell extends DS4Item {
|
|||
}
|
||||
|
||||
const ownerDataData = this.actor.data.data;
|
||||
const spellModifier = Number.isNumeric(this.data.data.bonus) ? parseInt(this.data.data.bonus) : undefined;
|
||||
if (spellModifier === undefined) {
|
||||
const hasComplexModifier = this.data.data.spellModifier.complex !== "";
|
||||
if (hasComplexModifier === undefined) {
|
||||
notifications.info(
|
||||
game.i18n.format("DS4.InfoManuallyEnterSpellModifier", {
|
||||
name: this.name,
|
||||
spellModifier: this.data.data.bonus,
|
||||
spellModifier: this.data.data.spellModifier.complex,
|
||||
}),
|
||||
);
|
||||
}
|
||||
const spellType = this.data.data.spellType;
|
||||
const checkTargetNumber = ownerDataData.combatValues[spellType].total + (spellModifier ?? 0);
|
||||
const checkTargetNumber =
|
||||
ownerDataData.combatValues[spellType].total +
|
||||
(hasComplexModifier ? 0 : this.data.data.spellModifier.numerical);
|
||||
|
||||
const speaker = ChatMessage.getSpeaker({ actor: this.actor, ...options.speaker });
|
||||
await createCheckRoll(checkTargetNumber, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue