Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryceg committed Jan 21, 2021
1 parent 103134b commit d1e8790
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/GeneralStore/JS/createGeneralStoreName.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { GeneralStore, Town } from '@lib'
import { GeneralStore, toTitleCase, Town } from '@lib'
import { random } from '../../../lib/src/random'

// @ts-ignore
// uses setup.createNPC
export const createGeneralStoreName = (town: Town, generalStore: GeneralStore) => {
const adjective = ['Dependable', 'Reliable', 'Expendable', 'Indispensible', 'Incomparable', 'Incredible', 'Excellent', 'Important', 'Cheap', 'Affordable', 'Affable', 'Discount', 'Low-Cost', 'Fancy'].random()
Expand Down Expand Up @@ -117,22 +116,22 @@ export const createGeneralStoreName = (town: Town, generalStore: GeneralStore) =

switch (roll) {
case 1:
generalStore.name = lib.toTitleCase(`The ${adjective} ${noun}`)
generalStore.name = toTitleCase(`The ${adjective} ${noun}`)
break
case 2:
generalStore.name = lib.toTitleCase(`${associatedNPC.firstName}'s ${adjective} ${rider}`)
generalStore.name = toTitleCase(`${associatedNPC.firstName}'s ${adjective} ${rider}`)
break
case 3:
generalStore.name = lib.toTitleCase(associatedNPC.firstName + ["'s General Goods", "'s Bric-a-Brac", "'s Trading Goods", "'s Shopping Place", `'s ${rider}`].random())
generalStore.name = toTitleCase(associatedNPC.firstName + ["'s General Goods", "'s Bric-a-Brac", "'s Trading Goods", "'s Shopping Place", `'s ${rider}`].random())
break
case 4:
generalStore.name = lib.toTitleCase(`The ${adjective} ${rider}`)
generalStore.name = toTitleCase(`The ${adjective} ${rider}`)
break
case 5:
generalStore.name = lib.toTitleCase(`The ${adjective} ${noun}`)
generalStore.name = toTitleCase(`The ${adjective} ${noun}`)
break
case 6:
generalStore.name = lib.toTitleCase(`The ${noun} and ${family.toUpperFirst()}`)
generalStore.name = toTitleCase(`The ${noun} and ${family.toUpperFirst()}`)
// @ts-ignore
generalStore.assistant = setup.createNPC(town, fam[family])
// @ts-ignore
Expand All @@ -141,7 +140,7 @@ export const createGeneralStoreName = (town: Town, generalStore: GeneralStore) =
town.npcRelations[generalStore.assistant.key].filter(r => r.targetNpcKey === associatedNPC.key)[0]?.relation)
break
case 7:
generalStore.name = lib.toTitleCase(`${associatedNPC.firstName} and ${family.toUpperFirst()}`)
generalStore.name = toTitleCase(`${associatedNPC.firstName} and ${family.toUpperFirst()}`)
// @ts-ignore
generalStore.assistant = setup.createNPC(town, fam[family])
// @ts-ignore
Expand All @@ -150,6 +149,6 @@ export const createGeneralStoreName = (town: Town, generalStore: GeneralStore) =
town.npcRelations[generalStore.assistant.key].filter(r => r.targetNpcKey === associatedNPC.key)[0]?.relation)
break
default:
generalStore.name = lib.toTitleCase(`The ${adjective} Adventurer's Store`)
generalStore.name = toTitleCase(`The ${adjective} Adventurer's Store`)
}
}

2 comments on commit d1e8790

@Glinkis
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this fix? And I see a random import from lib that's incorrect.

@ryceg
Copy link
Owner Author

@ryceg ryceg commented on d1e8790 Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry. Accidentally committed before I'd fully typed it out. Fixed the ts ignore bit! :P

Please sign in to comment.