@ -1,13 +1,14 @@
|
||||
const Random = {int, use};
|
||||
const Random = { int, use };
|
||||
|
||||
function int (min, max) {
|
||||
if (!min || !max) { return; }
|
||||
//return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min))) + min;
|
||||
return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min) + 1)) + min;
|
||||
function int(min, max) {
|
||||
if (!min || !max) {
|
||||
return;
|
||||
}
|
||||
return Math.floor(Math.random() * (Math.floor(max) - Math.ceil(min) + 1)) + min;
|
||||
}
|
||||
|
||||
function use (str) {
|
||||
function use(str) {
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = { Random };
|
||||
module.exports = { Random };
|
||||
|
@ -1,14 +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;
|
||||
let AttributeId;
|
||||
let AttributeLevel;
|
||||
let AttributeList = [];
|
||||
for (let Attribute of Attributes) {
|
||||
AttributeId = globals.Werte.find(att => att.kuerzel === Attribute).id;
|
||||
AttributeLevel = Character.attributes.find(att => att.id === AttributeId).level;
|
||||
AttributeList.push({ Name: Attribute, Level: AttributeLevel });
|
||||
}
|
||||
return AttributeList;
|
||||
};
|
||||
module.exports = { getAttributeLevels};
|
||||
module.exports = { getAttributeLevels };
|
||||
|
Reference in New Issue
Block a user