fixed storage location issues and minor bugs

This commit is contained in:
2021-04-28 18:43:19 +02:00
parent 9bbf1b302e
commit 471213dae0
11 changed files with 17 additions and 1782 deletions

View File

@ -1,7 +1,8 @@
const { getAttributeLevels } = require('@dsabot/getAttributeLevels');
const Chants = require('../data/Chants.json');
const Chants = require('@Lib/Chants.json');
const getChant = ({ Character: Character = [], chant_name: chant_name = '' } = {}) => {
//if (!Character.hasOwnProperty('chants')) return;
let chant_entry =
Chants.find(chant => chant.id.toLowerCase() === chant_name.toLowerCase()) ||
Chants.find(chant => chant.name.toLowerCase() === chant_name.toLowerCase());
@ -10,13 +11,12 @@ const getChant = ({ Character: Character = [], chant_name: chant_name = '' } = {
console.log(`getChant() Did not find entry for ${chant_name}`);
return;
}
if (!Character.hasOwnProperty('chants')) return;
let Level = 0; // This is the minimum attributes value.
let Chant = Character.chants.find(chant => chant.id === chant_entry.id) || {};
if (Chant && Chant.hasOwnProperty('level')) {
Level = Chant.level || 0;
}
console.log(chant_entry);
let Attributes = getAttributeLevels(chant_entry.attributes, Character);
return {

View File

@ -1,5 +1,5 @@
const { getAttributeLevels } = require('@dsabot/getAttributeLevels');
const Spells = require('../data/Spells.json');
const Spells = require('@Lib/Spells.json');
const getSpell = ({ Character: Character = [], spell_name: spell_name = '' } = {}) => {
const spell_entry =