{"size": 1039, "ext": "js", "max_stars_repo_path": "src/npc/functions/charData.js", "max_stars_repo_name": "Multarix/DnD-NPC", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/npc/functions/charData.js", "max_issues_repo_name": "Multarix/DnD-NPC", "max_issues_repo_issues_event_min_datetime": "2022-02-27T18:12:19.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-28T11:52:14.000Z", "max_forks_repo_path": "src/npc/functions/charData.js", "max_forks_repo_name": "Multarix/DnD-NPC", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 35.8275862069, "max_line_length": 105, "alphanum_fraction": 0.6284889317}
module.exports = (race, role) => {

	const age = Math.round(Math.random() * (race.maxAge - race.minAge) + race.minAge);
	const gender = (Math.random() > 0.5) ? "Male" : "Female";

	let n = Math.floor(Math.random() * role.backgrounds.length);
	const background = role.backgrounds[n];

	n = Math.floor(Math.random() * role.disposition.length);
	const lnc = role.disposition[n];
	n = Math.floor(Math.random() * race.disposition.length);
	const gne = race.disposition[n];
	const alignment = (gne === lnc) ? "True Neutral" : `${lnc} ${gne}`;

	const raceName = race.name.toLowerCase().replace("-", "");
	const reggie = /\w+$/g;
	const r = reggie.exec(raceName)[0];

	let f = require(`../names/${gender.toLowerCase()}/${r}.json`);
	let l = require(`../names/lastNames/${r}.json`);
	n = Math.floor(Math.random() * f.length);
	f = f[n];
	n = Math.floor(Math.random() * l.length);
	l = l[n];
	const name = `${f} ${l}`.replace(/\s$/, "");

	return { name: name, gender: gender, alignment: alignment, age: age, background: background, level: 1 };
};
