Update to dnd 0.98 Core with some fixes

Updated to 0.98 core for 0.7.x compatability (untested)

Class Skills are pulling in automatically on class item drop to character sheet.

TODO: Expand automated skill drop for Archetypes

KNOWN ISSUE: init.value is being converted to a string causing some NaN errors on the html.  Initiative was changed to a number instead of a string in 0.98 likely some place is assuming it is still a string.  I had to use Number() on the value because it was forcing other vales to be a string because the value is "".  Maybe someone can fix this
This commit is contained in:
supervj 2020-10-08 02:20:12 -04:00
parent 4bed1d1869
commit 44312146a7
132 changed files with 748 additions and 1010 deletions

View file

@ -100,7 +100,7 @@ export default class Actor5e extends Actor {
}
// Ability modifiers and saves
const dcBonus = Number.isNumeric(data.bonuses.power.dc) ? parseInt(data.bonuses.power.dc) : 0;
const dcBonus = Number.isNumeric(data.bonuses.power?.dc) ? parseInt(data.bonuses.power.dc) : 0;
const saveBonus = Number.isNumeric(bonuses.save) ? parseInt(bonuses.save) : 0;
const checkBonus = Number.isNumeric(bonuses.check) ? parseInt(bonuses.check) : 0;
for (let [id, abl] of Object.entries(data.abilities)) {
@ -109,7 +109,7 @@ export default class Actor5e extends Actor {
abl.saveBonus = saveBonus;
abl.checkBonus = checkBonus;
abl.save = abl.mod + abl.prof + abl.saveBonus;
abl.dc = 8 + abl.mod + abl.prof + dcBonus;
abl.dc = 8 + abl.mod + data.attributes.prof + dcBonus;
// If we merged saves when transforming, take the highest bonus here.
if (originalSaves && abl.proficient) {
@ -126,7 +126,7 @@ export default class Actor5e extends Actor {
if ( joat ) init.prof = Math.floor(0.5 * data.attributes.prof);
else if ( athlete ) init.prof = Math.ceil(0.5 * data.attributes.prof);
else init.prof = 0;
init.bonus = init.value + (flags.initiativeAlert ? 5 : 0);
init.bonus = Number(init.value + (flags.initiativeAlert ? 5 : 0));
init.total = init.mod + init.prof + init.bonus;
// Prepare power-casting data