From e548b0d5f112e74afa477238166e83779b04a520 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Sun, 18 Apr 2021 22:59:44 +1000
Subject: [PATCH 01/23] Add more flavour
---
lib/src/badges.ts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/src/badges.ts b/lib/src/badges.ts
index 3308fdaf3..29a7ecfb6 100644
--- a/lib/src/badges.ts
+++ b/lib/src/badges.ts
@@ -220,6 +220,20 @@ export const badges = {
message: 'AI Dungeon',
logo: 'AI Dungeon'
// link: 'https://play.aidungeon.io/'
+ },
+ {
+ label: 'No Brain',
+ message: 'Required'
+ },
+ {
+ label: 'I Cast',
+ message: 'Fireball',
+ color: 'red'
+ },
+ {
+ label: 'Do we',
+ message: 'level up yet',
+ color: 'green'
}
] as Badge[],
stats: {
From b855e5a92db0258e8a49b86d6c981edb125946f5 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 20:03:49 +1000
Subject: [PATCH 02/23] Add interfaces
---
lib/src/createMagic.ts | 12 +++++++++++-
lib/src/createRing.ts | 22 +++++++++++++++++++++-
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/lib/src/createMagic.ts b/lib/src/createMagic.ts
index 81f1a2707..0c9e78747 100644
--- a/lib/src/createMagic.ts
+++ b/lib/src/createMagic.ts
@@ -3,7 +3,7 @@ import { magicData, MagicType } from './magicData'
import { random } from './random'
import { assign } from './utils'
-export function createMagic (type: T | 'ring') {
+export function createMagic (type: T | 'ring'): MagicItem {
console.log(`Type: ${type}`)
if (type === 'ring') {
@@ -33,3 +33,13 @@ export function createMagic (type: T | 'ring') {
console.log(magic)
return magic
}
+
+export interface MagicItem {
+ type: string
+ description: string
+ name: string
+ prefix?: string
+ suffix?: string
+ prefixProperty?: string
+ suffixProperty?: string
+}
diff --git a/lib/src/createRing.ts b/lib/src/createRing.ts
index c5554f954..a2a3dd2df 100644
--- a/lib/src/createRing.ts
+++ b/lib/src/createRing.ts
@@ -1,3 +1,4 @@
+import { MagicItem } from '@lib'
import { articles } from './articles'
import { getRandomValue } from './getRandomValue'
import { random } from './random'
@@ -9,7 +10,21 @@ interface Options {
activation: string
}
-export function createRing (base?: Partial) {
+interface MagicRing extends MagicItem {
+ works: string
+ material: string
+ decoration: string
+ gemstone: string
+ intendedowner: string
+ importance: string
+ setting: string
+ cut: string
+ power: string
+ cost: string
+ activation: string
+}
+
+export function createRing (base?: Partial): MagicRing {
const ringData = createRingData()
const ring = {
@@ -193,6 +208,11 @@ export function createRing (base?: Partial) {
])
})
+ assign(ring, {
+ type: 'ring',
+ name: `${ring.gemstone} Ring`,
+ description: ring.firstOutputs
+ })
return ring
}
From 1343b1c850b0da45439dd6ab7249e19b2954dff8 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 20:04:11 +1000
Subject: [PATCH 03/23] Remove unused duplicate properties
---
src/NPCGeneration/npcData.js | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/NPCGeneration/npcData.js b/src/NPCGeneration/npcData.js
index 4beecf4f2..0ce2e58c7 100644
--- a/src/NPCGeneration/npcData.js
+++ b/src/NPCGeneration/npcData.js
@@ -1,6 +1,5 @@
setup.initNpcData = () => {
setup.npcData = {
-
lifeEvents: {
performed: {
probability: 3,
@@ -1224,7 +1223,6 @@ setup.initNpcData = () => {
}
}
},
-
skinColour: ['translucent', 'white', 'pale', 'fair', 'light', 'light tan', 'tan', 'pale', 'fair', 'light', 'light tan', 'tan', 'dark tan', 'brown'],
idle: ['sitting, with a piece of bread in hand', 'sitting, mug in hand', 'poring over some map', 'reading some letter intently', 'reading a book', 'shuffling a pack of cards', 'chewing on a piece of hay', 'sharpening a knife', 'buffing a piece of armour', 'polishing a shield', 'sharpening the blade on a fearsome looking dagger', 'cutting an apple into bite sized pieces', 'biting into an apple', 'eating an apple while looking at some book', 'eating a hunk of cheese while reading a book', 'sipping out of a huge mug while reading a book', "reading a book titled '<>'", "reading a book titled '<>'", "reading a book titled '<>'"],
reading: ["a piece of history- my forefather's journal, detailing his life in $town.name when it was just a settlement.", 'my journal, from many years ago.', "my mother's journal, from just before she disappeared", 'a document which I received by postboy two days ago... I believe it is in code, and somebody is trying to tell me something.', "a traitor's memoirs, extremely rare... I thought it would be a good laugh, but some of what he says is concerningly accurate.", "some sort of spell, though I don't know how to read it.", 'a document I bought at the flea market; it looks to be a set of instructions on how to make a golem.', "a book which I bought, believing it to be blank, and suitable for a journal. However, now there's this strange foreign script that I can't read in it.", 'a book that I bought as a gift for my mother, who loves beautiful covers, despite not being able to read.'],
@@ -1234,8 +1232,6 @@ setup.initNpcData = () => {
adventure: ['retired from adventuring', 'currently looking for an adventure', 'looking for assistance', 'recuperating from an adventure', 'on a holiday from adventuring', 'taking a short break from adventuring'],
hairColour: ['brunette', 'brunette', 'brown', 'brownish', 'auburn', 'amber', 'hazel', 'red', 'dark red', 'blonde', 'dark blonde', 'white', 'platinum', 'black', 'black'],
hairType: ['thick', 'wispy', 'straight', 'straight', 'wavy', 'wavy', 'curly', 'wiry', 'oily', 'lush', 'poofy', 'long', 'braided', 'very long', 'greasy', 'unruly', 'unusually styled', 'short cropped'],
- dndClass: ['barbarian', 'bard', 'cleric', 'druid', 'fighter', 'monk', 'rogue', 'ranger', 'paladin', 'sorcerer', 'warlock', 'wizard'],
- background: ['acolyte', 'charlatan', 'criminal', 'entertainer', 'folk hero', 'guild artisan', 'hermit', 'noble', 'outlander', 'sage', 'sailor', 'soldier', 'urchin'],
pockets: ['5 cp', '6 cp', '15 cp', '22 cp', '27 cp', '5 sp', '5 sp', '6 sp', '7 sp', '2 gp', '34 cp and 4 sp', '12 sp and 7 gp', 'a clove of garlic', 'a vial of ink worth 8sp', 'hardtack', 'an explosive rune, dealing 2d4 fire damage', 'a palm-sized glass sphere', 'a wooden comb', 'fragments of a shattered sword', 'a deck of tarot cards', 'map of a nearby castle', 'map of the local area', 'a tin spoon', 'a mess kit', 'lacy undergarments', 'spectacles worth 5gp', 'a spool of thread', 'a piece of chalk', 'a necklace of animal teeth', "a headhunter's contract", 'a list of people in a nearby city', 'a worn leather strap', 'a ring of iron keys', 'a flask full of salt water', 'a box of candles', 'a vial of quicksilver', "a traveller's journal", 'a lead amulet', 'a signet ring for a noble house', 'a list of local taverns', 'a golden yellow topaz gem worth 50gp', 'a page torn from a spellbook', 'scraps of bad poetry', 'a pair of bloodstained gloves', 'thirteen mouse teeth', 'a pouch full of dried berries', 'an invitation to a wedding that happened a few weeks ago', 'a brass ring', 'a shopping list', 'the cork from a wine bottle', 'a scrap of paper with unintelligible writing on it', 'a smoking pipe', 'a pouch of ruby powder', 'a deed to a ruined tower', 'a bottle of honey', 'a sling with 10 bullets', 'a broken buckle', 'a knot of silk ribbons', 'a silver pearl worth 10gp', 'a potion of Polymorph Self worth 350gp', '1pp wrapped in a crude map', 'pocket sand', 'a wedge of cheese', 'a string of wooden prayer beads', 'a lock of hair', 'a dead mouse', 'a compass', 'an empty flask', '85gp', 'three diamonds worth 30gp each', 'a black pearl worth 50gp', 'a black opal worth 100gp'],
value: ['experience', 'family', 'progeny', 'learning', 'wealth', 'masterwork', 'revenge', 'intelligence', 'discovery', 'pilgrimage', 'invention', 'miracle', 'secret', 'martyrdom', 'collection', 'patronage', 'fame'],
drive: ['health', 'beauty', 'thrills', 'knowledge', 'power', 'partnership', 'networking', 'glory', 'entertainment', 'helpfulness', 'bravery', 'compassion', 'piety', 'solitude', 'relationships', 'hedonism', 'privacy'],
From 6d88ce4a9f7eec5bad0954f40fd8bacf397e5d47 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:44:52 +1000
Subject: [PATCH 04/23] Shift notification down slightly
---
src/Settings/Plugins/notify.css | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Settings/Plugins/notify.css b/src/Settings/Plugins/notify.css
index d9eee43c2..7cd6fabaa 100644
--- a/src/Settings/Plugins/notify.css
+++ b/src/Settings/Plugins/notify.css
@@ -7,7 +7,8 @@
position : fixed;
display : block;
width : 16em;
- right : -20em; top : 2em;
+ right : -20em;
+ top : 3em;
padding : 0.5em;
background-color : #fff;
color : #000;
From ef26ba167f38b65d84138f0ebc9b2dc5258f6e7d Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:45:03 +1000
Subject: [PATCH 05/23] Remove useless file
---
src/NPCGeneration/exportNPC.js | 52 ----------------------------------
1 file changed, 52 deletions(-)
delete mode 100644 src/NPCGeneration/exportNPC.js
diff --git a/src/NPCGeneration/exportNPC.js b/src/NPCGeneration/exportNPC.js
deleted file mode 100644
index 8d94ce127..000000000
--- a/src/NPCGeneration/exportNPC.js
+++ /dev/null
@@ -1,52 +0,0 @@
-setup.exportNPC = function (npc) {
- const npcExport = {
- character: {
- // firstName: npc.firstName,
- // lastName: npc.lastName,
- name: `${npc.firstName} ${npc.lastName}`,
- age: npc.age,
- class: npc.dndClass,
- classes: [{
- isStartingClass: true,
- level: npc.level | 1,
- definition: {
- name: npc.dndClass,
- subclassDefinition: null
- }
- }],
- background: {
- definition: {
- name: npc.background,
- description: npc.backgroundOrigin,
- featureDescription: npc.backgroundOrigin
- }
- },
- race: {
- racialTraits: null,
- fullName: npc.race
- },
- hair: npc.hair,
- eyes: npc.eyes,
- skin: npc.skinColour,
- traits: {
- bonds: npc.bond,
- ideal: npc.ideal,
- flaws: npc.trait,
- personalityTraits: `${npc.name} is ${npc.calmTrait} when calm, and ${npc.stressTrait} when stressed.`,
- appearance: `${npc.name} is ${lib.articles.output(npc.age)} ${npc.malefemale} ${npc.race}. ${npc.heshe.toUpperFirst()} is ${npc.height} and ${npc.weight}, and has ${npc.eyes} eyes, with ${npc.skinColour} skin. The most notable physical trait of ${npc.firstName} is that ${npc.heshe} has ${npc.physicalTrait}.`
- },
- bio: `${npc.name} is ${lib.articles.output(npc.age)} ${npc.malefemale} ${npc.race}. ${npc.heshe.toUpperFirst()} is ${npc.height} and ${npc.weight}, and has ${npc.eyes} eyes, with ${npc.skinColour} skin. The most notable physical trait of ${npc.firstName} is that ${npc.heshe} has ${npc.physicalTrait}.
- I was born ${npc.birthplace}, and was raised by ${npc.familyUnit}. I had ${lib.articles.output(npc.familyLifestyle)} upbringing in ${npc.familyHome}. ${npc.childhoodMemories}. ${npc.backgroundOrigin} ${npc.professionOrigin}.
- `,
- gmnotes: `${npc.name} ${npc.trait}. ${npc.heshe.toUpperFirst()} is ${npc.calmTrait} when calm, and ${npc.stressTrait} when stressed.`,
- inplayerjournals: 'all',
- notes: {
- backstory: `I was born ${npc.birthplace}, and was raised by ${npc.familyUnit}. I had ${lib.articles.output(npc.familyLifestyle)} upbringing in ${npc.familyHome}. ${npc.childhoodMemories}. ${npc.backgroundOrigin} ${npc.professionOrigin}.`
- },
-
- cp: npc.wealth
-
- }
- }
- return JSON.stringify(npcExport)
-}
From 8b82c86e3f7ecc5068f06afb8ec9748d956e67c2 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:45:33 +1000
Subject: [PATCH 06/23] Shift createFamilyHouse to outside createFamily
---
lib/npc-generation/familyRelationships.ts | 4 ++--
src/NPCGeneration/expandNPC.ts | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/npc-generation/familyRelationships.ts b/lib/npc-generation/familyRelationships.ts
index 3feb992b7..4221f0044 100644
--- a/lib/npc-generation/familyRelationships.ts
+++ b/lib/npc-generation/familyRelationships.ts
@@ -1,6 +1,7 @@
import { roads } from '../town/roads'
import { Town } from '../town/_common'
import { Family, NPC } from './_common'
+import { random } from '../src/random'
export const familyRelationships = {
/**
@@ -107,7 +108,6 @@ export function createFamily (town: Town, npc: NPC) {
road: ''
}
}
- createFamilyHouse(town, family)
town.families[key] = family
npc.family = key
}
@@ -115,7 +115,7 @@ export function createFamily (town: Town, npc: NPC) {
export function createFamilyHouse (town: Town, family: Family) {
const road = town.roads[family.home.road] ||
roads.findExisting(town) ||
- lib.random(Object.keys(town.roads))
+ random(Object.keys(town.roads))
// roads.assign(town)
for (const member in family.members) {
diff --git a/src/NPCGeneration/expandNPC.ts b/src/NPCGeneration/expandNPC.ts
index 1c5332ed5..e2c379a69 100644
--- a/src/NPCGeneration/expandNPC.ts
+++ b/src/NPCGeneration/expandNPC.ts
@@ -1,4 +1,4 @@
-import type { NPC, Town } from '@lib'
+import { createFamilyHouse, NPC, Town } from '@lib'
import { createHistory } from './createHistory'
import { createLifeEvents } from './createLifeEvents'
import { createFriends } from './Relationships/createFriends'
@@ -27,6 +27,8 @@ export const expandNPC = (town: Town, npc: NPC) => {
})
})
+ createFamilyHouse(town, town.families[npc.family])
+
createHistory(town, npc)
createFriends(town, npc)
console.groupEnd()
From c53713b04adaf146eb4e99d92a4d12522fd72e45 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:57:58 +1000
Subject: [PATCH 07/23] Convert death
---
src/NPCGeneration/setupDeath.d.ts | 20 ---
.../{SetupDeath.js => setupDeath.ts} | 130 +++++++++++-------
src/main.ts | 7 +-
3 files changed, 88 insertions(+), 69 deletions(-)
delete mode 100644 src/NPCGeneration/setupDeath.d.ts
rename src/NPCGeneration/{SetupDeath.js => setupDeath.ts} (65%)
diff --git a/src/NPCGeneration/setupDeath.d.ts b/src/NPCGeneration/setupDeath.d.ts
deleted file mode 100644
index 130c124b3..000000000
--- a/src/NPCGeneration/setupDeath.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { NPC } from '../../lib/npc-generation/_common'
-import { Town } from '../../lib/town/_common'
-
-interface Setup {
- createDeadNPC(town: Town, base: Partial): NPC
- npcDeath(town: Town, npc: NPC, base: Partial): NPC
-}
-
-export type DeathData = {
- whileAdventuring(town: Town, npc: NPC, text: string): string
- cause: CauseOfDeath[]
- burialConditions(town: Town, npc: NPC, base: Partial): NPC
- bodyCondition: [number, string][]
-}
-
-interface CauseOfDeath {
- probability?: number
- exclusions(town: Town, npc: NPC): boolean
- function(town: Town, npc: NPC): string
-}
diff --git a/src/NPCGeneration/SetupDeath.js b/src/NPCGeneration/setupDeath.ts
similarity index 65%
rename from src/NPCGeneration/SetupDeath.js
rename to src/NPCGeneration/setupDeath.ts
index 0c1d35b27..5c9a3a9be 100644
--- a/src/NPCGeneration/SetupDeath.js
+++ b/src/NPCGeneration/setupDeath.ts
@@ -1,9 +1,35 @@
// uses setup.createNPC, setup.createRelationship, setup.profile
-/**
- * @type {import("./setupDeath").DeathData}
- */
-const death = {
- whileAdventuring (town, npc, text) {
+
+import { NPC, Town } from '@lib'
+
+export type DeadNPC = NPC & {
+ isAlive: false
+ roll: {
+ deathConditions: number
+ }
+ death: {
+ graveStandard: string
+ cause: string
+ murderer?: string
+ timeSinceDeath: number
+ }
+}
+
+export type DeathData = {
+ whileAdventuring(town: Town, npc: NPC, text: string): string
+ cause: CauseOfDeath[]
+ burialConditions(town: Town, npc: NPC, base: Partial): NPC
+ bodyCondition: [number, string][]
+}
+
+interface CauseOfDeath {
+ probability?: number
+ exclusions(town: Town, npc: NPC): boolean
+ function(town: Town, npc: NPC): string
+}
+
+export const death = {
+ whileAdventuring (town: Town, npc: NPC, text: string) {
const whilst = [
'returning from an adventure',
`on ${npc.hisher} way to an adventure`,
@@ -17,42 +43,42 @@ const death = {
cause: [
// ______
{
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return npc.profession === 'surgeon'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died from a disease caught from a patient while performing a surgery on them.`
}
},
{
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return lib.findProfession(town, npc).sector === 'construction'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died in a workplace accident.`
}
},
// {
// probability: 3,
- // function (town, npc) {
+ // function (town: Town, npc: NPC) {
// const text = `${npc.firstName} was killed by a wild animal.`
// return text
// }
// },
{
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return lib.findProfession(town, npc).sector === 'arts'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} was killed in a freak accident at an art show.`
}
},
{
probability: 1,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return lib.findProfession(town, npc).sector === 'arts'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
console.log('Hello! Creating a murderer.')
const murderer = setup.createNPC(town, {
socialClass: npc.socialClass || 'commoner',
@@ -65,33 +91,33 @@ const death = {
},
{
probability: 2,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return lib.findProfession(town, npc).sector === 'government and law'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
const murderer = setup.createNPC(town, {
socialClass: npc.socialClass
})
setup.createRelationship(town, npc, murderer, { relationship: 'murderer', reciprocalRelationship: `someone who ${murderer.heshe} murdered.` })
- npc.death.murderer = murderer.key
+ if (npc.death) npc.death.murderer = murderer.key
return `${npc.firstName} was murdered by ${setup.profile(murderer, 'someone with a grudge')}.`
}
},
{
probability: 50,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return ['settled adult', 'elderly', 'vulnerably elderly'].includes(npc.ageStage)
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died from ${['exposure', 'cancer', 'a plague', 'diptheria', 'cholera', 'dysentery', 'malaria', 'the flu', 'typhoid fever', 'smallpox', 'leprosy'].random()}.`
}
},
{
probability: 50,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return npc.hasClass === true
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
const text = `${npc.firstName} ${['died from', 'was killed by'].random()} ${['a monster', 'a trap in a dungeon', 'a rival adventuring party', 'some goblins', 'a kobold ambush', 'a powerful foe', 'a wild animal', 'a dragon', 'a particularly sneaky mimic'].random()}`
death.whileAdventuring(town, npc, text)
return text
@@ -99,46 +125,54 @@ const death = {
},
{
probability: 30,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return ['settled adult', 'elderly', 'vulnerably elderly'].includes(npc.ageStage)
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died in ${['a riot', 'a war', 'a religious crusade', 'a raid', 'a mugging'].random()}.`
}
},
{
probability: 30,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return ['young adult', 'settled adult', 'elderly', 'vulnerably elderly'].includes(npc.ageStage)
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died from an ${['infected arm', 'infected leg', 'infection', 'infection from a broken arm', 'infection from a broken leg'].random()}.`
}
},
{
probability: 50,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return npc.gender === 'woman'
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died during childbirth.`
}
},
{
probability: 90,
- exclusions (town, npc) {
+ exclusions (town: Town, npc: NPC) {
return ['child'].includes(npc.ageStage)
},
- function (town, npc) {
+ function (town: Town, npc: DeadNPC) {
return `${npc.firstName} died from ${['falling from a tree', 'being trampled underfoot by a horse', 'the flu', 'cholera'].random()}.`
}
}
],
- burialConditions (town, npc, base) {
+ burialConditions (town: Town, npc: NPC, base: Partial) {
console.log('Burial conditions...')
-
- /** @type {[number, string, number, string][]} */
- const burialConditions = [
+ const newNPC = {
+ isAlive: false,
+ roll: {
+ deathConditions: 0
+ },
+ death: {
+ graveStandard: '',
+ burialConditions: ''
+ }
+ }
+ const burialConditions: [number, string, number, string][] = [
// [lifestyleModifier, lifestyleType, graveRoll, graveDescription]
[70, 'aristocratic', 80, 'a beautiful ornate coffin on a private plot'],
[50, 'wealthy', 60, 'a beautiful ornate coffin'],
@@ -149,15 +183,15 @@ const death = {
[-25, 'wretched', 0, 'a mass grave as an afterthought']
]
- npc.roll.deathConditions = lib.fm(random(1, 100), (town.roll.welfare - 50) / 2)
- console.log('deathConditions roll:', npc.roll.deathConditions)
+ newNPC.roll.deathConditions = lib.fm(random(1, 100), (town.roll.welfare - 50) / 2)
+ console.log('deathConditions roll:', newNPC.roll.deathConditions)
const lifestyle = lib.npcLifestyleStandard(town, npc).lifestyleStandard
let townHelpDescription = ''
for (const burialCondition of burialConditions) {
if (lifestyle === burialCondition[1]) {
- lib.fm(npc.roll.deathConditions, burialCondition[0])
+ lib.fm(newNPC.roll.deathConditions, burialCondition[0])
if ((town.roll.welfare - burialCondition[2]) > 20) {
townHelpDescription = ' with help from the government.'
} if ((town.roll.welfare - burialCondition[2]) < -20) {
@@ -170,14 +204,15 @@ const death = {
}
for (const burialCondition of burialConditions) {
- if (npc.roll.deathConditions > burialCondition[2]) {
- npc.death.graveStandard = base.graveStandard || burialCondition[3]
+ if (newNPC.roll.deathConditions > burialCondition[2]) {
+ newNPC.death.graveStandard = base?.death?.graveStandard || burialCondition[3]
break
}
}
- npc.death.burialConditions = `${npc.heshe.toUpperFirst()} was buried in ${npc.death.graveStandard}${townHelpDescription}`
- return npc
+ newNPC.death.burialConditions = `${npc.heshe.toUpperFirst()} was buried in ${newNPC.death.graveStandard}${townHelpDescription}`
+ lib.assign(npc, newNPC)
+ return npc as DeadNPC
},
bodyCondition: [
[0, 'The body is as fresh as they come, and rigor mortis has not set in yet.'],
@@ -186,23 +221,22 @@ const death = {
]
}
-setup.createDeadNPC = (town, base = {}) => {
+export const createDeadNPC = (town: Town, base: Partial = {}) => {
console.groupCollapsed('Creating a dead NPC!')
const npc = setup.createNPC(town, base)
console.log('RIP', npc.firstName)
- setup.npcDeath(town, npc, base)
+ npcDeath(town, npc, base)
return npc
}
-setup.npcDeath = (town, npc, base = {}) => {
+export const npcDeath = (town: Town, npc: NPC, base: Partial = {}) => {
npc.passageName = 'NPCDeadProfile'
- npc.death = {}
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
npc.death = {
- cause: lib.weightedRandomFetcher(town, death.cause, npc),
- murderer: null,
+ cause: lib.weightedRandomFetcher(town, death.cause, npc) as string,
timeSinceDeath: lib.dice(2, 60),
- ...base,
- ...npc.death
+ ...base
}
death.burialConditions(town, npc, base)
return npc
diff --git a/src/main.ts b/src/main.ts
index 64421f1dd..10ad05d94 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -49,6 +49,7 @@ import { outputGMBinder } from './Tools/Exports/outputGMBinder'
import { copyText } from './Tools/Exports/clipboard'
import { createGuardhouse, createGuardhouseName } from './MiniEstablishments/Guardhouse/createGuardhouse'
import { createStartBuildings } from './Town/js/createStartBuildings'
+import { npcDeath, createDeadNPC } from './NPCGeneration/SetupDeath'
declare global {
interface Setup {
@@ -112,6 +113,8 @@ declare global {
createGuardhouse: typeof createGuardhouse
createGuardhouseName: typeof createGuardhouseName
createStartBuildings: typeof createStartBuildings
+ npcDeath: typeof npcDeath
+ createDeadNPC: typeof createDeadNPC
}
}
@@ -175,7 +178,9 @@ Object.assign(setup, {
outputGMBinder,
createGuardhouse,
createGuardhouseName,
- createStartBuildings
+ createStartBuildings,
+ npcDeath,
+ createDeadNPC
})
/**
From a7af1d57be98e3631318f73c6e850049ce1d2f74 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:58:39 +1000
Subject: [PATCH 08/23] Change to HSL
---
src/Settings/CSS/stylesheet.css | 88 ++++++++++++++++-----------------
1 file changed, 44 insertions(+), 44 deletions(-)
diff --git a/src/Settings/CSS/stylesheet.css b/src/Settings/CSS/stylesheet.css
index e5a695197..c456b46fd 100644
--- a/src/Settings/CSS/stylesheet.css
+++ b/src/Settings/CSS/stylesheet.css
@@ -1,50 +1,50 @@
:root {
- --text-normal: #111;
- --text-muted: #72767d;
- --text-link: #35c;
- --text-link-hover: #57e;
- --header-primary: #58180D;
- --header-secondary: #c9ad6a;
- --interactive-normal: #d5e4d5;
- --interactive-hover: #a4c7a4;
- --interactive-active: #a5c0a5;
- --interactive-muted: #b0c5b0;
- --blockquote-color: #e5e4c1;
- --table-green: #e0e5c1;
- --background-primary: #dedede;
- --background-accent: #a6a794;
- --background-secondary: #cccccc;
- --background-secondary-alt: #d4c8c8;
- --background-tertiary: #fffde2;
- --background-floating: #e6e6e6;
- --monster-yellow: #FDF1DC;
- --descriptive-yellow: #faf7ea;
+ --text-normal: hsl(0, 0%, 10%);
+ --text-muted: hsl(220, 5%, 50%);
+ --text-link: hsl(230, 60%, 50%);
+ --text-link-hover: hsl(230, 80%, 60%);
+ --header-primary: hsl(10, 75%, 20%);
+ --header-secondary: hsl(40, 50%, 60%);
+ --interactive-normal: hsl(120, 25%, 85%);
+ --interactive-hover: hsl(120, 25%, 70%);
+ --interactive-active: hsl(120, 15%, 70%);
+ --interactive-muted: hsl(120, 15%, 60%);
+ --blockquote-color: hsl(60, 40%, 80%);
+ --table-green: hsl(70, 40%, 80%);
+ --background-primary: hsl(0, 0%, 90%);
+ --background-accent: hsl(60, 10%, 60);
+ --background-secondary: hsl(0, 0%, 80%);
+ --background-secondary-alt: hsl(0, 15%, 80%);
+ --background-tertiary: hsl(55, 100%, 95%);
+ --background-floating: hsl(0, 0%, 90%);
+ --monster-yellow: hsl(40, 89%, 95%);
+ --descriptive-yellow: hsl(50, 60%, 95%);
}
html[data-theme="dark"], html.dark {
- --text-normal: #dcddde;
- --text-link: #7289da;
- --background-primary: #1c1c1e;
- --background-secondary: #333333;
- --background-tertiary: #202020;
- --blockquote-color: #313131;
- --interactive-normal: #3f3f3f;
- --interactive-hover: #6d6d6d;
- --header-primary: #c73f3b;
- --header-secondary: #8f896b;
- --interactive-active: #744b4b;
- --interactive-hover: rgb(143, 84, 84);
- --interactive-muted: rgb(97, 30, 30);
- --table-green: #3a3b35;
- --background-accent: #966767;
-
- /* --background-primary: #36393f;
+ --text-normal: hsl(210, 5%, 90%);
+ --text-link: hsl(230, 60%, 65%);
+ --background-primary: hsl(240, 5%, 10%);
+ --background-secondary: hsl(0, 0%, 20%);
+ --background-tertiary: hsl(0, 0%, 15%);
+ --blockquote-color: hsl(0, 0%, 20%);
+ --interactive-normal: hsl(0, 0%, 25%);
+ --interactive-hover: hsl(0, 0%, 40%);
+ --header-primary: hsl(2, 55%, 50%);
+ --header-secondary: hsl(50, 14%, 50%);
+ --interactive-active: hsl(0, 20%, 40%);
+ --interactive-hover: hsl(0, 25%, 45%);
+ --interactive-muted: hsl(0, 50%, 25%);
+ --table-green: hsl(70, 5%, 25%);
+ --background-accent: hsl(0, 20%, 50%);
+
+ /* --background-primary: #36093f;
--background-secondary: #2f3136; */
- --background-secondary-alt: #292b2f;
- --background-tertiary: #202225;
- --background-floating: #18191c;
- --descriptive-yellow: #4b483c;
+ --background-secondary-alt: hsl(220, 7%, 17%);
+ --background-tertiary: hsl(216, 7%, 14%);
+ --background-floating: hsl(225, 8%, 10%);
+ --descriptive-yellow: hsl(48, 11%, 25%);
}
body {
@@ -189,9 +189,9 @@ body[data-tags~="force-one-column"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom: 3px solid var(--header-secondary);
- box-shadow: 4px 4px 36px rgb(48 32 0 / 12%);
+ box-shadow: 4px 4px 36px rgb(48 32 0 / 15%);
z-index: 90;
- /* Subtract the border size */
+ /* Subtract the border size */
padding-bottom: calc(0.4em - 3px);
}
@@ -767,7 +767,7 @@ input, select, textarea {
input:not(:disabled):focus, select:not(:disabled):focus, textarea:not(:disabled):focus,
input:not(:disabled):hover, select:not(:disabled):hover, textarea:not(:disabled):hover {
/* background-color: rgb(240, 217, 140);
- border-color: rgb(194, 163, 61); */
+ border-color: rgb(194, 160, 61); */
background-color: var(--interactive-normal);
border-color: var(--interactive-hover)
}
From 87940653ed9f557f5333f812545fcf0cdcd30896 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Mon, 19 Apr 2021 22:58:52 +1000
Subject: [PATCH 09/23] minor change
---
src/Settings/CSS/stylesheet.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Settings/CSS/stylesheet.css b/src/Settings/CSS/stylesheet.css
index c456b46fd..188e884c3 100644
--- a/src/Settings/CSS/stylesheet.css
+++ b/src/Settings/CSS/stylesheet.css
@@ -189,7 +189,7 @@ body[data-tags~="force-one-column"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom: 3px solid var(--header-secondary);
- box-shadow: 4px 4px 36px rgb(48 32 0 / 15%);
+ box-shadow: 4px 4px 36px rgb(48 32 0 / 12%);
z-index: 90;
/* Subtract the border size */
padding-bottom: calc(0.4em - 3px);
From 3f48a12c55db3c21b897b47c4439223220c9d5de Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:10:12 +1000
Subject: [PATCH 10/23] Formatting
---
src/Alchemist/AlchemistOutput.twee | 14 ++--
src/Blacksmith/SmithyOutput.twee | 7 +-
src/GeneralStore/GeneralStoreOutput.twee | 1 +
.../Brothel/BrothelOutput.twee | 7 +-
.../Graveyard/GraveyardOutput.twee | 11 ++-
.../Guardhouse/GuardhouseOutput.twee | 3 +-
.../Market/MarketsOutput.twee | 76 +++++++++++--------
src/MiniEstablishments/Posters.twee | 12 +--
.../Temple/TempleOutput.twee | 10 +--
.../TownSquare/TownSquareOutput.twee | 32 +++++---
src/Settings/CSS/stylesheet.css | 27 +++++++
src/Tavern/TavernOutput.twee | 23 +++---
src/Town/TownMicroEventsOutput.twee | 27 ++++---
13 files changed, 146 insertions(+), 104 deletions(-)
diff --git a/src/Alchemist/AlchemistOutput.twee b/src/Alchemist/AlchemistOutput.twee
index ddde17d9e..45e654381 100644
--- a/src/Alchemist/AlchemistOutput.twee
+++ b/src/Alchemist/AlchemistOutput.twee
@@ -1,15 +1,13 @@
-:: AlchemistOutput [alchemist]
-\<>
-\<><>
-\<>
-\$building.name
-\<>
-<>You enter $building.name, <>. <> There is a chemist behind the shop counter currently <>.
+:: AlchemistOutput [alchemist nobr]
+<>
+<><>
+<>
+$building.name <>< ><>You enter $building.name, <>. <> There is a chemist behind the shop counter currently <>.
Chemist The $associatedNPC.weight chemist <> <>. <> introduces $associatedNPC.himherself as <>, the $associatedNPC.owner of the shop, and asks what $associatedNPC.heshe can do for you.
<Talk with $associatedNPC.name" t8n>>
$associatedNPC.name <>< >
< Generate plothook">><><> <><>< >< >
<>
<>
-<>< >
\ No newline at end of file
+<>
\ No newline at end of file
diff --git a/src/Blacksmith/SmithyOutput.twee b/src/Blacksmith/SmithyOutput.twee
index 96b401082..ae16119cb 100644
--- a/src/Blacksmith/SmithyOutput.twee
+++ b/src/Blacksmith/SmithyOutput.twee
@@ -1,13 +1,14 @@
-:: SmithyOutput
+:: SmithyOutput [nobr]
<>
<>
<>
-<>$building.name
+$building.name
+<>< >
<>You make your way down <>, and enter $building.name and see that inside, the $building.structure.descriptor is $building.size. <> There is a blacksmith currently <>.
<>
Blacksmith The blacksmith <> <>. <> introduces $associatedNPC.himherself as <>, the $associatedNPC.owner of the smithy, and asks what $associatedNPC.heshe can do for you.
<>
< Generate plothook">><><><> <><>< >< >
<>
-<><
>
\ No newline at end of file
+<>
\ No newline at end of file
diff --git a/src/GeneralStore/GeneralStoreOutput.twee b/src/GeneralStore/GeneralStoreOutput.twee
index 83c929da1..110ef48ed 100644
--- a/src/GeneralStore/GeneralStoreOutput.twee
+++ b/src/GeneralStore/GeneralStoreOutput.twee
@@ -4,6 +4,7 @@
<>
<>
$building.name <>
+<>< >
You make your way down <>, and enter $building.structure.descriptor and see that inside, the $building.size building is $building.cleanliness.<> $building.clutter< > You notice $building.note. The store's shopkeep is currently $building.idle.
Shopkeeper
The shopkeep <> <>. <> introduces $associatedNPC.himherself as <>, the $associatedNPC.owner of the General Store, and $building.say. $building.shopkeepNote.
diff --git a/src/MiniEstablishments/Brothel/BrothelOutput.twee b/src/MiniEstablishments/Brothel/BrothelOutput.twee
index ec9b8d221..d720ab41f 100644
--- a/src/MiniEstablishments/Brothel/BrothelOutput.twee
+++ b/src/MiniEstablishments/Brothel/BrothelOutput.twee
@@ -1,11 +1,8 @@
-:: BrothelOutput [brothel]
-<>
+:: BrothelOutput [brothel nobr]
<>
<>
<>
-$building.name
-<>< >
-You make your way down <>, and enter $building.name $building.structure.descriptor. Inside, the $building.size $building.structure.material.noun building is $building.cleanliness. You notice $building.notice.
+$building.name <>You make your way down <>, and enter $building.name $building.structure.descriptor. Inside, the $building.size $building.structure.material.noun building is $building.cleanliness. You notice $building.notice.
When people talk about $building.name, they say $building.talk. Apparently, it specialises in $building.specialty.
Rumours abound in whorehouses, and $building.name is no different; apparently, $building.rumour.
Brothel $associatedNPC.title
diff --git a/src/MiniEstablishments/Graveyard/GraveyardOutput.twee b/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
index c8dbb7094..90b6969a1 100644
--- a/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
+++ b/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
@@ -1,9 +1,8 @@
-:: GraveyardOutput
-\<>
-\<>
-\<>
-\$building.name
-You walk down <> to the $building.wordNoun. It is $building.location, and is $building.size. You enter the $building.wordNoun $building.entrance. It's mostly $building.cleanliness. As you enter you notice $building.feature.
+:: GraveyardOutput [nobr]
+<>
+<>
+<>
+$building.name You walk down <> to the $building.wordNoun. It is $building.location, and is $building.size. You enter the $building.wordNoun $building.entrance. It's mostly $building.cleanliness. As you enter you notice $building.feature.
Gravedigger $building.gravediggerLook.
The gravedigger greets you as you come near, and introduces $associatedNPC.himherself as <>. <> says $building.gravediggerChat.
< ><><><><><>
diff --git a/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee b/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
index 55462a453..ab5fd4ba3 100644
--- a/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
+++ b/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
@@ -3,8 +3,7 @@
<>
<>
<>
-$currentPassage.name
-You make your way down <>, and enter $currentPassage.name $currentPassage.structure.descriptor. $currentPassage.name is known for $currentPassage.notableFeature
+$currentPassage.name You make your way down <>, and enter $currentPassage.name $currentPassage.structure.descriptor. $currentPassage.name is known for $currentPassage.notableFeature
It is run by <>, who are $currentPassage.expertise.
At the moment, <>
<>
diff --git a/src/MiniEstablishments/Market/MarketsOutput.twee b/src/MiniEstablishments/Market/MarketsOutput.twee
index 77fa06c3e..783cbac86 100644
--- a/src/MiniEstablishments/Market/MarketsOutput.twee
+++ b/src/MiniEstablishments/Market/MarketsOutput.twee
@@ -1,37 +1,47 @@
-:: MarketOutput [market]
-<><>
+:: MarketOutput [market nobr]
+<>
<><><><>
-<>< >< >$building.name
-\You wander through the streets of $town.name, and come across the market, which is located in $building.location. It seems that the vendors are organised by $building.organisation. The market is known for $building.draw, and is $building.cleanliness. Today the market is $building.crowd.
+<><>
+$building.name You wander through the streets of $town.name, and come across the market, which is located in $building.location. It seems that the vendors are organised by $building.organisation. The market is known for $building.draw, and is $building.cleanliness. Today the market is $building.crowd.
Merchants
-\<>
-\<> <> is _seller.selling from a _seller.tent.
+<>
+<> <> is _seller.selling from a _seller.tent.
< >
-< Who else is there?">>
-<><><><>
-<>
-<><><> <>There's <> selling $building.moreSeller.merchant.selling from <>.< >< >
-A <> is selling magical trinkets from <>. Or, at least, they're supposedly magical items.
-<>
-<>< >< >< >
-< > -- <>
- <>
- <>
- <><>
- <>
- <>The $building.magicSeller.manwoman beckons you over to $building.magicSeller.hisher stall, and introduces $building.magicSeller.himherself as <>, a purveyor of fine goods. The $building.magicSeller.raceNote asks you for your ring size, and then $building.magicSeller.heshe reaches below $building.magicSeller.hisher table, and procures a ring...
-
-
<> ring
- $building.magic.firstOutputs
- < >< Look at another ring">><>
- <>
-
-
<> ring
- $building.magic.secondOutputs
< ><><>< >
- <>
- <><>
- <>
$building.magic.name $building.magic.description
<>
- <>
-<>
-
+
+ < Who else is there?">>
+ <><><><>
+ <>
+ <>
+ <>
+ <>
+
+ <>
+ There's <> selling $building.moreSeller.merchant.selling from <>.
+ < >
+ < >
+
+
+ A <> is selling magical trinkets from <>. Or, at least, they're supposedly magical items.
+ <>
+ <>< >< >< >
+ < > -- <>
+ <>
+ <>
+ <>
+ <>
+ <>The $building.magicSeller.manwoman beckons you over to $building.magicSeller.hisher stall, and introduces $building.magicSeller.himherself as <>, a purveyor of fine goods. The $building.magicSeller.raceNote asks you for your ring size, and then $building.magicSeller.heshe reaches below $building.magicSeller.hisher table, and procures a ring...
+
+
<> ring
+ $building.magic.firstOutputs
+ < >< Look at another ring">><>
+ <>
+
+
<> ring
+ $building.magic.secondOutputs
< ><><>
+ <>
+ <><>
+ <>
$building.magic.name $building.magic.description< >
+ < >
+ < >
+
\ No newline at end of file
diff --git a/src/MiniEstablishments/Posters.twee b/src/MiniEstablishments/Posters.twee
index 878606a4d..698d0b6fa 100644
--- a/src/MiniEstablishments/Posters.twee
+++ b/src/MiniEstablishments/Posters.twee
@@ -1,8 +1,8 @@
-:: Posters
+:: Posters [nobr]
<>
-\<>
-\ <>
-\< >
-\<>
+<>
+ <>
+< >
+<>
<>< >
-\
+
diff --git a/src/MiniEstablishments/Temple/TempleOutput.twee b/src/MiniEstablishments/Temple/TempleOutput.twee
index 5c663de9d..f63c95e6c 100644
--- a/src/MiniEstablishments/Temple/TempleOutput.twee
+++ b/src/MiniEstablishments/Temple/TempleOutput.twee
@@ -1,5 +1,5 @@
-:: TempleOutput
-<><>
+:: TempleOutput [nobr]
+<>
<>
<>
$building.name You come across $building.structure.templeDescriptor. $building.guardReadout
@@ -9,7 +9,7 @@
$building.priestLook. The priest greets you, and introduces $associatedNPC.himherself as <>. $building.priestChat.
<Get Temple Blessing" t8n>>Blessing
$building.blessing
< >
-<><Buy something" t8n>>
+<Buy something" t8n>>
<>
<>
<>
@@ -29,5 +29,5 @@
}
}>>
<>
-< >< >
-<>< >
\ No newline at end of file
+<>
+<>
\ No newline at end of file
diff --git a/src/MiniEstablishments/TownSquare/TownSquareOutput.twee b/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
index d6fea49c8..d25ff803f 100644
--- a/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
+++ b/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
@@ -1,11 +1,23 @@
-:: TownSquareOutput
-<>The Town Square You're in the town square. It's $building.size, and $building.cleanliness. It features $building.feature As you <>, you see <>
-There's <> There's also a noticeboard, which has various posters, requests, and announcements tacked to it.
-<>
-<>
- <>
-< >
-<>
-<>< >
-<><><> $building.associatedNPC< >< >
+:: TownSquareOutput [nobr]
+<>
+The Town Square You're in the town square.
+It's $building.size, and $building.cleanliness. It features $building.feature
+As you <>, you see <>
+There's <> There's also a noticeboard, which has various posters, requests, and announcements tacked to it.
+
+ <>
+ <>
+ <>
+ < >
+ <>
+ <>
+ < >
+
+ <>
+ <>
+ <> $building.associatedNPC
+ < >
+ < >
+
+
<>
diff --git a/src/Settings/CSS/stylesheet.css b/src/Settings/CSS/stylesheet.css
index 188e884c3..f35a5334a 100644
--- a/src/Settings/CSS/stylesheet.css
+++ b/src/Settings/CSS/stylesheet.css
@@ -499,6 +499,9 @@ p {
line-height: 1.75em;
}
+p:empty {
+ display: hidden;
+}
/* P+P */
@@ -557,10 +560,34 @@ h1+ p::first-line {
font-family: Scaly Sans Caps;
}
+h1+ button + p::first-line {
+ font-family: Scaly Sans Caps;
+}
+
+h1+ button + br + p::first-line {
+ font-family: Scaly Sans Caps;
+}
+
+
+
+h1 + blockquote + p::first-line {
+ font-family: Scaly Sans Caps;
+}
+
+h1+ button + blockquote + p::first-line {
+ font-family: Scaly Sans Caps;
+}
+
+h1+ p button + blockquote + p::first-line {
+ font-family: Scaly Sans Caps;
+}
+
#passages .first-character + p + p {
text-indent: 0;
}
+
+
blockquote {
font-family: Scaly Sans;
box-sizing: border-box;
diff --git a/src/Tavern/TavernOutput.twee b/src/Tavern/TavernOutput.twee
index 9a6c289c7..304b252f1 100644
--- a/src/Tavern/TavernOutput.twee
+++ b/src/Tavern/TavernOutput.twee
@@ -1,24 +1,23 @@
-:: TavernOutput [tavern]
-\
-\<>
-\<>
-\<>
-\$building.name
-\You make your way through the $town.type of $town.name until you come to <>, which is called $building.name , <> $building.structure.descriptor that the locals know best for its $building.draw.
+:: TavernOutput [tavern nobr]
+
+<>
+<>
+<>
+$building.name <>< >You make your way through the $town.type of $town.name until you come to <>, which is called $building.name , <> $building.structure.descriptor that the locals know best for its $building.draw.
The Tavern
-\<> $building.feature
+<> $building.feature
<>
<>
<>
The Bar Behind the counter is who you would assume to be the bartender, <> who is currently <>. You walk up to the bar, and strike up conversation with the $associatedNPC.manwoman, who introduces $associatedNPC.himherself as <>, the $associatedNPC.owner of $building.name.
-\<>
+<>
<>
<>
Tavern Entertainment
-\$building.entertainment
+$building.entertainment
<>
-\< ><><><>
-\<><>$building.carousing
< >< >
+< ><><><>
+<><>$building.carousing
< >< >
<>
<>
<>
\ No newline at end of file
diff --git a/src/Town/TownMicroEventsOutput.twee b/src/Town/TownMicroEventsOutput.twee
index 1e26ea3d7..692e84fac 100644
--- a/src/Town/TownMicroEventsOutput.twee
+++ b/src/Town/TownMicroEventsOutput.twee
@@ -1,15 +1,14 @@
-:: TownMicroEventsOutput
+:: TownMicroEventsOutput [nobr]
<>
-\ <>Looking for the sliders? They're currently set to <>. You can change them in the settings.< >
-\<>
-\ <>Want to get straight to the action, sans slider screen? They're currently set to <>. You can change them in the settings.< >
-\< >
-\< 2>>
-\
-\ As you make your way along
-\ <>
-\ <>
-\ <>
-\ the road,
-\ < >
-\ <> < >
\ No newline at end of file
+ <>Looking for the sliders? They're currently set to <>. You can change them in the settings.< >
+<>
+ <>Want to get straight to the action, sans slider screen? They're currently set to <>. You can change them in the settings.< >
+<>
+< 2>>
+ As you make your way along
+ <>
+ <>
+ <>
+ the road,
+ < >
+ <> < >
\ No newline at end of file
From d79d29a69b778a5e114649cc9a13609a3f0758e6 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:16:26 +1000
Subject: [PATCH 11/23] Add message for local
---
src/Settings/Setting.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Settings/Setting.js b/src/Settings/Setting.js
index a875830c6..4dc7f5f9a 100644
--- a/src/Settings/Setting.js
+++ b/src/Settings/Setting.js
@@ -58,6 +58,7 @@ function isPatron () {
}
function patreonContent () {
+ if (location.origin === 'file://') return 'Patreon content is unlocked because you are running a local copy.'
if (isPatron()) return 'Patreon content is unlocked.'
return 'Patreon content is not currently unlocked.'
}
From 150442465cf1ee6df9b39ac8a6640a2dd82385cf Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:27:14 +1000
Subject: [PATCH 12/23] Fixed an issue with tippy not initialising
---
src/Buildings/Components/CreateNewNPC.twee | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Buildings/Components/CreateNewNPC.twee b/src/Buildings/Components/CreateNewNPC.twee
index 5778ba835..7fc28f847 100644
--- a/src/Buildings/Components/CreateNewNPC.twee
+++ b/src/Buildings/Components/CreateNewNPC.twee
@@ -15,6 +15,7 @@
<>
<><>< >
<><>< >
+ <>
<>
<>
<>
From c6c1d70009222ca7d763a5a4453d5b26927bc273 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:27:24 +1000
Subject: [PATCH 13/23] Remove h4
---
src/Alchemist/AlchemistOutput.twee | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Alchemist/AlchemistOutput.twee b/src/Alchemist/AlchemistOutput.twee
index 45e654381..2b345d9de 100644
--- a/src/Alchemist/AlchemistOutput.twee
+++ b/src/Alchemist/AlchemistOutput.twee
@@ -5,9 +5,9 @@
<>
$building.name <>< ><>You enter $building.name, <>. <> There is a chemist behind the shop counter currently <>.
Chemist The $associatedNPC.weight chemist <> <>. <> introduces $associatedNPC.himherself as <>, the $associatedNPC.owner of the shop, and asks what $associatedNPC.heshe can do for you.
-<Talk with $associatedNPC.name" t8n>>
+<>
$associatedNPC.name <>< >
-< Generate plothook">><><> <><>< >< >
+< ><><> <><>< >< >
<>
<>
<>
\ No newline at end of file
From 08fb93261353fcbfaed5333447cec5ccc48d37db Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:28:59 +1000
Subject: [PATCH 14/23] Formatting
---
src/Alchemist/ChemistTalk.twee | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Alchemist/ChemistTalk.twee b/src/Alchemist/ChemistTalk.twee
index e75b08582..0785c89f0 100644
--- a/src/Alchemist/ChemistTalk.twee
+++ b/src/Alchemist/ChemistTalk.twee
@@ -1,2 +1,2 @@
-:: ChemistTalk
-$associatedNPC.firstName looks <>, and idly shifts a box of <> as $associatedNPC.heshe talks. The $associatedNPC.raceNote <> as you peruse the shop. $associatedNPC.firstName tells you that $associatedNPC.heshe is working on <>, and points to the <>. Looking inside the $building.brew.vesselType, you see <> bubbling away< >.
+:: ChemistTalk [nobr]
+$associatedNPC.firstName looks <>, and idly shifts a box of <> as $associatedNPC.heshe talks. The $associatedNPC.raceNote <> as you peruse the shop. $associatedNPC.firstName tells you that $associatedNPC.heshe is working on <>, and points to the <>. Looking inside the $building.brew.vesselType, you see <> bubbling away< >.
From df911ef4e0916dabf8f1828780f853a68ec25ba6 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Thu, 22 Apr 2021 22:39:44 +1000
Subject: [PATCH 15/23] formatting
---
.../NPCProfile/Components/NPCEarlyLife.twee | 2 +-
.../NPCProfile/Components/NPCHeader.twee | 2 +-
src/NPCGeneration/NPCProfile/NPCProfile.twee | 47 ++++++++++---------
3 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/NPCGeneration/NPCProfile/Components/NPCEarlyLife.twee b/src/NPCGeneration/NPCProfile/Components/NPCEarlyLife.twee
index ba2d84d45..50f2de803 100644
--- a/src/NPCGeneration/NPCProfile/Components/NPCEarlyLife.twee
+++ b/src/NPCGeneration/NPCProfile/Components/NPCEarlyLife.twee
@@ -1,4 +1,4 @@
-:: NPCEarlyLife
+:: NPCEarlyLife [nobr]
Early Life
I was born $currentNPC.birthplace, and was raised by $currentNPC.familyUnit<
> as an only child.<> with my brother.<>, along with my $currentNPC.siblingNumber siblings.< > I had <
> upbringing in $currentNPC.familyHome. <>I didn't know my parents growing up.< ><>$currentNPC.parentalLineage.< > $currentNPC.childhoodMemories.
diff --git a/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee b/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
index 8ae7fbaaa..c31c85992 100644
--- a/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
+++ b/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
@@ -15,7 +15,7 @@ $currentNPC.title
rerender: true,
dialogOpts: $npcs[$currentPassage.key]
})>>
- <>
+ <>
< >
/* <>
<>
diff --git a/src/NPCGeneration/NPCProfile/NPCProfile.twee b/src/NPCGeneration/NPCProfile/NPCProfile.twee
index 7162a3056..509f0fc94 100644
--- a/src/NPCGeneration/NPCProfile/NPCProfile.twee
+++ b/src/NPCGeneration/NPCProfile/NPCProfile.twee
@@ -1,29 +1,30 @@
-:: NPCProfile
+:: NPCProfile [nobr]
<>
-<><>
< >
+<><>
< >
<><> $currentNPC.name<><>< > is <> $currentNPC.malefemale $currentNPC.race.
-\<> is <> and <>, and has $currentNPC.eyes eyes<> and <>,< > with $currentNPC.skinColour skin. The most notable physical trait of $currentNPC.firstName is that $currentNPC.heshe has $currentNPC.physicalTrait.
+<> is <> and <>, and has $currentNPC.eyes eyes<> and <>,< > with $currentNPC.skinColour skin.
+The most notable physical trait of $currentNPC.firstName is that $currentNPC.heshe has $currentNPC.physicalTrait.
$currentNPC.firstName $currentNPC.trait.
-\<><> $currentNPC.vocalPattern. < >
-\<><> is <> < >
-\When $currentNPC.heshe is relaxed, $currentNPC.heshe is $currentNPC.calmTrait. In moments of stress, $currentNPC.heshe becomes $currentNPC.stressTrait.
-\Religion-wise, $currentNPC.firstName is <> of <><>.
-\< 0>>Despite sexism against $currentNPC.himher, <>Perhaps due to sexism, < >$currentNPC.professionSuccess, with a background of being <>.
-\<>
- \<> belongs to the <> social class
-\<>
- \<> belongs to the $currentNPC.socialClass social class, but <>
-\< >.
-\$currentNPC.firstName currently has $currentNPC.pockets in $currentNPC.hisher pockets, and <> to $currentNPC.hisher name. <> lives on <>.
-\<>In combat, $currentNPC.heshe uses $currentNPC.weapon. < ><>$currentNPC.firstName knows $currentNPC.knownLanguages[0] and <>. < >
-\<>$currentNPC.doesnt< >
-\<>
- \<> is $currentNPC.sexuality
- \<>
- \, and has <>, <>.
- \< >
- \<>$currentNPC.firstName has <>, <>.
-\< >
+<><> $currentNPC.vocalPattern. < >
+<><> is <> < >
+When $currentNPC.heshe is relaxed, $currentNPC.heshe is $currentNPC.calmTrait. In moments of stress, $currentNPC.heshe becomes $currentNPC.stressTrait.
+Religion-wise, $currentNPC.firstName is <> of <><>.
+< 0>>Despite sexism against $currentNPC.himher, <>Perhaps due to sexism, < >$currentNPC.professionSuccess, with a background of being <>.
+<>
+ <> belongs to the <> social class
+<>
+ <> belongs to the $currentNPC.socialClass social class, but <>
+< >.
+$currentNPC.firstName currently has $currentNPC.pockets in $currentNPC.hisher pockets, and <> to $currentNPC.hisher name. <> lives on <>.
+<>In combat, $currentNPC.heshe uses $currentNPC.weapon. < ><>$currentNPC.firstName knows $currentNPC.knownLanguages[0] and <>. < >
+<>$currentNPC.doesnt< >
+<>
+ <> is $currentNPC.sexuality
+ <>
+ , and has <>, <>.
+ < >
+ <>$currentNPC.firstName has <>, <>.
+< >
<>
<>$currentNPC.note
< >
<>
From c7aed22d0a413ded61b5f3af70a86401e0993bec Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 11:21:35 +1000
Subject: [PATCH 16/23] update changelog
---
CHANGELOG.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1e308a1e0..af5254fdb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,16 @@ 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/).
+## Unreleased
+
+### Added
+- Edit button to buildings that have an editor.
+
+### Changed
+- Modified formatting
+- Shifted notification down slightly so it does not collide with the header
+- Fixed an issue with Tippy not initialising for elements created in a table.
+
## 2.8.5
### Added
From b79ab94aad0b1b00ec7ca4dbef77795c9326fee6 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 12:29:13 +1000
Subject: [PATCH 17/23] Closes #518
---
src/PlotHook/plothooks.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/PlotHook/plothooks.ts b/src/PlotHook/plothooks.ts
index 540d75b18..ccd355fa1 100644
--- a/src/PlotHook/plothooks.ts
+++ b/src/PlotHook/plothooks.ts
@@ -107,6 +107,7 @@ export const plothooks = [
function (town: Town) {
const npc = createNPC(town, {
background: 'noble',
+ socialClass: 'nobility',
gender: 'man'
})
return `The party is mistaken by a ${profile(npc, 'wealthy man')} as carriage caretakers in a shantytown neighborhood. He hands them money to protect his vehicle. The legitimate caretakers challenge the PCs and try to steal the wealthy wagon. Does the party protect the rich man's vehicle or do they leave the locals to do as they please, risking later persecution by the noble client?`
From f6d854179a83b839a7f57b099cf6cc6dd5c27a4e Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 13:47:06 +1000
Subject: [PATCH 18/23] slight refactoring
---
lib/npc-generation/createDescriptors.ts | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/npc-generation/createDescriptors.ts b/lib/npc-generation/createDescriptors.ts
index efa8db73c..5892539c8 100644
--- a/lib/npc-generation/createDescriptors.ts
+++ b/lib/npc-generation/createDescriptors.ts
@@ -1,6 +1,11 @@
import { articles } from '../src/articles'
import { NPC } from './_common'
+const getHumanOrRaceDescription = (npc: NPC) => {
+ if (npc.race === 'human') return `${lib.random([npc.weight, npc.height])} ${npc.manwoman}`
+ return `${lib.random([npc.weight, npc.height])} ${npc.malefemale} ${npc.raceName}`
+}
+
export function createDescriptors (npc: NPC): string[] {
console.log(`assigning descriptors to ${npc.name}...`)
@@ -9,9 +14,9 @@ export function createDescriptors (npc: NPC): string[] {
* @see https://github.com/ryceg/Eigengrau-s-Essential-Establishment-Generator/wiki/Style-Guide#adjectives
*/
const descriptors = [
- `${npc.age || npc.ageStage} ${npc.raceName}`,
+ `${npc.age || npc.ageStage} ${npc.raceName} with ${npc.physicalTrait}`,
`${npc.skinColour} skinned ${lib.random([npc.weight, npc.height])} ${npc.raceName}`,
- `${lib.random([npc.weight, npc.height])} ${npc.raceName}`,
+ `${getHumanOrRaceDescription(npc)} with ${npc.physicalTrait}`,
`${lib.random([npc.height, npc.age])} ${npc.gender} with ${npc.physicalTrait}`
]
@@ -22,11 +27,12 @@ export function createDescriptors (npc: NPC): string[] {
default:
switch (npc.race) {
case 'human':
- descriptors.push(`${lib.random([npc.weight, npc.height])} ${npc.manwoman}`)
break
default:
- descriptors.push(`${lib.random([npc.weight, npc.height])} ${npc.malefemale} ${npc.raceName}`)
- descriptors.push(`${lib.random([npc.weight, npc.height])} ${lib.raceTraits[npc.race].raceWords.raceAdjective} ${npc.manwoman}`)
+ descriptors.push(
+ getHumanOrRaceDescription(npc),
+ `${lib.random([npc.weight, npc.height])} ${lib.raceTraits[npc.race].raceWords.raceAdjective} ${npc.manwoman}`
+ )
}
}
From 6ff5a5fd122fb1ba2af66201f36c9a4a3d5a3077 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 21:42:57 +1000
Subject: [PATCH 19/23] Add printImage
---
src/Alchemist/AlchemistOutput.twee | 1 +
src/Blacksmith/SmithyOutput.twee | 1 +
src/Buildings/GenericPassage.twee | 1 +
src/Castle/CastleOutput.twee | 3 +-
src/Docks/DocksOutput.twee | 1 +
src/Factions/FactionProfile.twee | 1 +
src/GeneralStore/GeneralStoreOutput.twee | 2 +-
src/GeneralStore/JS/createGeneralStore.js | 3 +-
.../Brothel/BrothelOutput.twee | 1 +
.../Graveyard/GraveyardOutput.twee | 1 +
.../Guardhouse/GuardhouseOutput.twee | 1 +
.../Market/MarketsOutput.twee | 1 +
.../Temple/TempleOutput.twee | 1 +
.../TownSquare/TownSquareOutput.twee | 1 +
.../NPCProfile/Components/NPCHeader.twee | 7 +-
src/Religion/DeityProfile.twee | 4 +
src/Roads/RoadProfile.twee | 6 +-
src/Settings/CustomImages.twee | 178 ++++++++++++++++++
src/Start/Start.twee | 5 +-
src/Tavern/TavernOutput.twee | 2 +-
src/Tavern/js/createTavern.ts | 1 +
21 files changed, 210 insertions(+), 12 deletions(-)
create mode 100644 src/Settings/CustomImages.twee
diff --git a/src/Alchemist/AlchemistOutput.twee b/src/Alchemist/AlchemistOutput.twee
index 2b345d9de..59f8b6612 100644
--- a/src/Alchemist/AlchemistOutput.twee
+++ b/src/Alchemist/AlchemistOutput.twee
@@ -1,5 +1,6 @@
:: AlchemistOutput [alchemist nobr]
+<>
<>
<><>
<>
diff --git a/src/Blacksmith/SmithyOutput.twee b/src/Blacksmith/SmithyOutput.twee
index ae16119cb..1c618ec5a 100644
--- a/src/Blacksmith/SmithyOutput.twee
+++ b/src/Blacksmith/SmithyOutput.twee
@@ -1,5 +1,6 @@
:: SmithyOutput [nobr]
+<>
<>
<>
<>
diff --git a/src/Buildings/GenericPassage.twee b/src/Buildings/GenericPassage.twee
index 1a04e7e56..03102c13f 100644
--- a/src/Buildings/GenericPassage.twee
+++ b/src/Buildings/GenericPassage.twee
@@ -1,4 +1,5 @@
:: GenericPassage
+\<>
<>$building.name
<>
<>
diff --git a/src/Castle/CastleOutput.twee b/src/Castle/CastleOutput.twee
index 9bd37e400..9209dfc48 100644
--- a/src/Castle/CastleOutput.twee
+++ b/src/Castle/CastleOutput.twee
@@ -1,5 +1,6 @@
:: CastleOutput
-<>
+\<>
+\<>
\<>
This $building.size $building.wordNoun was built by $building.builtBy $building.age, and is $building.condition. As you approach, <>.
<>It is named after <>, <>.
< >It is known for $building.knownFor, and is worth defending because $building.defense.reason. The castle needs assistance $building.lookingFor.
diff --git a/src/Docks/DocksOutput.twee b/src/Docks/DocksOutput.twee
index 878001dcf..e50ee897f 100644
--- a/src/Docks/DocksOutput.twee
+++ b/src/Docks/DocksOutput.twee
@@ -1,4 +1,5 @@
:: DocksOutput
+\<>
\<>
\<>
\<>
diff --git a/src/Factions/FactionProfile.twee b/src/Factions/FactionProfile.twee
index edb85e9be..52dab924e 100644
--- a/src/Factions/FactionProfile.twee
+++ b/src/Factions/FactionProfile.twee
@@ -1,4 +1,5 @@
:: FactionProfile
+\<>
\<><>
\<>
\$currentPassage.name
diff --git a/src/GeneralStore/GeneralStoreOutput.twee b/src/GeneralStore/GeneralStoreOutput.twee
index 110ef48ed..2757f7920 100644
--- a/src/GeneralStore/GeneralStoreOutput.twee
+++ b/src/GeneralStore/GeneralStoreOutput.twee
@@ -1,5 +1,5 @@
:: generalStoreOutput [nobr]
-
+<>
<>
<>
<>
diff --git a/src/GeneralStore/JS/createGeneralStore.js b/src/GeneralStore/JS/createGeneralStore.js
index 252780f68..658cb7631 100644
--- a/src/GeneralStore/JS/createGeneralStore.js
+++ b/src/GeneralStore/JS/createGeneralStore.js
@@ -23,7 +23,8 @@ setup.createGeneralStore = (town, opts = {}) => {
passageName: 'generalStoreOutput',
initPassage: 'InitgeneralStore',
buildingType: 'generalStore',
- objectType: 'building'
+ objectType: 'building',
+ localImage: 'general-store-illustration'
})
lib.createStructure(town, generalStore)
generalStore.structure.descriptor = `${lib.articles.output(generalStore.structure.material.wealth)} ${generalStore.structure.material.noun} ${generalStore.wordNoun} with ${lib.articles.output(generalStore.structure.roof.verb)} roof`
diff --git a/src/MiniEstablishments/Brothel/BrothelOutput.twee b/src/MiniEstablishments/Brothel/BrothelOutput.twee
index d720ab41f..e3eb1a81b 100644
--- a/src/MiniEstablishments/Brothel/BrothelOutput.twee
+++ b/src/MiniEstablishments/Brothel/BrothelOutput.twee
@@ -1,4 +1,5 @@
:: BrothelOutput [brothel nobr]
+<>
<>
<>
<>
diff --git a/src/MiniEstablishments/Graveyard/GraveyardOutput.twee b/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
index 90b6969a1..8dc7f4695 100644
--- a/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
+++ b/src/MiniEstablishments/Graveyard/GraveyardOutput.twee
@@ -1,4 +1,5 @@
:: GraveyardOutput [nobr]
+<>
<>
<>
<>
diff --git a/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee b/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
index ab5fd4ba3..7b07daebc 100644
--- a/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
+++ b/src/MiniEstablishments/Guardhouse/GuardhouseOutput.twee
@@ -1,4 +1,5 @@
:: GuardhouseOutput [nobr]
+<>
<>
<>
<>
diff --git a/src/MiniEstablishments/Market/MarketsOutput.twee b/src/MiniEstablishments/Market/MarketsOutput.twee
index 783cbac86..93075db06 100644
--- a/src/MiniEstablishments/Market/MarketsOutput.twee
+++ b/src/MiniEstablishments/Market/MarketsOutput.twee
@@ -1,4 +1,5 @@
:: MarketOutput [market nobr]
+<>
<>
<><><><>
<>< >
diff --git a/src/MiniEstablishments/Temple/TempleOutput.twee b/src/MiniEstablishments/Temple/TempleOutput.twee
index f63c95e6c..e887a1202 100644
--- a/src/MiniEstablishments/Temple/TempleOutput.twee
+++ b/src/MiniEstablishments/Temple/TempleOutput.twee
@@ -1,4 +1,5 @@
:: TempleOutput [nobr]
+<>
<>
<>
<>
diff --git a/src/MiniEstablishments/TownSquare/TownSquareOutput.twee b/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
index d25ff803f..7c19092db 100644
--- a/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
+++ b/src/MiniEstablishments/TownSquare/TownSquareOutput.twee
@@ -1,4 +1,5 @@
:: TownSquareOutput [nobr]
+<>
<>
The Town Square You're in the town square.
It's $building.size, and $building.cleanliness. It features $building.feature
diff --git a/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee b/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
index c31c85992..e14b3c8dd 100644
--- a/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
+++ b/src/NPCGeneration/NPCProfile/Components/NPCHeader.twee
@@ -1,5 +1,6 @@
-:: NPCHeader
-<><>
+:: NPCHeader [nobr]
+<>
+<>
<>
< >
<>
@@ -34,4 +35,4 @@ $currentNPC.title
<> */
<> --
<><><><>Saved $currentNPC.name to the NPCs list.< ><><>< >
-< >< >
\ No newline at end of file
+<>
\ No newline at end of file
diff --git a/src/Religion/DeityProfile.twee b/src/Religion/DeityProfile.twee
index 3e2224317..dd2f5278c 100644
--- a/src/Religion/DeityProfile.twee
+++ b/src/Religion/DeityProfile.twee
@@ -1,5 +1,9 @@
:: DeityProfile [nobr]
<>
+<>
+
+< >
$currentPassage.name
Edit $currentPassage.name
/* <>
diff --git a/src/Roads/RoadProfile.twee b/src/Roads/RoadProfile.twee
index dbfe48886..5275403f0 100644
--- a/src/Roads/RoadProfile.twee
+++ b/src/Roads/RoadProfile.twee
@@ -1,8 +1,8 @@
-:: RoadProfile
+:: RoadProfile [nobr]
/* <> */
+<>
$currentPassage.name
-$currentPassage.description
-
+$currentPassage.description
<><>< {
const nsfwItems = ['Brothel'];
if (!settings.disableNSFW) return building;
diff --git a/src/Settings/CustomImages.twee b/src/Settings/CustomImages.twee
new file mode 100644
index 000000000..ad22e7f02
--- /dev/null
+++ b/src/Settings/CustomImages.twee
@@ -0,0 +1,178 @@
+:: CustomImages [nobr force-one-column]
+<>
+<>
+<>< ><><>< > -- <><>
+< >
+/* <> */
+<>
+<>
+ <>
+
+ <>
+ < {
+ const nsfwItems = ['Brothel'];
+ if (!settings.disableNSFW) return building;
+ return !building.includes(nsfwItems);
+ })>>
+ < >
+
+ <>
+
+ <>
+ < Object.assign(obj, {
+ [building.name]: building.key
+ }), {})>>
+ < >
+
+ <>
+
+ <>
+ < Object.assign(obj, {
+ [road.name]: road.key
+ }), {})>>
+ < >
+
+ <>
+
+ <>
+ < Object.assign(obj, {
+ [deity.name]: deity.key
+ }), {})>>
+ < >
+
+ <>
+
+ <>
+ < Object.assign(obj, {
+ [npc.name]: npc.key
+ }), {})>>
+ < >
+
+ <>
+
+ <>
+ < Object.assign(obj, {
+ [faction.name]: faction.key
+ }), {})>>
+ < >
+
+ <>
+
+ <>
+ <>
+ < >
+
+ <>the $town.type of $town.name
+ <>Select a type
+< >
+<>
+ <>
+ <>
+ <>
+ < building.key === $target).customImage || 'url goes here'>>
+ <>
+ <>
+ <>
+ <>
+ <>
+ <>
+ <>
+ <>
+< >
+-- <>
+
+--
+<>
+
+ <>
+ <>
+ <>
+ <>
+ <>
+ <>
+ < building.key === $target).customImage to $url>>
+ <>
+ <>
+ <>
+ <>
+ <>
+ <>
+ < >
+ <>
+< >
+
+Great sources include:
+
+ [[ArtBreeder|https://www.artbreeder.com/create]]
+ [[This gallery of watercolour concept art|https://imgur.com/gallery/5WcP9pn]]
+
+
+Loaded URL: <>
+
+
+< >
+
+:: PrintImage [nobr]
+<>
+<>
+<>
+
+
+<>
+
+
+< >
+
+:: ShowAllSaved [nobr force-one-column]
+<>
+<>
+
+
+ Object
+ Name
+ File
+ Delete
+
+<>
+< 0>><>
+
+ _typeKey
+
+ <>
+
+ _itemKey
+ _item
+ x
+
+ < >
+ < >
+< >
+
\ No newline at end of file
diff --git a/src/Start/Start.twee b/src/Start/Start.twee
index 1600843ed..075060975 100644
--- a/src/Start/Start.twee
+++ b/src/Start/Start.twee
@@ -1,9 +1,10 @@
:: Start
-\<>[img[banner]]
+\<><>[img[banner]]
<>
\Quick Scenario Generator <>< >
\<>
\< ><><><>
<>
<>
<>
-<>
\ No newline at end of file
+<>
+[[CustomImages]]
\ No newline at end of file
diff --git a/src/Tavern/TavernOutput.twee b/src/Tavern/TavernOutput.twee
index 304b252f1..23d97b5f2 100644
--- a/src/Tavern/TavernOutput.twee
+++ b/src/Tavern/TavernOutput.twee
@@ -1,5 +1,5 @@
:: TavernOutput [tavern nobr]
-
+<>
<>
<>
<>
diff --git a/src/Tavern/js/createTavern.ts b/src/Tavern/js/createTavern.ts
index 843b06b3f..fc8c6b228 100644
--- a/src/Tavern/js/createTavern.ts
+++ b/src/Tavern/js/createTavern.ts
@@ -47,6 +47,7 @@ export const createTavern = (town: Town, opts: Options = {}): Tavern => {
initPassage: 'InitTavern',
buildingType: 'tavern',
objectType: 'building',
+ localImage: 'tavern-illustration',
lighting: ['poorly lit', 'somewhat dark', 'dimly lit', 'well lit', 'brightly lit', 'well lit', 'brightly lit', 'bright and welcoming', 'fire-lit'].random(),
// @ts-ignore
stageDescriptor: setup.tavern.stageDescriptor.random(),
From 4b9208cd8b8640aa1df715c094cbed036ad67898 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 22:49:05 +1000
Subject: [PATCH 20/23] Fix issue with patreon supporter sometimes not
initialising
---
src/Meta/PatreonSupporters.twee | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/Meta/PatreonSupporters.twee b/src/Meta/PatreonSupporters.twee
index 9f45241e6..3f0113c46 100644
--- a/src/Meta/PatreonSupporters.twee
+++ b/src/Meta/PatreonSupporters.twee
@@ -1,16 +1,16 @@
-:: PatreonSupporters
+:: PatreonSupporters [nobr]
Patreon Supporters
Special thanks to my [[Patreon|https://www.patreon.com/join/eigengrausgenerator?]] supporters!
<>
<>
<>
-<>
-<>
-<>
-<>
+<>
+<>
+<>
+<>
- - _random
- - _random2
+ - $patreonSupporters
+ - $patreonSupporters2
< >
From 4586dae3321b24be2a70c04f9981bb21e08bb1c6 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 22:49:33 +1000
Subject: [PATCH 21/23] add localImage
---
lib/buildings/_common.ts | 1 +
lib/religion/religion.ts | 1 +
lib/town/_common.ts | 1 +
lib/town/townRender.ts | 7 +++++++
4 files changed, 10 insertions(+)
diff --git a/lib/buildings/_common.ts b/lib/buildings/_common.ts
index 3386e1332..3b3ae1820 100644
--- a/lib/buildings/_common.ts
+++ b/lib/buildings/_common.ts
@@ -6,6 +6,7 @@ export interface Location {
objectType: 'building'
/** The type of building- 'castle', 'townSquare', 'generalStore', etc. */
type: string
+ buildingType: string
passageName?: string
parentKey?: string
name?: string
diff --git a/lib/religion/religion.ts b/lib/religion/religion.ts
index 09419cc61..177deb758 100644
--- a/lib/religion/religion.ts
+++ b/lib/religion/religion.ts
@@ -262,6 +262,7 @@ export interface Deity {
* @usage 'Hades resides in ______'
*/
realm?: string
+ customImage?: URL
followers: Partial
/**
* If a deity particularly embodies a virtue or vice, it can be specified.
diff --git a/lib/town/_common.ts b/lib/town/_common.ts
index 5ba2af509..a9ad7affd 100644
--- a/lib/town/_common.ts
+++ b/lib/town/_common.ts
@@ -68,6 +68,7 @@ export interface TownProfessions extends Profession {
}
export interface Town extends TownBasics {
+ localImage: string
taxes: {
welfare: number
military: number
diff --git a/lib/town/townRender.ts b/lib/town/townRender.ts
index 048825d1e..adb1c21a3 100644
--- a/lib/town/townRender.ts
+++ b/lib/town/townRender.ts
@@ -1,9 +1,16 @@
import { Town } from './_common'
import { getPolice } from './getPolice'
+export const townOrCity = (town: Town) => {
+ if (town.type === 'city' || town.type === 'town') return 'city-illustration'
+ return 'town-illustration'
+}
+
export function townRender (town: Town) {
console.log(`Rendering ${town.name}...`)
+ town.localImage = townOrCity(town)
+
town.roll.guardFunding = 0
const police = getPolice(town.factions)
From 55e3fbbd33b497ed4e8c34582f746ea1db8f6cb7 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 22:51:06 +1000
Subject: [PATCH 22/23] Rename buildingTypes object
---
src/Roads/RoadProfile.twee | 2 +-
src/Start/CreateBuilding.twee | 2 +-
src/Town/js/createNewBuilding.js | 25 ++++++++++++++++++++++++-
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/Roads/RoadProfile.twee b/src/Roads/RoadProfile.twee
index 5275403f0..c0a7a8db2 100644
--- a/src/Roads/RoadProfile.twee
+++ b/src/Roads/RoadProfile.twee
@@ -3,7 +3,7 @@
<>
$currentPassage.name
$currentPassage.description
-<><>< {
+<><>< {
const nsfwItems = ['Brothel'];
if (!settings.disableNSFW) return building;
return !building.includes(nsfwItems);
diff --git a/src/Start/CreateBuilding.twee b/src/Start/CreateBuilding.twee
index 55256c20a..8f01fe4e0 100644
--- a/src/Start/CreateBuilding.twee
+++ b/src/Start/CreateBuilding.twee
@@ -1,5 +1,5 @@
:: CreateBuilding
-<>< {
+<>< {
const nsfwItems = ['Brothel'];
if (!settings.disableNSFW) return building;
return !building.includes(nsfwItems);
diff --git a/src/Town/js/createNewBuilding.js b/src/Town/js/createNewBuilding.js
index 6ef40d03d..8f33abbaf 100644
--- a/src/Town/js/createNewBuilding.js
+++ b/src/Town/js/createNewBuilding.js
@@ -1,5 +1,28 @@
setup.initBuildingTypes = () => {
setup.buildingTypes = {
+ 'Alchemist': 'alchemist',
+ 'Bakery': 'bakery',
+ 'Barber': 'barber',
+ 'Brothel': 'brothel',
+ 'Butcher': 'butcher',
+ 'Castle': 'castle',
+ 'Cobbler': 'cobbler',
+ 'Docks': 'docks',
+ 'Dungeon': 'dungeon',
+ 'Fletcher': 'fletcher',
+ 'Florist': 'florist',
+ 'General Store': 'generalStore',
+ 'Graveyard': 'graveyard',
+ 'Guardhouse': 'guardhouse',
+ 'Jeweller': 'jeweller',
+ 'Market': 'market',
+ 'Smithy': 'smithy',
+ 'Tailor': 'tailor',
+ 'Tavern': 'tavern',
+ 'Temple': 'temple',
+ 'Town Square': 'townSquare'
+ }
+ setup.createBuildingKeys = {
// please keep this in alphabetic order
// TODO automatically sort into alphabetic order
// TODO automatically find available buildings
@@ -31,7 +54,7 @@ setup.createNewBuilding = (town, type, opts) => {
// this is necessary to point the function towards where the building creation function is kept.
// unfortunately, it currently needs to be updated manually with each new building.
- const newBuilding = setup.buildingTypes[lib.toTitleCase(type)](town, { ...opts, isHighlighted: true })
+ const newBuilding = setup.createBuildingKeys[lib.toTitleCase(type)](town, { ...opts, isHighlighted: true })
console.log(town)
if (Array.isArray(town.buildings)) town.buildings.push(newBuilding)
return newBuilding
From 75eeba8c3fd82134ee4eedc972c00b39dce15270 Mon Sep 17 00:00:00 2001
From: ryceg
Date: Fri, 23 Apr 2021 22:54:48 +1000
Subject: [PATCH 23/23] Add custom images
---
CHANGELOG.md | 9 ++++--
lib/src/getIllustration.ts | 45 +++++++++++++----------------
src/Settings/CSS/stylesheet.css | 14 ++++-----
src/Settings/CustomImages.twee | 50 +++++++++++++++++++--------------
src/Settings/Setting.js | 39 +++++++++++++++++--------
src/Start/Start.twee | 3 +-
src/Start/StoryInit.twee | 2 +-
7 files changed, 93 insertions(+), 69 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af5254fdb..27472ca5e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,16 +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/).
-## Unreleased
+## 2.8.5
### Added
-- Edit button to buildings that have an editor.
+- Edit button to buildings that have an editor (it's still rather terrible, but at least now it's more visible)
+- Custom image uploading for Hero patrons accessible in the settings.
### Changed
+- Fixed issue with Patreon thanks list sometimes breaking.
- Modified formatting
- Shifted notification down slightly so it does not collide with the header
- Fixed an issue with Tippy not initialising for elements created in a table.
+### Removed
+- Obsolete 'Show Sliders' setting.
+
## 2.8.5
### Added
diff --git a/lib/src/getIllustration.ts b/lib/src/getIllustration.ts
index 4dce18e07..3d5d46c2c 100644
--- a/lib/src/getIllustration.ts
+++ b/lib/src/getIllustration.ts
@@ -1,24 +1,9 @@
-import { Town } from '../town/_common'
-
type Illustration =
| 'general-store-illustration'
| 'tavern-illustration'
| 'town-illustration'
| 'city-illustration'
-export const getIllustration = (illustration: Illustration, alt: string) => {
- let img = ' '
- return img
-}
-
const getPath = () => {
if (process.env.NODE_ENV === 'production' && location.origin !== 'file://') {
return './'
@@ -26,19 +11,29 @@ const getPath = () => {
return '../'
}
-// It would obviously be preferable to output actual s instead of having it render via SugarCube.
-// Unfortunately, I am not a clever man, and cannot figure it out.
-export const getImage = (illustration: Illustration) => {
+const addLocalSourceSet = (illustration: Illustration, sizes: string[] = ['360', '411', '500', '576', '768', '992', '1200']) => {
+ let img = ''
+ const path = getPath()
+ for (const size of sizes) {
+ img += `${path}src/Resources/img/hero/${illustration}-x${size}.jpg ${size}w, `
+ }
+ return img
+}
+
+export const getCustomImage = (url: URL) => {
+ const img = document.createElement('img')
+ img.id = 'illustration'
+ img.src = url as unknown as string
+ img.alt = 'A custom-defined image.'
+ return img.outerHTML
+}
+
+export const getLocalImage = (illustration: Illustration) => {
const img = document.createElement('img')
const path = getPath()
img.id = 'illustration'
img.src = `${path}src/Resources/img/hero/${illustration}.jpg`
- img.srcset = `${path}src/Resources/img/hero/${illustration}-x360.jpg 360w, ${path}src/Resources/img/hero/${illustration}-x411.jpg 411w, ${path}src/Resources/img/hero/${illustration}-x500.jpg 500w, ${path}src/Resources/img/hero/${illustration}-x576.jpg 576w, ${path}src/Resources/img/hero/${illustration}-x768.jpg 768w, ${path}src/Resources/img/hero/${illustration}-x992.jpg 992w, ${path}src/Resources/img/hero/${illustration}-x1200.jpg 1200w, ${path}src/Resources/img/hero/${illustration}.jpg`
+ if (process.env.NODE_ENV === 'production' && location.origin !== 'file://') img.srcset = `${addLocalSourceSet(illustration)} ${path}src/Resources/img/hero/${illustration}.jpg`
img.alt = `An image depicting ${lib.articles.output(illustration)}, created by artist Juho Huttunen.`
- return img
-}
-
-export const townOrCity = (town: Town) => {
- if (town.type === 'city' || town.type === 'town') return 'city-illustration'
- return 'town-illustration'
+ return img.outerHTML
}
diff --git a/src/Settings/CSS/stylesheet.css b/src/Settings/CSS/stylesheet.css
index f35a5334a..2f1486d1c 100644
--- a/src/Settings/CSS/stylesheet.css
+++ b/src/Settings/CSS/stylesheet.css
@@ -232,7 +232,7 @@ footer {
padding-bottom: 20vw;
}
#paper {
- top: 15vw
+ top: 20vw
}
body {
font-size: 16px
@@ -252,7 +252,7 @@ footer {
padding-bottom: 20vw;
}
#paper {
- top: 14vw;
+ top: 21vw;
}
blockquote {
margin-inline-start: 10px;
@@ -275,7 +275,7 @@ footer {
padding-bottom: 25vw;
}
#paper {
- top: 13vw
+ top: 20vw
}
}
@@ -294,7 +294,7 @@ footer {
padding-bottom: 28vw;
}
#paper {
- top: 13vw
+ top: 20vw
}
}
@@ -313,7 +313,7 @@ footer {
padding-bottom: 35vw;
}
#paper {
- top: 13.5vw
+ top: 20vw
}
}
@@ -332,7 +332,7 @@ footer {
padding: 19vw;
}
#paper {
- top: 13vw
+ top: 19vw
}
}
@@ -353,7 +353,7 @@ footer {
}
#paper {
- top: 14vw
+ top: 20vw
}
}
diff --git a/src/Settings/CustomImages.twee b/src/Settings/CustomImages.twee
index ad22e7f02..ed830ffff 100644
--- a/src/Settings/CustomImages.twee
+++ b/src/Settings/CustomImages.twee
@@ -23,13 +23,7 @@
<>
<>
- <>
- < {
- const nsfwItems = ['Brothel'];
- if (!settings.disableNSFW) return building;
- return !building.includes(nsfwItems);
- })>>
- < >
+ <><>< >
<>
@@ -103,8 +97,6 @@
--
<>
-
- <>
<>
<>
<>
@@ -117,20 +109,22 @@
<>
<>
<>
+ <>
+ <>
< >
<>
+ <>
< >
-Great sources include:
-
+Great sources include:
[[ArtBreeder|https://www.artbreeder.com/create]]
[[This gallery of watercolour concept art|https://imgur.com/gallery/5WcP9pn]]
-Loaded URL: <>
+Loaded URL: <>_outputImage< >
+ < >
-
-< >
+<>
:: PrintImage [nobr]
<>
@@ -152,8 +146,19 @@ Loaded URL: <>
<>
:: ShowAllSaved [nobr force-one-column]
-<>
+Saved Images
+<><>
<>
+<>
+ <>
+ <>
+ <>
+ <>
+< > (NPCs and other specifics are flushed on restart)
Object
@@ -161,18 +166,21 @@ Loaded URL: <>
File
Delete
-<>
+<><>
< 0>><>
_typeKey
- <>
+ <><>
_itemKey
_item
- x
-
+ < ><><><>
+ <>
+
+ < >
< >
- < >
+ <>< >
< >
-
\ No newline at end of file
+
+< >
\ No newline at end of file
diff --git a/src/Settings/Setting.js b/src/Settings/Setting.js
index 4dc7f5f9a..72d279031 100644
--- a/src/Settings/Setting.js
+++ b/src/Settings/Setting.js
@@ -44,6 +44,28 @@ $(document).on(':dialogopened', function () {
}
}
)
+ setup.addSettingButton({
+ target: 'pantheon',
+ name: 'customImages',
+ description: 'Add custom images.',
+ buttonDescription: 'Open Image Importer'
+ },
+ () => {
+ if (isPatron()) {
+ setup.openDialog({
+ header: 'Import Images',
+ passage: 'CustomImages',
+ rerender: true
+ })
+ } else {
+ setup.openDialog({
+ header: 'Patreon Content',
+ passage: 'ImportPatreon',
+ rerender: true
+ })
+ }
+ }
+ )
}
})
@@ -72,23 +94,18 @@ Setting.addToggle('darkMode', {
default: window.matchMedia('(prefers-color-scheme: dark)').matches
})
-Setting.addToggle('showCelsius', {
- label: 'Show celsius?'
-})
-
-Setting.addToggle('showMetric', {
- label: 'Show metric?'
-})
-
Setting.addToggle('showBiomeGeneration', {
label: 'Edit biome before generation?',
desc: 'If you want to specify the biome and demographics before town creation, enable this.',
onChange: settingShowBiomeGeneration
})
-Setting.addToggle('showSliders', {
- label: 'Show sliders?',
- desc: 'If you would like to change the variables of buildings, enable this. Warning: feature is in beta.'
+Setting.addToggle('showCelsius', {
+ label: 'Show celsius?'
+})
+
+Setting.addToggle('showMetric', {
+ label: 'Show metric?'
})
Setting.addToggle('silverStandard', {
diff --git a/src/Start/Start.twee b/src/Start/Start.twee
index 075060975..65c8ea4d4 100644
--- a/src/Start/Start.twee
+++ b/src/Start/Start.twee
@@ -6,5 +6,4 @@
<>
<>
<>
-<>
-[[CustomImages]]
\ No newline at end of file
+<>
\ No newline at end of file
diff --git a/src/Start/StoryInit.twee b/src/Start/StoryInit.twee
index 6bd85f968..913f135e7 100644
--- a/src/Start/StoryInit.twee
+++ b/src/Start/StoryInit.twee
@@ -5,7 +5,7 @@
<>
<