-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16e1caa
commit 921a864
Showing
8 changed files
with
170 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
export default { | ||
"ClassBarbarian": true, | ||
"ClassBard": true, | ||
"ClassCleric": true, | ||
"ClassDruid": true, | ||
"ClassFighter": true, | ||
"ClassMonk": true, | ||
"ClassPaladin": true, | ||
"ClassRanger": true, | ||
"ClassRogue": true, | ||
"ClassSorcerer": true, | ||
"ClassWarlock": true, | ||
"ClassWizard": true, | ||
"GenderFemale": true, | ||
"GenderMale": true, | ||
"GenderNon-Binary": true, | ||
"OrientationAsexual": true, | ||
"OrientationBisexual": true, | ||
"OrientationHeterosexual": true, | ||
"OrientationHomosexual": true, | ||
"ProfessionEntertainer": true, | ||
"ProfessionLearned": true, | ||
"ProfessionLesser Nobility": true, | ||
"ProfessionMartial": true, | ||
"ProfessionProfessional": true, | ||
"ProfessionUnderclass": true, | ||
"ProfessionWorking Class": true, | ||
"RaceDragonborn": true, | ||
"RaceDwarf": true, | ||
"RaceElf": true, | ||
"RaceGnome": true, | ||
"RaceHalf-Elf": true, | ||
"RaceHalf-Orc": true, | ||
"RaceHalfling": true, | ||
"RaceHuman": true, | ||
"RaceTiefling": true, | ||
"RelationshipStatusDivorced": true, | ||
"RelationshipStatusIn a relationship": true, | ||
"RelationshipStatusMarried": true, | ||
"RelationshipStatusMarried and having an affair": true, | ||
"RelationshipStatusRecently broken up": true, | ||
"RelationshipStatusRecently divorced": true, | ||
"RelationshipStatusRecently widowed": true, | ||
"RelationshipStatusSeeing someone who is married": true, | ||
"RelationshipStatusSingle": true, | ||
"RelationshipStatusWidowed": true, | ||
"TraitBad Traits": true, | ||
"TraitGood Traits": true, | ||
"level": 1, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { classesJSON, languagesJSON, namesJSON, personalityTraitsJSON, plotHooksJSON, professionsJSON, racesJSON, sexJSON, listJSON } from "../npc-gen.js"; | ||
import NPCGenerator from "./applications/NPCGenerator.js"; | ||
import defaultOptions from "../data/defaultApiOptions.js"; | ||
|
||
/** | ||
* @param {number} [amount=1] | ||
* @param {defaultOptions} [options={}] | ||
*/ | ||
export default function generateNPC(amount = 1, options = {}) { | ||
let confirmed = false; | ||
Dialog.confirm({ | ||
title: game.i18n.localize("npcGen.areYouSure"), | ||
content: `<p>${game.i18n.localize("npcGen.amountToGen").replace("%n", amount)}</p>`, | ||
yes: () => { | ||
confirmed = true; | ||
}, | ||
defaultYes: false, | ||
}).then(() => { | ||
if (!confirmed) return; | ||
|
||
if (Object.keys(options).length === 0) { | ||
options = defaultOptions; | ||
} | ||
|
||
for (let i = 1; i < amount + 1; i++) { | ||
let generator = new NPCGenerator({ | ||
classesJSON: classesJSON, | ||
languagesJSON: languagesJSON, | ||
namesJSON: namesJSON, | ||
personalityTraitsJSON: personalityTraitsJSON, | ||
plotHooksJSON: plotHooksJSON, | ||
professionsJSON: professionsJSON, | ||
racesJSON: racesJSON, | ||
sexJSON: sexJSON, | ||
listJSON: listJSON, | ||
}); | ||
|
||
generator.generateNPC(options).then(() => { | ||
generator._apiSave().then(() => { | ||
generator.close(); | ||
}); | ||
}); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters