Options
All
  • Public
  • Public/Protected
  • All
Menu

eigengraus-essential-establishment-generator

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AgeName

AgeName: "elderly" | "settled adult" | "young adult" | "child"

Alignments

Alignments: "Lawful Good" | "Neutral Good" | "Chaotic Good" | "Lawful Neutral" | "Neutral" | "Chaotic Neutral" | "Lawful Evil" | "Chaotic Evil" | "Neutral Evil"

AlignmentsAbbreviated

AlignmentsAbbreviated: "LG" | "NG" | "CG" | "LN" | "N" | "CN" | "CE" | "NE" | "LE"

BackgroundName

BackgroundName: "acolyte" | "criminal" | "folk hero" | "noble" | "sage" | "soldier" | "charlatan" | "entertainer" | "guild artisan" | "gladiator" | "hermit" | "knight" | "outlander" | "pirate" | "sailor" | "urchin" | "commoner" | "merchant" | "child" | "peasant"

Biome

Biome: "temperate" | "tropical" | "arid" | "polar"

ClassName

ClassName: "barbarian" | "bard" | "cleric" | "druid" | "fighter" | "monk" | "paladin" | "ranger" | "rogue" | "sorcerer" | "warlock" | "wizard"

ClericDomains

ClericDomains: "arcana" | "death" | "forge" | "grave" | "knowledge" | "life" | "light" | "nature" | "order" | "peace" | "tempest" | "trickery" | "twilight" | "war"

CurrencyAbbreviated

CurrencyAbbreviated: "cp" | "sp" | "gp" | "ep" | "pp"

CurrencyFull

CurrencyFull: "copper" | "silver" | "gold" | "electrum" | "platinum"

DeepReadonly

DeepReadonly<T>: T extends ReadonlyPrimitive ? T : T extends infer U[] ? ReadonlyArray<DeepReadonly<U>> : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer M> ? ReadonlySet<DeepReadonly<M>> : Readonly<T>

Type parameters

  • T

DeityStatus

DeityStatus: "alive" | "imprisoned" | "dormant" | "dead" | "uncertain"

EconomicIdeology

EconomicIdeology: "feudalism" | "capitalism" | "syndicalism" | "communism" | "primitivism"

EconomicIdeologyIST

EconomicIdeologyIST: keyof typeof economicPairs

FactionResource

FactionResource: keyof typeof factionData.resources.types

FactionType

FactionType: keyof typeof factionData.types

FifthEditionAbbr

FifthEditionAbbr: "AcInc" | "DMG" | "EGtW" | "ERLW" | "EEPC" | "GGtR" | "RotF" | "LR" | "MM" | "MOoT" | "MToF" | "OGA" | "PHB" | "SCAG" | "TCoE" | "VGtM" | "WGtE" | "XGtE"

GenderName

GenderName: "man" | "woman"

KeysMatching

KeysMatching<T, V>: {[ K in keyof T]: T[K] extends V ? K : never }[keyof T]

Returns the keys from T whose property types match the type V.

Type parameters

  • T

  • V

LifestyleStandardName

LifestyleStandardName: "aristocratic" | "wealthy" | "comfortable" | "modest" | "poor" | "squalid" | "wretched"

MaterialTypes

MaterialTypes: keyof typeof types

PantheonTypes

PantheonTypes: "greek" | "norse"

PartialRecord

PartialRecord<T, V>: Partial<Record<T, V>>

Type parameters

  • T: string | number

  • V

PoliticalIdeology

PoliticalIdeology: "autocracy" | "meritocracy" | "democracy" | "kleptocracy" | "magocracy" | "militocracy" | "oligarchy" | "sophocracy" | "theocracy" | "technocracy"

PoliticalIdeologyIC

PoliticalIdeologyIC: keyof typeof politicalIdeologyPairs

PoliticalSource

PoliticalSource: keyof typeof townData.politicalSource

ProfessionNames

ProfessionNames: keyof typeof professions

ProfessionSector

ProfessionSector: "family" | "adventuring" | "agriculture" | "government and law" | "science" | "craftsmanship" | "hospitality" | "mining" | "construction" | "arts" | "business" | "communication" | "transportation" | "religion" | "magic" | "military" | "crime" | "communications" | "outcast" | "unemployed" | "self employed" | "caregiver" | "naval"

ProfessionType

ProfessionType: "" | "family" | "dndClass" | "labourer" | "recreation" | "profession" | "business"

RaceName

RaceName: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc"

ReligionStrength

ReligionStrength: "fanatical true believer" | "unshakingly devoted believer" | "conspicuously faithful believer" | "outspoken believer" | "quiet true believer" | "casual observer" | "open-minded seeker" | "cautious listener" | "critical student" | "outspoken cynic" | "broken heretic"

RoadMaterialType

RoadMaterialType: "dirt" | "gravel" | "pavement" | "brick"

RoadType

RoadType: "street" | "lane" | "road" | "square" | "way" | "crescent" | "close" | "wynd" | "row" | "dyke" | "avenue" | "alley" | "drive" | "boulevard" | "plaza" | "track" | "trail"

RollArray

RollArray: [number, ...unknown[]][]

RollData

RollData<T>: {readonly [ P in keyof T["roll"]]?: RollArray }

Type parameters

  • T: Rolled

Seasons

Seasons: "spring" | "summer" | "autumn" | "winter"

SocialClassName

SocialClassName: "indentured servitude" | "paupery" | "peasantry" | "commoner" | "nobility" | "aristocracy"

SystemType

SystemType: "5e" | "Pathfinder" | "Pathfinder 2e" | "Dungeon World" | "GURPS"

ThresholdTable

ThresholdTable<T>: [number, T][]

Type parameters

  • T = string

TownType

TownType: "hamlet" | "village" | "town" | "city"

Vices

Vices: keyof typeof traits["viceKey"]

Virtues

Virtues: keyof typeof traits["virtueKey"]

VirtuesVices

VirtuesVices: Virtues | Vices

WeightRecord

WeightRecord<T>: {[ P in T]: number }

Each value represents the weight of its key

Type parameters

  • T: string

WizardSchools

WizardSchools: "Bladesinging" | "Chronurgy" | "Graviturgy" | "Order of the Scribes" | "School of Abjuration" | "School of Conjuration" | "School of Divination" | "School of Enchantment" | "School of Evocation" | "School of Illusion" | "School of Necromancy" | "School of Transmutation" | "War Magic"

WorldType

WorldType: "earth" | "fr" | "gn"

For specifying the origin of material.

  • 'earth' - for specifying things like June 12, etc.

  • 'fr': Forgotten Realms - DnD specific content.

  • 'pf': Pathfinder specific content.

Variables

Const ClericDomain

ClericDomain: Record<ClericDomains, FifthEditionBookInfo> = ...

Const WizardSchool

WizardSchool: Record<WizardSchools, FifthEditionBookInfo> = ...

Const alchemistData

alchemistData: AlchemistData = ...

Const articles

articles: { find: (word: string) => undefined | string; output: (word: string, upper?: boolean) => string; override: (article: string, word: string, caseSensitive?: boolean) => undefined | "cannot add article override -> invalid word" | "cannot add article override -> invalid article, must be \"a\" or \"an\"" } = ...

Type declaration

  • find: (word: string) => undefined | string
      • (word: string): undefined | string
      • Parameters

        • word: string

        Returns undefined | string

  • output: (word: string, upper?: boolean) => string
      • (word: string, upper?: boolean): string
      • Parameters

        • word: string
        • Optional upper: boolean

        Returns string

  • override: (article: string, word: string, caseSensitive?: boolean) => undefined | "cannot add article override -> invalid word" | "cannot add article override -> invalid article, must be \"a\" or \"an\""
      • (article: string, word: string, caseSensitive?: boolean): undefined | "cannot add article override -> invalid word" | "cannot add article override -> invalid article, must be \"a\" or \"an\""
      • Must be called in story JS or StoryInit, as the override map isn't stateful.

        Parameters

        • article: string
        • word: string
        • Optional caseSensitive: boolean

        Returns undefined | "cannot add article override -> invalid word" | "cannot add article override -> invalid article, must be \"a\" or \"an\""

Const backgroundTraits

backgroundTraits: Record<BackgroundName, BackgroundTrait> = ...

Const bandits

bandits: ConstructUtils<Bandits> = ...

Const bodyParts

bodyParts: { arms: { descriptions: string[] }; head: { chin: string[]; ears: string[]; eyes: string[]; hair: string[]; misc: string[]; mouth: string[]; nose: string[] }; legs: { descriptions: string[] }; torso: { descriptions: string[] } } = ...

Type declaration

  • arms: { descriptions: string[] }
    • descriptions: string[]
  • head: { chin: string[]; ears: string[]; eyes: string[]; hair: string[]; misc: string[]; mouth: string[]; nose: string[] }
    • chin: string[]
    • ears: string[]
    • eyes: string[]
    • hair: string[]
    • misc: string[]
    • mouth: string[]
    • nose: string[]
  • legs: { descriptions: string[] }
    • descriptions: string[]
  • torso: { descriptions: string[] }
    • descriptions: string[]

Const books

books: Books = ...

Const bunny

bunny: ConstructUtils<Bunny> = ...

Const cabin

cabin: ConstructUtils<Cabin> = ...

Const cat

cat: ConstructUtils<Cat> = ...

Const cavern

cavern: ConstructUtils<Cavern> = ...

Const cheese

cheese: ConstructUtils<Cheese> = ...

Const classTraits

classTraits: Record<ClassName, ClassTraits> = ...

Const colours

colours: Record<ColourName, ColourData> = ...

Const economicPairs

economicPairs: Readonly<{ capitalist: "capitalism"; communist: "communism"; feudalist: "feudalism"; primitivist: "primitivism"; syndicalist: "syndicalism" }> = ...

Const factionData

factionData: FactionData = ...

Const factionSliders

factionSliders: Record<"influence" | "reputation" | "age" | "size" | "stability" | "resources" | "joiningFee" | "leaderBribes" | "leaderCompetence", FactionSlider> = ...

Const familyRelationships

familyRelationships: { inverse: (npc: NPC, key: string) => string; nouns: Record<string, string>; verbose: (key: string) => string } = ...

Type declaration

  • inverse: (npc: NPC, key: string) => string
      • (npc: NPC, key: string): string
      • Parameters

        • npc: NPC
        • key: string

        Returns string

  • nouns: Record<string, string>
  • verbose: (key: string) => string
      • (key: string): string
      • Parameters

        • key: string

        Returns string

Const flora

flora: { flower: { bush: string[]; stemP: string[]; stemS: string[] }; fruit: { fruitP: string[]; fruitS: string[]; tree: string[] }; tree: { typeArticle: string[]; typeS: string[] }; vegetable: { vegetableP: string[]; vegetableS: string[] } } = ...

Type declaration

  • flower: { bush: string[]; stemP: string[]; stemS: string[] }
    • bush: string[]
    • stemP: string[]
    • stemS: string[]
  • fruit: { fruitP: string[]; fruitS: string[]; tree: string[] }
    • fruitP: string[]
    • fruitS: string[]
    • tree: string[]
  • tree: { typeArticle: string[]; typeS: string[] }
    • typeArticle: string[]
    • typeS: string[]
  • vegetable: { vegetableP: string[]; vegetableS: string[] }
    • vegetableP: string[]
    • vegetableS: string[]

Const genderData

genderData: { man: { boygirl: "boy"; childNoun: "son"; domTitle: "Master"; godgoddess: "god"; guygirl: "guy"; heshe: "he"; himher: "him"; himherself: "himself"; hisher: "his"; hisherself: "hisself"; malefemale: "male"; manwoman: "man"; marriageNoun: "husband"; menwomen: "men"; niblingNoun: "nephew"; niblingReciprocalNoun: "uncle"; oppositeGender: "woman"; parentNoun: "father"; siblingNoun: "brother"; title: "Mr" }; woman: { boygirl: "girl"; childNoun: "daughter"; domTitle: "Mistress"; godgoddess: "goddess"; guygirl: "girl"; heshe: "she"; himher: "her"; himherself: "herself"; hisher: "her"; hisherself: "herself"; malefemale: "female"; manwoman: "woman"; marriageNoun: "wife"; menwomen: "women"; niblingNoun: "niece"; niblingReciprocalNoun: "aunt"; oppositeGender: "man"; parentNoun: "mother"; siblingNoun: "sister"; title: "Ms" } } = ...

Type declaration

  • man: { boygirl: "boy"; childNoun: "son"; domTitle: "Master"; godgoddess: "god"; guygirl: "guy"; heshe: "he"; himher: "him"; himherself: "himself"; hisher: "his"; hisherself: "hisself"; malefemale: "male"; manwoman: "man"; marriageNoun: "husband"; menwomen: "men"; niblingNoun: "nephew"; niblingReciprocalNoun: "uncle"; oppositeGender: "woman"; parentNoun: "father"; siblingNoun: "brother"; title: "Mr" }
    • boygirl: "boy"
    • childNoun: "son"
    • domTitle: "Master"
    • godgoddess: "god"
    • guygirl: "guy"
    • heshe: "he"
    • himher: "him"
    • himherself: "himself"
    • hisher: "his"
    • hisherself: "hisself"
    • malefemale: "male"
    • manwoman: "man"
    • marriageNoun: "husband"
    • menwomen: "men"
    • niblingNoun: "nephew"
    • niblingReciprocalNoun: "uncle"
    • oppositeGender: "woman"
    • parentNoun: "father"
    • siblingNoun: "brother"
    • title: "Mr"
  • woman: { boygirl: "girl"; childNoun: "daughter"; domTitle: "Mistress"; godgoddess: "goddess"; guygirl: "girl"; heshe: "she"; himher: "her"; himherself: "herself"; hisher: "her"; hisherself: "herself"; malefemale: "female"; manwoman: "woman"; marriageNoun: "wife"; menwomen: "women"; niblingNoun: "niece"; niblingReciprocalNoun: "aunt"; oppositeGender: "man"; parentNoun: "mother"; siblingNoun: "sister"; title: "Ms" }
    • boygirl: "girl"
    • childNoun: "daughter"
    • domTitle: "Mistress"
    • godgoddess: "goddess"
    • guygirl: "girl"
    • heshe: "she"
    • himher: "her"
    • himherself: "herself"
    • hisher: "her"
    • hisherself: "herself"
    • malefemale: "female"
    • manwoman: "woman"
    • marriageNoun: "wife"
    • menwomen: "women"
    • niblingNoun: "niece"
    • niblingReciprocalNoun: "aunt"
    • oppositeGender: "man"
    • parentNoun: "mother"
    • siblingNoun: "sister"
    • title: "Ms"

Const generalStore

generalStore: { crud: string[]; get: { customers: ({ base: undefined; relationshipDescription: string; relationships: { associatedNPC: { reciprocalRelationship: string; relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any } | { base: { profession: string }; relationshipDescription: string; relationships: { associatedNPC: { reciprocalRelationship: string; relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any })[]; note: any; priceTalk: any; say: any; shopkeepNote: any }; goods: { cleaning supplies: string[]; fabrics: string[]; food staples: string[]; luxuries: string[]; tools: string[] }; idle: string[]; rollData: { activity: { description: string; hasRolls: boolean; preceding: string }; cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }; expertise: { description: string; isHidden: boolean; preceding: string; rolls: ThresholdTable<string> }; magic: { description: string; hasRolls: boolean; preceding: string }; priceModifier: { description: string; hasRolls: boolean; preceding: string }; reputation: { description: string; hasRolls: boolean; preceding: string }; size: { description: string; preceding: string; rolls: ThresholdTable<string> }; wealth: { description: string; preceding: string; rolls: ThresholdTable<string> } } } = ...

Type declaration

  • crud: string[]
  • get: { customers: ({ base: undefined; relationshipDescription: string; relationships: { associatedNPC: { reciprocalRelationship: string; relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any } | { base: { profession: string }; relationshipDescription: string; relationships: { associatedNPC: { reciprocalRelationship: string; relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any })[]; note: any; priceTalk: any; say: any; shopkeepNote: any }
  • goods: { cleaning supplies: string[]; fabrics: string[]; food staples: string[]; luxuries: string[]; tools: string[] }
    • cleaning supplies: string[]
    • fabrics: string[]
    • food staples: string[]
    • luxuries: string[]
    • tools: string[]
  • idle: string[]
  • rollData: { activity: { description: string; hasRolls: boolean; preceding: string }; cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }; expertise: { description: string; isHidden: boolean; preceding: string; rolls: ThresholdTable<string> }; magic: { description: string; hasRolls: boolean; preceding: string }; priceModifier: { description: string; hasRolls: boolean; preceding: string }; reputation: { description: string; hasRolls: boolean; preceding: string }; size: { description: string; preceding: string; rolls: ThresholdTable<string> }; wealth: { description: string; preceding: string; rolls: ThresholdTable<string> } }
    • activity: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }
    • expertise: { description: string; isHidden: boolean; preceding: string; rolls: ThresholdTable<string> }
      • description: string
      • isHidden: boolean
      • preceding: string
      • rolls: ThresholdTable<string>
    • magic: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • priceModifier: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • reputation: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • size: { description: string; preceding: string; rolls: ThresholdTable<string> }
    • wealth: { description: string; preceding: string; rolls: ThresholdTable<string> }

Const ghost

ghost: ConstructUtils<Ghost> = ...

Const goblin

goblin: ConstructUtils<Goblin> = ...

Const goblins

goblins: ConstructUtils<Goblins> = ...

Const guardhouseData

guardhouseData: { evidenceLocker: { items: { function: any }[] }; get: { customers: ({ base: { profession: string; professionSector: undefined }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any } | { base: { profession: undefined; professionSector: string }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any })[]; event: (town: Town, guardhouse: Guardhouse) => { function: any }[]; holdingCell: { base?: undefined | Partial<NPC>; reason: string }[]; officeDescription: (guardhouse: Guardhouse) => { description: string; size: number; wealth: number }[]; officeItems: string[] }; name: { adjective: string[]; wordNoun: string[] }; notableFeature: { exclusions?: any; function: any }[]; rollData: { activity: { description: string; hasRolls: boolean; preceding: string }; cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }; expertise: { description: string; preceding: string; rolls: ThresholdTable<string> }; magic: { description: string; hasRolls: boolean; preceding: string }; reputation: { description: string; hasRolls: boolean; preceding: string }; size: { description: string; preceding: string; rolls: ThresholdTable<string> }; wealth: { description: string; preceding: string; rolls: ThresholdTable<string> } } } = ...

Type declaration

  • evidenceLocker: { items: { function: any }[] }
    • items: { function: any }[]
  • get: { customers: ({ base: { profession: string; professionSector: undefined }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any } | { base: { profession: undefined; professionSector: string }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any })[]; event: (town: Town, guardhouse: Guardhouse) => { function: any }[]; holdingCell: { base?: undefined | Partial<NPC>; reason: string }[]; officeDescription: (guardhouse: Guardhouse) => { description: string; size: number; wealth: number }[]; officeItems: string[] }
    • customers: ({ base: { profession: string; professionSector: undefined }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any } | { base: { profession: undefined; professionSector: string }; relationshipDescription: string; relationships: { associatedNPC: { relationship: string }; building: { reciprocalRelationship: string; relationship: string } }; description: any })[]
    • event: (town: Town, guardhouse: Guardhouse) => { function: any }[]
        • example

          `At the moment, ______

          Parameters

          Returns { function: any }[]

    • holdingCell: { base?: undefined | Partial<NPC>; reason: string }[]
    • officeDescription: (guardhouse: Guardhouse) => { description: string; size: number; wealth: number }[]
        • (guardhouse: Guardhouse): { description: string; size: number; wealth: number }[]
        • Parameters

          Returns { description: string; size: number; wealth: number }[]

    • officeItems: string[]
  • name: { adjective: string[]; wordNoun: string[] }
    • adjective: string[]
    • wordNoun: string[]
  • notableFeature: { exclusions?: any; function: any }[]
  • rollData: { activity: { description: string; hasRolls: boolean; preceding: string }; cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }; expertise: { description: string; preceding: string; rolls: ThresholdTable<string> }; magic: { description: string; hasRolls: boolean; preceding: string }; reputation: { description: string; hasRolls: boolean; preceding: string }; size: { description: string; preceding: string; rolls: ThresholdTable<string> }; wealth: { description: string; preceding: string; rolls: ThresholdTable<string> } }
    • activity: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • cleanliness: { description: string; preceding: string; rolls: ThresholdTable<string> }
    • expertise: { description: string; preceding: string; rolls: ThresholdTable<string> }
    • magic: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • reputation: { description: string; hasRolls: boolean; preceding: string }
      • description: string
      • hasRolls: boolean
      • preceding: string
    • size: { description: string; preceding: string; rolls: ThresholdTable<string> }
    • wealth: { description: string; preceding: string; rolls: ThresholdTable<string> }

Const horse

horse: ConstructUtils<Horse> = ...

Const inventory

inventory: (FoodItem | MiscItem)[] = ...

Const lifestyleStandards

lifestyleStandards: Record<LifestyleStandardName, LifestyleStandard> = ...

Const market

market: MarketData = ...

Const marriagePools

marriagePools: Record<RaceName, RaceName[]> = ...

Const matchFirst

matchFirst: { equalTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T; largerThan: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T; largerThanOrEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T; notEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T; smallerThan: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T; smallerThanOrEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T } = ...

Type declaration

  • equalTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

  • largerThan: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

  • largerThanOrEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

  • notEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

  • smallerThan: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

  • smallerThanOrEqualTo: <T>(value: number, map: Record<number, T>, defaultValue?: T) => undefined | T
      • <T>(value: number, map: Record<number, T>, defaultValue?: T): undefined | T
      • Type parameters

        • T

        Parameters

        • value: number
        • map: Record<number, T>
        • Optional defaultValue: T

        Returns undefined | T

Const medal

medal: { create: (base?: Partial<Medal>) => Medal } = ...

Type declaration

  • create: (base?: Partial<Medal>) => Medal
      • (base?: Partial<Medal>): Medal
      • Parameters

        • Optional base: Partial<Medal>

        Returns Medal

Const newspaper

newspaper: string[] = ...

Contains a variety of newspaper headlines.

Const ogre

ogre: ConstructUtils<Ogre> = ...

Const orcs

orcs: ConstructUtils<Orcs> = ...

Const pastry

pastry: ConstructUtils<Pastry> = ...

Const patreonCharacters

patreonCharacters: { Brugo Gul'Moth: { age: string; ageYears: number; background: string; backgroundOrigin: string; beard: string; calmTrait: string; eyes: string; familyUnit: string; firstName: string; gender: string; hairColour: string; hairType: string; hasClass: boolean; height: string; heightInches: number; idle: string[]; inventory: string; isThrowaway: boolean; lastName: string; name: string; note: string; parentalLineage: string; physicalTrait: string; profession: string; professionOrigin: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string; weightPounds: number }; Galder Fendt: { age: string; ageYears: number; background: string; beard: string; calmTrait: string; eyes: string; firstName: string; gender: string; hairColour: string; hasClass: boolean; height: string; heightInches: number; idle: never[]; isThrowaway: boolean; lastName: string; name: string; note: string; physicalTrait: string; profession: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string }; Tylien Birchbottom: { age: string; ageYears: number; background: string; backgroundOrigin: string; calmTrait: string; firstName: string; gender: string; greeting: string[]; hairColour: string; hairType: string; hasClass: boolean; height: string; heightInches: number; idle: string[]; isThrowaway: boolean; lastName: string; note: string; owner: string; physicalTrait: string; profession: string; professionOrigin: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string } } = ...

Type declaration

  • Brugo Gul'Moth: { age: string; ageYears: number; background: string; backgroundOrigin: string; beard: string; calmTrait: string; eyes: string; familyUnit: string; firstName: string; gender: string; hairColour: string; hairType: string; hasClass: boolean; height: string; heightInches: number; idle: string[]; inventory: string; isThrowaway: boolean; lastName: string; name: string; note: string; parentalLineage: string; physicalTrait: string; profession: string; professionOrigin: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string; weightPounds: number }
    • age: string
    • ageYears: number
    • background: string
    • backgroundOrigin: string
    • beard: string
    • calmTrait: string
    • eyes: string
    • familyUnit: string
    • firstName: string
    • gender: string
    • hairColour: string
    • hairType: string
    • hasClass: boolean
    • height: string
    • heightInches: number
    • idle: string[]
    • inventory: string
    • isThrowaway: boolean
    • lastName: string
    • name: string
    • note: string
    • parentalLineage: string
    • physicalTrait: string
    • profession: string
    • professionOrigin: string
    • race: string
    • scar: string
    • stressTrait: string
    • trait: string
    • vocalPattern: string
    • weight: string
    • weightPounds: number
  • Galder Fendt: { age: string; ageYears: number; background: string; beard: string; calmTrait: string; eyes: string; firstName: string; gender: string; hairColour: string; hasClass: boolean; height: string; heightInches: number; idle: never[]; isThrowaway: boolean; lastName: string; name: string; note: string; physicalTrait: string; profession: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string }
    • age: string
    • ageYears: number
    • background: string
    • beard: string
    • calmTrait: string
    • eyes: string
    • firstName: string
    • gender: string
    • hairColour: string
    • hasClass: boolean
    • height: string
    • heightInches: number
    • idle: never[]
    • isThrowaway: boolean
    • lastName: string
    • name: string
    • note: string
    • physicalTrait: string
    • profession: string
    • race: string
    • scar: string
    • stressTrait: string
    • trait: string
    • vocalPattern: string
    • weight: string
  • Tylien Birchbottom: { age: string; ageYears: number; background: string; backgroundOrigin: string; calmTrait: string; firstName: string; gender: string; greeting: string[]; hairColour: string; hairType: string; hasClass: boolean; height: string; heightInches: number; idle: string[]; isThrowaway: boolean; lastName: string; note: string; owner: string; physicalTrait: string; profession: string; professionOrigin: string; race: string; scar: string; stressTrait: string; trait: string; vocalPattern: string; weight: string }
    • age: string
    • ageYears: number
    • background: string
    • backgroundOrigin: string
    • calmTrait: string
    • firstName: string
    • gender: string
    • greeting: string[]
    • hairColour: string
    • hairType: string
    • hasClass: boolean
    • height: string
    • heightInches: number
    • idle: string[]
    • isThrowaway: boolean
    • lastName: string
    • note: string
    • owner: string
    • physicalTrait: string
    • profession: string
    • professionOrigin: string
    • race: string
    • scar: string
    • stressTrait: string
    • trait: string
    • vocalPattern: string
    • weight: string

Const personalityTraits

personalityTraits: Record<string, Traits> = ...

Const politicalIdeologyPairs

politicalIdeologyPairs: Readonly<{ autocratic: "autocracy"; democratic: "democracy"; kleptocratic: "kleptocracy"; magocratic: "magocracy"; meritocratic: "meritocracy"; militocratic: "militocracy"; oligarchic: "oligarchy"; sophocratic: "sophocracy"; technocratic: "technocracy"; theocratic: "theocracy" }> = ...

Const professionTraits

professionTraits: Record<"merchant" | "blacksmith" | "bartender" | "politician", ProfessionTraits> = ...

Const professions

professions: Record<string, Profession> = ...

Const raceTraits

raceTraits: Record<RaceName, RaceTrait> = ...

Const religion

religion: ReligionData = ...

Const roads

roads: { assign: (town: Town, building?: Building) => Road; create: (town: Town, opts?: Partial<Road>) => Road; features: string[]; get: { features: any }; material: { types: Record<RoadMaterialType, RoadMaterial>; exclusions: any; get: any }; name: { type: Record<RoadType, RoadData>; create: any }; namesakes: { reason: any }; precedingText: { default: any; isTheRoad: any }; width: { capacity: number[][]; largeRoads: string[]; rolls: ThresholdTable<string>; getCapacity: any } } = ...

Type declaration

Const socialClass

socialClass: Record<string, SocialClass> = ...

Const spider

spider: ConstructUtils<Spider> = ...

Const structureData

structureData: { colour: string[]; material: { rollData: { wealth: { rolls: ThresholdTable<string> } }; types: Record<string, MaterialType> }; rollData: { size: { rolls: ThresholdTable<string> } }; roof: { colour: string[]; rollData: { wealth: { rolls: ThresholdTable<string> } }; types: Record<string, RoofType> } } = ...

Type declaration

Const terrain

terrain: Record<Biome, TerrainData> = ...

Const townData

townData: TownData = ...

Const traitDescriptions

traitDescriptions: Record<Virtues, ThresholdTable<string>> = ...
usage

'is _____'

Const traits

traits: { viceKey: { arbitrary: string; cowardly: string; cruel: string; deceitful: string; indulgent: string; lazy: string; lustful: string; proud: string; reckless: string; selfish: string; suspicious: string; vengeful: string; worldly: string }; virtueKey: { chaste: string; energetic: string; forgiving: string; generous: string; honest: string; just: string; merciful: string; modest: string; pious: string; prudent: string; temperate: string; trusting: string; valorous: string } } = ...

Type declaration

  • viceKey: { arbitrary: string; cowardly: string; cruel: string; deceitful: string; indulgent: string; lazy: string; lustful: string; proud: string; reckless: string; selfish: string; suspicious: string; vengeful: string; worldly: string }
    • arbitrary: string
    • cowardly: string
    • cruel: string
    • deceitful: string
    • indulgent: string
    • lazy: string
    • lustful: string
    • proud: string
    • reckless: string
    • selfish: string
    • suspicious: string
    • vengeful: string
    • worldly: string
  • virtueKey: { chaste: string; energetic: string; forgiving: string; generous: string; honest: string; just: string; merciful: string; modest: string; pious: string; prudent: string; temperate: string; trusting: string; valorous: string }
    • chaste: string
    • energetic: string
    • forgiving: string
    • generous: string
    • honest: string
    • just: string
    • merciful: string
    • modest: string
    • pious: string
    • prudent: string
    • temperate: string
    • trusting: string
    • valorous: string

Const treasureMap

treasureMap: { create: (base?: Partial<TreasureMap>) => TreasureMap } = ...

Type declaration

  • create: (base?: Partial<TreasureMap>) => TreasureMap
      • (base?: Partial<TreasureMap>): TreasureMap
      • Parameters

        • Optional base: Partial<TreasureMap>

        Returns TreasureMap

Const tree

tree: ConstructUtils<Tree> = ...

Const urlData

urlData: UrlData = ...

Const weather

weather: { cloudIntensityDescriptors: { extremely overcast: string[]; heavy clouds: string[]; light clouds: string[]; medium clouds: string[]; none: string[]; overcast: string[]; thick clouds: string[] }; precipitationDescriptors: { drizzle: string[]; heavy fog: string[]; heavy rain: string[]; heavy snow: string[]; light fog: string[]; light rain: string[]; light snow: string[]; medium fog: string[]; medium snow: string[]; no precipitation: string[]; rain: string[]; thunderstorm: string[] }; precipitationIntensity: { 1: { cloud: any; freezing: any; raining: any }; 2: { cloud: any; freezing: any; raining: any }; 3: { cloud: any; freezing: any; raining: any }; 4: { cloud: any; freezing: any; raining: any } }; precipitationLevel: { 1: (weather: Weather) => boolean; 2: (weather: Weather) => boolean; 3: (weather: Weather) => boolean; 4: (weather: Weather) => boolean; 5: (weather: Weather) => boolean }; temperatureDescriptors: ThresholdTable<string> } = ...

Type declaration

  • cloudIntensityDescriptors: { extremely overcast: string[]; heavy clouds: string[]; light clouds: string[]; medium clouds: string[]; none: string[]; overcast: string[]; thick clouds: string[] }
    • extremely overcast: string[]
    • heavy clouds: string[]
    • light clouds: string[]
    • medium clouds: string[]
    • none: string[]
    • overcast: string[]
    • thick clouds: string[]
  • precipitationDescriptors: { drizzle: string[]; heavy fog: string[]; heavy rain: string[]; heavy snow: string[]; light fog: string[]; light rain: string[]; light snow: string[]; medium fog: string[]; medium snow: string[]; no precipitation: string[]; rain: string[]; thunderstorm: string[] }
    • drizzle: string[]
    • heavy fog: string[]
    • heavy rain: string[]
    • heavy snow: string[]
    • light fog: string[]
    • light rain: string[]
    • light snow: string[]
    • medium fog: string[]
    • medium snow: string[]
    • no precipitation: string[]
    • rain: string[]
    • thunderstorm: string[]
  • precipitationIntensity: { 1: { cloud: any; freezing: any; raining: any }; 2: { cloud: any; freezing: any; raining: any }; 3: { cloud: any; freezing: any; raining: any }; 4: { cloud: any; freezing: any; raining: any } }
  • precipitationLevel: { 1: (weather: Weather) => boolean; 2: (weather: Weather) => boolean; 3: (weather: Weather) => boolean; 4: (weather: Weather) => boolean; 5: (weather: Weather) => boolean }
    • 1: (weather: Weather) => boolean
        • Parameters

          Returns boolean

    • 2: (weather: Weather) => boolean
        • Parameters

          Returns boolean

    • 3: (weather: Weather) => boolean
        • Parameters

          Returns boolean

    • 4: (weather: Weather) => boolean
        • Parameters

          Returns boolean

    • 5: (weather: Weather) => boolean
        • Parameters

          Returns boolean

  • temperatureDescriptors: ThresholdTable<string>

Const wolf

wolf: ConstructUtils<Wolf> = ...

Functions

addTippyAccessibility

  • addTippyAccessibility(): void

alchemistModifiers

  • alchemistModifiers(alchemist: Alchemist): void

Const applyFMtoTrait

assert

  • assert(condition: boolean, message?: string): asserts condition

assign

  • assign<T, S>(target: T, source: S): asserts target is T & S
  • An alternative to Object.assign, which asserts that the properties are added to the type.

    example

    const obj = { a: 0, b: 1} assign(obj, { c: 2 }) // Typescript now knows that c is available.

    Type parameters

    • T

    • S

    Parameters

    • target: T
    • source: S

    Returns asserts target is T & S

assignFunctionalGenderRoll

  • assignFunctionalGenderRoll(town: Town, npc: NPC): number
  • description

    We assign a roll for the gender, but need to ensure that manually assigned genders that are passed as an argument don't have a conflicting roll.

    Parameters

    Returns number

breakGenderNorms

  • breakGenderNorms(town: Town): boolean

calcPercentage

  • calcPercentage(target: number, integer: number | number[]): number

capitalizeFirstLetter

  • capitalizeFirstLetter(text: string): string

clamp

  • clamp(value: number, min?: number, max?: number): number
  • Parameters

    • value: number
    • Optional min: number
    • Optional max: number

    Returns number

clampRolls

  • clampRolls(rolls: Record<string, number>): void
  • Clamps every value presented to the 1-100 range. Most useful for rolls.

    Parameters

    • rolls: Record<string, number>

    Returns void

closestMatch

  • closestMatch<T, R, K1, K2>(array: T[], readout: R, key1: K1, key2: K2, val1: T[K1], val2: T[K2]): T[R]
  • example

    closestMatch(lib.alchemistData.get.priceTalk($building), "priceTalk", "priceModifier", "wealth", $building.priceModifier, $building.roll.wealth)

    Type parameters

    • T: Record<R, string> & Record<K1 | K2, number>

    • R: string | number | symbol

    • K1: string | number | symbol

    • K2: string | number | symbol

    Parameters

    • array: T[]

      The array of objects

    • readout: R

      The key for the readout text

    • key1: K1

      Key for first value

    • key2: K2

      Key for second value

    • val1: T[K1]

      Location of first roll

    • val2: T[K2]

      Location of second roll

    Returns T[R]

contentsFetcher

  • contentsFetcher<T>(keyTarget: T | T[], contentsTarget: Encounter<T>[]): (_: Town, biome?: string) => string
  • This is the function used to handle random encounters. It needs a lot of work, and will change.

    Type parameters

    • T: string

    Parameters

    • keyTarget: T | T[]
    • contentsTarget: Encounter<T>[]

    Returns (_: Town, biome?: string) => string

      • (_: Town, biome?: string): string
      • Parameters

        • _: Town
        • Optional biome: string

        Returns string

createAlchemistName

  • createAlchemistName(chemistFirstName: string): string

createAlchemy

  • createAlchemy(base?: Base): ({ type: string } & Base & { liquidColour: string; liquidSecondary: string; liquidTexture: string; liquidTitle: string; potionContainer: string; potionEffect: string; potionLabel: string; potionSideEffect: string; potionStrength: string; potionTitle: string; potionTitleRoll: number; smell: string; taste: string } & { descriptionReadout: string; titleReadout: string } & { effectReadout: string }) | { preservationMethod: string; smallThing: string; type: string } | { bodyPart: string; bodyPartOrigin: string; preservationMethod: string; type: string } | { substanceForm: string; substanceType: string; type: string } | { herb: string; herbPreservation: string; readout: string; type: string } | { containerDescription: string; liquidColour: string; liquidDescription: string; liquidSecondary: string; liquidTexture: string; potionPurpose: string; type: string; vesselDescriptor: string; vesselMaterial: string; vesselType: string }
  • Parameters

    • Optional base: Base

    Returns ({ type: string } & Base & { liquidColour: string; liquidSecondary: string; liquidTexture: string; liquidTitle: string; potionContainer: string; potionEffect: string; potionLabel: string; potionSideEffect: string; potionStrength: string; potionTitle: string; potionTitleRoll: number; smell: string; taste: string } & { descriptionReadout: string; titleReadout: string } & { effectReadout: string }) | { preservationMethod: string; smallThing: string; type: string } | { bodyPart: string; bodyPartOrigin: string; preservationMethod: string; type: string } | { substanceForm: string; substanceType: string; type: string } | { herb: string; herbPreservation: string; readout: string; type: string } | { containerDescription: string; liquidColour: string; liquidDescription: string; liquidSecondary: string; liquidTexture: string; potionPurpose: string; type: string; vesselDescriptor: string; vesselMaterial: string; vesselType: string }

createAllies

  • createAllies(faction: Faction): void

createAutoTippy

  • createAutoTippy<C>(utils: C, ...args: Parameters<C["create"]>): (word?: string) => string
  • Type parameters

    Parameters

    • utils: C
    • Rest ...args: Parameters<C["create"]>

    Returns (word?: string) => string

      • (word?: string): string
      • Parameters

        • Optional word: string

        Returns string

createBackground

  • createBackground(npc: NPC): void

createBuilding

createBuildingRelationship

  • createBuildingRelationship(town: Town, building: Building, npc: NPC, options: Options): void

createClass

  • createClass(town: Town, npc: NPC): void

createColour

  • createColour(filters?: Filters): string

createDescriptors

  • createDescriptors(npc: NPC): void

createFamily

  • createFamily(town: Town, npc: NPC): void

createFamilyLifestyle

  • createFamilyLifestyle(marriage: Marriage): void

createLeaderGroup

  • createLeaderGroup(faction: Faction): void

createLifestyleStandards

  • createLifestyleStandards(town: Town, npc: NPC): void

createLivery

createMagic

  • createMagic<T>(type: T | "ring"): ({ activation: string; cost: string; power: string } & { cut: string; decoration: string; gemstone: string; importance: string; intendedowner: string; material: string; setting: string; works: string } & { firstOutputs: string; secondOutputs: string }) | ({ prefix: string; prefixProperty: string; suffix: string; suffixProperty: string; type: string } & { description: string; name: string })
  • Type parameters

    • T: "weapon" | "armour" | "trinket"

    Parameters

    • type: T | "ring"

    Returns ({ activation: string; cost: string; power: string } & { cut: string; decoration: string; gemstone: string; importance: string; intendedowner: string; material: string; setting: string; works: string } & { firstOutputs: string; secondOutputs: string }) | ({ prefix: string; prefixProperty: string; suffix: string; suffixProperty: string; type: string } & { description: string; name: string })

createName

  • createName(parameters?: Params): string

createPersonality

  • createPersonality(npc: Partial<NPC>): void

createPubRumour

  • createPubRumour(): string

createReligiosity

  • createReligiosity(town: Town, npc: NPC): void

createRing

  • createRing(base?: Partial<Options>): { activation: string; cost: string; power: string } & { cut: string; decoration: string; gemstone: string; importance: string; intendedowner: string; material: string; setting: string; works: string } & { firstOutputs: string; secondOutputs: string }
  • Parameters

    • Optional base: Partial<Options>

    Returns { activation: string; cost: string; power: string } & { cut: string; decoration: string; gemstone: string; importance: string; intendedowner: string; material: string; setting: string; works: string } & { firstOutputs: string; secondOutputs: string }

createRivals

  • createRivals(faction: Faction): void

createRoad

  • createRoad(): string

createRoleplayQuestion

  • createRoleplayQuestion(): string

createSocialClass

  • createSocialClass(town: Town, npc: NPC): void

createStructure

createTavernName

  • createTavernName(): string

Const createTippy

  • createTippy(readout: string): string
  • To be used when you want to wrap a tippy around something i.e. you know what you're doing

    Note the lack of a closing span.

    Parameters

    • readout: string

    Returns string

Const createTippyFull

  • createTippyFull(readout: string, word: string): string
  • The function that should be used most of the time.

    Parameters

    • readout: string
    • word: string

    Returns string

Const createTippyWord

  • createTippyWord(tippy: string, word: string): string
  • Assumes that the first argument was created using the createTippy function.

    Note the two closing spans to accommodate this.

    Parameters

    • tippy: string
    • word: string

    Returns string

Const createTownReligion

createTrap

  • createTrap(): Trap

cullBuildings

  • cullBuildings(buildingsToCreate: BuildingToCreate[]): Generator<BuildingToCreate, void, unknown>

deepFreeze

defineRollDataGetter

  • defineRollDataGetter<T>(obj: T, rolls: RollArray, propName: keyof T & string, keyName?: keyof T & string, index?: number, rollLocation?: Record<string, number>): void
  • This handles setting up getters and setters for attributes like wealth, cleanliness and such.

    It expects the obj (the one that is getting the attributes), and the rolls (the one that is providing the descriptions).

    It needs the propName to be exact, unless the optional keyName is specified. This is for when you might want to tie several properties to the same attribute, i.e. cleanliness controlling bedleanliness.

    The index is an optional argument, which tells the function to look at a different location in the array for the string. This is most useful for when you have multiple descriptions tied to the same thing (long and short descriptions, or cleanliness controlling bedCleanliness as well.)

    Type parameters

    • T: Rolled & Named

    Parameters

    • obj: T
    • rolls: RollArray
    • propName: keyof T & string
    • keyName: keyof T & string = ...
    • index: number = 1
    • rollLocation: Record<string, number> = ...

    Returns void

Const deityIsWas

Const deityStatus

  • deityStatus(deity: Deity): string

Const deityUsesUsed

deleteBuildingRelationship

  • deleteBuildingRelationship(town: Town, building: Building | null, npc: NPC | null): void

dice

  • dice(a: string | number, b?: number): number
  • Parameters

    • a: string | number
    • Optional b: number

    Returns number

Const fetchDeity

  • fetchDeity(town: Town, deities?: Deity[]): string

fetchGender

fetchProfessionChance

  • fetchProfessionChance(town: Town, npc: NPC): string

fetchProfessions

  • fetchProfessions(town: Town): Record<string, Profession & { name: string; population: number }>
  • This is run on start up. It returns the available town professions, with their support values.

    Individual professions are returned by the fetchProfessionChance() function located in NPCGeneration/fetchProfessionChance.js

    Parameters

    Returns Record<string, Profession & { name: string; population: number }>

fetchRace

filterNpcByProfession

  • filterNpcByProfession(npcs: Record<string, NPC>, profession: string): NPC[]

filterNull

  • filterNull<T>(obj: Record<string, T>): void
  • Removes all null entries.

    Type parameters

    • T

    Parameters

    • obj: Record<string, T>

    Returns void

findBuilding

  • findBuilding(town: Town, key: string): undefined | Building

findBuildingIndex

  • findBuildingIndex(town: Town, key: string): number

findBuildingRelationship

  • If supplied just the building, it finds the indexes of all relationships with the building as the buildingKey If supplied the npc, it finds the indexes of all with the npc as the npcKey providing both will only find the index of that relationship

    Parameters

    Returns BuildingRelationship[]

findChildRace

findInArray

  • findInArray<T, K>(array: T[], key: K, value: T[K]): undefined | T
  • For returning an object from an array by key value i.e. town.buildings keys. find building find array

    Type parameters

    • T

    • K: string | number | symbol

    Parameters

    • array: T[]
    • key: K
    • value: T[K]

    Returns undefined | T

findInContainer

  • findInContainer<T>(container: Record<string, T>): <K, V>(key: K, value: V) => undefined | T
  • Searches with a depth of one.

    Type parameters

    • T

    Parameters

    • container: Record<string, T>

    Returns <K, V>(key: K, value: V) => undefined | T

      • <K, V>(key: K, value: V): undefined | T
      • Function that searches for an object where the value is found inside of the array the key maps to.

        Type parameters

        • K: string | number | symbol

        • V

        Parameters

        • key: K
        • value: V

        Returns undefined | T

findIndexInArray

  • findIndexInArray<T, K>(array: T[], key: K, value: T[K]): number

findParentRaces

  • findParentRaces(npc: NPC): { fatherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil"; lineage: undefined | string; motherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil" }
  • Parameters

    Returns { fatherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil"; lineage: undefined | string; motherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil" }

    • fatherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil"
    • lineage: undefined | string
    • motherRace: "dragonborn" | "dwarf" | "elf" | "gnome" | "half-elf" | "halfling" | "half-orc" | "human" | "tiefling" | "goblin" | "orc" | "devil"

findPartnerRace

findProfession

first

  • first(array: string): string
  • first<T>(array: T[]): T
  • Returns the first element of an array or string.

    Parameters

    • array: string

    Returns string

  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns T

firstCharacter

  • firstCharacter(word: string): string

fm

  • fm(base: number, val: number): number

formatPercentile

  • formatPercentile(percentages: [string, number][]): string[]

freeze

  • freeze<T>(obj: T): Readonly<T>
  • Freezes objects to prevent accidental mutation. To improve speed, it does not apply in production mode.

    Type parameters

    • T

    Parameters

    • obj: T

    Returns Readonly<T>

generalStoreModifiers

generalStoreRenders

generateBuildingMaterial

  • generateBuildingMaterial(town: Town, mainMaterial: string, buildingWealth: number): MaterialType

getAgeInYears

getAllColours

  • getAllColours(): string[]

Const getAllTraits

  • getAllTraits(npc: NPC): TraitDescriptions[]

getBuildingTier

  • getBuildingTier(townWealth: number, buildingWealth: number): number

getDeity

  • getDeity(town: Town, npc: NPC): string

getMarriages

  • getMarriages(town: Town, npc: NPC): boolean

getNpcGender

getOppositeGender

getPolice

getPredominantRace

  • getPredominantRace(percentages: Record<RaceName, number>): PredominantRace

getRandomValue

  • getRandomValue<T>(target: T): T[keyof T]
  • Fetches a random value from an object. Used to fetch when it's not important which it fetches; any random tavern, or any random Patreon character.

    Type parameters

    • T

    Parameters

    • target: T

    Returns T[keyof T]

getReligiosityDescription

  • getReligiosityDescription(town: Town, npc: NPC): string

getSellingTalk

  • getSellingTalk(town: Town, building: Building, associatedNPC: NPC): string

getTavernSin

  • getTavernSin(tavern: Tavern): "honest" | "corrupt" | "venal" | "sleazy" | "seedy" | "surprisingly trustworthy" | "trustworthy" | "surprisingly reliable" | "reliable" | "surprisingly honest"
  • Parameters

    Returns "honest" | "corrupt" | "venal" | "sleazy" | "seedy" | "surprisingly trustworthy" | "trustworthy" | "surprisingly reliable" | "reliable" | "surprisingly honest"

getTaxRate

  • getTaxRate(town: Town): number

getTownMaterial

  • getTownMaterial(startLocationMaterials: string[], wealth: number, size: number): string

Const getTrait

Const getTraitDescription

  • getTraitDescription(trait: "modest" | "chaste" | "energetic" | "forgiving" | "generous" | "honest" | "just" | "merciful" | "pious" | "prudent" | "temperate" | "trusting" | "valorous", roll: number): undefined | string
  • Parameters

    • trait: "modest" | "chaste" | "energetic" | "forgiving" | "generous" | "honest" | "just" | "merciful" | "pious" | "prudent" | "temperate" | "trusting" | "valorous"
    • roll: number

    Returns undefined | string

Const getTraitsReadout

  • getTraitsReadout(npc: NPC): string

getUUID

  • getUUID(): string
  • Somewhat low quality UUID generation, based on the seeded randomness.

    Returns string

initSexistProfession

  • initSexistProfession(town: Town, npc: NPC): void

isDefined

  • isDefined<T>(value?: T): value is T

isDominantGender

  • isDominantGender(town: Town, npc: NPC): boolean

isOfAge

isUndefined

  • isUndefined<T>(value?: T): value is undefined
  • Type parameters

    • T

    Parameters

    • Optional value: T

    Returns value is undefined

keys

  • keys<T>(object: T): keyof T[]
  • An alternative, stricter typed version of Object.keys.

    example

    const obj = { a: 0, b: 1 } Object.keys(obj) // string[] keys(obj) // "a" | "b"

    Type parameters

    • T

    Parameters

    • object: T

    Returns keyof T[]

knewParents

  • knewParents(town: Town, npc: NPC): boolean

last

  • last(array: string): string
  • last<T>(array: T[]): T
  • Returns the last element of an array.

    Parameters

    • array: string

    Returns string

  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns T

linguisticDrift

  • linguisticDrift(name: string): string

Const makeList

  • makeList(array: string[], noAnd?: boolean): string

npcGrossIncome

  • npcGrossIncome(town: Town, npc: NPC): number

npcLifestyleExpenses

  • npcLifestyleExpenses(town: Town, npc: NPC): number

npcLifestyleStandard

npcNetIncome

  • npcNetIncome(town: Town, npc: NPC): number

npcProfit

  • npcProfit(town: Town, npc: NPC): number

npcTaxRate

  • npcTaxRate(town: Town, npc: NPC): number

npcTotalLifestyleExpenses

  • npcTotalLifestyleExpenses(town: Town, npc: NPC): number

Const parseTraitIntoSentences

  • parseTraitIntoSentences(npc: NPC, traits: TraitDescriptions[]): string

Const personalityTraitExists

  • personalityTraitExists(personalityTrait: string): boolean

politicsWeightedRoll

  • politicsWeightedRoll<S, I>(size: S, type: I): undefined | keyof { economicIdeology: WeightRecord<EconomicIdeology>; politicalSource: WeightRecord<"absolute monarchy" | "constitutional monarchy" | "republic" | "anarchy"> }[I]

random

  • random<T>(array: readonly T[]): T
  • random(max: number): number
  • random(min: number, max: number): number

randomFloat

  • randomFloat(max: number): number
  • randomFloat(min: number, max: number): number

readoutLivery

  • readoutLivery(livery: Livery): string

removeFromArray

  • removeFromArray<T>(array: T[], value: T): void
  • Removes a value from the array.

    Type parameters

    • T

    Parameters

    • array: T[]
    • value: T

    Returns void

removeFromArrayByPredicate

  • removeFromArrayByPredicate<T>(array: T[], predicate: (value: T, index: number, array: T[]) => boolean): void
  • Uses a predicate callback to remove a value from an array.

    Type parameters

    • T

    Parameters

    • array: T[]
    • predicate: (value: T, index: number, array: T[]) => boolean
        • (value: T, index: number, array: T[]): boolean
        • Parameters

          • value: T
          • index: number
          • array: T[]

          Returns boolean

    Returns void

repeat

  • repeat(fn: (index: number) => void, times: number): void
  • Calls a function N number of times.

    Parameters

    • fn: (index: number) => void
        • (index: number): void
        • Parameters

          • index: number

          Returns void

    • times: number

    Returns void

rollFromTable

  • rollFromTable<T>(table: ThresholdTable<T>, maxRoll?: number, bias?: number): T
  • Return a random value from a static roll table. Designed to be less performance-intensive than weightedRandomFetcher,

    The table should contain the intended probabilities of each result for example, calling rollFromTable([[1, 'a'], [2, 'b']]) would return 'a' 1/3 of the time, and b 2/3 of the time.

    Defining maxRoll is not strictly necessary, although I recommend doing so to prevent re-computing the same total of probabilities.

    Using bias will make certain outcomes more likely. Negative biases skew results toward the first entries, and positive biases skew toward the last entries.

    Type parameters

    • T

    Parameters

    Returns T

setAge

  • setAge(npc: NPC): void

setFactionAge

  • setFactionAge(faction: Faction): void

setFactionInfluence

  • setFactionInfluence(faction: Faction): void

setFactionJoinStats

  • setFactionJoinStats(faction: Faction): void

setFactionMisc

  • setFactionMisc(faction: Faction): void

setFactionName

  • setFactionName(town: Town, faction: Faction): string

setFactionReputation

  • setFactionReputation(faction: Faction): void

setFactionResources

  • setFactionResources(faction: Faction): void

setFactionSize

  • setFactionSize(town: Town, faction: Faction): void

setFactionStability

  • setFactionStability(faction: Faction): void

setMaterialProbability

setRace

  • setRace(npc: NPC): void

setRandom

  • setRandom(fn: typeof randomFn): void

setRandomFloat

  • setRandomFloat(fn: typeof randomFloatFn): void

sortArray

  • sortArray<K>(container: Record<K, number>): readonly K[][]
  • Maps a dictionary of string/number pairs into an array of tuples.

    example

    { human: 16.12, dragonborn: 0.3, dwarf: 6.1249 } // converts into [['dragonborn', 0.3], ['dwarf', 6.1249], ['human', 16.12]]

    Type parameters

    • K: string

    Parameters

    • container: Record<K, number>

    Returns readonly K[][]

sumWeights

tavernModifiers

tavernRooms

  • tavernRooms(tavern: Tavern): number

tavernSleep

  • tavernSleep(tavern: Tavern): string

toTitleCase

  • toTitleCase(input: string): string

townDemographics

  • townDemographics(town: Town): void

townRender

updateDemographics

  • updateDemographics(town: Town, newDemographics: Record<RaceName, number>): void

updateTownSocioPolitics

  • updateTownSocioPolitics(town: Town): void

validateNpcGender

validateWeight

  • validateWeight(weight?: number): number

wageVariation

  • wageVariation(town: Town, npc: NPC): number
  • town.roll.wealth increases or decreases npc.professionLuck by up to 10%, reflecting the strength of the economy. The expected range is between -25 and 25.

    Parameters

    Returns number

weightRandom

Const weightedRandomFetcher

  • weightedRandomFetcher<T, A>(town: Town, args: Record<string, A> | A[], obj?: T, exclusionFunction?: (town: Town, arg: A) => boolean, output?: "object" | keyof A): unknown
  • Type parameters

    • T

    • A: Arg<T, A>

    Parameters

    • town: Town

      Needed because everything needs town to evaluate

    • args: Record<string, A> | A[]

      The object containing the objects that you're drawing from

    • Optional obj: T

      The optional npc, building, or whatever that is needed for functions.

    • Optional exclusionFunction: (town: Town, arg: A) => boolean

      The optional global exclusion testing function; this is for things like pulling just the paper type objects from plothooks. Saves on LoC. Leave exclusionFunction blank if everything in your object is always going to be allowed.

        • (town: Town, arg: A): boolean
        • Parameters

          Returns boolean

    • Optional output: "object" | keyof A

      What should be outputted at the end. Set to 'object' to return the whole object. defaultProbability is the optional default unit. You won't usually need to supply this.

    Returns unknown

Generated using TypeDoc