Skip to content

Commit

Permalink
Fix racial description not updating (#642)
Browse files Browse the repository at this point in the history
* Fix errors

Signed-off-by: ryceg <[email protected]>

* Closes #639

Signed-off-by: ryceg <[email protected]>

* Add exclude search

Signed-off-by: ryceg <[email protected]>

* Change numberbox to not be a container

Signed-off-by: ryceg <[email protected]>

* Fixes period being pushed to new line

Signed-off-by: ryceg <[email protected]>

* Add to search exclude

Signed-off-by: ryceg <[email protected]>

* alter alchemist

Signed-off-by: ryceg <[email protected]>

* Fix dropcap

Signed-off-by: ryceg <[email protected]>

* formatting

Signed-off-by: ryceg <[email protected]>

* add liveblock

Signed-off-by: ryceg <[email protected]>

* add func

Signed-off-by: ryceg <[email protected]>

* fix accidental omission of sanitize

Signed-off-by: ryceg <[email protected]>

* Extract height weight and bmi to functions

Signed-off-by: ryceg <[email protected]>

* define height and weight as getters

Signed-off-by: ryceg <[email protected]>

* Add broken function to add placeholder to weight and height

Signed-off-by: ryceg <[email protected]>

* Add edit stats page

Signed-off-by: ryceg <[email protected]>

* Shift genderdata to npc-generation

Signed-off-by: ryceg <[email protected]>

* remove mood

Signed-off-by: ryceg <[email protected]>

* Formatting

Signed-off-by: ryceg <[email protected]>

* Change to make pronouns getters

Signed-off-by: ryceg <[email protected]>

* formatting

Signed-off-by: ryceg <[email protected]>

* Change to use $npcs

Signed-off-by: ryceg <[email protected]>

* Fixes

Signed-off-by: ryceg <[email protected]>

* fix

Signed-off-by: ryceg <[email protected]>

* meh

Signed-off-by: ryceg <[email protected]>

* remove console logs because they were annoying.

Signed-off-by: ryceg <[email protected]>

* Fixed NPC gender not changing or refreshing properly when editing.

Signed-off-by: ryceg <[email protected]>

* Upgrade

Signed-off-by: ryceg <[email protected]>

* remove typedoc for the moment

Signed-off-by: ryceg <[email protected]>

* Final commit

Signed-off-by: ryceg <[email protected]>

* remove unused type

Signed-off-by: ryceg <[email protected]>

* Remove editing weight thing

Signed-off-by: ryceg <[email protected]>

* Fix type issues

Signed-off-by: ryceg <[email protected]>
  • Loading branch information
ryceg authored Jun 24, 2021
1 parent f4937a5 commit 1a17228
Show file tree
Hide file tree
Showing 46 changed files with 451 additions and 304 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
- name: Copy main map
run: cp -r ./gh-pages/main.js.map ./

- name: Create TypeDocs
run: yarn typedoc
# - name: Create TypeDocs
# run: yarn typedoc

- name: Deploy
uses: JamesIves/[email protected]
Expand Down
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"src/init.js": true,
"gh-pages/**": true,
"/src/Tools/Exports/example.json": true,
"/yarn.lock": true
},
"editor.formatOnSave": false,
"prettier.semi": false,
"highlight.maxMatches": 250,
Expand Down
3 changes: 1 addition & 2 deletions .vscode/twine-macros.twee-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ sugarcube-2:

# misc
numberslider: {}
numberbox:
container: true
numberbox: {}
notify:
container: true
fadein:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 2.8.11

### Added
- Some of the NPC stats are now editable.

### Changed
- Fixed racial description while editing town demographics not updating.
- Fixed an annoying issue where the period at the end of the sentence for racial and religious demographics would be pushed to a new line.
- Made the dropcap on NPC profile pages standardized
- The text following the dropcap on the NPC profile page is no longer indented weirdly.
- Fixed NPC gender not changing or refreshing properly when editing.
- Fixed buildings not working in the nav bar.
- Made the profiles just pass the ID as a string, which should be slightly faster.


## 2.8.10

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export * from './npc-generation/createDescriptors'
export * from './npc-generation/createSocialClass'
export * from './npc-generation/createLifestyleStandards'
export * from './npc-generation/socialClass'
export * from './npc-generation/genderData'
export * from './npc-generation/createName'
export * from './npc-generation/createNamesake'
export * from './npc-generation/createReligiosity'
Expand Down Expand Up @@ -125,7 +126,6 @@ export * from './src/findInContainer'
export * from './src/findProfession'
export * from './src/firstCharacter'
export * from './src/flora'
export * from './src/genderData'
export * from './src/getRandomValue'
export * from './src/getIllustration'
export * from './src/inventory'
Expand Down
2 changes: 1 addition & 1 deletion lib/npc-generation/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ReligionStrength } from '../religion/religion'
import { ProfessionName, ProfessionSector, ProfessionType } from './professions'
import { LifestyleStandardName } from './lifestyleStandards'
import { Virtues } from './traits/getTraits'
import { GenderName } from '../src/genderData'
import { GenderName } from '../npc-generation/genderData'
import { BackgroundName } from './backgroundTraits'
import { ClassName } from './classTraits'
import { RaceName, AgeName } from './raceTraits'
Expand Down
2 changes: 1 addition & 1 deletion lib/npc-generation/createName.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GenderName } from '../src/genderData'
import { GenderName } from '../npc-generation/genderData'
import { random } from '../src/random'
import { capitalizeFirstLetter } from '../src/utils'
import { RaceName, raceTraits } from './raceTraits'
Expand Down
2 changes: 1 addition & 1 deletion lib/npc-generation/createNamesake.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchGender } from '../../lib/src/genderData'
import { fetchGender } from '../../lib/npc-generation/genderData'
import { Town } from '../town/_common'
import { createName } from './createName'
import { fetchRace } from './fetchRace'
Expand Down
2 changes: 1 addition & 1 deletion lib/src/genderData.ts → lib/npc-generation/genderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NPC } from '../npc-generation/_common'
export type BinaryGender = 'man' | 'woman'
export type GenderName = 'man' | 'woman' | 'nonbinary' | 'entity'

interface GenderPronouns {
export interface GenderPronouns {
godgoddess: string
title: string
domTitle: string
Expand Down
10 changes: 5 additions & 5 deletions lib/npc-generation/npcFinances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ export function wageVariation (town: Town, npc: NPC): number {

export function npcGrossIncome (town: Town, npc: NPC): number {
// TODO add hobbies
console.log(`Returning ${npc.name}'s gross income...`)
// console.log(`Returning ${npc.name}'s gross income...`)
const profession = findProfession(town, npc)
return Math.round(calcPercentage(profession.dailyWage, (wageVariation(town, npc), (town.roll.wealth - 50) / 3)))
}

export function npcNetIncome (town: Town, npc: NPC): number {
console.log(`Returning ${npc.name}'s net income...`)
// console.log(`Returning ${npc.name}'s net income...`)
return Math.round(calcPercentage(npcGrossIncome(town, npc), -npcTaxRate(town, npc)))
}

export function npcLifestyleStandard (town: Town, npc: NPC): LifestyleStandard {
console.log(`Returning ${npc.name}'s lifestyle standard...`)
// console.log(`Returning ${npc.name}'s lifestyle standard...`)
const income = npcNetIncome(town, npc)
for (const lifestyleStandard of Object.values(lifestyleStandards)) {
if (income >= lifestyleStandard.incomeThreshold) {
Expand All @@ -35,7 +35,7 @@ export function npcLifestyleStandard (town: Town, npc: NPC): LifestyleStandard {
}

export function npcLifestyleExpenses (town: Town, npc: NPC): number {
console.log(`Returning ${npc.name}'s lifestyle expenses...`)
// console.log(`Returning ${npc.name}'s lifestyle expenses...`)
const income = npcGrossIncome(town, npc)
return Math.round(income * (npcLifestyleStandard(town, npc).dailyWagePercentage / 100))
}
Expand All @@ -45,7 +45,7 @@ export function npcTotalLifestyleExpenses (town: Town, npc: NPC): number {
}

export function npcProfit (town: Town, npc: NPC): number {
console.log(`Returning ${npc.name}'s profit...`)
// console.log(`Returning ${npc.name}'s profit...`)
return Math.round(npcNetIncome(town, npc) - npcTotalLifestyleExpenses(town, npc))
}

Expand Down
2 changes: 1 addition & 1 deletion lib/npc-generation/raceTraits.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThresholdTable } from '../src/rollFromTable'
import { dice } from '../src/dice'
import { GenderName } from '../src/genderData'
import { GenderName } from '../npc-generation/genderData'

export type RaceName = 'dragonborn' | 'dwarf' | 'elf' | 'gnome' | 'half-elf' | 'halfling' | 'half-orc' | 'human' | 'tiefling' | 'goblin' | 'orc' | 'lizardfolk'

Expand Down
106 changes: 58 additions & 48 deletions lib/npc-generation/setRace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { random } from '../src/random'
import { closestMatch } from '../src/closestMatch'
import { ThresholdTable } from '../src/rollFromTable'
import { GenderName } from '../src/genderData'
import { GenderName } from '../npc-generation/genderData'

import { bmiDescriptions } from './bmiDescriptions'
import { GenderTraits, RaceName, raceTraits } from './raceTraits'
Expand Down Expand Up @@ -38,55 +38,65 @@ export function setRace (npc: NPC) {

npc.heightInches = baseHeight + heightModifier
npc.weightPounds = baseWeight + (heightModifier * weightModifier)
npc.bmi = Math.trunc((npc.weightPounds / (npc.heightInches * npc.heightInches)) * raceData.bmiModifier)
npc.weight = npc.weight || closestMatch(bmiDescriptions, 'weight', 'bmi', 'muscleMass', npc.bmi, npc.muscleMass)
}

export const getNPCBMI = (weightPounds: number, heightInches: number, bmiModifier = 703) => {
return Math.trunc((weightPounds / (heightInches * heightInches)) * bmiModifier)
}

export const getNPCWeight = (bmi: number, muscleMass: number) => {
return closestMatch(bmiDescriptions, 'weight', 'bmi', 'muscleMass', bmi, muscleMass)
}

export const getNPCHeight = (heightInches: number) => {
let resultantHeight = ''
const heightChart: ThresholdTable = [
[84, 'giraffe-like'],
[78, 'towering'],
[77, 'extremely tall'],
[76, 'very tall'],
[75, 'rather tall'],
[74, 'quite tall'],
[73, 'reasonably tall'],
[72, 'tall'],
[71, 'taller than average'],
[70, 'average sized'],
[69, 'medium sized'],
[68, 'on the short side'],
[67, 'somewhat short'],
[66, 'relatively short'],
[65, 'short-ish'],
[64, 'short'],
[63, 'short'],
[62, 'rather short'],
[61, 'barely five foot'],
[60, 'quite short'],
[59, 'rather small'],
[58, 'really short'],
[57, 'pint sized'],
[56, 'quite small'],
[55, 'small'],
[54, 'squat'],
[53, 'somewhat squat'],
[52, 'quite squat'],
[50, 'rather squat'],
[48, 'somewhat tiny'],
[46, 'rather small'],
[44, 'rather tall (compared to a halfling)'],
[42, 'tall (compared to a halfling)'],
[40, 'barely a metre'],
[38, 'diminutive'],
[36, 'quite diminutive'],
[34, 'adorably short'],
[32, 'tiny'],
[30, 'so so tiny'],
[0, 'impossibly small']
]
for (const [height, description] of heightChart) {
if (height >= npc.heightInches) {
npc.height = description
if (height >= heightInches) {
resultantHeight = description
}
}
if (!resultantHeight) resultantHeight = 'average'
return resultantHeight
}

const heightChart: ThresholdTable = [
[84, 'giraffe-like'],
[78, 'towering'],
[77, 'extremely tall'],
[76, 'very tall'],
[75, 'rather tall'],
[74, 'quite tall'],
[73, 'reasonably tall'],
[72, 'tall'],
[71, 'taller than average'],
[70, 'average sized'],
[69, 'medium sized'],
[68, 'on the short side'],
[67, 'somewhat short'],
[66, 'relatively short'],
[65, 'short-ish'],
[64, 'short'],
[63, 'short'],
[62, 'rather short'],
[61, 'barely five foot'],
[60, 'quite short'],
[59, 'rather small'],
[58, 'really short'],
[57, 'pint sized'],
[56, 'quite small'],
[55, 'small'],
[54, 'squat'],
[53, 'somewhat squat'],
[52, 'quite squat'],
[50, 'rather squat'],
[48, 'somewhat tiny'],
[46, 'rather small'],
[44, 'rather tall (compared to a halfling)'],
[42, 'tall (for a halfling)'],
[40, 'barely a metre'],
[38, 'diminutive'],
[36, 'quite diminutive'],
[34, 'adorably short'],
[32, 'tiny'],
[30, 'so so tiny'],
[0, 'impossibly small']
]
2 changes: 1 addition & 1 deletion lib/npc-generation/traits/getTraits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const getInverseTrait = (trait: VirtuesVices) => {

export const getTrait = (trait: VirtuesVices, npc: NPC, humanized?: boolean) => {
const sanitizedVirtue = getVirtue(trait)
if (sanitizedVirtue.wasVice === false) return sanitizeTraitValues(npc.roll.traits[trait as Virtues])
if (sanitizedVirtue.wasVice === false) return sanitizeTraitValues(npc.roll.traits[trait as Virtues], humanized)
const correspondingVirtue = getVirtue(trait)
return sanitizeTraitValues(npc.roll.traits[correspondingVirtue.virtue], humanized)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/town/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Weather } from '../src/weather'
import { townData, TownType, PoliticalIdeology, EconomicIdeology } from './townData'
import { EconomicIdeologyIST, PoliticalIdeologyIC } from './updateTownSocioPolitics'
import { Pantheon, PantheonTypes } from 'lib/religion/religion'
import { GenderName } from '../../lib/src/genderData'
import { GenderName } from '../../lib/npc-generation/genderData'
import { Biome, Seasons } from '../../lib/src/terrain'

export type PoliticalSource = keyof typeof townData.politicalSource
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "eigengraus-essential-establishment-generator",
"version": "2.8.10",
"version": "2.8.11",
"description": "Eigengrau's Essential Establishment Generator",
"main": "main.txt",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/Alchemist/AlchemistOutput.twee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<<set $associatedNPC to $npcs[$building.associatedNPC.key]>>
<span class='flex-line'><<button "Edit $building.name" $building.initPassage>><</button>></span>
<h1 class="interactive-only">$building.name</h1><span @id="$building.key"></span><p>You enter $building.name, <<print lib.articles.output($building.structure.alchemistDescriptor)>>. <<print lib.closestMatch(lib.alchemistData.get.lookAround($building), 'note', 'cleanliness', 'wealth', $building.roll.cleanliness, $building.roll.wealth)>> There is a chemist behind the shop counter currently <<print $associatedNPC.idle.random()>>.</p>
<section><h3>Chemist</h3><p>The $associatedNPC.weight chemist <<print $associatedNPC.greeting.random()>> <<print ['when you come inside', 'after finishing with another customer', 'as soon as you come through the door', 'when you come up to the counter', 'while you look around'].random()>>. <<print $associatedNPC.heshe.toUpperFirst()>> introduces $associatedNPC.himherself as <<profile $associatedNPC>>, the $associatedNPC.owner of the shop, and asks what $associatedNPC.heshe can do for you.</p>
<section><h3>Chemist</h3><p><<print lib.articles.output($associatedNPC.descriptor)>> <<print $associatedNPC.greeting.random()>> <<print ['when you come inside', 'after finishing with another customer', 'as soon as you come through the door', 'when you come up to the counter', 'while you look around'].random()>>. <<print $associatedNPC.heshe.toUpperFirst()>> introduces $associatedNPC.himherself as <<profile $associatedNPC>>, the $associatedNPC.owner of the shop, and asks what $associatedNPC.heshe can do for you.</p>
<<linkreplace "Talk with $associatedNPC.name" t8n>>
<h6>$associatedNPC.name</h6><<include "ChemistTalk">><</linkreplace>></section>
<span class="interactive-only"><<link "Generate plothook">><<set $associatedNPC.plot to setup.alchemistMission($town)>><</link>></span><<liveblock>><<if def $associatedNPC.plot>><div id="plothook"><<print ["When you say that you're adventurers, $associatedNPC.hisher $associatedNPC.eyes eyes light up, and $associatedNPC.heshe says", "You chat for a while, and then $associatedNPC.firstName says ", "You discuss business, and when you talk about your adventures, $associatedNPC.firstName asks "].random()>> "$associatedNPC.plot"</div><</if>><</liveblock>>
Expand Down
2 changes: 1 addition & 1 deletion src/Alchemist/ChemistTalk.twee
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
:: ChemistTalk [nobr]
$associatedNPC.firstName looks <<print $associatedNPC.currentMood.random()>>, and idly shifts a box of <<print lib.alchemistData.ingredients.random()>> as $associatedNPC.heshe talks. The $associatedNPC.raceNote <<print $associatedNPC.chitchat.random()>> as you peruse the shop. $associatedNPC.firstName tells you that $associatedNPC.heshe is working on <<print lib.articles.output($building.brew.potionPurpose)>>, and points to the <<linkappend $building.brew.containerDescription t8n>>. Looking inside the $building.brew.vesselType, you see <<print lib.articles.output($building.brew.liquidDescription)>> bubbling away<</linkappend>>.
$associatedNPC.firstName looks <<print setup.npcData.currentMood.random()>>, and idly shifts a box of <<print lib.alchemistData.ingredients.random()>> as $associatedNPC.heshe talks. The $associatedNPC.raceNote <<print $associatedNPC.chitchat.random()>> as you peruse the shop. $associatedNPC.firstName tells you that $associatedNPC.heshe is working on <<print lib.articles.output($building.brew.potionPurpose)>>, and points to the <<linkappend $building.brew.containerDescription t8n>>. Looking inside the $building.brew.vesselType, you see <<print lib.articles.output($building.brew.liquidDescription)>> bubbling away<</linkappend>>.
2 changes: 1 addition & 1 deletion src/Blacksmith/BlacksmithTalk.twee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:: BlacksmithTalk
<<linkreplace "<h4>Talk with $associatedNPC.name</h4>" t8n>>
<h6>$associatedNPC.name</h6>$associatedNPC.firstName looks <<print $associatedNPC.currentMood.random()>>, and while you chat, $associatedNPC.heshe moves around the shop, preparing a new project for work. $associatedNPC.firstName <<print ["loves working in $building.name", "hates working in $building.name", "finds working in the $building.name boring", "finds working in the smithy fun", "finds working in the $building.name rather lonely", "wishes $associatedNPC.heshe could go adventuring instead of working here"].random()>>, and says that the patrons of $building.name are <<print ["alright, especially the farmers, who are pretty decent blokes", "a bit stingy, especially the farmers", "somewhat stingy", "fine, but rather dull", "way too exciting for $associatedNPC.firstName's tastes", "nice and friendly", "nice and friendly, but rather boring- nothing interesting is ever ordered", "just a bunch of hicks", "a bunch of weirdos", "pretty normal stock, nothing out of the ordinary", "a bit rude and stuck up", "fairly generous with their coin"].random()>>.
<h6>$associatedNPC.name</h6>$associatedNPC.firstName looks <<print setup.npcData.currentMood.random()>>, and while you chat, $associatedNPC.heshe moves around the shop, preparing a new project for work. $associatedNPC.firstName <<print ["loves working in $building.name", "hates working in $building.name", "finds working in the $building.name boring", "finds working in the smithy fun", "finds working in the $building.name rather lonely", "wishes $associatedNPC.heshe could go adventuring instead of working here"].random()>>, and says that the patrons of $building.name are <<print ["alright, especially the farmers, who are pretty decent blokes", "a bit stingy, especially the farmers", "somewhat stingy", "fine, but rather dull", "way too exciting for $associatedNPC.firstName's tastes", "nice and friendly", "nice and friendly, but rather boring- nothing interesting is ever ordered", "just a bunch of hicks", "a bunch of weirdos", "pretty normal stock, nothing out of the ordinary", "a bit rude and stuck up", "fairly generous with their coin"].random()>>.
/* <span class="click-and-remove-link"><<link "What are you working on?">><<set $associatedNPC.currentProject to setup.createBlacksmithProject($town, $building, $associatedNPC)>><<update>><</link>></span> */
/* <span class="click-and-remove-link"><<link "Test">><<set $associatedNPC.currentProject to "GREAT SUCCESS">><<update>><</link>></span> */
<<liveblock>><<if def $associatedNPC.currentProject>><span id="currentProject">$associatedNPC.currentProject</span><</if>><</liveblock>><</linkreplace>>
6 changes: 3 additions & 3 deletions src/Blacksmith/js/blacksmithProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createBlacksmithProject = function (town: Town, smithy: Smithy, bla
function (town: Town) {
// @ts-ignore
const market = lib.findInArray(town.buildings, 'buildingType', 'market') || setup.createNewBuilding(town, 'Market')
return `${lib.articles.output(lib.random(weapon))} to sell at ${setup.profile(market, 'the markets', 'town.buildings')} ${["in a couple day's time", 'soon', 'tomorrow', 'next Saturday', 'the day after tomorrow'].random()}.`
return `${lib.articles.output(lib.random(weapon))} to sell at ${setup.profile(market, 'the markets')} ${["in a couple day's time", 'soon', 'tomorrow', 'next Saturday', 'the day after tomorrow'].random()}.`
}
},
{
Expand Down Expand Up @@ -50,7 +50,7 @@ export const createBlacksmithProject = function (town: Town, smithy: Smithy, bla
function (town: Town) {
// @ts-ignore
const market = lib.findInArray(town.buildings, 'buildingType', 'market') || setup.createNewBuilding(town, 'Market')
return `some ${mundane.random()} to sell at ${setup.profile(market, 'the markets', 'town.buildings')} ${["in a couple day's time", 'soon', 'tomorrow', 'next Saturday', 'the day after tomorrow'].random()}.`
return `some ${mundane.random()} to sell at ${setup.profile(market, 'the markets')} ${["in a couple day's time", 'soon', 'tomorrow', 'next Saturday', 'the day after tomorrow'].random()}.`
}
},
{
Expand Down Expand Up @@ -122,7 +122,7 @@ export const createBlacksmithProject = function (town: Town, smithy: Smithy, bla
function (town: Town) {
// @ts-ignore
const building = lib.findInArray(town.buildings, 'buildingType', 'temple') || setup.createNewBuilding(town, 'Temple')
return `an ornamental ${lib.random(weapon)} for ${setup.profile(building.associatedNPC, 'the priest')} of ${setup.profile(building, building.name, 'town.buildings')}.`
return `an ornamental ${lib.random(weapon)} for ${setup.profile(building.associatedNPC, 'the priest')} of ${setup.profile(building)}.`
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/Buildings/Components/CreateNewNPC.twee
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<</button>>
<<liveblock>>
<<if $currentPassage.randomNPC>>
<div id="NPC" class="descriptive">
<div id="NPC" class="descriptive no-indent">
<h3>$currentPassage.randomNPC.name</h3>
<<print lib.firstCharacter(lib.articles.output($currentPassage.randomNPC.descriptor).toUpperFirst())>> is currently <<print $currentPassage.randomNPC.idle.random()>> in the corner.
You strike up conversation with $currentPassage.randomNPC.himher, and the $currentPassage.randomNPC.descriptor introduces $currentPassage.randomNPC.himherself as
Expand Down
Loading

0 comments on commit 1a17228

Please sign in to comment.