refactored Skillcheck Command

This commit is contained in:
2021-04-20 18:09:34 +02:00
parent 6ec0a2fe68
commit 91e62f3b28
5 changed files with 102 additions and 62 deletions

View File

@ -0,0 +1,14 @@
const globals = require('../globals');
const getAttributeLevels = (Attributes = [], Character = {}) => {
let AttributeId;
let AttributeLevel;
let AttributeList = [];
for (let Attribute of Attributes) {
AttributeId = globals.Werte.find((attribute) => attribute.kuerzel === Attribute).id;
AttributeLevel = Character.attributes.find((att) => att.id === AttributeId).level;
AttributeList.push({ Name: Attribute, Level: AttributeLevel });
}
return AttributeList;
};
module.exports = { getAttributeLevels};