Compare commits

..

No commits in common. "master" and "1.2.1" have entirely different histories.

14 changed files with 345 additions and 945 deletions

View file

@ -35,9 +35,9 @@ In the settings of the plugin you will Find settings and options to add your own
## Inline Generator
If you found yourself needing a quick name for an Elf or really wanting a quick dungeon description then look no further then the Inline generator. You can activate this by using the Callout token (Default is set to '@', can be changed in settings) and scrolling through the list of generators possible.
If you found yourself needing a quick name for an Elf or really wanting a quick dungeon description then look no further then the Inline generator. You can activate this by using the Callout token (Default is set to '@', can be changed in settings)and scrolling through the list of generators possible.
### Inline Example
### Example
![Example](Obsidian_mrGSNRjLpe.gif)
@ -67,4 +67,4 @@ Below is a table for all the settings in this plugin
- ~~Randomization within a note.~~
- Possibly more Generation type.
- Better UI
- ~~JSON Import And Export~~
- JSON Import And Export

View file

@ -119,7 +119,7 @@ export class GeneratorModal extends Modal {
multiNames: false
}
genSettings.race = raceSelected;
settingsdiv.empty();
settingsdiv.innerHTML = "";
settingsdiv.createEl("h3", { text: "Customise The Generation" });
new Setting(settingsdiv)
.setName("Male or Female?")
@ -197,7 +197,7 @@ export class GeneratorModal extends Modal {
}
generatorInnSettings(settingsdiv: HTMLElement, genAmount: number, generatorFunction: (settings: innGeneratorSettings) => {name:string,description:string,rumors:string[]}) {
settingsdiv.empty();
settingsdiv.innerHTML = "";
settingsdiv.createEl("h3", { text: "Customise The Generation" });
genAmount = 1;
let innList = '';
@ -245,7 +245,7 @@ export class GeneratorModal extends Modal {
}
generatorLootSettings(settingsdiv: HTMLElement, genAmount: number, generatorFunction: (enableCurrency:boolean, currencyFrequency: number, currencyTypes: object[], lootTable: lootTables) => string, enableCurrency:boolean, currencyFrequency: number, currencyTypes: object[]) {
settingsdiv.empty();
settingsdiv.innerHTML = "";
settingsdiv.createEl("h3", { text: "Customise The Generation" });
genAmount = 1;
let list = '';
@ -292,7 +292,7 @@ export class GeneratorModal extends Modal {
}
generatorFCGSettlementSettings(settingsdiv: HTMLElement, genAmount: number, generatorFunction: () => ISettlementDomainObject) {
settingsdiv.empty();
settingsdiv.innerHTML = "";
settingsdiv.createEl("h3", { text: "Customise The Generation" });
genAmount = 1;
let list = '';
@ -343,7 +343,7 @@ export class GeneratorModal extends Modal {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
generatorCustomSettings(settingsdiv: HTMLElement, genAmount: number, generatorFunction: (settings ?: any) => string, settings ?: any) {
settingsdiv.empty();
settingsdiv.innerHTML = "";
settingsdiv.createEl("h3", { text: "Customise The Generation" });
genAmount = 1;
let list = "";

View file

@ -8,7 +8,7 @@ import { familyNameList } from "lists/humanFamilyNames";
import { titleLastNames } from "lists/titleLastNames";
import * as FCG from "fantasy-content-generator";
import FantasyPlugin from "main";
import { Editor, EditorPosition, EditorSuggest, EditorSuggestContext, EditorSuggestTriggerInfo } from "obsidian";
import { Editor, EditorPosition, EditorSuggest, EditorSuggestContext, EditorSuggestTriggerInfo, MarkdownView } from "obsidian";
import { generatorAirships } from "generators/airship";
import { generatorDrinks } from "generators/drink";
import { generateMiscellaneousArtifacts } from "generators/artifact";
@ -21,7 +21,6 @@ import { generatorGroups } from "generators/groups";
import { generatorReligions } from "generators/religions";
import { generatePathfinderName } from "generators/Pathfinder/pathfinderName";
import { generatePlotHook } from "generators/plothook";
import { generateTradingPost } from "generators/tradingPost";
type Generator = () => string | Error;
@ -39,122 +38,121 @@ export class InlineGeneratorSuggester extends EditorSuggest<string> {
//An object storing all the Generator functions used by the particular selection
private generators: Generators = {
'TradingPost': () => "Trading Post Name: " + generateCityName(this.plugin.settings.citySettings) + "\n" + generateTradingPost(),
'ElfMale': () => nameByRace("elf", { gender: "male" }),
'ElfMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + elfFamilyNames[Math.floor(Math.random() * elfFamilyNames.length)],
'ElfFemale': () => nameByRace("elf", { gender: "female" }),
'ElfFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + elfFamilyNames[Math.floor(Math.random() * elfFamilyNames.length)],
'Orc': () => nameByRace("orc"),
'OrcLastname': () => nameByRace("orc") + " " + titleLastNames[Math.floor(Math.random() * titleLastNames.length)],
'DwarfMale': () => nameByRace("elf", { gender: "male" }),
'DwarfMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + dwarfFamilyNames[Math.floor(Math.random() * dwarfFamilyNames.length)],
'DwarfFemale': () => nameByRace("elf", { gender: "female" }),
'DwarfFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + dwarfFamilyNames[Math.floor(Math.random() * dwarfFamilyNames.length)],
'HumanMale': () => nameByRace("elf", { gender: "male" }),
'HumanFemale': () => nameByRace("elf", { gender: "female" }),
'HumanMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + familyNameList[Math.floor(Math.random() * familyNameList.length)],
'HumanFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + familyNameList[Math.floor(Math.random() * familyNameList.length)],
"DungeonsLabryinths": () => generateDungeonName(this.plugin.settings.dungeonSettings),
"InnsTaverns": () => {
'Gen-ElfMale': () => nameByRace("elf", { gender: "male" }),
'Gen-ElfMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + elfFamilyNames[Math.floor(Math.random() * elfFamilyNames.length)],
'Gen-ElfFemale': () => nameByRace("elf", { gender: "female" }),
'Gen-ElfFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + elfFamilyNames[Math.floor(Math.random() * elfFamilyNames.length)],
'Gen-Orc': () => nameByRace("orc"),
'Gen-OrcLastname': () => nameByRace("orc") + " " + titleLastNames[Math.floor(Math.random() * titleLastNames.length)],
'Gen-DwarfMale': () => nameByRace("elf", { gender: "male" }),
'Gen-DwarfMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + dwarfFamilyNames[Math.floor(Math.random() * dwarfFamilyNames.length)],
'Gen-DwarfFemale': () => nameByRace("elf", { gender: "female" }),
'Gen-DwarfFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + dwarfFamilyNames[Math.floor(Math.random() * dwarfFamilyNames.length)],
'Gen-HumanMale': () => nameByRace("elf", { gender: "male" }),
'Gen-HumanFemale': () => nameByRace("elf", { gender: "female" }),
'Gen-HumanMaleLastname': () => nameByRace("elf", { gender: "male" }) + " " + familyNameList[Math.floor(Math.random() * familyNameList.length)],
'Gen-HumanFemaleLastname': () => nameByRace("elf", { gender: "female" }) + " " + familyNameList[Math.floor(Math.random() * familyNameList.length)],
"Gen-DungeonsLabryinths": () => generateDungeonName(this.plugin.settings.dungeonSettings),
"Gen-InnsTaverns": () => {
const innInfo = generateInn(this.plugin.settings.innSettings);
return innInfo.name + "\nDescription: " + innInfo.description + "\nRumors: " + innInfo.rumors;
},
"Settlement": () => {
"Gen-Settlement": () => {
const CityInfo = FCG.Settlements.generate();
const name = generateCityName(this.plugin.settings.citySettings);
return "Name: " + name + "\nPopulation: " + CityInfo.population + "\nType: " + CityInfo.type.split("_").map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
},
"Airships": () => generatorAirships(),
"Drinks": () => generatorDrinks(this.plugin.settings.drinkSettings),
"Artifacts": () => generateMiscellaneousArtifacts(),
"LootTreasure": () => generateLoot(this.plugin.settings.enableCurrency, this.plugin.settings.currencyFrequency, this.plugin.settings.currencyTypes, this.plugin.settings.lootSettings),
"Metals": () => generatorMetals(),
"MagicalTrees": () => generatorMagical_trees(),
"Ship": () => generateShipName(),
"AnimalGroups": () => generatorAnimal_groups(),
"Groups": () => generatorGroups(this.plugin.settings.groupSettings),
"Religion": () => generatorReligions(),
"AasimarsLastname": () => generatePathfinderName("aasimars", "male", true),
"CatfolkLastname": () => generatePathfinderName("catfolk", "male", true),
"FetchlingsLastname": () => generatePathfinderName("fetchlings", "male", true),
"HalfElfLastname": () => generatePathfinderName("halfelf", "male", true),
"HalfOrcLastname": () => generatePathfinderName("halforc", "male", true),
"HobgoblinLastname": () => generatePathfinderName("hobgoblin", "male", true),
"IfritsLastname": () => generatePathfinderName("ifrits", "male", true),
"KobaldsLastname": () => generatePathfinderName("kobalds", "male", true),
"OreadsLastname": () => generatePathfinderName("oreads", "male", true),
"RatfolkLastname": () => generatePathfinderName("ratfolk", "male", true),
"SylphsLastname": () => generatePathfinderName("sylphs", "male", true),
"TenguLastname": () => generatePathfinderName("tengu", "male", true),
"TiansLastname": () => generatePathfinderName("tians", "male", true),
"TieflingLastname": () => generatePathfinderName("tiefling", "male", true),
"UndinesLastname": () => generatePathfinderName("undines", "male", true),
"AngelMaleLastname": () => nameByRace("angel", { gender: "male" }) + " " + nameByRace("angel", { gender: "male" }),
"AngelFemaleLastname": () => nameByRace("angel", { gender: "female" }) + " " + nameByRace("angel", { gender: "female" }),
"CavePersonMaleLastname": () => nameByRace("cavePerson", { gender: "male" }) + " " + nameByRace("cavePerson", { gender: "male" }),
"CavePersonFemaleLastname": () => nameByRace("cavePerson", { gender: "female" }) + " " + nameByRace("cavePerson", { gender: "female" }),
"DarkElfMaleLastname": () => nameByRace("darkelf", { gender: "male" }) + " " + nameByRace("darkelf", { gender: "male" }),
"DarkElfFemaleLastname": () => nameByRace("darkelf", { gender: "female" }) + " " + nameByRace("darkelf", { gender: "female" }),
"DemonLastname": () => nameByRace("demon") + " " + nameByRace("demon"),
"DragonMaleLastname": () => nameByRace("dragon", { gender: "male" }) + " " + nameByRace("dragon", { gender: "male" }),
"DragonFemaleLastname": () => nameByRace("dragon", { gender: "female" }) + " " + nameByRace("dragon", { gender: "female" }),
"DrowMaleLastname": () => nameByRace("drow", { gender: "male" }) + " " + nameByRace("drow", { gender: "male" }),
"DrowFemaleLastname": () => nameByRace("drow", { gender: "female" }) + " " + nameByRace("drow", { gender: "female" }),
"FairyMaleLastname": () => nameByRace("fairy", { gender: "male" }) + " " + nameByRace("fairy", { gender: "male" }),
"FairyFemaleLastname": () => nameByRace("fairy", { gender: "female" }) + " " + nameByRace("fairy", { gender: "female" }),
"GnomeMaleLastname": () => nameByRace("gnome", { gender: "male" }) + " " + nameByRace("gnome", { gender: "male" }),
"GnomeFemaleLastname": () => nameByRace("gnome", { gender: "female" }) + " " + nameByRace("gnome", { gender: "female" }),
"GoblinLastname": () => nameByRace("goblin") + " " + nameByRace("goblin"),
"HalfDemonMaleLastname": () => nameByRace("halfdemon", { gender: "male" }) + " " + nameByRace("halfdemon", { gender: "male" }),
"HalfDemonFemaleLastname": () => nameByRace("halfdemon", { gender: "female" }) + " " + nameByRace("halfdemon", { gender: "female" }),
"HalflingMaleLastname": () => nameByRace("halfling", { gender: "male" }) + " " + nameByRace("halfling", { gender: "male" }),
"HalflingFemaleLastname": () => nameByRace("halfling", { gender: "female" }) + " " + nameByRace("halfling", { gender: "female" }),
"HighElfMaleLastname": () => nameByRace("highelf", { gender: "male" }) + " " + nameByRace("highelf", { gender: "male" }),
"HighElfFemaleLastname": () => nameByRace("highelf", { gender: "female" }) + " " + nameByRace("highelf", { gender: "female" }),
"HighFairyMaleLastname": () => nameByRace("highfairy", { gender: "male" }) + " " + nameByRace("highfairy", { gender: "male" }),
"HighFairyFemaleLastname": () => nameByRace("highfairy", { gender: "female" }) + " " + nameByRace("angel", { gender: "female" }),
"OgreLastname": () => nameByRace("ogre") + " " + nameByRace("ogre"),
"Aasimars": () => generatePathfinderName("aasimars", "male", false),
"Catfolk": () => generatePathfinderName("catfolk", "male", false),
"Fetchlings": () => generatePathfinderName("fetchlings", "male", false),
"HalfElf": () => generatePathfinderName("halfelf", "male", false),
"HalfOrc": () => generatePathfinderName("halforc", "male", false),
"Hobgoblin": () => generatePathfinderName("hobgoblin", "male", false),
"Ifrits": () => generatePathfinderName("ifrits", "male", false),
"Kobalds": () => generatePathfinderName("kobalds", "male", false),
"Oreads": () => generatePathfinderName("oreads", "male", false),
"Ratfolk": () => generatePathfinderName("ratfolk", "male", false),
"Sylphs": () => generatePathfinderName("sylphs", "male", false),
"Tengu": () => generatePathfinderName("tengu", "male", false),
"Tians": () => generatePathfinderName("tians", "male", false),
"Tiefling": () => generatePathfinderName("tiefling", "male", false),
"Undines": () => generatePathfinderName("undines", "male", false),
"AngelMale": () => nameByRace("angel", { gender: "male" }),
"CavePersonMale": () => nameByRace("cavePerson", { gender: "male" }),
"DarkElfMale": () => nameByRace("darkelf", { gender: "male" }),
"DragonMale": () => nameByRace("dragon", { gender: "male" }),
"DrowMale": () => nameByRace("drow", { gender: "male" }),
"FairyMale": () => nameByRace("fairy", { gender: "male" }),
"GnomeMale": () => nameByRace("Gnome", { gender: "male" }),
"HalfDemonMale": () => nameByRace("halfdemon", { gender: "male" }),
"HalflingMale": () => nameByRace("halfling", { gender: "male" }),
"HighElfMale": () => nameByRace("highelf", { gender: "male" }),
"HighFairyMale": () => nameByRace("highfairy", { gender: "male" }),
"Ogre": () => nameByRace("ogre"),
"AngelFemale": () => nameByRace("angel", { gender: "female" }),
"CavePersonFemale": () => nameByRace("cavePerson", { gender: "female" }),
"DarkElfFemale": () => nameByRace("darkelf", { gender: "female" }),
"Demon": () => nameByRace("demon"),
"DragonFemale": () => nameByRace("dragon", { gender: "female" }),
"DrowFemale": () => nameByRace("drow", { gender: "female" }),
"FairyFemale": () => nameByRace("fairy", { gender: "female" }),
"GnomeFemale": () => nameByRace("gnome", { gender: "female" }),
"Goblin": () => nameByRace("goblin"),
"HalfDemonFemale": () => nameByRace("halfdemon", { gender: "female" }),
"HalflingFemale": () => nameByRace("halfling", { gender: "female" }),
"HighElfFemale": () => nameByRace("highelf", { gender: "female" }),
"HighFairyFemale": () => nameByRace("highfairy", { gender: "female" }),
"PlotStoryHooks": () => generatePlotHook(),
"Gen-Airships": () => generatorAirships(),
"Gen-Drinks": () => generatorDrinks(this.plugin.settings.drinkSettings),
"Gen-Artifacts": () => generateMiscellaneousArtifacts(),
"Gen-LootTreasure": () => generateLoot(this.plugin.settings.enableCurrency, this.plugin.settings.currencyFrequency, this.plugin.settings.currencyTypes, this.plugin.settings.lootSettings),
"Gen-Metals": () => generatorMetals(),
"Gen-MagicalTrees": () => generatorMagical_trees(),
"Gen-Ship": () => generateShipName(),
"Gen-AnimalGroups": () => generatorAnimal_groups(),
"Gen-Groups": () => generatorGroups(this.plugin.settings.groupSettings),
"Gen-Religion": () => generatorReligions(),
"Gen-AasimarsLastname": () => generatePathfinderName("aasimars", "male", true),
"Gen-CatfolkLastname": () => generatePathfinderName("catfolk", "male", true),
"Gen-FetchlingsLastname": () => generatePathfinderName("fetchlings", "male", true),
"Gen-HalfElfLastname": () => generatePathfinderName("halfelf", "male", true),
"Gen-HalfOrcLastname": () => generatePathfinderName("halforc", "male", true),
"Gen-HobgoblinLastname": () => generatePathfinderName("hobgoblin", "male", true),
"Gen-IfritsLastname": () => generatePathfinderName("ifrits", "male", true),
"Gen-KobaldsLastname": () => generatePathfinderName("kobalds", "male", true),
"Gen-OreadsLastname": () => generatePathfinderName("oreads", "male", true),
"Gen-RatfolkLastname": () => generatePathfinderName("ratfolk", "male", true),
"Gen-SylphsLastname": () => generatePathfinderName("sylphs", "male", true),
"Gen-TenguLastname": () => generatePathfinderName("tengu", "male", true),
"Gen-TiansLastname": () => generatePathfinderName("tians", "male", true),
"Gen-TieflingLastname": () => generatePathfinderName("tiefling", "male", true),
"Gen-UndinesLastname": () => generatePathfinderName("undines", "male", true),
"Gen-AngelMaleLastname": () => nameByRace("angel", { gender: "male" }) + " " + nameByRace("angel", { gender: "male" }),
"Gen-AngelFemaleLastname": () => nameByRace("angel", { gender: "female" }) + " " + nameByRace("angel", { gender: "female" }),
"Gen-CavePersonMaleLastname": () => nameByRace("cavePerson", { gender: "male" }) + " " + nameByRace("cavePerson", { gender: "male" }),
"Gen-CavePersonFemaleLastname": () => nameByRace("cavePerson", { gender: "female" }) + " " + nameByRace("cavePerson", { gender: "female" }),
"Gen-DarkElfMaleLastname": () => nameByRace("darkelf", { gender: "male" }) + " " + nameByRace("darkelf", { gender: "male" }),
"Gen-DarkElfFemaleLastname": () => nameByRace("darkelf", { gender: "female" }) + " " + nameByRace("darkelf", { gender: "female" }),
"Gen-DemonLastname": () => nameByRace("demon") + " " + nameByRace("demon"),
"Gen-DragonMaleLastname": () => nameByRace("dragon", { gender: "male" }) + " " + nameByRace("dragon", { gender: "male" }),
"Gen-DragonFemaleLastname": () => nameByRace("dragon", { gender: "female" }) + " " + nameByRace("dragon", { gender: "female" }),
"Gen-DrowMaleLastname": () => nameByRace("drow", { gender: "male" }) + " " + nameByRace("drow", { gender: "male" }),
"Gen-DrowFemaleLastname": () => nameByRace("drow", { gender: "female" }) + " " + nameByRace("drow", { gender: "female" }),
"Gen-FairyMaleLastname": () => nameByRace("fairy", { gender: "male" }) + " " + nameByRace("fairy", { gender: "male" }),
"Gen-FairyFemaleLastname": () => nameByRace("fairy", { gender: "female" }) + " " + nameByRace("fairy", { gender: "female" }),
"Gen-GnomeMaleLastname": () => nameByRace("gnome", { gender: "male" }) + " " + nameByRace("gnome", { gender: "male" }),
"Gen-GnomeFemaleLastname": () => nameByRace("gnome", { gender: "female" }) + " " + nameByRace("gnome", { gender: "female" }),
"Gen-GoblinLastname": () => nameByRace("goblin") + " " + nameByRace("goblin"),
"Gen-HalfDemonMaleLastname": () => nameByRace("halfdemon", { gender: "male" }) + " " + nameByRace("halfdemon", { gender: "male" }),
"Gen-HalfDemonFemaleLastname": () => nameByRace("halfdemon", { gender: "female" }) + " " + nameByRace("halfdemon", { gender: "female" }),
"Gen-HalflingMaleLastname": () => nameByRace("halfling", { gender: "male" }) + " " + nameByRace("halfling", { gender: "male" }),
"Gen-HalflingFemaleLastname": () => nameByRace("halfling", { gender: "female" }) + " " + nameByRace("halfling", { gender: "female" }),
"Gen-HighElfMaleLastname": () => nameByRace("highelf", { gender: "male" }) + " " + nameByRace("highelf", { gender: "male" }),
"Gen-HighElfFemaleLastname": () => nameByRace("highelf", { gender: "female" }) + " " + nameByRace("highelf", { gender: "female" }),
"Gen-HighFairyMaleLastname": () => nameByRace("highfairy", { gender: "male" }) + " " + nameByRace("highfairy", { gender: "male" }),
"Gen-HighFairyFemaleLastname": () => nameByRace("highfairy", { gender: "female" }) + " " + nameByRace("angel", { gender: "female" }),
"Gen-OgreLastname": () => nameByRace("ogre") + " " + nameByRace("ogre"),
"Gen-Aasimars": () => generatePathfinderName("aasimars", "male", false),
"Gen-Catfolk": () => generatePathfinderName("catfolk", "male", false),
"Gen-Fetchlings": () => generatePathfinderName("fetchlings", "male", false),
"Gen-HalfElf": () => generatePathfinderName("halfelf", "male", false),
"Gen-HalfOrc": () => generatePathfinderName("halforc", "male", false),
"Gen-Hobgoblin": () => generatePathfinderName("hobgoblin", "male", false),
"Gen-Ifrits": () => generatePathfinderName("ifrits", "male", false),
"Gen-Kobalds": () => generatePathfinderName("kobalds", "male", false),
"Gen-Oreads": () => generatePathfinderName("oreads", "male", false),
"Gen-Ratfolk": () => generatePathfinderName("ratfolk", "male", false),
"Gen-Sylphs": () => generatePathfinderName("sylphs", "male", false),
"Gen-Tengu": () => generatePathfinderName("tengu", "male", false),
"Gen-Tians": () => generatePathfinderName("tians", "male", false),
"Gen-Tiefling": () => generatePathfinderName("tiefling", "male", false),
"Gen-Undines": () => generatePathfinderName("undines", "male", false),
"Gen-AngelMale": () => nameByRace("angel", { gender: "male" }),
"Gen-CavePersonMale": () => nameByRace("cavePerson", { gender: "male" }),
"Gen-DarkElfMale": () => nameByRace("darkelf", { gender: "male" }),
"Gen-DragonMale": () => nameByRace("dragon", { gender: "male" }),
"Gen-DrowMale": () => nameByRace("drow", { gender: "male" }),
"Gen-FairyMale": () => nameByRace("fairy", { gender: "male" }),
"Gen-GnomeMale": () => nameByRace("Gnome", { gender: "male" }),
"Gen-HalfDemonMale": () => nameByRace("halfdemon", { gender: "male" }),
"Gen-HalflingMale": () => nameByRace("halfling", { gender: "male" }),
"Gen-HighElfMale": () => nameByRace("highelf", { gender: "male" }),
"Gen-HighFairyMale": () => nameByRace("highfairy", { gender: "male" }),
"Gen-Ogre": () => nameByRace("ogre"),
"Gen-AngelFemale": () => nameByRace("angel", { gender: "female" }),
"Gen-CavePersonFemale": () => nameByRace("cavePerson", { gender: "female" }),
"Gen-DarkElfFemale": () => nameByRace("darkelf", { gender: "female" }),
"Gen-Demon": () => nameByRace("demon"),
"Gen-DragonFemale": () => nameByRace("dragon", { gender: "female" }),
"Gen-DrowFemale": () => nameByRace("drow", { gender: "female" }),
"Gen-FairyFemale": () => nameByRace("fairy", { gender: "female" }),
"Gen-GnomeFemale": () => nameByRace("gnome", { gender: "female" }),
"Gen-Goblin": () => nameByRace("goblin"),
"Gen-HalfDemonFemale": () => nameByRace("halfdemon", { gender: "female" }),
"Gen-HalflingFemale": () => nameByRace("halfling", { gender: "female" }),
"Gen-HighElfFemale": () => nameByRace("highelf", { gender: "female" }),
"Gen-HighFairyFemale": () => nameByRace("highfairy", { gender: "female" }),
"Gen-PlotStoryHooks": () => generatePlotHook(),
}
constructor(getCompletions: () => string[], plugin: FantasyPlugin) {
@ -202,8 +200,10 @@ export class InlineGeneratorSuggester extends EditorSuggest<string> {
result = this.generators[value]();
}
if (this.plugin.currentEditor) {
this.plugin.currentEditor.replaceRange(result.toString(), this.startChar, this.endChar);
// insert the result into the editor
const activeView = app.workspace.getActiveViewOfType(MarkdownView);
if (activeView) {
activeView.editor.replaceRange(result.toString(), this.startChar, this.endChar);
}
}
}

View file

@ -4,32 +4,7 @@ export function generateCityName(settings : cityGeneratorSetting) {
const prefixes = settings.prefixArray;
const suffixes = settings.suffixArray;
const syllables = [
'ab', 'ac', 'ad', 'al', 'an', 'ap', 'ar', 'as', 'at', 'au',
'ba', 'be', 'bi', 'bo', 'bu',
'ca', 'ce', 'ci', 'co', 'cu',
'da', 'de', 'di', 'do', 'du',
'ea', 'eb', 'ec', 'ed', 'el', 'em', 'en', 'er', 'es', 'et', 'eu',
'fa', 'fe', 'fi', 'fo', 'fu',
'ga', 'ge', 'gi', 'go', 'gu',
'ha', 'he', 'hi', 'ho', 'hu',
'ia', 'ib', 'ic', 'id', 'ie', 'if', 'ig', 'il', 'im', 'in', 'io', 'ip', 'ir', 'is', 'it', 'iu',
'ja', 'je', 'ji', 'jo', 'ju',
'ka', 'ke', 'ki', 'ko', 'ku',
'la', 'le', 'li', 'lo', 'lu',
'ma', 'me', 'mi', 'mo', 'mu',
'na', 'ne', 'ni', 'no', 'nu',
'oa', 'ob', 'oc', 'od', 'oe', 'of', 'og', 'oi', 'oj', 'ok', 'ol', 'om', 'on', 'oo', 'op', 'or', 'os', 'ot', 'ou', 'ov', 'ow', 'ox', 'oz',
'pa', 'pe', 'pi', 'po', 'pu',
'qa', 'qe', 'qi', 'qo', 'qu',
'ra', 're', 'ri', 'ro', 'ru',
'sa', 'se', 'si', 'so', 'su',
'ta', 'te', 'ti', 'to', 'tu',
'wa', 'we', 'wi', 'wo', 'wu',
'xa', 'xe', 'xi', 'xo', 'xu',
'ya', 'ye', 'yi', 'yo', 'yu',
'za', 'ze', 'zi', 'zo'
];
const syllables = ["ab", "ac", "al", "am", "an", "ap", "apo", "ar", "arr", "as", "ast", "at", "ate", "au", "av", "ay", "aye", "ba", "be", "ben", "bo", "br", "bri", "bu", "bur", "ca", "cal", "car", "ce", "chi", "ci", "ck", "co", "com", "con", "cor", "cy", "d", "da", "dan", "dar", "de", "den", "di", "do", "dor", "du", "dur", "ed", "el", "en", "eon", "er", "es", "ey", "fa", "far", "fe", "fi", "fin", "fo", "for", "foy", "fr", "fu", "ga", "gal", "ge", "gi", "gil", "gin", "go", "gor", "gr", "gu", "ha", "han", "har", "he", "hi", "hin", "ho", "hoe", "hos", "hu", "ic", "il", "ill", "in", "ing", "ion", "ir", "irk", "is", "ja", "je", "jen", "jo", "ju", "ka", "ke", "ker", "ki", "kir", "ko", "la", "lan", "las", "le", "ler", "li", "lin", "lis", "lo", "lor", "loy", "lu", "ma", "mac", "mal", "man", "mas", "me", "mi", "mo", "mon", "mu", "mul", "mur", "na", "nal", "ne", "ni", "no", "nor", "nov", "nu", "och", "ode", "oka", "ol", "ome", "on", "op", "or", "ore", "os", "ou", "ous", "pa", "par", "pe", "pen", "pi", "po", "pol", "pon", "por", "pu", "qu", "ra", "re", "ri", "ro", "ru", "sa", "se", "si", "so", "su", "ta", "te", "ti", "to", "tu", "ul", "un", "ur", "us", "va", "ve", "vi", "vo", "vu", "wa", "we", "wi", "wo", "wu", "y", "ya", "ye", "yi", "yo", "yu", "za", "ze", "zi", "zo"];
let prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
const suffix = suffixes[Math.floor(Math.random() * suffixes.length)];
@ -43,7 +18,7 @@ export function generateCityName(settings : cityGeneratorSetting) {
generatedName = capitalizeFirstLetter(generatedName);
prefix = capitalizeFirstLetter(prefix);
return numSyllables > 3 ? `${prefix} ${generatedName}` : `${generatedName}${suffix}`;
return numSyllables > 2 ? `${prefix} ${generatedName}` : `${generatedName}${suffix}`;
}
function capitalizeFirstLetter(string:string) {

View file

@ -1,64 +1,91 @@
import { currency, lootTables } from "settings/Datatypes";
export function generateLoot(enableCurrency: boolean, currencyFrequency: number, currencyTypes: currency[], lootTable: lootTables) {
const { adj, items } = lootTable;
const itemAmount = Math.floor(Math.random() * 5) + 1;
const adjectives = lootTable.adj;
const nouns = lootTable.nouns;
const ItemAmount = Math.floor(Math.random() * (5 - 1 + 1)) + 1;
let loot = '';
for (let index = 0; index < itemAmount; index++) {
const randomAdjective = adj[Math.floor(Math.random() * adj.length)];
const amount = generateRareHighNumber(50, 0.1);
const randomNoun = getRandomElement(items);
const article = /^[aeiou]/i.test(randomAdjective) ? 'an' : 'a';
const plural = randomNoun?.endsWith('s') ? `${randomNoun}'` : `${randomNoun}s`;
loot += `${amount > 1 ? `${amount} ${randomAdjective} ${plural}` : `${article} ${randomAdjective} ${randomNoun}`}, `;
for (let index = 0; index < ItemAmount; index++) {
const randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
const amount = generateRareHighNumber(50, 0.1);
const vowels = ["a", "e", "i", "o", "u"];
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
const vowelOrNot = isFirstCharInArray(vowels, randomAdjective) ? "an" : "a";
let addS = randomNoun;
if (!(randomNoun[randomNoun.length-1] === "e") && !(randomNoun[randomNoun.length] === "s")) {
addS = randomNoun[randomNoun.length] === "s" ? randomNoun + "'s" : randomNoun + "s";
}
amount > 1 ? loot += `${amount} ${randomAdjective} ${addS}` : loot += `${vowelOrNot} ${randomAdjective} ${randomNoun}`;
loot += ", "
}
if (enableCurrency) {
const shouldGenCurrency = Math.random() * 100;
const currencyLoot = currencyTypes
.map((element) => {
const randomCurrencyAmount = generateRareHighNumberByRarity(element.rarity);
return randomCurrencyAmount > 0 ? `${randomCurrencyAmount} ${element.name}, ` : '';
})
.join('');
let currencyLoot = '';
const shouldGenCurrency = Math.floor(Math.random() * 100);
if (shouldGenCurrency < currencyFrequency) {
loot += currencyLoot;
currencyTypes.forEach(element => {
const randomCurrencyAmount = generateRareHighNumberByRarity(element.rarity);
if (randomCurrencyAmount > 0) {
currencyLoot += randomCurrencyAmount + " " + element.name + ", ";
}
});
}
loot += currencyLoot;
}
return loot.slice(0, -2);
return loot;
}
function isFirstCharInArray(array: string[], string: string) {
return array.includes(string[0]);
}
function generateRareHighNumber(maxNumber: number, rarityFactor: number) {
const randomNumber = Math.random();
const rarity = randomNumber < rarityFactor ? rarityFactor : rarityFactor / 10;
return Math.floor(Math.random() * maxNumber * rarity);
if (randomNumber < rarityFactor) {
return Math.floor(Math.random() * maxNumber);
} else {
return Math.floor(Math.random() * (maxNumber / 10));
}
}
function generateRareHighNumberByRarity(rarity: string) {
const rarityFactors: { [key: string]: number } = { common: 0.7, uncommon: 0.5, rare: 0.2, rarest: 0.02 };
const maxNumbers: { [key: string]: number } = { common: 300, uncommon: 150, rare: 30, rarest: 10 };
let rarityFactor = 0;
let maxNumber = 0;
const randomNumber = Math.random();
const isZero = Math.random();
if (randomNumber > rarityFactors[rarity] || rarityFactors[rarity] === undefined) {
if (rarity === "common" && isZero > 0.3) {
rarityFactor = 0.7;
maxNumber = 300;
}
if (rarity === "uncommon" && isZero > 0.5) {
rarityFactor = 0.5;
maxNumber = 150;
}
if (rarity === "rare" && isZero > 0.8) {
rarityFactor = 0.2
maxNumber = 30
}
if (rarity === "rarest" && isZero > 0.98) {
rarityFactor = 0.02
maxNumber = 10
}
if (rarityFactor === 0) {
return 0;
}
return Math.floor(Math.random() * maxNumbers[rarity]);
}
function getRandomElement<T>(arr: { item: T, weight: number }[]): T | undefined {
const totalWeight = arr.reduce((acc, cur) => acc + cur.weight, 0);
let randomWeight = Math.random() * totalWeight;
for (const { item, weight } of arr) {
if (randomWeight < weight) {
return item;
}
randomWeight -= weight;
if (randomNumber < rarityFactor) {
return Math.floor(Math.random() * maxNumber);
} else {
return Math.floor(Math.random() * (maxNumber / 10));
}
return undefined;
}

View file

@ -1,495 +0,0 @@
import { rollD100, rollD20, weightedRandomItem } from "settings/Datatypes";
//Inspiration for this Generator Was taken from Spectactular Settlements Published By Nord Games. https://nordgamesllc.com/product/spectacular-settlements/ Please Buy the Book if you like this Generator.
const specialtyOptions: string[] = ["Atypical Shipping Methods", "Food & Drink", "Hospitality", "Information", "Purchasing Connections", "Unscrupulous Contractors"];
const ageOptions: { string: string, range: number[] }[] = [
{ string: "Established", range: [4, 8] },
{ string: "Mature", range: [9, 13] },
{ string: "Old", range: [14, 17] },
{ string: "Recently Established", range: [1, 3] },
{ string: "Ancient", range: [18, 19] },
{ string: "Unknown", range: [20, 20] },
];
const conditionOptions: { string: string, range: number[] }[] = [
{ string: "Ramshackled", range: [1, 2] },
{ string: "Poor", range: [3, 6] },
{ string: "Fair", range: [7, 14] },
{ string: "Good", range: [15, 18] },
{ string: "Immaculate", range: [19, 20] },
];
const visitorTrafficOptions: { string: string, range: number[] }[] = [
{ string: "Vacant: No one is really visiting.", range: [1, 2] },
{ string: "Groups: Visitors are a rarity, though a few might be around.", range: [3, 6] },
{ string: "Crowds: It's typical to see new visitors most days.", range: [7, 14] },
{ string: "Droves: New people come in and out of this trading post.", range: [15, 18] },
{ string: "Masses: The post is swarming with faces that would not be deemed as familiar.", range: [19, 20] },
];
const sizeOptions: { string: string, range: number[] }[] = [
{ string: "Tiny", range: [1, 2] },
{ string: "Small", range: [3, 6] },
{ string: "Medium", range: [7, 14] },
{ string: "Large", range: [15, 18] },
{ string: "Very Large", range: [19, 20] },
];
const environmentOptions: { string: string, range: number[] }[] = [
{ string: "Mountainous", range: [1, 2] },
{ string: "Desert", range: [3, 4] },
{ string: "Valley", range: [5, 6] },
{ string: "Swamp", range: [7, 8] },
{ string: "Plains", range: [9, 10] },
{ string: "Coastal", range: [11, 12] },
{ string: "Forest", range: [13, 14] },
{ string: "River", range: [15, 16] },
{ string: "Tundra", range: [17, 18] },
{ string: "Underground", range: [19, 20] }
];
const residentPopulationOptions: { string: string, range: number[] }[] = [
{ string: "Nearly Deserted", range: [1, 2] },
{ string: "Sparse", range: [3, 6] },
{ string: "Comfortable", range: [7, 14] },
{ string: "Congested", range: [15, 18] },
{ string: "Overwhelmed", range: [19, 20] },
];
const visitorDispositionOptions: { string: string, range: number[] }[] = [
{ string: "Hostile", range: [1, 2] },
{ string: "Unfriendly", range: [3, 6] },
{ string: "Neutral", range: [7, 14] },
{ string: "Friendly", range: [15, 18] },
{ string: "Open", range: [19, 20] },
];
const lawEnforcementOptions = [
{ string: "None", range: [1, 2] },
{ string: "Sheriff", range: [3, 6] },
{ string: "Local Watch", range: [7, 14] },
{ string: "Well-equipped", range: [15, 18] },
{ string: "Overwhelmingly Present", range: [19, 20] },
];
const leadershipOptions: { string: string, range: number[] }[] = [
{ string: "No Leader", range: [1, 1] },
{ string: "Hereditary", range: [2, 4] },
{ string: "Merchant Monarch", range: [5, 7] },
{ string: "Underworld or Criminal", range: [8, 10] },
{ string: "Oligarchy", range: [11, 13] },
{ string: "Local Council", range: [14, 16] },
{ string: "Single Elected Leader", range: [17, 19] },
{ string: "Commune", range: [20, 20] }
];
const wealthOptions: { string: string, range: number[] }[] = [
{ string: "Destitute", range: [1, 2] },
{ string: "Impoverished", range: [3, 6] },
{ string: "Average", range: [7, 14] },
{ string: "Prosperous", range: [15, 17] },
{ string: "Wealthy", range: [18, 19] },
{ string: "Affluent", range: [20, 20] }
];
const crimeOptions: { string: string, range: number[] }[] = [
{ string: "Regular", range: [1, 2] },
{ string: "Common", range: [3, 6] },
{ string: "Average", range: [7, 14] },
{ string: "Uncommon", range: [15, 18] },
{ string: "Rare", range: [19, 20] }
];
const shopOptions: { string: string, range: number[] }[] = [
{ string: "Baker", range: [1, 4] },
{ string: "Butcher", range: [5, 8] },
{ string: "Cooper", range: [9, 12] },
{ string: "Carpenter", range: [13, 16] },
{ string: "General Store", range: [17, 24] },
{ string: "Herbalist", range: [25, 28] },
{ string: "Smithy", range: [29, 36] },
{ string: "Tailor", range: [37, 40] },
{ string: "Tanner", range: [41, 44] },
{ string: "Thatcher", range: [45, 48] },
{ string: "Wainwright", range: [49, 52] },
{ string: "Weaver", range: [53, 56] },
{ string: "Alchemist", range: [57, 59] },
{ string: "Artist", range: [60, 62] },
{ string: "Bank/Exchange", range: [63, 65] },
{ string: "Cobbler", range: [66, 68] },
{ string: "Foundry", range: [69, 71] },
{ string: "Mill", range: [72, 74] },
{ string: "Textile Production", range: [75, 77] },
{ string: "Shipwright", range: [78, 80] },
{ string: "Rare Botanicals", range: [81, 82] },
{ string: "Luxury Furnishings", range: [83, 84] },
{ string: "Rare Trade Goods", range: [85, 86] },
{ string: "Rare Drink Brewery", range: [87, 88] },
{ string: "Magic Shop-Armor", range: [89, 90] },
{ string: "Magic Shop-Books", range: [91, 92] },
{ string: "Magic Shop-Clothing", range: [93, 94] },
{ string: "Magic Shop-Jewelry", range: [95, 96] },
{ string: "Magic Shop-Weapons", range: [97, 98] },
{ string: "Magic Shop-Miscellaneous & Curiosities", range: [99, 100] }
];
const serviceOptions: { string: string, range: number[] }[] = [
{ string: "Barber", range: [1, 8] },
{ string: "Bathhouse", range: [9, 16] },
{ string: "Doctor/Apothercary", range: [17, 24] },
{ string: "House of Leisure (GM Discretion)", range: [25, 32] },
{ string: "Inn", range: [33, 44] },
{ string: "Club", range: [45, 52] },
{ string: "Soothsayer", range: [53, 60] },
{ string: "Stable", range: [61, 68] },
{ string: "Tavern", range: [69, 80] },
{ string: "Hired Help - Muscle", range: [81, 82] },
{ string: "Hired Help - Assassins/Thieves", range: [83, 84] },
{ string: "Hired Help - Ranged Attack Specialists", range: [85, 86] },
{ string: "Hired Help - Scribes and Clerks", range: [87, 88] },
{ string: "Hired Help - Caravans and Mounts", range: [89, 90] },
{ string: "Hired Help - Arcane Academics/Inventors", range: [91, 92] },
{ string: "Hired Help - Magic Mercs", range: [93, 94] },
{ string: "Hired Help - Religious Guidance", range: [95, 96] },
{ string: "Hired Help - Divine Specialists", range: [97, 98] },
{ string: "Hired Help - Guides and Trackers", range: [99, 100] }
];
const origins: string[] = [
"Accidental: 'the trading post came about due to an accident, such as a caravan breaking down or mistaken directions. What was set up to deal with the eventually become the trading post.'",
"Business Venture: 'The trading post was established by a wealthy entrepreneur specifically to be a trading post from the start.'",
"Crossroads: 'The trading post is at the intersection of more than one major trade route.'",
"Military Outpost: 'The trading post was built on the remnants of an old fortress or watchtower, the structures of which have long since fallen down or been repurposed by the locals.'",
"No Man's Land: 'The trading post was established as a neutral place where opposing forces could purchase wares, without encroaching on enemy territory.'",
"Native: 'The trading post was started by someone native to the area, who saw potential in trade with passersby.'",
"Overnight Stop: 'The trading post was originally a single, large house for overnight stays for weary travellers, which soon grew, along with the demand for accommodations.'",
"Wilderness Expert: 'The trading post was started when a trapper, hunter or guide set up a camp, in order to aid those passing through the area.'",
"Religious: 'The trading post was established by a religious order, as a means of supporting their ministry.'",
"River Crossing: 'The trading post was built near a major river crossing so that traders could more easily cross and barter their goods.'",
"Pilgrimage: 'The trading post was set up to serve the needs of people travelling on a pilgrimage.'",
"King's Grant: 'The trading post was established as part of a royal grant, as a means of encouraging trade and commerce in the region.'",
"Scavengers: 'The trading post was created by a group of scavengers, who had discovered a valuable resource or sought to capitalize on the needs of travellers.'",
"Fishing Group: 'The trading post was established by a Group of Fishermen, in order to support a nearby population and capitalize on the sea trade.'",
"Frontier Expansion: 'The trading post was established as part of a larger effort to expand the kingdom's frontier, and to open up new trade routes.'"
];
export function generateTradingPost(): string {
let visitorTrafficMod = 0;
let popWealth = 0;
let sizeMod = 0;
let crimeMod = 0;
const origin = origins[Math.floor(Math.random() * origins.length)];
const specialiaty = specialtyOptions[Math.floor(Math.random() * specialtyOptions.length)];
const age = ageRoll();
visitorTrafficMod += age.mod;
const condition = conditionRoll();
popWealth += condition.mod;
const visitorTraffic = visitorTrafficRoll(visitorTrafficMod);
sizeMod += visitorTraffic.mod[0];
crimeMod += visitorTraffic.mod[1];
const postSize = weightedRandomItem(sizeOptions, rollD20(sizeMod));
const environment = weightedRandomItem(environmentOptions, rollD20(0));
const residentPop = residentPopRoll();
crimeMod += residentPop.mod;
const visitorDisposition = weightedRandomItem(visitorDispositionOptions, rollD20(0));
const lawEnforcement = lawEnforcementRoll();
crimeMod += lawEnforcement.mod;
const leadership = leadershipRoll();
const wealth = wealthRoll(popWealth);
crimeMod += wealth.mod;
const crime = weightedRandomItem(crimeOptions, rollD20(crimeMod));
const shops = shopRoll(postSize as string);
const services = serviceRoll(postSize as string);
return `Origin: ${origin}\nSpeciality: ${specialiaty}\nAge: ${age.string}\nCondition: ${condition.string}\nVisitor Traffic: ${visitorTraffic.string}\nTrading Post Size: ${postSize}\nEnvironment: ${environment}\nResident Population: ${residentPop.string}\nDisposition to Visitors: ${visitorDisposition}\nLaw Enforcement: ${lawEnforcement.string}\nLeadership: ${leadership}\nWealth: ${wealth.string}\nCrime: ${crime}\nShops: ${shops}\nServices: ${services}`
}
function serviceRoll(tradingPostSize: string): string {
let shopAmount = 0;
switch (tradingPostSize) {
case "Tiny":
shopAmount = Math.floor((Math.random() * 6) + 1);
break;
case "Small":
shopAmount = Math.floor((Math.random() * 6) + 1) + 1;
break;
case "Medium":
shopAmount = Math.floor((Math.random() * 6) + 1) + 3;
break;
case "Large":
shopAmount = Math.floor((Math.random() * 6) + 1) + 5;
break;
case "Very Large":
shopAmount = Math.floor((Math.random() * 6) + 1) + 7;
break;
default:
break;
}
const services: string[] = [];
for (let index = 0; index < shopAmount; index++) {
const roll: string = weightedRandomItem(serviceOptions, rollD100(0)) as string;
let hiredHelp = "";
if (roll.includes("Hired Help")) {
const helpSize = Math.floor((Math.random() * 12) + 1);
if (helpSize <= 6) {
hiredHelp = ": An Individual Person who is hiring out their services of this type";
}
if (helpSize <= 10) {
hiredHelp = ": A Team of people who are hiring out their services of this type";
} else {
hiredHelp = ": A Guild that is organised for this type of service "
}
}
services.push(`${roll + hiredHelp}`);
}
return generateStringWithCounts(services);
}
function shopRoll(tradingPostSize: string): string {
let shopAmount = 0;
switch (tradingPostSize) {
case "Tiny":
shopAmount = Math.floor((Math.random() * 8) + 1) + 2;
break;
case "Small":
shopAmount = Math.floor((Math.random() * 8) + 1) + 4;
break;
case "Medium":
shopAmount = Math.floor((Math.random() * 8) + 1) + 6;
break;
case "Large":
shopAmount = Math.floor((Math.random() * 8) + 1) + 8;
break;
case "Very Large":
shopAmount = Math.floor((Math.random() * 8) + 1) + 10;
break;
default:
break;
}
const shops: string[] = [];
for (let index = 0; index < shopAmount; index++) {
const roll: string = weightedRandomItem(shopOptions, rollD100(0)) as string;
shops.push(roll);
}
console.log(shops);
return generateStringWithCounts(shops);
}
function leadershipRoll(): string {
const roll: string = weightedRandomItem(leadershipOptions, rollD20(0)) as string;
let result = roll;
leadershipOptions.forEach(element => {
if (element.string === roll) {
if (element.string === leadershipOptions[4].string) {
const sway = Math.floor((Math.random() * 4) + 1);
switch (sway) {
case 1:
result = "Plutocracy (Merchant Group Runs the Post)";
break;
case 2:
result = "Magocracy (Mages and Magic users Run the Post)";
break;
case 3:
result = "Theocracy (Priests and Religious Orders Run the Post)";
break;
case 4:
result = "A Small unknown group Runs the Post";
break;
default:
break;
}
}
}
});
return result;
}
function ageRoll(): { string: string, mod: number } {
const roll: string = weightedRandomItem(ageOptions, rollD20(0)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: 0 }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: 1 };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: 2 };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: -1 };
}
if (roll === ageOptions[4].string) {
return { string: roll, mod: 3 };
}
return { string: roll, mod: 4 };
}
function wealthRoll(mod: number): { string: string, mod: number } {
const roll: string = weightedRandomItem(wealthOptions, rollD20(mod)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: -4 }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: -2 };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: 0 };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: -1 };
}
if (roll === ageOptions[4].string) {
return { string: roll, mod: -2 };
}
return { string: roll, mod: -4 };
}
function conditionRoll(): { string: string, mod: number } {
const roll: string = weightedRandomItem(conditionOptions, rollD20(0)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: -6 }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: -3 };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: 0 };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: 3 };
}
return { string: roll, mod: 6 };
}
function visitorTrafficRoll(mod: number): { string: string, mod: number[] } {
const roll: string = weightedRandomItem(visitorTrafficOptions, rollD20(mod)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: [0, 2] }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: [1, 1] };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: [2, 0] };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: [3, -1] };
}
return { string: roll, mod: [4, -2] };
}
function residentPopRoll(): { string: string, mod: number } {
const roll: string = weightedRandomItem(residentPopulationOptions, rollD20(0)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: 2 }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: 1 };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: 0 };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: -1 };
}
return { string: roll, mod: -2 };
}
function lawEnforcementRoll(): { string: string, mod: number } {
const roll: string = weightedRandomItem(lawEnforcementOptions, rollD20(0)) as string;
if (roll === ageOptions[0].string) {
return { string: roll, mod: -8 }
}
if (roll === ageOptions[1].string) {
return { string: roll, mod: -4 };
}
if (roll === ageOptions[2].string) {
return { string: roll, mod: 0 };
}
if (roll === ageOptions[3].string) {
return { string: roll, mod: 4 };
}
return { string: roll, mod: 8 };
}
function generateStringWithCounts(arr: string[]): string {
const counts: Record<string, number> = {};
for (const item of arr) {
counts[item] = (counts[item] || 0) + 1;
}
let result = "";
for (const item in counts) {
const count = counts[item];
const itemString = count > 1 ? `${item}s` : item;
if (result === "") {
result = `${count} ${itemString}`;
} else {
result = `${result}, ${count} ${itemString}`;
}
}
return result;
}

58
main.ts
View file

@ -1,5 +1,5 @@
import { GeneratorModal } from 'editor/GeneratorModal';
import { MarkdownView, Notice, Plugin, Editor } from 'obsidian';
import { MarkdownView, Notice, Plugin } from 'obsidian';
import { InlineGeneratorSuggester } from "editor/InlineGenerator";
import { FantasyPluginSettings, possibleOptions } from 'settings/Datatypes';
import { DEFAULT_SETTINGS } from 'settings/DefaultSetting';
@ -7,7 +7,6 @@ import { SettingTab } from 'settings/SettingsTab';
export default class FantasyPlugin extends Plugin {
settings: FantasyPluginSettings;
currentEditor: Editor | null = null;
//Function used to return the array of options for the suggester.
getOptionsForSuggest(): string[] {
@ -16,55 +15,21 @@ export default class FantasyPlugin extends Plugin {
async onload() {
await this.loadSettings();
this.app.workspace.on('active-leaf-change', (leaf) => {
if (leaf) {
const view = leaf.view;
if (view instanceof MarkdownView) {
this.currentEditor = view.editor;
} else {
this.currentEditor = null;
}
} else {
this.currentEditor = null;
app.workspace.onLayoutReady(() => {
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
// Make sure the user is editing a Markdown file.
if (view) {
//Register the InlineGeneratorSuggester to the Editor suggester.
this.registerEditorSuggest(new InlineGeneratorSuggester(this.getOptionsForSuggest, this));
}
});
//Command to open Modal dialog
this.addCommand({
id: 'open-fantasy-generator',
name: 'Open Fantasy Generator',
callback: () => {
new GeneratorModal(this.app, (result) => {
const copyContent = async () => {
//Try to see if any generators spit out an Error or if copying the string fails.
try {
if (result instanceof Error) {
new Notice(`${result}`);
} else {
await navigator.clipboard.writeText(result);
new Notice(`${result} was copied to the clipboard.`);
}
} catch (err) {
console.error('Failed to copy: ', err);
new Notice("Failed to copy, Check error in console.");
}
}
copyContent();
}, this).open();
},
});
//Register the InlineGeneratorSuggester to the Editor suggester.
this.registerEditorSuggest(new InlineGeneratorSuggester(this.getOptionsForSuggest, this));
// This creates an icon in the left ribbon to access the modal for the Fantasy Content Generator.
this.addRibbonIcon('book', 'Fantasy Generators', (evt: MouseEvent) => {
const ribbonIconEl = this.addRibbonIcon('book', 'Fantasy Generators', (evt: MouseEvent) => {
// Called when the user clicks the icon.
new GeneratorModal(this.app, (result) => {
const copyContent = async () => {
console.log();
//Try to see if any generators spit out an Error or if copying the string fails.
try {
if (result instanceof Error) {
@ -83,10 +48,15 @@ export default class FantasyPlugin extends Plugin {
}, this).open();
});
// Perform additional things with the ribbon
ribbonIconEl.addClass('my-plugin-ribbon-class');
// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new SettingTab(this.app, this));
// When registering intervals, this function will automatically clear the interval when the plugin is disabled.
this.registerInterval(window.setInterval(() => console.log('setInterval'), 5 * 60 * 1000));
console.log("loaded Fantasy Content Generator");
}

View file

@ -1,7 +1,7 @@
{
"id": "fantasy-content-generator",
"name": "Fantasy Content Generator",
"version": "1.2.4",
"version": "1.2.1",
"minAppVersion": "0.15.0",
"description": "A Fantasy Content Generator for Obsidian for All Your TTRPG / World Building Needs",
"author": "Gregory Jagermeister ",

View file

@ -1,7 +1,7 @@
{
"name": "fantasy-content-generator",
"version": "1.2.4",
"description": "A Fantasy Content Generator For all your TTRPG Needs",
"version": "1.2.1",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",

View file

@ -4,115 +4,114 @@ import { Notice } from 'obsidian';
// The possible Options that could be selected durring inline generation
export const possibleOptions = [
'TradingPost',
'ElfMale',
'ElfMaleLastname',
'ElfFemale',
'ElfFemaleLastname',
'Orc',
'OrcLastname',
'DwarfMale',
'DwarfMaleLastname',
'DwarfFemale',
'DwarfFemaleLastname',
'HumanMale',
'HumanFemale',
'HumanMaleLastname',
'HumanFemaleLastname',
"DungeonsLabryinths",
"InnsTaverns",
"Settlement",
"Airships",
"Drinks",
"Artifacts",
"LootTreasure",
"Metals",
"MagicalTrees",
"Ship",
"AnimalGroups",
"Groups",
"Religion",
"AasimarsLastname",
"CatfolkLastname",
"FetchlingsLastname",
"HalfElfLastname",
"HalfOrcLastname",
"HobgoblinLastname",
"IfritsLastname",
"KobaldsLastname",
"OreadsLastname",
"RatfolkLastname",
"SylphsLastname",
"TenguLastname",
"TiansLastname",
"TieflingLastname",
"UndinesLastname",
"AngelMaleLastname",
"AngelFemaleLastname",
"CavePersonMaleLastname",
"CavePersonFemaleLastname",
"DarkElfMaleLastname",
"DarkElfFemaleLastname",
"DemonLastname",
"DragonMaleLastname",
"DragonFemaleLastname",
"DrowMaleLastname",
"DrowFemaleLastname",
"FairyMaleLastname",
"FairyFemaleLastname",
"GnomeMaleLastname",
"GnomeFemaleLastname",
"GoblinLastname",
"HalfDemonMaleLastname",
"HalfDemonFemaleLastname",
"HalflingMaleLastname",
"HalflingFemaleLastname",
"HighElfMaleLastname",
"HighElfFemaleLastname",
"HighFairyMaleLastname",
"HighFairyFemaleLastname",
"OgreLastname",
"Aasimars",
"Catfolk",
"Fetchlings",
"HalfElf",
"HalfOrc",
"Hobgoblin",
"Ifrits",
"Kobalds",
"Oreads",
"Ratfolk",
"Sylphs",
"Tengu",
"Tians",
"Tiefling",
"Undines",
"AngelMale",
"CavePersonMale",
"DarkElfMale",
"DragonMale",
"DrowMale",
"FairyMale",
"GnomeMale",
"HalfDemonMale",
"HalflingMale",
"HighElfMale",
"HighFairyMale",
"Ogre",
"AngelFemale",
"CavePersonFemale",
"DarkElfFemale",
"Demon",
"DragonFemale",
"DrowFemale",
"FairyFemale",
"GnomeFemale",
"Goblin",
"HalfDemonFemale",
"HalflingFemale",
"HighElfFemale",
"HighFairyFemale",
"PlotStoryHooks"
'Gen-ElfMale',
'Gen-ElfMaleLastname',
'Gen-ElfFemale',
'Gen-ElfFemaleLastname',
'Gen-Orc',
'Gen-OrcLastname',
'Gen-DwarfMale',
'Gen-DwarfMaleLastname',
'Gen-DwarfFemale',
'Gen-DwarfFemaleLastname',
'Gen-HumanMale',
'Gen-HumanFemale',
'Gen-HumanMaleLastname',
'Gen-HumanFemaleLastname',
"Gen-DungeonsLabryinths",
"Gen-InnsTaverns",
"Gen-Settlement",
"Gen-Airships",
"Gen-Drinks",
"Gen-Artifacts",
"Gen-LootTreasure",
"Gen-Metals",
"Gen-MagicalTrees",
"Gen-Ship",
"Gen-AnimalGroups",
"Gen-Groups",
"Gen-Religion",
"Gen-AasimarsLastname",
"Gen-CatfolkLastname",
"Gen-FetchlingsLastname",
"Gen-HalfElfLastname",
"Gen-HalfOrcLastname",
"Gen-HobgoblinLastname",
"Gen-IfritsLastname",
"Gen-KobaldsLastname",
"Gen-OreadsLastname",
"Gen-RatfolkLastname",
"Gen-SylphsLastname",
"Gen-TenguLastname",
"Gen-TiansLastname",
"Gen-TieflingLastname",
"Gen-UndinesLastname",
"Gen-AngelMaleLastname",
"Gen-AngelFemaleLastname",
"Gen-CavePersonMaleLastname",
"Gen-CavePersonFemaleLastname",
"Gen-DarkElfMaleLastname",
"Gen-DarkElfFemaleLastname",
"Gen-DemonLastname",
"Gen-DragonMaleLastname",
"Gen-DragonFemaleLastname",
"Gen-DrowMaleLastname",
"Gen-DrowFemaleLastname",
"Gen-FairyMaleLastname",
"Gen-FairyFemaleLastname",
"Gen-GnomeMaleLastname",
"Gen-GnomeFemaleLastname",
"Gen-GoblinLastname",
"Gen-HalfDemonMaleLastname",
"Gen-HalfDemonFemaleLastname",
"Gen-HalflingMaleLastname",
"Gen-HalflingFemaleLastname",
"Gen-HighElfMaleLastname",
"Gen-HighElfFemaleLastname",
"Gen-HighFairyMaleLastname",
"Gen-HighFairyFemaleLastname",
"Gen-OgreLastname",
"Gen-Aasimars",
"Gen-Catfolk",
"Gen-Fetchlings",
"Gen-HalfElf",
"Gen-HalfOrc",
"Gen-Hobgoblin",
"Gen-Ifrits",
"Gen-Kobalds",
"Gen-Oreads",
"Gen-Ratfolk",
"Gen-Sylphs",
"Gen-Tengu",
"Gen-Tians",
"Gen-Tiefling",
"Gen-Undines",
"Gen-AngelMale",
"Gen-CavePersonMale",
"Gen-DarkElfMale",
"Gen-DragonMale",
"Gen-DrowMale",
"Gen-FairyMale",
"Gen-GnomeMale",
"Gen-HalfDemonMale",
"Gen-HalflingMale",
"Gen-HighElfMale",
"Gen-HighFairyMale",
"Gen-Ogre",
"Gen-AngelFemale",
"Gen-CavePersonFemale",
"Gen-DarkElfFemale",
"Gen-Demon",
"Gen-DragonFemale",
"Gen-DrowFemale",
"Gen-FairyFemale",
"Gen-GnomeFemale",
"Gen-Goblin",
"Gen-HalfDemonFemale",
"Gen-HalflingFemale",
"Gen-HighElfFemale",
"Gen-HighFairyFemale",
"Gen-PlotStoryHooks"
];
// currency Datatype for defining custom currency
@ -142,7 +141,7 @@ export type dungeonGenSettings = {
// Datatype for collecting loot settings
export type lootTables = {
adj: string[]
items: { item: string, weight: number }[];
nouns: string[];
}
// Datatype for collecting Drink settings
@ -209,22 +208,3 @@ export function exportJSON(data: any) {
new Notice("Data Exporting!");
}
export function weightedRandomItem(table: { string: string, range: number[] }[], roll: number) {
// Find the object in the table that corresponds to the roll
const item = table.find(({ range }) => range[0] <= roll && roll <= range[1]);
// Return the item
return item?.string;
}
export function rollD20(modifier: number) {
return Math.clamp(Math.floor((Math.random() * 20) + 1) + modifier, 1, 20);
}
export function rollD100(modifier: number) {
return Math.clamp(Math.floor((Math.random() * 100) + 1) + modifier, 1, 100);
}

View file

@ -5,7 +5,7 @@ export const DEFAULT_SETTINGS: FantasyPluginSettings = {
enableCurrency: false,
citySettings: {
prefixArray: ["camp", "castle", "east", "edge", "ever", "great", "mount", "new", "north", "red", "rose", "south", "west"],
suffixArray: ["avon", "bank", "barrow", "bay", "beach", "bell", "borough", "berg", "bourne", "broad", "bridge", "brook", "brough", "burgh", "burn", "bury", "by", "caster", "chester", "cliffe", "combe", "cot", "cott", "cote", "cove", "croft", "crook", "dale", "den", "din", "dine", "don", "downs", "falls", "field", "fin", "flats", "ford", "fork", "gate", "grove", "ham", "harbour", "heights", "hill", "holm", "hurst", "ing", "kirk", "land", "lake", "latch", "lea", "leigh", "ley", "marsh", "mere", "minster", "mond", "ness", "park", "pilly", "point", "pond", "ridge", "river", "rock", "sett", "side", "son", "stead", "stoke", "stone", "stow", "thorpe", "ton", "tor", "town", "vale", "valley", "well", "wick", "worth", "cadia"],
suffixArray: ["wood", "avon", "bank", "bark", "barrow", "bay", "beach", "bell", "borough", "berg", "bourne", "broad", "bridge", "brook", "brough", "burgh", "burn", "bury", "by", "canyon", "caster", "chester", "cliffe", "combe", "cot", "cott", "cote", "cove", "creek", "croft", "crook", "dale", "den", "din", "dine", "don", "downs", "falls", "field", "fin", "flats", "ford", "fork", "gate", "grove", "gum", "ham", "harbour", "heights", "hill", "holm", "hurst", "ing", "kirk", "land", "lake", "latch", "lea", "leigh", "ley", "marsh", "mere", "minster", "mond", "mont", "more", "ness", "park", "pilly", "pine", "point", "pond", "ridge", "river", "rock", "sett", "side", "son", "stead", "stoke", "stone", "stow", "terrace", "thorpe", "ton", "tor", "town", "vale", "valley", "view", "village", "ville", "water", "well", "wharf", "wick", "wood", "worth"],
},
innSettings: {
prefixes: ["The Rusty", "The Cosy", "The Grand", "The Quiet", "The Friendly", "Bashur's", "Harmony", "Harmonic", "Bald Faced", "Black", "Grey", "Silver", "White", "Blue", "Purple", "Green", "The Ugly", "The Pretty", "Ye Ol' Fighting", "The Drunk", "One", "Two", "Three", "Four", "Five", "Busta", "The Terrified"],
@ -145,52 +145,8 @@ export const DEFAULT_SETTINGS: FantasyPluginSettings = {
nouns: ["Cocktail", "Smoothie", "Shake", "Juice", "Iced Tea", "Lemonade", "Soda", "Ale", "Brandy", "Tea", "Tea", "Sherry", "Brew", "Cappuchino", "Cider", "Coffee", "Cognac", "Dark Ale", "Dark Beer", "Drink", "Espresso", "Gin", "Java", "Lager", "Light Ale", "Light Beer", "Mead", "Mocha", "Red Wine", "Rum", "Sake", "Tea", "Tonic", "Vodka", "Whiskey", "White Wine", "Wine"]
},
lootSettings: {
adj: ["old", "tattered", "rotten", "shiny", "polished", "rusty", "broken", "priceless", "ancient", "precious", 'shiny', 'glowing', 'mysterious', 'ancient', 'enchanted', 'ornate', 'magical', 'powerful'],
items: [
{ item: 'feather', weight: 0.8 },
{ item: 'sword', weight: 0.2 },
{ item: 'bow', weight: 0.2 },
{ item: 'wand', weight: 0.1 },
{ item: 'armor', weight: 0.2 },
{ item: 'shield', weight: 0.1 },
{ item: 'amulet', weight: 0.1 },
{ item: 'ring', weight: 0.1 },
{ item: 'book', weight: 0.2 },
{ item: 'scroll', weight: 0.2 },
{ item: 'potion', weight: 0.3 },
{ item: 'trinket', weight: 0.3 },
{ item: 'gemstone', weight: 0.2 },
{ item: 'wand core', weight: 0.1 },
{ item: 'tome', weight: 0.2 },
{ item: 'relic', weight: 0.1 },
{ item: 'spellbook', weight: 0.2 },
{ item: 'grimoire', weight: 0.2 },
{ item: 'tome', weight: 0.2 },
{ item: 'journal', weight: 0.2 },
{ item: 'ledger', weight: 0.1 },
{ item: 'diary', weight: 0.1 },
{ item: 'healing potion', weight: 0.2 },
{ item: 'mana potion', weight: 0.2 },
{ item: 'invisibility potion', weight: 0.1 },
{ item: 'poison', weight: 0.1 },
{ item: 'love potion', weight: 0.1 },
{ item: 'strength potion', weight: 0.1 },
{ item: 'speed potion', weight: 0.1 },
{ item: 'water breathing potion', weight: 0.1 },
{ item: 'fire resistance potion', weight: 0.1 },
{ item: 'flying potion', weight: 0.1 },
{ item: 'locket', weight: 0.2 },
{ item: 'charm', weight: 0.3 },
{ item: 'statue', weight: 0.2 },
{ item: 'figurine', weight: 0.2 },
{ item: 'music box', weight: 0.1 },
{ item: 'dagger', weight: 0.1 },
{ item: 'pen', weight: 0.1 },
{ item: 'hourglass', weight: 0.1 },
{ item: 'pipe', weight: 0.1 },
{ item: 'goblet', weight: 0.1 },
{ item: 'candle', weight: 0.2 },
]
adj: ["old", "tattered", "rotten", "shiny", "polished", "rusty", "broken", "priceless", "ancient", "precious"],
nouns: ["bag", "scroll", "book", "map", "key", "ring", "necklace", "potion", "ball bearing", "alchemists fire", "antitoxin", "caltrop", "book", "candle", "map scroll", "chain", "climbers kit", "crowbar", "fishing tackle", "holy water", "hunting trap", "lantern", "lock", "oil", "poison", "ram portable", "spyglass", "tent", "bucket", "glass bottle", "chest", "signet ring", "sealing wax", "whetstone", "arrows", "bolt", "censer", "dice set", "dragonchess set", "flute", "glass blowers tool", "holy oil", "lute", "playing card set", "sack", "saddle", "sovereign glue", "universal solvent", "prosthetic wooden arm", "hook hand", "peg leg", "glass eye", "bag of marbles", "hatchet", "alchemists supplies", "brewers supplies", "burglars pack", "lockpicks", "calligraphers supplies", "carpenter's tool", "cartographers tool", "chain mail", "cooks utensil", "disguise kit", "dungeoneers pack", "entertainers pack", "explorers pack", "forgery kit", "half plate", "healers kit", "ink", "ink pen", "parchment", "shovel", "leather worker's tool", "masons tool", "navigator's tool", "net", "painters supplies", "perfume", "plate armor", "potters tool", "priests pack", "ring mail", "scale mail", "scholar's pack", "scimitar", "shield", "whistle", "smiths tool", "thieves tool", "torch", "weaver's tool", "cobblers tool", "jewelers tools", "tinkers tool", "poisoners kit", "herbalism kit", "bell", "block and tackle", "animal or pet", "traveler's clothes", "fine clothes"]
},
groupSettings: {
adj: ["azure", "black", "blue", "brass", "bronze", "brown", "cardinal", "cobalt", "copper", "crimson", "crystal", "demon", "denim", "diamond", "ebony", "electric", "emerald", "fire", "flame", "gold", "green", "grey", "grizzly", "ice", "ivory", "jade", "onyx", "orange", "red", "royal", "ruby", "sanguine", "sapphire", "scarlet", "thunder", "violet", "white", "yellow", "", "", "", "", "", "", "", "", "", "", "", ""],

View file

@ -20,7 +20,7 @@ export class SettingTab extends PluginSettingTab {
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
createSettingsBlock(containerEl: HTMLElement, textA: string, arr: any[], type: string, weights: boolean): void {
createSettingsBlock(containerEl: HTMLElement, textA: string, arr: any[], type: string): void {
new Setting(containerEl).setName(type + " being used").setDesc("Click 'remove' for any item you want removed from the Array");
new Setting(containerEl)
.setName("New Addition:")
@ -43,7 +43,7 @@ export class SettingTab extends PluginSettingTab {
for (let index = 0; index < arr.length; index++) {
new Setting(foldDiv)
.setName(weights ? JSON.stringify(arr[index]) : arr[index])
.setName(arr[index])
.addButton((btn) => btn
.setCta()
.setButtonText("Remove")
@ -263,8 +263,8 @@ export class SettingTab extends PluginSettingTab {
const preText = "";
const sufText = "";
this.createSettingsBlock(settlementDiv, preText, this.plugin.settings.citySettings.prefixArray, "Prefixes", false);
this.createSettingsBlock(settlementDiv, sufText, this.plugin.settings.citySettings.suffixArray, "Suffixes", false);
this.createSettingsBlock(settlementDiv, preText, this.plugin.settings.citySettings.prefixArray, "Prefixes");
this.createSettingsBlock(settlementDiv, sufText, this.plugin.settings.citySettings.suffixArray, "Suffixes");
// END SETTLEMENT SETTINGS //
@ -321,11 +321,11 @@ export class SettingTab extends PluginSettingTab {
const innDescText = "";
const innRumorText = "";
this.createSettingsBlock(innDiv, innPreText, this.plugin.settings.innSettings.prefixes, "Prefixes", false);
this.createSettingsBlock(innDiv, innTypeText, this.plugin.settings.innSettings.innType, "Type's", false);
this.createSettingsBlock(innDiv, innNounText, this.plugin.settings.innSettings.nouns, "Nouns", false);
this.createSettingsBlock(innDiv, innDescText, this.plugin.settings.innSettings.desc, "Description's", false);
this.createSettingsBlock(innDiv, innRumorText, this.plugin.settings.innSettings.rumors, "Rumors", false);
this.createSettingsBlock(innDiv, innPreText, this.plugin.settings.innSettings.prefixes, "Prefixes");
this.createSettingsBlock(innDiv, innTypeText, this.plugin.settings.innSettings.innType, "Type's");
this.createSettingsBlock(innDiv, innNounText, this.plugin.settings.innSettings.nouns, "Nouns");
this.createSettingsBlock(innDiv, innDescText, this.plugin.settings.innSettings.desc, "Description's");
this.createSettingsBlock(innDiv, innRumorText, this.plugin.settings.innSettings.rumors, "Rumors");
// END INN'S / TAVERN SETTINGS //
@ -380,8 +380,8 @@ export class SettingTab extends PluginSettingTab {
const drinkNounText = "";
const drinkAdjText = "";
this.createSettingsBlock(drinkDiv, drinkAdjText, this.plugin.settings.drinkSettings.adj, "Adjectives", false);
this.createSettingsBlock(drinkDiv, drinkNounText, this.plugin.settings.drinkSettings.nouns, "Nouns", false);
this.createSettingsBlock(drinkDiv, drinkAdjText, this.plugin.settings.drinkSettings.adj, "Adjectives");
this.createSettingsBlock(drinkDiv, drinkNounText, this.plugin.settings.drinkSettings.nouns, "Nouns");
// LOOT SETTINGS //
@ -434,8 +434,8 @@ export class SettingTab extends PluginSettingTab {
const lootNounText = "";
const lootAdjText = "";
this.createSettingsBlock(lootDiv, lootAdjText, this.plugin.settings.lootSettings.adj, "Adjectives", false);
this.createSettingsBlock(lootDiv, lootNounText, this.plugin.settings.lootSettings.items, "Items", true);
this.createSettingsBlock(lootDiv, lootAdjText, this.plugin.settings.drinkSettings.adj, "Adjectives");
this.createSettingsBlock(lootDiv, lootNounText, this.plugin.settings.drinkSettings.nouns, "Nouns");
// GROUP SETTINGS //
@ -491,11 +491,11 @@ export class SettingTab extends PluginSettingTab {
const groupTypes = ''
const groupSingleDescriptors = ''
this.createSettingsBlock(groupDiv, groupAdjectives, this.plugin.settings.groupSettings.adj, "Adjectives", false);
this.createSettingsBlock(groupDiv, groupNouns, this.plugin.settings.groupSettings.nouns, "Nouns", false);
this.createSettingsBlock(groupDiv, groupNounsPlural, this.plugin.settings.groupSettings.nounsP, "Plural Nouns", false);
this.createSettingsBlock(groupDiv, groupTypes, this.plugin.settings.groupSettings.groupTypes, "Types", false);
this.createSettingsBlock(groupDiv, groupSingleDescriptors, this.plugin.settings.groupSettings.singleDescriptors, "Descriptors", false);
this.createSettingsBlock(groupDiv, groupAdjectives, this.plugin.settings.groupSettings.adj, "Adjectives");
this.createSettingsBlock(groupDiv, groupNouns, this.plugin.settings.groupSettings.nouns, "Nouns");
this.createSettingsBlock(groupDiv, groupNounsPlural, this.plugin.settings.groupSettings.nounsP, "Plural Nouns");
this.createSettingsBlock(groupDiv, groupTypes, this.plugin.settings.groupSettings.groupTypes, "Types");
this.createSettingsBlock(groupDiv, groupSingleDescriptors, this.plugin.settings.groupSettings.singleDescriptors, "Descriptors");
// END GROUP SETTINGS //
@ -551,11 +551,11 @@ export class SettingTab extends PluginSettingTab {
const dungLocations = ''
const dungRandomDesc = ''
this.createSettingsBlock(dungDiv, dungAdjectives, this.plugin.settings.dungeonSettings.adjectives, "Adjectives", false);
this.createSettingsBlock(dungDiv, dungNouns, this.plugin.settings.groupSettings.nouns, "Nouns", false);
this.createSettingsBlock(dungDiv, dungLocations, this.plugin.settings.dungeonSettings.locations, "Locations", false);
this.createSettingsBlock(dungDiv, dungTypes, this.plugin.settings.dungeonSettings.dungeonTypes, "Types", false);
this.createSettingsBlock(dungDiv, dungRandomDesc, this.plugin.settings.dungeonSettings.randomDesc, "Descriptors", false);
this.createSettingsBlock(dungDiv, dungAdjectives, this.plugin.settings.dungeonSettings.adjectives, "Adjectives");
this.createSettingsBlock(dungDiv, dungNouns, this.plugin.settings.groupSettings.nouns, "Nouns");
this.createSettingsBlock(dungDiv, dungLocations, this.plugin.settings.dungeonSettings.locations, "Locations");
this.createSettingsBlock(dungDiv, dungTypes, this.plugin.settings.dungeonSettings.dungeonTypes, "Types");
this.createSettingsBlock(dungDiv, dungRandomDesc, this.plugin.settings.dungeonSettings.randomDesc, "Descriptors");
}
}

View file

@ -1,15 +1,4 @@
.theme-light .OFCGDetails {
border: 1px solid #ccc;
box-shadow: 0px 12px 0px 0px rgba(255, 255, 255, 0.37);
background-color: #f0f0f0;
}
.theme-light .OFCGDetails[open] summary {
border-bottom: 1px solid #666;
margin-bottom: 0.5em;
}
.theme-dark .OFCGDetails {
.OFCGDetails {
border: 1px solid #272727;
box-shadow: 0px 12px 0px 0px rgba(0, 0, 0, 0.37);
background-color: #313131;
@ -27,7 +16,7 @@
padding: 0.5em;
}
.theme-dark .OFCGDetails[open] summary {
.OFCGDetails[open] summary {
border-bottom: 1px solid #aaa;
margin-bottom: 0.5em;
}

View file

@ -1,5 +1,3 @@
{
"1.2.3": "0.15.0",
"1.2.2": "0.15.0",
"1.2.4": "0.15.0"
"1.2.1": "0.15.0"
}