<<nobr>>
<<silently>>
/* create character*/
/* start with random character or build off user-chosen characteristics */
<<if $location is 0>>
<<random-character>>
<<else>>
<<playerName>>
<<parish>>
<</if>>
/* assign disability */
<<if $age is "elderly adult">><<if random(1,3) is 1>><<set $disability to "hearing loss">><<else>><<if random(1,10) is 1>><<set $disability to either("crooked back", "weak legs", "speech impediment", "asthma", "epilepsy", "poor eyesight")>><</if>><</if>><<else>><<if random(1,10) is 1>><<set $disability to either("crooked back", "weak legs", "speech impediment", "asthma", "epilepsy", "poor eyesight")>><</if>><</if>>
/* adjust initial reputation by socio*/
<<if $socio is "beggars">><<set $reputation to 4>><<elseif $socio is "nobles">><<set $reputation to 8>><</if>>
/* initialize religion and origin*/
<<if $religion is "member of a dissident Protestant church">><<set $religion to either("Presbyterian", "Baptist", "Quaker")>><</if>>
<<if $origin is "somewhere else">><<set $origin to either("the Holy Roman Empire", "Italy", "Spain", "the Americas")>><</if>>
<<if $location is "in the western suburbs, specifically Westminster">><<set $location to "in Westminster">><</if>>
<<if $location is "in another part of the western suburbs">><<set $location to "in the western suburbs">><</if>>
/* generate NPC arrays */
/* add parents and siblings, with age weight on parents */
<<set _usedSibNames to []>>
<<if $agenum lt 30>>
<<addParentNPC>>
<<elseif $agenum gte 30 and random(1,2) eq 1>>
<<addParentNPC>>
<<elseif $agenum gte 40 and random(1,5) eq 1>>
<<addParentNPC>>
<<elseif $agenum gte 50 and random(1,10) eq 1>>
<<addParentNPC>>
<</if>>
<<if $socio is "beggars">>
<<set _x to random(0,1)>>
<<elseif $socio is "day labourers" or $socio is "servants">>
<<set _x to random(0,2)>>
<<elseif $socio is "artisans">>
<<set _x to random(1,2)>>
<<elseif $socio is "merchants">>
<<set _x to random(1,4)>>
<<elseif $socio is "nobles">>
<<set _x to random(2,6)>>
<</if>>
<<for _i to 0; _i lt _x; _i++>><<addSiblingsNPC>><</for>>
/* add family for married and widowed characters */
<<if $relationship is "married">><<addPartnerNPC>><</if>>
<<if $relationship is "married" or $relationship is "widowed">>
<<set _usedChildNames to []>>
<<if $socio is "beggars">>
<<set _x to random(0,1)>>
<<elseif $socio is "day labourers" or $socio is "servants">>
<<set _x to random(0,2)>>
<<elseif $socio is "artisans">>
<<set _x to random(1,3)>>
<<elseif $socio is "merchants">>
<<set _x to random(1,4)>>
<<elseif $socio is "nobles">>
<<set _x to random(2,6)>>
<</if>>
<<for _i to 0; _i lt _x; _i++>><<addChildNPC>><</for>>
<</if>>
/* add niblings for older, single non-servants */
<<if $relationship is "single" and $socio isnot "servants">>
<<if $agenum gte 30>>
<<if $age is "elderly adult">><<set _tempAge to "middle-aged adult">><<else>><<set _tempAge to "young adult">><</if>>
<<set _nibling to random(1,3)>>
<<if _nibling is 1>>
<<set $NPCs.push({name: weightedEither($fNames), age: _tempAge, relationship: "niece", health: "healthy"})>>
<<elseif _nibling is 2>>
<<set $NPCs.push({name: weightedEither($mNames), age: _tempAge, relationship: "nephew", health: "healthy"})>>
<</if>>
<</if>>
<</if>>
/* add servants and master's household*/
<<addServantNPC>>
<<if $socio is "servants">>
<<addMasterHousehold>>
<<if $relationship is "single" or $relationship is "betrothed">>
<<set $NPCsExtended to $NPCsExtended.concat($NPCs)>>
<<set $NPCs to $NPCsMaster.slice()>>
<<set $NPCsMaster to []>>
<</if>>
<</if>>
/* sort arrays by household precedence */
<<orderNPCs "$NPCs">>
<<orderNPCs "$NPCsMaster">>
<<orderNPCs "$NPCsExtended">>
<<orderNPCs "$NPCsServants">>
/* determine hoh and set pronouns*/
<<set-hoh>>
<<NPCpronouns>>
/* initialize savings — one month income, beggars start with nothing */
<<income>>
<<if $socio is "beggars">>
<<set $money to 0>>
<<elseif $socio is "servants" and ($age is "child" or $age is "adolescent")>>
<<if $gender is "male">><<set $money to 60>><<else>><<set $money to 40>><</if>>
<<else>>
<<set $money to $income>>
<</if>>
<<if $socio is "merchants">><<set $role to either($trades)>><</if>>
<</silently>>
/* print bio */
Your name is $name, and you are $agenum years old. You are proud to be a <<defVarReligion $religion>>, <<if $religion is "member of the Church of England">>the only true and legal faith<<else>>despite the fact that it is illegal in England.<</if>>
<br>
<br>
You were born <<if $agenum gte 15>>and raised <</if>>in <<if $origin is "London">>London<<else>>$origin, though you now make your home in London<</if>>. You currently live in the <<defParish "parish">> of $parish, which is $location. It is a good place for <<defVarSocio $socio>> like you<<if $socio is "merchants">> and you have found success for yourself as a $role<</if>><<if $disability isnot 0>><<if $socio is "beggars">>, as people take pity on you for your $disability and are generous with their alms.<<else>> despite your $disability<</if>><</if>>.
<br>
<br>
<<if $socio is "servants">><<if $relationship is "single" or $relationship is "betrothed">> As an unmarried servant, you live in your $masterTitle's household.<</if>> Your $masterTitle is <<if $masterStatus is "artisans">>an artisan<<elseif $masterStatus is "merchants">>a merchant<<elseif $masterStatus is "nobles">>a noble<</if>> with a household of <<if $relationship is "single" or $relationship is "betrothed">>$NPCs.length<<else>>$NPCsMaster.length<</if>> members.
<br>
<br>
<</if>>
<<if $relationship is "widowed">>Alas, your <<if $gender is "male">>wife<<else>>husband<</if>> died some time ago<<else>>You are currently <<if $relationship is "betrothed">><<defVarRelationship "betrothed">> to be married<<else>>$relationship<</if>><</if>>.
<<if $NPCs.length gt 0>>You live with your
<<for _i, _idx range $NPCs>>
<<if $NPCs.length eq 1>><<npc-rel-label $NPCs[_i].relationship>>, $NPCs[_i].name.
<<elseif _i < $NPCs.length - 1>><<npc-rel-label $NPCs[_i].relationship>>, $NPCs[_i].name;
<<else>> and <<npc-rel-label $NPCs[_i].relationship>>, $NPCs[_i].name.
<</if>>
<</for>>
<<elseif $NPCs.length eq 0>>You live alone.
<</if>>
<br><br>
<<if $servants gte 1>>Your <<defHousehold "household">> currently includes <<if $servants eq 1>>a servant<<else>>$servants servants.<</if>><br><br>
<</if>>
<<if $NPCsExtended.length gt 0>>Your
<<for _e, _idx range $NPCsExtended>>
<<if $NPCsExtended.length eq 1>>$NPCsExtended[_e].relationship, $NPCsExtended[_e].name
<<elseif _e < $NPCsExtended.length - 1>>$NPCsExtended[_e].relationship, $NPCsExtended[_e].name;
<<else>> and $NPCsExtended[_e].relationship, $NPCsExtended[_e].name
<</if>>
<</for>>also live<<if $NPCsExtended.length eq 1>>s<</if>> in London.
<br><br>
<</if>>
If you're ready to begin, [[click this link->December 1664]].
<br><br>
If you'd like a different character, you can refresh the game and start again.
/*<<click "click this link to try again">><<script>>Engine.play()<</script>><</click>>.*/
<</nobr>>
<<nobr>>
<<if not _headerEventActive>>
It is December 1664 and you are looking forward to the Christmas holidays. You are<<if $agenum lte 12>>n't<</if>> old enough to remember the days before King Charles II was <<defRestoration "restored to his rightful throne">>, when Christmas was banned as <<defBlasphemous "blasphemous">>, and it makes the weeks of celebration and feasting all the merrier.<br><br>
<<linkappend "Not everything is perfect, though.">> Rumors swirl throughout the city about the possibility of a coming war with the Dutch Republic after several Dutch ships were captured and brought into <<defPortsmouth "Portsmouth">> as prizes. <<if $origin is "the Dutch Republic">>You make merry with your neighbors even while you fear they will turn against you in the months ahead. <</if>>Worse, it is common knowledge that <<defPlague "plague">> has been spreading in the Dutch fleet for months, though it hasn't yet reached English shores.<br><br>
<<december-1664-helper>>
<</linkappend>>
<</if>>
<</nobr>>This is a text-based adventure game. Click the underlined teal text to advance in the game. Hover over (or tap on mobile) the bold purple text for definitions. Check out the sidebar/menu for information on your <<defHousehold "household">> and inventory, to visit the <<defApothecary "apothecary">>, or to restart the game. Best of luck surviving!
The year is 1664 and you are a resident of the great city of London in England. After decades of <<defCivilWar "civil war">> and <<defCommonwealth "experimental government">>, the merry monarch King Charles II was restored to the thrones of England, Scotland, and Ireland just four years ago and (most of) the kingdoms rejoiced.
But enough about the king! What about you?
Either [[create your character->identity]] or [[automatically generate a character->bio]].
<a href="https://upload.wikimedia.org/wikipedia/commons/4/48/Claude_de_Jongh_-_View_of_London_Bridge_-_Google_Art_Project_bridge.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/4/48/Claude_de_Jongh_-_View_of_London_Bridge_-_Google_Art_Project_bridge.jpg" width="100%" alt="Painting of London Bridge lined with buildings spanning the River Thames"></a>
//Claude de Jongh - "View of London Bridge", 1632//<<chunkText>>While infant mortality is common in this era, God granted your parents a healthy <<set $birthgender = ["daughter","son"]>><<listbox "$birthgender">><<optionsfrom $birthgender>><</listbox>> who not only survived but thrived and you are now a <<set _age = ["young adult", "middle-aged adult", "elderly adult", "child", "adolescent"]>><<listbox "$age">><<optionsfrom _age>><</listbox>>.
<<next>><<playerAge>><<if $agenum lte 15>>While the rich and powerful might get <<defBetrothed "betrothed">> as children and marry as teenagers, most people wait until their mid or late 20s when they have enough wealth to establish their own <<defHousehold "households">>. You are currently <<set _relationship = ["single", "betrothed"]>><<listbox "$relationship">><<optionsfrom _relationship>><</listbox>>.<<else>>Most people get married in their mid or late 20s to start a family, and those who are widowed often remarry as well. You are currently <<set _relationship = ["single", "married", "widowed"]>><<listbox "$relationship">><<optionsfrom _relationship>><</listbox>><</if>><<if $birthgender is "son">><<set $gender to "male">><<else>><<set $gender to "female">><</if>>
<<next>>The city has recently settled after the religious upset of the <<defCivilWar "civil war">>, and now there is relative harmony between <<defChurchOfEngland "members of the Church of England">> and members of <<defDissident "dissident">> <<defProtestants "Protestant">> churches. With the king married to a <<defCatholic "Catholic">> queen, there are even some openly worshipping Catholics! As a devout <<set _religion = ["member of the Church of England", "member of a dissident Protestant church", "Catholic"]>><<listbox "$religion">><<optionsfrom _religion>><</listbox>>, you know that yours is the only true faith.
<<next "read your biography" "bio">>You are originally from <<set _origin = ["London", "the English countryside", "another English town or city", "Scotland", "Ireland", "the Dutch Republic", "France", "somewhere else"]>><<listbox "$origin">><<optionsfrom _origin>><</listbox>> and currently live in London, the greatest city in all the British Isles. It is a diverse city, with people of all ages, origins, and socioeconomic statuses. The city is home to <<defNoble "nobles">>, <<defArtisan "artisans">>, and <<defMerchant "merchants">>, who employ <<defDayLabourer "day labourers">> and <<defServant "servants">> in their households and businesses. And there are also <<defBeggars "beggars">> living in all 97 <<defParish "parishes">> within its ancient walls. There are also more parishes spread out around those walls that can be considered part of its suburbs. This includes people living in the city of Westminster and those living across the river Thames, which can only be crossed by boat or by the <<defLondonBridge "London Bridge">>.
It's a great city for <<set _socio = ["day labourers", "servants", "artisans", "merchants", "nobles", "beggars"]>><<listbox "$socio">><<optionsfrom _socio>><</listbox>> like you to live in.
Your home is <<set _location = ["inside the City walls", "in the western suburbs, specifically Westminster", "in another part of the western suburbs", "in the northern suburbs", "in the eastern suburbs", "across the river in the southern suburbs"]>><<listbox "$location">><<optionsfrom _location>><</listbox>>.<br>
<a href="https://dac-collection.wesleyan.edu/objects-1/info/7197"><img src="https://wesleyan-dac-open-access.s3.amazonaws.com/images/DAC_1940-D1-131_001_OA.jpg" width="100%" alt="Panoramic map of London showing the city and River Thames"></a>
//Wencelaus Holler - "Map of London, before the Fire of 1666", ca. 1667//
<br>If that all looks right, then it's time to <</chunkText>><<nobr>>
Send not to know for whom the church bells toll. They toll for you.
<br><br>
<<death-announcement>>
<</nobr>>
<<nobr>>
<<silently>>
/* Collect surviving NPCs from each array */
<<set _survNPCs to []>>
<<for _si = 0; _si < $NPCs.length; _si++>>
<<if $NPCs[_si].health isnot "deceased" and $NPCs[_si].health isnot "deceased-pq" and !$NPCs[_si].relationship.startsWith("landlord")>>
<<set _survNPCs.push($NPCs[_si])>>
<</if>>
<</for>>
<<set _survExtended to []>>
<<for _si = 0; _si < $NPCsExtended.length; _si++>>
<<if $NPCsExtended[_si].health isnot "deceased" and $NPCsExtended[_si].health isnot "deceased-pq">>
<<set _survExtended.push($NPCsExtended[_si])>>
<</if>>
<</for>>
<<set _survServants to []>>
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health isnot "deceased" and $NPCsServants[_si].health isnot "deceased-pq">>
<<set _survServants.push($NPCsServants[_si])>>
<</if>>
<</for>>
<<set _survMaster to []>>
<<for _si = 0; _si < $NPCsMaster.length; _si++>>
<<if $NPCsMaster[_si].health isnot "deceased" and $NPCsMaster[_si].health isnot "deceased-pq">>
<<set _survMaster.push($NPCsMaster[_si])>>
<</if>>
<</for>>
/* Count fled family and servants (all alive) */
<<set _survFled to $FledFamily.length>>
<<set _survFledSv to $FledServants.length>>
/* Build the survivor text */
<<set _parts to []>>
<<if $socio is "servants" and _survMaster.length gt 0>>
/* Servant living with master: full details on extended, summary for master's household */
<<for _si = 0; _si < _survExtended.length; _si++>>
<<set _parts.push("your " + _survExtended[_si].relationship + " " + _survExtended[_si].name)>>
<</for>>
<<set _hhCount to _survNPCs.length + _survServants.length + _survMaster.length + _survFled + _survFledSv>>
<<if _hhCount gt 0>>
<<set _parts.push(_hhCount + " member" + (_hhCount gt 1 ? "s" : "") + " of your " + $masterTitle + "'s household")>>
<</if>>
<<else>>
/* Standard: full details on household NPCs, summaries for others */
<<for _si = 0; _si < _survNPCs.length; _si++>>
<<set _parts.push("your " + _survNPCs[_si].relationship + " " + _survNPCs[_si].name)>>
<</for>>
/* Add fled family with full details */
<<for _si = 0; _si < $FledFamily.length; _si++>>
<<set _parts.push("your " + $FledFamily[_si].relationship + " " + $FledFamily[_si].name)>>
<</for>>
<<if _survExtended.length gt 0>>
<<set _parts.push(_survExtended.length + " member" + (_survExtended.length gt 1 ? "s" : "") + " of your extended family")>>
<</if>>
<<set _svTotal to _survServants.length + _survFledSv>>
<<if _svTotal gt 0>>
<<set _parts.push(_svTotal + " servant" + (_svTotal gt 1 ? "s" : ""))>>
<</if>>
<<if _survMaster.length gt 0>>
<<set _parts.push(_survMaster.length + " member" + (_survMaster.length gt 1 ? "s" : "") + " of your " + $masterTitle + "'s household")>>
<</if>>
<</if>>
<</silently>>
<<if _parts.length gt 0>>You are survived by <<for _pi = 0; _pi < _parts.length; _pi++>><<if _pi gt 0 and _parts.length gt 2>>, <</if>><<if _pi gt 0 and _pi is _parts.length - 1>><<if _parts.length is 2>> and <<else>>and <</if>><</if>><<print _parts[_pi]>><</for>>.
<<else>>You have no surviving family.
<</if>>
<</nobr>><<nobr>><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/c/cb/Two_holy_men_lie_side_by_side_affected_by_the_plague_Wellcome_L0073320.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Two_holy_men_lie_side_by_side_affected_by_the_plague_Wellcome_L0073320.jpg" style="width:100%; height:auto;" alt="Drawing of two men lying side by side affected by the plague"></a>
//"Two Men Lie Side by Side Affected by the Plague", c. 17th century//
</div>
<br>
/* this passage is either called from quarantine or sickPC */
<<silently>><<check-NPCs>><<set _remedyEffect to 0>><<set $plagueInfection to 2>><</silently>>
<<if ndef $textGroup>><<set $textGroup = 1>><</if>>
<<switch $textGroup>>
<<case 1>>
<<if $quarantine gt 0>>Lord have mercy! A strange lump has appeared on your <<set _x to random(1,3)>>
<<if _x == 1>>leg
<<elseif _x == 2>>armpit
<<elseif _x == 3>>neck
<</if>>, and you are terrified to realize that you also have caught the dreaded <<defPlague "plague">>.
<br><br>
<<if _infectedFamily.length gt 0>>Worse yet, you learn that your
<<for _z, _y range _infectedFamily>>
<<if _infectedFamily.length eq 1>><<npc-rel-label $NPCs[_y].relationship>>, $NPCs[_y].name has fallen ill as well.<br><br>
<<elseif _z < _infectedFamily.length - 1>><<npc-rel-label $NPCs[_y].relationship>> $NPCs[_y].name, <<else>>and <<npc-rel-label $NPCs[_y].relationship>> $NPCs[_y].name have fallen ill as well.<br><br>
<</if>>
<</for>>
<</if>>
<<else>>
Your neighbors shut up the entrances to your house and paint a red cross with the words //Lord Have Mercy// on the front door.<br><br>
<</if>>
<<link "You pray that God has mercy on you as you take to your sickbed." `passage()`>><</link>>
<<case 2>>
<<player-treatments>>
<<link "You pray the treatments work." `passage()`>><</link>>
<<case 3>>
<<link "Unfortunately, your fever spikes, you grow weak, and you fear for your life." `passage()`>><</link>>
<br><br>
<<case 4>>
<<if $hoh gte 1 and $hoh lte 3>><<if $socio is "merchants">>It occurs to you that perhaps you ought to write your will<<if $reputation lte 2>>, but your reputation is so poor that no one can be convinced to bring you the writing materials you need<</if>>.
<<elseif $socio is "artisans">>It occurs to you that perhaps you ought to write your will<<if $reputation lte 2>>, but your reputation is so poor that you can't convince a <<defScrivener "scrivener">> to come help you.<</if>>.
<</if>>
<</if>>
/* smuggle out any healthy children if your rep is good enough */
<<smuggle-children>>
<<link "The days continue to pass with agonizing slowness." `passage()`>><</link>>
<<case 5>>
You spend most of your waking hours in a terrible, fevered state. <<if $NPCs.length gt 0>>In your brief moments of <<defLucidity "lucidity">>, you ask after your family<<if _infectedFamily.length eq 0>> and are grateful to hear no more have fallen ill... yet<</if>><</if>>.
<<silently>>
/* determine if sick family die or recover */
<<for _s range _infectedFamily>>
<<if _remedyEffect is 1 and random(1,3) is 1>><<set $NPCs[_s].health to "deceased-pq">>
<<elseif _remedyEffect is 0 and random(1,2) is 1>><<set $NPCs[_s].health to "deceased-pq">>
<<else>><<set $NPCs[_s].health to "recovered-pq">>
<</if>>
<</for>>
/* Check for family members who died or recovered */
<<set _deceased = []>>
<<set _recovered = []>>
<<for _d, _household range $NPCs>>
<<if _household.health is "deceased-pq">><<set _deceased.push(_d)>>
<</if>>
<<if _household.health is "recovered-pq">><<set _recovered.push(_d)>>
<</if>>
<</for>>
/* Also resolve infected servants now */
<<set _decSv5 to []>><<set _recSv5 to []>>
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "infected">>
<<if _remedyEffect is 1 and random(1,3) is 1>><<set $NPCsServants[_si].health to "deceased">><<set _decSv5.push(_si)>>
<<elseif _remedyEffect is 0 and random(1,2) is 1>><<set $NPCsServants[_si].health to "deceased">><<set _decSv5.push(_si)>>
<<else>><<set $NPCsServants[_si].health to "recovered">><<set _recSv5.push(_si)>>
<</if>>
<</if>>
<</for>>
/* Also resolve infected master household */
<<set _decMs5 to []>><<set _recMs5 to []>>
<<for _mi = 0; _mi < $NPCsMaster.length; _mi++>>
<<if $NPCsMaster[_mi].health is "infected">>
<<if random(1,2) eq 1>><<set $NPCsMaster[_mi].health to "deceased">><<set _decMs5.push(_mi)>>
<<else>><<set $NPCsMaster[_mi].health to "recovered">><<set _recMs5.push(_mi)>><</if>>
<</if>>
<</for>>
/* Also resolve infected extended family */
<<set _decEx5 to []>><<set _recEx5 to []>>
<<for _ei = 0; _ei < $NPCsExtended.length; _ei++>>
<<if $NPCsExtended[_ei].health is "infected">>
<<if random(1,2) eq 1>><<set $NPCsExtended[_ei].health to "deceased">><<set _decEx5.push(_ei)>>
<<else>><<set $NPCsExtended[_ei].health to "recovered">><<set _recEx5.push(_ei)>><</if>>
<</if>>
<</for>>
<</silently>>
/* reveal if sick family members have died or survived*/
<<if _recovered.length gt 0>><br><br>You are grateful to hear that your
<<for _r, _d range _recovered>>
<<if _recovered.length eq 1>><<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name has<<elseif _r < _recovered.length - 1>><<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name, <<else>>and <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name have
<</if>>
<</for>>started to recover from their illness.
<br><br>
<</if>>
<<if _deceased.length gt 0>><<if _recovered.length gt 0>>Unfortunately, not all have fared the same. <</if>>Your
<<for _x, _d range _deceased>>
<<if _deceased.length eq 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name has died.<<elseif _x < _deceased.length - 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name,<<else>>and <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name have died.
<</if>>
<</for>>
<br><br>
<</if>>
/* Report servant deaths and recoveries */
<<if _decSv5.length gt 0>>Your <<for _n, _idx range _decSv5>><<if _decSv5.length eq 1>>servant $NPCsServants[_idx].name has died.<<elseif _n < _decSv5.length - 1>>servant $NPCsServants[_idx].name, <<else>>and servant $NPCsServants[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recSv5.length gt 0>>Your <<for _n, _idx range _recSv5>><<if _recSv5.length eq 1>>servant $NPCsServants[_idx].name has recovered.<<elseif _n < _recSv5.length - 1>>servant $NPCsServants[_idx].name, <<else>>and servant $NPCsServants[_idx].name have recovered.<</if>><</for>><br><br><</if>>
/* Report master household deaths and recoveries */
<<if _decMs5.length gt 0>>In your $masterTitle's <<defHousehold "household">>, <<for _n, _idx range _decMs5>><<if _decMs5.length eq 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name has died.<<elseif _n < _decMs5.length - 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name, <<else>>and <<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recMs5.length gt 0>>In your $masterTitle's <<defHousehold "household">>, <<for _n, _idx range _recMs5>><<if _recMs5.length eq 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name has recovered.<<elseif _n < _recMs5.length - 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name, <<else>>and <<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name have recovered.<</if>><</for>><br><br><</if>>
/* Report extended family deaths and recoveries */
<<if _decEx5.length gt 0>>Your <<for _n, _idx range _decEx5>><<if _decEx5.length eq 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name has died.<<elseif _n < _decEx5.length - 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name, <<else>>and $NPCsExtended[_idx].relationship $NPCsExtended[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recEx5.length gt 0>>Your <<for _n, _idx range _recEx5>><<if _recEx5.length eq 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name has recovered.<<elseif _n < _recEx5.length - 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name, <<else>>and $NPCsExtended[_idx].relationship $NPCsExtended[_idx].name have recovered.<</if>><</for>><br><br><</if>>
<<silently>>
/* check if plague spreads */
<<fumigant-check>>
<<for _i = 0; _i < $NPCs.length; _i++>>
<<if $NPCs[_i].health is "healthy">>
<<if _fumes eq 1 and random(1,4) is 1>><<set $NPCs[_i].health to "infected">>
<<elseif _fumes eq 0 and random(1,2) is 1>><<set $NPCs[_i].health to "infected">>
<</if>>
<</if>>
<</for>>
/* Check for fumigants to prevent spread to servants */
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "healthy">>
<<if _fumes eq 1 and random(1,4) is 1>><<set $NPCsServants[_si].health to "infected">>
<<elseif _fumes eq 0 and random(1,2) is 1>><<set $NPCsServants[_si].health to "infected">>
<</if>>
<</if>>
<</for>>
<</silently>>
<<health-update>>
<br><br>
<<link "As your condition declines, you pray constantly." `passage()`>><</link>>
<<default>>
<<if $reputation lte 2>>Unfortunately, your reputation is so poor that you cannot convince any of your neighbors to bring food or medical supplies to your household any longer.
<<elseif $reputation gt 2>>Your friends and neighbors continue to bring you food and <<defPlague "plague">> remedies, which they pass in through the windows taking care to keep their distance from you.
<br><br>
<</if>>
/* check if player used a helpful remedy earlier */
<<unset $textGroup>>
<<if (_remedyEffect is 0 and random(1,2) is 1) or (_remedyEffect is 1 and random(1,3) is 1)>> But nothing works. At least you will grow too delirious to notice how miserable you are in the hours before your [[death]].
<<else>><<set $playerPlagueStatus to "recovered">> Miraculously, after a few days you feel your fever break and your <<defBuboes "buboes">> begin to go down. Thanks be to God, you have survived the <<defPlague "plague">>.
<br><br>
<<link "Too bad you and your household still have to be quarantined for the full 40 days, to make sure you don't spread the plague to anyone else." "Reconnecting">><</link>>
<</if>>
<</switch>><<if def $textGroup>><<set $textGroup += 1>><</if>>
<<set $quarantine +=1>><</nobr>><<widget "july-1665-helper">><<nobr>>
The graveyards are beginning to overflow and corpses are being flung into the open marshes of <<defTuttlefields "Tuttle-fields">>. There is still room in the <<defNewChapelChurchyard "New Chapel churchyard">>, that was walled in during the last <<defPlague "plague">> at great public expenses, but only the rich whose families can afford to pay are being buried there now.
<br><br>
It feels like the church bells are ringing constantly, with each new death or funeral.
<br><br>
<<if $socio is "nobles">>
The <<defPlague "plague">> has even followed the King's household to <<defHamptonCourt "Hampton Court">> and one of his guards dies of plague at the end of the month.<br><br><</if>>
<<if $location is "inside the City walls">>[[Worst of all, the first case of plague has appeared in your parish.->First Plague Day]]
<<else>>
<<if $role is "corpsebearer">>As you haul corpses day in and day out, you try not to think about how carelessly they are being treated. Luckily, their grieving families are still shut into their houses and aren't there to see it.
<br>
<br>
A man offers you a groat to take his wife away without letting her corpse be examined by a searcher first. Do you take the bribe? <span id="cb-bribe">
<<link "Yes">><<replace "#cb-bribe">>With so many dying, it seems pointless to force the few survivors into quarantine. For all you know, the poor woman just died of spotted fever. All the same, you take care <<storyline-return "not to examine the corpse too carefully." 1 4 -2>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg" style="width:100%; height:auto;" alt="Engraving of a corpse bearer carrying away the dead"></a>
//R. Price - "A Corpse Bearer", 1655//
</div>
<</replace>><</link>>
| <<link "No">><<replace "#cb-bribe">>You insist on waiting for the searcher to examine the corpse and consider reporting the man to your <<defParish "parish">> clerk, but decide that it was merely his grief speaking rather than an attempt to avoid being quarantined. After the searcher diagnoses the woman as dead from spotted fever, <<storyline-return "you take her corpse away." 1 0 1>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg" style="width:100%; height:auto;" alt="Engraving of a corpse bearer carrying away the dead"></a>
//R. Price - "A Corpse Bearer", 1655//
</div><</replace>><</link>></span>
<<elseif $role is "warder">>You stand watch outside shut up houses to ensure that no one tries to escape. Listening to the pleas of those locked inside with the sick and dying is bad enough. But the worst is when the houses go silent.
<br>
<br>
One night, a pair of men approach and offer you a groat to look the other way while they remove something from the house. Do you take the bribe? <span id="wd-bribe">
<<link "Yes">><<replace "#wd-bribe">>With so many dying, it seems pointless to pretend that shutting up the houses will stop the spread of plague. You say nothing as a woman inside the house lowers a small child out the window and into the arms of the waiting men. As they spirit the child away, you <<storyline-return "wonder if any of them will survive." 1 4 -2>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://iiif.wellcomecollection.org/image/V0010606EL/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/V0010606EL/full/1024%2C/0/default.jpg" style="width:100%; height:auto;" alt="Engraving of a death cart in a London street during the plague"></a>
//S. Davenport, after G. Cruikshank - "A Death Cart in a Street in London During the Great Plague", 1835//
</div><</replace>><</link>>
| <<link "No">><<replace "#wd-bribe">>You refuse to abandon your duty and the men slip away into the darkness. The next morning, when your replacement comes, you warn him about what happened and hope that he will be <<storyline-return "as diligent as you were." 1 0 1>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://iiif.wellcomecollection.org/image/V0010606EL/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/V0010606EL/full/1024%2C/0/default.jpg" style="width:100%; height:auto;" alt="Engraving of a death cart in a London street during the plague"></a>
//S. Davenport, after G. Cruikshank - "A Death Cart in a Street in London During the Great Plague", 1835//
</div><</replace>><</link>></span>
<<elseif $role is "searcher">>Day in and day out, you examine the corpses of people who have died. There are so many dead of <<defPlague "plague">> that it has become almost a joyful occasion when you find someone dead of a regular consumption or bad teeth.
<br>
<br>
One day, a woman offers you a groat to say that her son died of spotted fever, despite the obvious tokens of <<defPlague "plague">> on the poor boy's body. Do you take the bribe? <span id="bribe-yn">
<<link "Yes">><<replace "#bribe-yn">>With so many dying, it seems pointless to try to stop the spread of disease anymore. Besides, you've always been troubled by the practice of shutting up the healthy alongside the sick, to later become infected and die themselves. What does it hurt to profit a little while <<storyline-return "maybe saving a life?" 1 4 -2>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg" style="width:100%; height:auto;" alt="Engraving of men loading plague victims onto a cart"></a>
//Nathaniel Parr - "Plague in 1665", c. 1747//
</div>
<</replace>><</link>>
| <<link "No">><<replace "#bribe-yn">>As distasteful as it is to be the one to declare a household has been stricken by plague, it is your duty to tell the truth as you see it. You report the plague death to your parish clerk and see to it that the woman and her household are <<storyline-return "properly shut up." 1 0 1>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg" style="width:100%; height:auto;" alt="Engraving of men loading plague victims onto a cart"></a>
//Nathaniel Parr - "Plague in 1665", c. 1747//
</div>
<</replace>><</link>></span>
<<elseif $role is "nurse">>You fear death every day. You pray to God to protect you from harm and to gather up the souls of the innocent children you cannot save here on earth.
<br>
<br>
One day, you are bringing food to a house that was shut up so recently that the quarantine cross painted on the door is still fresh. The woman inside thanks you for your help then offers you a groat to smuggle her baby out in your empty basket. Do you take the bribe? <span id="ns-bribe">
<<link "Yes">><<replace "#ns-bribe">>The little boy is perfectly healthy and you can't bear to condemn him to being shut up to die. You tuck him into your basket and smuggle him out to his waiting aunt, who blesses you and promises to name her <<storyline-return "next child in your honor." 1 4 -2>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://iiif.wellcomecollection.org/image/V0010610/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/V0010610/full/1024%2C/0/default.jpg" style="width:100%; height:auto;" alt="Etching of a man consuming antidotes to the plague"></a>
//J. Franklin - "A Man Consuming Many Antidotes to the Plague", 1841//
</div><</replace>><</link>>
| <<link "No">><<replace "#ns-bribe">>It breaks your heart to say no, but you can't risk smuggling the little boy out of the house. What if he were to cry and you were to be discovered? Or worse, what if he is already harboring the plague and your attempts to save him only doom whatever family takes him in? You encourage her to put her faith in God and <<storyline-return "hurry away." 1 0 1>><br><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://iiif.wellcomecollection.org/image/V0010610/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/V0010610/full/1024%2C/0/default.jpg" style="width:100%; height:auto;" alt="Etching of a man consuming antidotes to the plague"></a>
//J. Franklin - "A Man Consuming Many Antidotes to the Plague", 1841//
</div><</replace>><</link>></span>
<<else>>
You are grateful to have survived long enough to see [[August 1665]].
<</if>>
<</if>>
<</nobr>><</widget>><<widget "august-1665-helper">><<nobr>>
The city has ordered public <<defFasts "fasts">> and prayers to help combat the plague. <<if $religion is "Presbyterian">><<if $money gt 2400>>You hear about a private meeting of your fellow <<defPresbyterians "Presbyterians">> in <<defCoventGarden "Covent Garden">>. <span id="conventicle">Do you attend? <<link "Yes">><<replace "#conventicle">>You attend the private meeting, but unfortunately everyone there is arrested. You are told you can be released if you pay £5 to help care for the poor of the city. You have no choice but to pay.<<set $money -= 1200>><<set $decisions.push({text: "Aug 1665: Attended Presbyterian conventicle and was fined £5", money: -1200, repDelta: 0, repBefore: $reputation, infectPct: null})>><</replace>><</link>> | <<link "No">><<replace "#conventicle">>You decide not to risk it, which is lucky for you because everyone who attends the meeting is arrested. They are told they can be released if they pay £5 each to help care for the poor of the city, but they refuse and so are imprisoned.<<set $decisions.push({text: "Aug 1665: Avoided Presbyterian conventicle", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><</replace>><</link>></span><<else>>You attempt to join a private meeting of your fellow <<defPresbyterians "Presbyterians">> in <<defCoventGarden "Covent Garden">> but are too poor and turned away, which is lucky for you because everyone who attends the meeting is arrested. They are told they can be released if they pay £5 each to help care for the poor of the city, but they refuse and so are imprisoned.<</if>><</if>>
<<if $socio is "nobles">>
Afraid of the worsening plague outbreak, the King removes his household even further away to the west, finally settling into the city of <<defSalisbury "Salisbury">>. Unfortunately, there is no royal palace there and anyone who follows him will have to find their own makeshift lodgings somewhere else in the city.<</if>>
<br><br>You can continue to try and prevent catching plague by visiting the <<defApothecary "Apothecary">> for fumigants and medicines, or you can:
<<preventative>>
[[Continue to September 1665->September 1665]]
<</nobr>><</widget>><<nobr>>
/* Pregnancy and marriage tracking, betrothal should not trigger pregnancy due to age restrictions in character generation */
<<if $relationship is "married">>
<<if $gender is "female">>
<<if $agenum gte 16 and $agenum lte 40>>
<<set $pregnant to 0>>
<<set _tempPregnant to random(1,10)>>
<<if _tempPregnant is 1>>
<<set $pregnant to 1>>
<</if>>
<</if>>
<</if>>
<</if>>
/* one-time call of do you want to be married and/or apprenticed (mutually exclusive) */
<<if _headerEventActive>>
/* Header event active — suppress passage body until resolved */
<<elseif $agenum gte 16 and $seekingDecision is 0 and $relationship isnot "married">>
<<marriage-market>>
<<elseif ($socio is "day labourers" or $socio is "artisans" or $socio is "merchants") and $agenum gte 14 and $agenum lte 21 and $relationship is "single" and $seekingMarriage is 0 and $seekingDecision isnot 2>>
<<apprenticeship-market>>
<<elseif $socio is "nobles" and $agenum gte 16 and $seekingDecision is 1 and $seekingDecision isnot 3>>
<<preferment-market>>
/* passage continues after decisions are made */
<<else>>
The Christmas festivities end with a great snowfall. It's bitterly cold and the frost doesn't break for over two weeks. <<if $socio is "nobles">><<if $agenum lte 12>>Your family leaves you safe and warm at home while they attend on the king and queen at Court.<<else>>That isn't enough to stop you from attending on the king and queen at Court and buying them expensive New Year's gifts to gain their favor.<<set $money -=4800>><<set $decisions.push({text: "Jan 1665: Bought New Year's gifts for the King and Queen", money: -4800, repDelta: 0, repBefore: $reputation, infectPct: null})>> <</if>><</if>>Freezing rain alternates with snow all winter and rumors swirl about the Dutch fleet.<br><br>
/*Beggar story*/
<<if $socio is "beggars">>Even though you are one of the deserving poor and have a license to beg in your <<defParish "parish">>, few people are in a charitable mood. At least you have a roof over your head and receive bread each week, thanks to your parish's <<defOverseersOfThePoor "Overseers of the Poor">>
<<if $agenum gte 12 and $agenum lte 59>>, even if they put you to work to earn it
<</if>>.
You are not freezing or starving to death, even if you are always cold and hungry.
<</if>>
/*Day Labourer story */
<<if $socio is "day labourers">>
<<if $agenum lte 15>>As the child of a <<defDayLabourer "day labourer">>, each member of your family has
<<else>>As a <<defDayLabourer "day labourer">>, you have
<</if>> to search for a job every day and the weather is so miserable that some days you can’t find work. But at least you have a roof over your head and there is enough money to buy at least bread for your <<defHousehold "household">> every week. You are not freezing or starving to death, even if you are always cold and hungry.
<</if>>
/* Servant Story */
<<if $socio is "servants">>As a servant, you spend as much time running errands outside as inside, but at least you have a roof over your head, warm clothes, and plenty to eat. But you can’t help but worry about how the war will impact your life.
<</if>>
/*Artisan Story */
<<if $socio is "artisans">>As
<<if $agenum lte 15>> the child of
<</if>> a <<set _role = ["baker", "chandler", "grocer", "tailor", "weaver"]>><<listbox "$role">><<optionsfrom _role>><</listbox>>, you spend much of your time working inside and are very glad to have a roof over your head, a fire in your hearth, and enough money for you and your <<defHousehold "household">> to eat well. But you can’t help but worry about how the war will impact your
<<if $agenum lte 15>>family's
<</if>>trade.
<</if>>
/* Merchant Story */
<<if $socio is "merchants">>As <<if $agenum lte 15>>the child of a merchant, you spend much of your time working inside and are very glad to have a roof over your head, a fire in each of your many hearths, and plenty of money to buy the latest fashions. But your family can’t help but worry about how the war will impact their trade.<<else>>a merchant, you spend much of your time working inside and are very glad to have a roof over your head, a fire in each of your many hearths, and plenty of money to buy the latest fashions. But you can’t help but worry about how the war will impact your trade.<</if>>
<</if>>
/* Noble Story */
<<if $socio is "nobles">><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/2/2d/Anthony_van_Dyck_-_Queen_Henrietta_Maria_of_England_-_KMSsp240_-_Statens_Museum_for_Kunst.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/2/2d/Anthony_van_Dyck_-_Queen_Henrietta_Maria_of_England_-_KMSsp240_-_Statens_Museum_for_Kunst.jpg" style="width:100%; height:auto;" alt="Portrait of Queen Henrietta Maria of England"></a>
<br>
//Anthony van Dyck - "Queen Henrietta Maria of England", c. 1614-1641//
</div>As <<if $agenum lte 15>>the child of <</if>>a minor noble, you spend much of your time inside at the royal Court of King Charles II in hopes of securing more titles, honor, and riches for yourself and your family<<if $religion is "Catholic">>, especially since <<defQueenCatherine "Queen Catherine">> and the Queen Mother both share your <<defCatholic "Catholic">> faith<</if>>. You fill your days traveling among the royal family's various London palaces—including attending the <<defHenriettaMaria "Queen Mother's">> weekly social circle as faithfully as if it were church—and spending money on the latest fashions and trends. But you can’t help but worry about how the war will impact your life.
<</if>>
<<if $origin isnot "the Dutch Republic">>It's almost a relief when war officially breaks out on March 4th.<<else>>Things go from bad to worse for you when war officially breaks out on March 4th.<</if>> Men pass back and forth through London, headed for the <<defFleet "fleet">>—some voluntarily, some after having been <<defImpressed "impressed">> and forced into service.
<br><br>
/* Beggar options */
<<if $socio is "beggars">><<beggar-choice>><br>
<</if>>
/* Day Labourer options */
<<if $socio is "day labourers">>Finally, there is plenty of work to be had.
<<if $gender is "female">>You are doing laundry day in and day out in the city fields, which brings in enough money that you finally have enough to spend on things other than food and rent.<br><br>
Do you:<ul>
<li>[[save it->May 1665][$money to Math.clamp($money + 120, -1000000, 1000000)]]</li>
<li>[[increase your donations to the poor->May 1665][$reputation to Math.clamp($reputation + 1, 0, 10); $money to Math.clamp($money - 120, -1000000, 1000000)]]</li>
<li>[[take a day off and splurge on a trip to the theatre->May 1665][$reputation to Math.clamp($reputation - 1, 0, 10); $money to Math.clamp($money - 120, -1000000, 1000000)]]</li>
</ul>
<<else>>A friend of one of your neighbors offers you twice your normal wages to help haul and cart goods for the Navy. <br>
Do you:<ul>
<li><<if random(1,2) eq 1>>[[decide to accept this generous offer.|impressed][$impressed += 1]]<<else>>[[decide to accept this generous offer.|May 1665][$money to Math.clamp($money + 480, -1000000, 1000000); $reputation to Math.clamp($reputation - 1, 0, 10)]]<</if>></li>
<li>[[choose to continue working for one of your regular employers instead.|May 1665]]</li>
</ul>
<</if>>
<</if>>
/* Servant options */
<<if $socio is "servants">>Your $masterTitle warns you to keep a sharp eye out to avoid <<if $gender is "male">>being <<defImpressed "impressed">> into the Navy yourself.
<br><br>Are you:
<ul>
<<set _pronoun to ($masterGender is "female") ? "her" : "his">><li><<link `"careful to heed " + _pronoun + " warning"` "May 1665">><</link>></li>
<li><<if random(1,2) is 1>>[[not convinced it would be a worse life and spend as much of your—admittedly little—free time in the streets and alehouses as you did before|impressed][$impressed += 1]]<<else>><<storyline-return "not convinced it would be a worse life and spend as much of your—admittedly little—free time in the streets and alehouses as you did before" 1 -12 -1>><</if>></li>
</ul>
<<else>>being harassed or mistaken for a woman of loose morals.
<br>Do you:
<ul>
<<set _pronoun to ($masterGender is "female") ? "her" : "his">><li><<link `"agree with " + _pronoun + " warning"` "May 1665">><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><</link>></li>
<<set _pronoun to ($masterGender is "female") ? "she's" : "he's">><li><<link `"think " + _pronoun + " overreacting and spend as much of your—admittedly little—free time in the streets and alehouses as you did before"` "May 1665">><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $money -= 12>><</link>></li>
</ul>
<</if>>
<</if>>
/* Artisan options */
<<if $socio is "artisans">>For now, at least, your <<if $agenum lte 15>>family's <</if>>business is booming.
<br><br>
When you go to church on Easter Sunday, you are reminded of how lucky you are as one of God’s chosen people.
<br><br>Do you: <ul>
<li>[[celebrate your good fortune by increasing your donations to the poor->May 1665][$reputation to Math.clamp($reputation + 1, 0, 10); $money to Math.clamp($money - 560, -1000000, 1000000)]]</li>
<li>[[save your money in case of future misfortune->May 1665][$money to Math.clamp($money + 560, -1000000, 1000000)]]</li>
<li>[[take a day off and splurge on a trip to the theatre->May 1665][$reputation to Math.clamp($reputation - 1, 0, 10); $money to Math.clamp($money - 132, -1000000, 1000000)]]</li>
</ul>
<</if>>
/* Merchant options */
<<if $socio is "merchants">>For now, at least, your <<if $agenum lte 15>>family's <</if>>business is booming.
<br><br>
When you go to church on Easter Sunday, you are reminded of how lucky you are as one of God’s chosen people.
<br><br>Do you:
<ul>
<li>[[celebrate your good fortune by increasing your donations to the poor->May 1665][$reputation to Math.clamp($reputation + 1, 0, 10); $money to Math.clamp($money - 2800, -1000000, 1000000)]]</li>
<li>[[save your money in case of future misfortune->May 1665][$money to Math.clamp($money + 2800, -1000000, 1000000)]]</li>
<li>[[take some time off and go fox hunting in the countryside->May 1665][$reputation to Math.clamp($reputation - 1, 0, 10)]]</li>
</ul>
<</if>>
/* Noble options */
<<if $socio is "nobles">>Court is abuzz with gossip about the war and there’s plenty to keep an ambitious courtier busy.
<br><br>Do you: <ul>
<li>[[throw in and help with the war effort->May 1665][$reputation to Math.clamp($reputation + 1, 0, 10); $money to Math.clamp($money - 12000, -1000000, 1000000)]]</li>
<li>[[keep yourself out of the fray and focus on your own needs->May 1665][$reputation to Math.clamp($reputation - 1, 0, 10)]]</li>
</ul>
<</if>>
<</if>>
<</nobr>><<set $money to 0>>
<<set $expenses to 0>>
<<set $income to 0>>
<<set $hoh to 0>>
<<set $role to "0">>
<<set $billSubscribed to 0>>
<<set $debtWarned to 0>>
<<set $debtForcedAttend to 0>>
<<set $childServiceOffered to -1>>
<<set $inDebtorsPrison to 0>>
<<set $debtorPrisonInfected to 0>>
<<set $debtorPrisonMonths to 0>>
<<set $creditorWaitCount to 0>>
<<set $debtorPrisonCount to 0>>
<<set $debtSellUsed to 0>>
<<set $debtFled to 0>>
<<set $disability to 0>>
<<set $navyDismissed to false>>
<<set $impressedFromIndex to -1>>
<<set $reputation to 6>>
<<set $office to "">>
<<set $churchSkipRepPenalty to 0>>
<<set $churchServiceDecision to false>>
<<set $plagueInfection to 0>>
<<set $playerPlagueStatus to "healthy">>
<<set $location to 0>>
<<set $impressed to 0>>
<<set $murder to 0>>
<<set $NPCs = []>>
<<set $NPCsExtended = []>>
<<set $quarantineSwapped to "">>
<<set $SavedNPCs to []>>
<<set $SavedServants to []>>
<<set $seekingDecision to 0>>
<<set $shutUpHouse to 0>>
<<set $randomEventCompleted to false>>
<<set $FledFamily = []>>
<<set $fled to 0>>
<<set $fledBroke to false>>
<<set $fledFromIndex to 0>>
<<set $fledReturn to "">>
<<set $followedCourt to 0>>
<<set $getaway = []>>
<<set $NPCsServants = []>>
<<set $FledServants = []>>
<<set $NPCsMaster = []>>
<<set $masterStatus to "">>
<<set $masterGender to "">>
<<set $masterTitle to "">>
<<set $caretakerLabel to "">>
<<set $fNames = {Elizabeth: 400, Anne: 370, Mary: 300, Margaret: 230, Jane: 150, Catherine: 190, Alice: 190, Dorothy: 190, Joan: 50, Frances: 50, Agnes: 50, Eleanor: 60, Cecily: 30, Bridget: 30, Sarah: 50, Isabel: 40, Margery: 28, Lucy: 20, Ursula: 20, Grace: 20, Christian: 20, Joyce: 20, Susan: 20, Winifred: 10, Barbara: 10, Constance: 10, Edith: 10, Maud: 20, Philippa: 10, Ellen: 10, Lettice: 10, Magdalen: 10, Maria: 10, Martha: 10, Thomasine: 10, Blanche: 10, Helen: 10, Joanna: 10, Judith: 10, Rose: 10, Gertrude: 10, Rebecca: 10, Hester: 10, Honora: 20, Mabel: 10, Susanna: 10,Sybil: 10, Amy: 10, Anna: 10, Audrey: 10, Emma: 10, Johanna: 10, Juliana: 10, Muriel: 10, Abigail: 10, Cecilia: 10, Christina: 10, Denise: 10, Faith: 10, Florence: 10, Francisca: 10, Grisel: 10, Inez: 10, Jeanne: 10, Jocosa: 10, Lora: 10, Matilda: 10, Penelope: 10, Sylvestra: 10, Theodosia: 10, Theophila: 10, Agatha: 10, Alathea: 10, Amata: 10, Arabella: 10, Beatrice: 10, Benedicta: 10, Camilla: 10, Cassandra: 10, Claude: 10, Clemence: 10, Diana: 10, Dorcas: 10, Esther: 10, Isotta: 10, Marcella: 10, Olive: 10,}>>
<<set $mNames = {
John: 1500, Thomas: 1300, William: 1300, Richard: 620, Robert: 600, Henry: 500, James: 430, George: 420, Edward: 400, Charles: 210, Francis: 200, Samuel: 200, Alexander: 150, Nicholas: 148, Peter: 120, Edmund: 120, Christopher: 110, David: 110, Anthony: 100, Hugh: 90, Joseph: 90, Andrew: 90, Roger: 80, Walter: 80, Ralph: 80, Arthur: 70, Philip: 70, Patrick: 70, Nathaniel: 70, Matthew: 70, Daniel: 60, Humphrey: 60, Stephen: 50, Benjamin: 50, Michael: 40, Archibald: 40, Gilbert: 40, Laurence: 40, Abraham: 30, Isaac: 30, Simon: 30, Paul: 30, Adam: 30, Martin: 30, Leonard: 30, Jean: 30, Lewis: 20, Timothy: 20, Jacob: 20, Bartholomew: 20, Bernard: 20, Rowland: 20, Theophilus: 20, Giles: 20, Jeremiah: 20, Joshua: 20, Oliver: 20, Clement: 10, Gabriel: 10, Maurice: 10, Owen: 10, Donald: 10, Miles: 10, Brian: 10, Luke: 10, Ambrose: 10, Jonathan: 10, Valentine: 10, Cuthbert: 10, Mark: 10, Moses: 10, Colin: 10, Dudley: 10, Geoffrey: 10, Gerard: 10, Gervase: 10, Josias: 10, Tobias: 10, Zachary: 10, Ferdinando: 10, Augustine: 10, Cornelius: 10, Gregory: 10, Herbert: 10, Josiah: 10, Marmaduke: 10, Pierre: 10, Aaron: 10, Ellis: 10, Jonas: 10, Lancelot: 10, Lionel: 10, Louis: 10, Nehemiah: 10, Sampson: 10, Sebastian: 10, Vincent: 10, Antonio: 10, Christian: 10, Denis: 10, Duncan: 10, Erasmus: 10, Everard: 10, Godfrey: 10, Jerome: 10, Morgan: 10, Neil: 10, Theodore: 10, Abel: 10, Adrian: 10, Barnabas: 10, Basil: 10, Elias: 10, Elisha: 10, Gerald: 10, Giovanni: 10, Griffith: 10, Guy: 10, Heneage: 10, Jan: 10, Matthias: 10, Obadiah: 10, Seth: 10,
}>>
<<set $wallParishes = {"St Alban Wood Street": 46, "All Hallows Barking": 86, "All Hallows Bread Street": 20, "All Hallows the Great": 90, "All Hallows Honey Lane": 9, "All Hallows the Less": 43, "All Hallows Lombard Street": 18, "All Hallows Staining": 38, "All Hallows London Wall": 93, "St Alphage": 51, "St Andrew Hubbard": 27, "St Andrew Undershaft": 56, "St Andrew Wardrobe": 81, "St Anne Aldersgate": 42, "St Ann Blackfriars": 97, "St Antholin": 13, "St Austin": 13, "St Bartholomew Exchange": 22, "St Benet Fink": 29, "St Benet Gracechurch": 13, "St Benet Paul's Wharf": 70, "St Benet Sherehog": 13, "St Botolph Billingsgate": 23, "Christ Church": 140, "St Christopher": 16, "St Clement Eastcheap": 15, "St Dionis Backchurch": 31, "St Dunstan East": 102, "St Edmund the King": 20, "St Ethelburga": 23, "St Faith under St Paul's": 30, "St Vedast alias Foster": 25, "St Gabriel Fenchurch": 18, "St George Botolph Lane": 13, "St Gregory by St Paul's": 118, "St Helen": 25, "St James Duke's Place": 41, "St James Garlickhithe": 40, "St John Baptist": 31, "St John Evangelist": 5, "St John Zachary": 23, "St Katherine Coleman": 44, "St Katherine Creechurch": 87, "St Lawrence Jewry": 45, "St Lawrence Pountney": 38, "St Leonard Eastcheap": 14, "St Leonard Foster Lane": 37, "St Magnus": 36, "St Margaret Lothbury": 33, "St Margaret Moses": 14, "St Margaret New Fish Street": 26, "St Margaret Pattens": 17, "St Mary Abchurch": 30, "St Mary Aldermanbury": 46, "St Mary Aldermay": 20, "St Mary le Bow": 21, "St Mary Bothaw": 22, "St Mary Colechurch": 5, "St Mary Hill": 23, "St Mary Mounthaw": 12, "St Mary Somerset": 73, "St Mary Staining": 7, "St Mary Woolchurch": 22, "St Mary Woolnoth": 21, "St Martin Ironmonger Lane": 11, "St Martin Ludgate": 51, "St Martin Orgar": 25, "St Martin Outwich": 17, "St Martin Vintry": 76, "St Matthew Friday Street": 9, "St Mary Magdalen Milk Street": 19, "St Mary Magdalen Old Fish Street": 42, "St Michael Bassishaw": 38, "St Michael Cornhill": 36, "St Michael Crooked Lane": 46, "St Michael Queenhithe": 47, "St Michael Quern": 17, "St Michael Royal": 22, "St Michael Wood Street": 24, "St Mildred Bread Street": 12, "St Mildred Poultrey": 24, "St Nicholas Acons": 14, "St Nicholas Cole Abbey": 31, "St Nicholas Olave": 18, "St Olave Hart Street": 37, "St Olave Jewry": 29, "St Olave Silver Street": 42, "St Pancras Soper Lane": 12, "St Peter Ad Vincula": 10, "St Peter Cheap": 13, "St Peter Cornhill": 36, "St Peter Paul's Wharf": 23, "St Peter Poor": 22, "St Stephen Coleman Street": 133, "St Stephen Walbrook": 19, "St Swithin": 41, "St Thomas Apostle": 29, "Trinity": 31}>>
<<set $WestmParishes = {"St Clement Danes": 534, "St Paul Covent Garden": 133, "St Martin in the Fields": 1242, "St Mary Savoy": 80, "St Margaret Westminster": 807}>>
<<set $eParishes = {"Holy Trinity Minories": 12, "St Katharine Tower": 200, "St Mary Whitechapel": 671, "St Dunstan Stepney": 1392, "St Botolph Aldgate": 785}>>
<<set $wParishes = {"St Andrew Holbom": 843, "Bridewell Precinct": 34, "St Bride": 412, "St Dunstan West": 265, "St Sepulchre": 851}>>
<<set $nParishes = {"St Bartholomew Great": 90, "St Bartholomew Less": 44, "St Botolph Aldersgate": 187, "St Botolph Bishopsgate": 545, "St Giles Cripplegate": 1353, "St Giles in the Field": 931, "St James Clerkenwell": 313, "St Leonard Shoreditch": 424, "St Mary Islington": 58, "St John at Hackney": 80}>>
<<set $sParishes = {"St George Southwark": 259, "St Olave Southwark": 829, "St Saviour Southwark": 605, "St Thomas Southwark": 54, "St Mary Lambeth": 236, "St Mary Magdalen Bermondsey": 305, "St Mary Newington": 235, "St Mary Rotherhithe": 40}>>
<<set $fireParishes = ["All Hallows Bread Street", "All Hallows the Great", "All Hallows Honey Lane", "All Hallows the Less", "All Hallows Lombard Street", "Bridewell Precinct", "Christ Church", "St Alban Wood Street", "St Andrew Hubbard", "St Andrew Wardrobe", "St Anne Aldersgate", "St Ann Blackfriars", "St Antholin", "St Austin", "St Bartholomew Exchange", "St Benet Fink", "St Benet Gracechurch", "St Benet Paul's Wharf", "St Benet Sherehog", "St Botolph Billingsgate", "St Bride", "St Christopher", "St Clement Eastcheap", "St Dionis Backchurch", "St Dunstan East", "St Edmund the King", "St Faith under St Paul's", "St Vedast alias Foster", "St Gabriel Fenchurch", "St George Botolph Lane", "St Gregory by St Paul's", "St James Garlickhithe", "St John Baptist", "St John Evangelist", "St John Zachary", "St Lawrence Jewry", "St Lawrence Pountney", "St Leonard Eastcheap", "St Margaret Lothbury", "St Margaret Moses", "St Margaret New Fish Street", "St Margaret Pattens", "St Martin Ironmonger Lane", "St Martin Ludgate", "St Martin Orgar", "St Martin Vintry", "St Mary Abchurch", "St Mary Aldermanbury", "St Mary Aldermay", "St Mary Bothaw", "St Mary Colechurch", "St Mary Hill", "St Mary le Bow", "St Mary Mounthaw", "St Mary Somerset", "St Mary Staining", "St Mary Woolchurch", "St Mary Woolnoth", "St Matthew Friday Street", "St Mary Magdalen Milk Street", "St Mary Magdalen Old Fish Street", "St Michael Bassishaw", "St Michael Cornhill", "St Michael Crooked Lane", "St Michael Queenhithe", "St Michael Quern", "St Michael Royal", "St Michael Wood Street", "St Mildred Bread Street", "St Mildred Poultrey", "St Nicholas Acons", "St Nicholas Cole Abbey", "St Nicholas Olave", "St Olave Jewry", "St Olave Silver Street", "St Pancras Soper Lane", "St Peter Cheap", "St Peter Paul's Wharf", "St Stephen Walbrook", "St Swithin", "St Thomas Apostle", "Trinity"]>>
<<set $nbNames to ["Thomas", "Thomasina", "Charlotte", "Charles", "Philippa", "Phillip", "John", "Joan"]>>
<<set $fumes = {}>>
<<set $remedies = {}>>
<<set $fumes.Incense = { name: "incense to burn in your home to prevent plague and clear out rooms after infection", quantity: 0, cost: 36 }>>
<<set $fumes.Purse = { name: "a purse of incense", quantity: 0, cost: 60 }>>
<<set $fumes.Fancy = { name: "St. Giles Powder", quantity: 0, cost: 192 }>>
<<set $fumes.Generic = { name: "brimstone and saltpeter with a little myrrh", quantity: 0, cost: 24 }>>
<<set $remedies.Plaster = { name: "a blistering plaster to break the buboes and draw out malignity", quantity: 0, cost: 21 }>>
<<set $remedies.Celestial = { name: "celestial water", quantity: 0, cost: 36 }>>
<<set $remedies.Treacle = { name: "a posset of London Treacle", quantity: 0, cost: 36 }>>
<<set $remedies.Suppository = { name: "a suppository of a fig filled with salt", quantity: 0, cost: 0 }>>
<<set $remedies.Cordial = { name: "a cordial tincture to be drunk for two days after infection", quantity: 0, cost: 12 }>>
<<set $remedies.Immodium = { name: "an anti-diarrheal posset made of plantain, sorrel, or knot grass", quantity: 0, cost: 0 }>>
<<set $pregnancyAnnounced to false>>
<<set $seekingApprenticeship to 0>>
<<set $seekingPreferment to 0>>
<<set $prefermentOffer to 0>>
<<set $apprenticeship to 0>>
<<set $servantPromotion to 0>>
<<set $decisions to []>>
<<set $trades to ["mercer", "draper", "ironmonger", "goldsmith"]>>
<<set $lodger to 0>>
<<set $lodgerRent to 0>>
<<set $preFireLocation to "">>
<<set $preFireParish to "">>
<<set $quarantine to 0>>
<<set $plagueRevealed to 0>>
<<set $pesthouseReparation to 0>>
<<set $gender to "">>
<<set $birthgender to "">>
<<set $age to "">>
<<set $agenum to 0>>
<<set $name to "">>
<<set $relationship to "">>
<<set $religion to "">>
<<set $origin to "">>
<<set $socio to "">>
<<set $parish to "">>
<<set $hhlocation to "">>
<<set $skipServices to 0>>
<<set $monthIndex to 0>>
<<set $food to "">>
<<set $pregnant to 0>>
<<set $seekingMarriage to 0>>
<<set $NPCAge to "">>
<<set $NPCAgeNum to 0>>
<<set $minAge to 0>>
<<set $maxAge to 0>>
<<set $FatherAge to 0>>
<<set $MotherAge to 0>>
<<set $hasFather to false>>
<<set $hasMother to false>>
<<set $fkidRel to "">>
<<set $mkidRel to "">>
<<set $servants to 0>>
<<set $apprentice to 0>>
<<set $worker to 0>>
<<set $ward to 0>>
<<set $accident to 0>>
<<set $death to 0>>
<<set $discovery to 0>>
<<set $elderly to 0>>
<<set $fever to 0>>
<<set $miscarriage to 0>>
<<set $runover to 0>>
<<set $steward to 0>>
<<set $wedding to 0>>
<<set $apprenticeshipOffer to 0>>
<<set $timeline to ["December 1664", "January 1665", "May 1665", "June 1665", "July 1665", "August 1665", "September 1665", "October 1665", "November 1665", "December 1665", "January 1666", "February 1666", "March 1666", "April 1666", "May 1666", "June 1666", "July 1666", "August 1666", "September 1666", "October 1666", "November 1666", "December 1666"
]>>
<<initDeathData>>
<<set $catchUpSummaries to ["War with the Dutch looms on the horizon. Christmas is celebrated as usual across the city.", "A great snowfall blankets London and the frost lasts two weeks. The Thames nearly freezes over.", "The first plague cases appear. Houses are shut up with red crosses and the words 'Lord Have Mercy Upon Us' painted on their doors.", "The English fleet wins a great victory over the Dutch at the Battle of Lowestoft. The King and his court flee London for Hampton Court as plague spreads.", "Plague deaths accelerate sharply. Burials now happen day and night, and the streets empty as those who can afford to flee do so.", "Deaths outpace burials. The summer heat is oppressive and the city reeks of death. People strip clothing from corpses out of desperation.", "Plague deaths reach their terrible peak at over 7,000 a week. The streets are nearly deserted.", "Cold, rainy weather arrives at last. Plague numbers finally begin to decline, though thousands still die each week.", "People begin trickling back into the city as deaths continue to fall. Shops cautiously reopen.", "Despite two great frosts, plague numbers tick upward again. A grim Christmas settles over the city.", "Plague recedes. Nobles return in their coaches, shops reopen, and the streets fill with life again.", "The King returns to Whitehall, a sign the worst is over. A great snow covers the mass graves as if hiding a terrible dream.", "The Queen of Portugal dies. London continues to mourn and rebuild.", "Plague cases creep upward again with the spring warmth. Easter is celebrated cautiously.", "The King\'s birthday is celebrated with bonfires, though plague still lingers in the city.", "The fleet engages the Dutch again. Four days of cannon fire are heard from London.", "Press gangs roam the streets seizing men for the fleet. The summer heat returns.", "Plague numbers climb again in the heat. The fleet burns Dutch ships in a bold raid.", "A great fire breaks out and burns for days, destroying much of the City within the walls.", "Thousands are left homeless by the fire. The city begins to clear rubble and rebuild amidst the ashes.", "The King declares an official day of thanksgiving. The plague is declared over at last.", "Fires still smolder in cellars beneath the ruins. London looks ahead to a long recovery."]>><<nobr>>
<<silently>>
<<fumigant-check>>
<<if tags().includes("storyline") and visited() lte 1>>
<<set $monthIndex to $timeline.indexOf(passage())>>
<<if _fumes gt 0 and random(1,2) eq 1>><<infection-program>>
<<elseif _fumes lt 1>><<infection-program>>
<</if>>
<<income>><<expenses>><<disposable>>
<</if>>
<</silently>>
<<if tags().includes("storyline")>><h2><<print passage()>>, $location</h2><</if>>
<<if tags().includes("quarantine")>><h2><<print passage()>></h2><</if>>
<<set _headerEventActive to false>><<if tags().includes("storyline") and visited() lte 1>><<debt-check>><<child-service-check>><<noble-child-service-check>><<debtor>><</if>>
<<if tags().includes("storyline") and visited() lte 1 and $inDebtorsPrison is 1>><<debtor-prison-check>><</if>>
<<if tags().includes("storyline") and $inDebtorsPrison is 1 and $plagueInfection isnot 1 and $plagueInfection isnot 2 and $playerPlagueStatus isnot "recovered">>
<<if random(1,2) eq 1>><<set $plagueInfection to 1>><<set $debtorPrisonInfected to 1>><</if>>
<</if>>
<<silently>>
<<if ndef _infectedFamily>><<set _infectedFamily = []>><</if>>
<<if ndef _infectedServants>><<set _infectedServants = []>><</if>>
<<if ndef _infectedMaster>><<set _infectedMaster = []>><</if>>
<<if ndef _infectedExtended>><<set _infectedExtended = []>><</if>>
<</silently>>
<</nobr>><<widget "december-1664-helper">><<nobr>><<party-costs>><<set-caretaker>>
<<linkappend "But those are worries for the future!">> For now, it is time to eat, drink, and play games with dice and cards to celebrate the Christmas season. <<if $religion is "member of the Church of England">>You look forward to gathering with your neighbors in the <<defParish "parish">> church to celebrate the birth of Jesus Christ.<<elseif $religion is "Catholic">> You enjoy gathering with your fellow Catholics at the magnificent chapel attached to <<defSomersetHouse "Somerset House">>, the Queen Mother <<defHenriettaMaria "Henrietta Maria's">> London home. <<else>>You might not be able to celebrate as openly as a conforming member of the Church of England, or the <<defPapists "papists">> who flock to the chapels of the Catholic <<defQueenCatherine "Queen Catherine">> and Queen Mother <<defHenriettaMaria "Henrietta Maria">>, but you will still enjoy the holidays in the comfort and privacy of your home.
<</if>>
<br>
<br>
<span id="decision">Do you want to celebrate Christmas with a feast?
<<link "Yes">><<silently>><<infection-program>><</silently>><<replace "#decision">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $decisions.push({text: "Dec 1664: Celebrated Christmas with a feast", money: -_partyCost, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You <<if $hoh isnot 1>>convince your $caretakerLabel to <</if>>plan a feast for the household and a few friends. You're excited about all the things on the menu but especially your favorite dessert <<set _food = ["minced pie", "sweetmeats", "currant cake", "syllabub", "tansy"]>><<listbox "$food">><<optionsfrom _food>><</listbox>>.
<br><br>
On Christmas Eve, you see a comet in the sky and you wonder if it is [[a sign of good things to come->January 1665]].
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/6/6c/Comet_1665.png"><img src="https://upload.wikimedia.org/wikipedia/commons/6/6c/Comet_1665.png" width="100%" alt="Illustration of a comet streaking across the night sky"></a>
//"Great Comet of 1665"//
<</replace>><</link>> | <<link "No">>
<<replace "#decision">><<set $decisions.push({text: "Dec 1664: Skipped the Christmas feast to save money", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<if $hoh is 4>>You convince your _husband<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle<<elseif $hoh isnot 1>>You convince your family<<else>>You decide<</if>> to save money and forego a large feast for the holiday.
<br><br>
On Christmas Eve, you see a comet in the sky and you wonder if it is [[a sign of good things to come->January 1665]].
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/6/6c/Comet_1665.png"><img src="https://upload.wikimedia.org/wikipedia/commons/6/6c/Comet_1665.png" width="100%" alt="Illustration of a comet streaking across the night sky"></a>
//"Great Comet of 1665"//
<</replace>><</link>></span><</linkappend>>
<</nobr>><</widget>><<widget "funeral-choice">><<nobr>>
/* Accepts either a pre-set _deadNPCs array or a single NPC argument */
<<if ndef _deadNPCs>>
<<set _deadNPCs to []>>
<<if _args.length gt 0>>
<<set _deadNPCs.push({npc: _args[0], label: "your " + _args[0].relationship})>>
<</if>>
<</if>>
<<if _deadNPCs.length gt 0>>
<<set _npcDeathOccurred to true>>
<br>
/* Build a readable list of the dead */
<<set _deathList to "">>
<<for _fi = 0; _fi lt _deadNPCs.length; _fi++>>
<<if _fi gt 0 and _deadNPCs.length gt 2>><<set _deathList to _deathList + ", ">><</if>>
<<if _fi gt 0 and _fi is _deadNPCs.length - 1>><<set _deathList to _deathList + " and ">><</if>>
<<set _deathList to _deathList + _deadNPCs[_fi].label + " " + _deadNPCs[_fi].npc.name>>
<</for>>
/* Calculate proper funeral cost based on socio */
<<if $socio is "nobles">><<set _funeralCost to 4800>>
<<elseif $socio is "merchants">><<set _funeralCost to 960>>
<<elseif $socio is "artisans">><<set _funeralCost to 240>>
<<else>><<set _funeralCost to 12>>
<</if>>
<<set _funeralCost to _funeralCost * _deadNPCs.length>>
<<set _burialCost to 9 * _deadNPCs.length>>
<span id="funeral-combined">Do you give <<print _deathList>>
<<link "a quick burial">><<replace "#funeral-combined">>
<<master-pays _burialCost>>
<<for _fi = 0; _fi lt _deadNPCs.length; _fi++>><<set _deadNPCs[_fi].npc.funeralDone to true>><<set $decisions.push({text: "Quick burial for " + _deadNPCs[_fi].npc.name, money: (_masterPaid ? 0 : -9), repDelta: 0, repBefore: $reputation, infectPct: null})>><</for>>
Given everything that is happening, a quick funeral will have to be <<storyline-return "enough for your dead." 0>>
<</replace>><</link>> | <<link "a proper funeral">><<replace "#funeral-combined">>
<<plague-risk-check "crowd">>
<<master-pays _funeralCost>>
<<set _perCost to Math.round(_funeralCost / _deadNPCs.length)>>
<<for _fi = 0; _fi lt _deadNPCs.length; _fi++>><<set _deadNPCs[_fi].npc.funeralDone to true>><<set $decisions.push({text: "Proper funeral for " + _deadNPCs[_fi].npc.name, money: (_masterPaid ? 0 : -_perCost), repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>><</for>>
Despite everything that is happening, you are still determined to give your dead <<storyline-return "a proper funeral." 0>>
<</replace>><</link>>
</span>
<</if>>
<</nobr>><</widget>>
<<widget "setAge">><<nobr>>
<<if $minAge lte 0>>
<<set $minAge to 0>>
<</if>>
<<if $maxAge gte 100>>
<<set $maxAge to 100>>
<</if>>
<<set $NPCAgeNum to random($minAge,$maxAge)>>
<<if $NPCAgeNum gte 60>><<set $NPCAge to "elderly adult">>
<<elseif $NPCAgeNum gte 30>><<set $NPCAge to "middle-aged adult">>
<<elseif $NPCAgeNum gte 16>><<set $NPCAge to "young adult">>
<<elseif $NPCAgeNum gte 10>><<set $NPCAge to "adolescent">>
<<elseif $NPCAgeNum gte 5>><<set $NPCAge to "child">>
<<else>><<set $NPCAge to "infant">>
<</if>>
<</nobr>><</widget>>
<<widget "addPartnerNPC">><<nobr>>
<<set $minAge to $agenum-15>>
<<if $minAge lte 16>>
<<set $minAge to 16>>
<</if>>
<<set $maxAge to $agenum+15>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<if $gender is "female">>
<<set $NPCs.push({name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "husband", health: "healthy", location: $location})>>
<</if>>
<<if $gender is "male">>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "wife", health: "healthy", location: $location})>>
<</if>>
/* <<if $gender is "nonbinary">>
<<set $NPCs.push({name: $nbNames.pluck(), agenum: $NPCAgeNum, age: $NPCAge, relationship: "spouse", health: "healthy", location: $location})>>
<</if>> */
/*<<silently>><<for _d range _deceased>><<if $NPCs[_d].relationship is "wife">><<set $relationship to "single">><</if>><</for>><</silently>>*/
<</nobr>><</widget>>
<<widget "addNewbornNPC">><<nobr>>
<<if random(1,2) eq 1>>
<<set $NPCs.push({ name: weightedEither($fNames), agenum: 0, age: "infant", relationship: "daughter", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: 0, age: "infant", relationship: "son", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<</nobr>><</widget>>
<<widget "addChildNPC">><<nobr>>
<<set $minAge to 0>>
<<set $maxAge to $agenum-20>>
<<setAge>>
<<if random(1,2) eq 1>>
<<set _n to weightedEither($fNames)>><<for ; _usedChildNames.includes(_n); >><<set _n to weightedEither($fNames)>><</for>><<set _usedChildNames.push(_n)>><<set $NPCs.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "daughter", health: "healthy", location: $location})>>
<<else>>
<<set _n to weightedEither($mNames)>><<for ; _usedChildNames.includes(_n); >><<set _n to weightedEither($mNames)>><</for>><<set _usedChildNames.push(_n)>><<set $NPCs.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "son", health: "healthy", location: $location})>>
<</if>>
<</nobr>><</widget>>
<<widget "addParentNPC">><<nobr>>
/* generate mother */
<<set $hasMother to false>><<set $hasFather to false>>
<<set $minAge to $agenum+20>>
<<set $maxAge to $agenum+40>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<if random(1,4) lte 3>>
<<set $MotherAge to $NPCAgeNum>>
/* 1 in 6 chance of step-parent */
<<if random(1,6) is 1>>
<<set _type to "step-mother">>
<<else>>
<<set _type to "mother">>
<</if>>
/* generate and place in extended household if player older or married/widowed */
<<if $agenum lte 30>>
<<if $relationship is "single" or $relationship is "betrothed">>
<<set $NPCs.push({ name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: _type, health: "healthy", location: $location})>>
<<else>>
<<set $NPCsExtended.push({ name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: _type, health: "healthy", location: $location})>>
<</if>>
<<else>>
<<set $NPCsExtended.push({ name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: _type, health: "healthy", location: $location})>>
<</if>>
<<set $hasMother to true>>
<</if>>
/* generate father */
<<set $minAge to $agenum+20>>
<<set $maxAge to $agenum+60>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<if random(1,4) lte 3>>
<<set $FatherAge to $NPCAgeNum>>
/* 1 in 6 chance of step-parent */
<<if random(1,6) is 1>>
<<set _type to "step-father">>
<<else>>
<<set _type to "father">>
<</if>>
/* generate and place in extended household if player older or married/widowed */
<<if $agenum lte 30 and ($relationship is "single" or $relationship is "betrothed")>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: _type, health: "healthy", location: $location})>>
<<else>>
<<set $NPCsExtended.push({ name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: _type, health: "healthy", location: $location})>>
<</if>>
<<set $hasFather to true>>
<</if>>
/* no orphaned children/adolescents at beginning of game */
<<if $agenum lte 15>>
<<if not $hasMother and not $hasFather>>
<<if random(1,2) is 1>>
<<set $minAge to $agenum+20>>
<<set $maxAge to $agenum+40>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<set $NPCs.push({ name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "mother", health: "healthy", location: $location})>>
/* 1 in 6 chance for step-mother */
<<if random(1,6) is 1>>
<<set $NPCs[$NPCs.length-1].relationship to "step-mother">>
<</if>>
<<set $MotherAge to $NPCAgeNum>>
<<set $hasMother to true>>
<<else>>
<<set $minAge to $agenum+20>>
<<set $maxAge to $agenum+60>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "father", health: "healthy", location: $location})>>
/* 1 in 6 chance for step-father */
<<if random(1,6) is 1>>
<<set $NPCs[$NPCs.length-1].relationship to "step-father">>
<</if>>
<<set $FatherAge to $NPCAgeNum>>
<<set $hasFather to true>>
<</if>>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "addSiblingsNPC">><<nobr>>
/* check for parents' ages first */
<<if $hasMother>>
<<set $minAge to $MotherAge-40>>
<<if $minAge lte 0>>
<<set $minAge to 0>>
<</if>>
<<set $maxAge to $MotherAge-20>>
<<elseif $hasFather>>
<<set $minAge to 0>>
<<set $maxAge to $FatherAge-20>>
<<else>>
<<set $minAge to $agenum-10>>
<<if $minAge lte 0>>
<<set $minAge to 0>>
<</if>>
<<set $maxAge to $agenum+10>>
<</if>>
<<setAge>>
<<if $agenum lte 30 and $relationship is "single" and $NPCAgeNum lte 30>>
<<if random(1,2) eq 1>>
<<set _n to weightedEither($fNames)>><<for ; _usedSibNames.includes(_n); >><<set _n to weightedEither($fNames)>><</for>><<set _usedSibNames.push(_n)>><<set $NPCs.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "sister", health: "healthy", location: $location})>>
<<else>>
<<set _n to weightedEither($mNames)>><<for ; _usedSibNames.includes(_n); >><<set _n to weightedEither($mNames)>><</for>><<set _usedSibNames.push(_n)>><<set $NPCs.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "brother", health: "healthy", location: $location})>>
<</if>>
/* <<if random(1,20) eq 1>>
<<set $NPCs.push({ name: $nbNames.pluck(), agenum: $NPCAgeNum, age: $NPCAge, relationship: "sibling", health: "healthy", location: $location})>>
<</if>> */
<<else>>
<<if random(1,2) eq 1>>
<<set _n to weightedEither($fNames)>><<for ; _usedSibNames.includes(_n); >><<set _n to weightedEither($fNames)>><</for>><<set _usedSibNames.push(_n)>><<set $NPCsExtended.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "sister", health: "healthy", location: $location})>>
<<else>>
<<set _n to weightedEither($mNames)>><<for ; _usedSibNames.includes(_n); >><<set _n to weightedEither($mNames)>><</for>><<set _usedSibNames.push(_n)>><<set $NPCsExtended.push({ name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "brother", health: "healthy", location: $location})>>
<</if>>
/* <<if random(1,20) eq 1>><<set $NPCsExtended.push({ name: $nbNames.pluck(), agenum: $NPCAgeNum, age: $NPCAge, relationship: "sibling", health: "healthy", location: $location})>>
<</if>> */
<</if>>
<</nobr>><</widget>>
<<widget "NPCpronouns">><<nobr>>
<<set _femSuffix to ["daughter", "mother", "sister", "wife", "niece", "aunt", "mistress"]>>
<<set _maleSuffix to ["son", "father", "brother", "husband", "nephew", "uncle", "apprentice", "guardian", "cousin", "landlord"]>>
<<set _endsFem to function(r) { return _femSuffix.some(function(s) { return r.endsWith(s); }); }>>
<<set _endsMale to function(r) { return _maleSuffix.some(function(s) { return r.endsWith(s); }); }>>
<<set _allArrays to [$NPCs, $NPCsExtended]>>
<<for _a = 0; _a < _allArrays.length; _a++>>
<<for _i = 0; _i < _allArrays[_a].length; _i++>>
<<set _npc to _allArrays[_a][_i]>>
<<set _rel to _npc.relationship>>
<<if _endsFem(_rel) or _rel.startsWith("female")>>
<<set _npc.hishers to "her">><<set _npc.heshe to "she">><<set _npc.gender to "female">>
<<elseif _endsMale(_rel) or _rel.startsWith("male")>>
<<set _npc.hishers to "his">><<set _npc.heshe to "he">><<set _npc.gender to "male">>
<<else>>
<<if !_npc.heshe>><<set _npc.hishers to "their">><<set _npc.heshe to "they">><</if>>
<</if>>
<</for>>
<</for>>
<</nobr>><</widget>>
/* add household members for upper class */
/* note: servants are not given specific age numbers */
<<widget "addServantNPC">><<nobr>>
<<if $socio is "nobles">>
<<set $servants to random(8,12)>>
<<elseif $socio is "merchants">>
<<set $servants to random(1,3)>>
<<elseif $socio is "artisans">>
<<set $servants to either(0,1)>>
<<else>>
<<set $servants to 0>>
<</if>>
<<for _s to 0; _s lt $servants; _s++>>
<<if random(1,2) eq 1>>
<<set $NPCsServants.push({name: weightedEither($fNames), age: either("young adult", "middle-aged adult"), relationship: "servant", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set $NPCsServants.push({name: weightedEither($mNames), age: either("young adult", "middle-aged adult"), relationship: "servant", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<</for>>
<</nobr>><</widget>>
/* set player name based on frequency of names in 1665 */
<<widget "playerName">><<nobr>>
/* boost origin-appropriate names by 5x */
<<if $origin is "Ireland">>
<<set $fNames.Bridget *= 5>><<set $fNames.Honora *= 5>><<set $fNames.Grisel *= 5>><<set $fNames.Joan *= 5>><<set $fNames.Agnes *= 5>>
<<set $mNames.Patrick *= 5>><<set $mNames.Owen *= 5>><<set $mNames.Brian *= 5>><<set $mNames.Neil *= 5>><<set $mNames.Donald *= 5>><<set $mNames.Morgan *= 5>><<set $mNames.Denis *= 5>><<set $mNames.Gerald *= 5>><<set $mNames.Maurice *= 5>><<set $mNames.Hugh *= 5>>
<<elseif $origin is "Scotland">>
<<set $fNames.Grisel *= 5>><<set $fNames.Muriel *= 5>><<set $fNames.Christian *= 5>><<set $fNames.Maud *= 5>><<set $fNames.Agnes *= 5>><<set $fNames.Margaret *= 5>>
<<set $mNames.Archibald *= 5>><<set $mNames.Duncan *= 5>><<set $mNames.Colin *= 5>><<set $mNames.Donald *= 5>><<set $mNames.Neil *= 5>><<set $mNames.Alexander *= 5>><<set $mNames.James *= 5>><<set $mNames.David *= 5>><<set $mNames.Andrew *= 5>>
<<elseif $origin is "the Dutch Republic">>
<<set $fNames.Jeanne *= 5>><<set $fNames.Theodosia *= 5>><<set $fNames.Theophila *= 5>><<set $fNames.Agnes *= 5>><<set $fNames.Johanna *= 5>><<set $fNames.Margaret *= 5>><<set $fNames.Maria *= 5>><<set $fNames.Gertrude *= 5>><<set $fNames.Christina *= 5>><<set $fNames.Barbara *= 5>><<set $fNames.Cecilia *= 5>><<set $fNames.Blanche *= 5>><<set $fNames.Philippa *= 5>><<set $fNames.Matilda *= 5>><<set $fNames.Anna *= 5>><<set $fNames.Emma *= 5>>
<<set $mNames.Jan *= 5>><<set $mNames.Cornelius *= 5>><<set $mNames.Matthias *= 5>><<set $mNames.Adrian *= 5>><<set $mNames.Gerard *= 5>><<set $mNames.Elias *= 5>><<set $mNames.Abel *= 5>><<set $mNames.Christian *= 5>>
<<elseif $origin is "France">>
<<set $fNames.Clemence *= 5>><<set $fNames.Claude *= 5>><<set $fNames.Benedicta *= 5>><<set $fNames.Amata *= 5>><<set $fNames.Sylvestra *= 5>><<set $fNames.Theodosia *= 5>><<set $fNames.Theophila *= 5>><<set $fNames.Blanche *= 5>><<set $fNames.Denise *= 5>><<set $fNames.Cecilia *= 5>><<set $fNames.Jeanne *= 5>><<set $fNames.Frances *= 5>><<set $fNames.Maria *= 5>><<set $fNames.Magdalen *= 5>>
<<set $mNames.Jean *= 5>><<set $mNames.Pierre *= 5>><<set $mNames.Louis *= 5>><<set $mNames.Guy *= 5>><<set $mNames.Gervase *= 5>><<set $mNames.Geoffrey *= 5>><<set $mNames.Gerard *= 5>><<set $mNames.Maurice *= 5>><<set $mNames.Bernard *= 5>><<set $mNames.Giles *= 5>><<set $mNames.Denis *= 5>><<set $mNames.Vincent *= 5>><<set $mNames.Sebastian *= 5>><<set $mNames.Valentine *= 5>><<set $mNames.Ferdinando *= 5>><<set $mNames.Antonio *= 5>><<set $mNames.Giovanni *= 5>><<set $mNames.Francis *= 5>>
<<elseif $origin is "somewhere else">>
<<set $fNames.Francisca *= 5>><<set $fNames.Inez *= 5>><<set $fNames.Isotta *= 5>><<set $fNames.Benedicta *= 5>><<set $fNames.Camilla *= 5>><<set $fNames.Marcella *= 5>><<set $fNames.Amata *= 5>><<set $fNames.Theodosia *= 5>><<set $fNames.Theophila *= 5>><<set $fNames.Florence *= 5>><<set $fNames.Cecilia *= 5>>
<<set $mNames.Antonio *= 5>><<set $mNames.Giovanni *= 5>><<set $mNames.Ferdinando *= 5>><<set $mNames.Sebastian *= 5>><<set $mNames.Erasmus *= 5>><<set $mNames.Theophilus *= 5>><<set $mNames.Josias *= 5>><<set $mNames.Tobias *= 5>><<set $mNames.Augustine *= 5>><<set $mNames.Basil *= 5>><<set $mNames.Jerome *= 5>><<set $mNames.Lionel *= 5>><<set $mNames.Lancelot *= 5>>
<</if>>
<<if $gender eq "female">><<set $name = weightedEither($fNames)>>
<<elseif $gender eq "male">><<set $name = weightedEither($mNames)>>
<</if>>
<</nobr>><</widget>>
<<widget "playerAge">><<nobr>>
<<if $age eq "child">><<set $agenum to random(5,9)>>
<<elseif $age eq "adolescent">><<set $agenum to random(10,15)>>
<<elseif $age eq "young adult">><<set $agenum to random(16,29)>>
<<elseif $age eq "middle-aged adult">><<set $agenum to random(30,59)>>
<<elseif $age eq "elderly adult">><<set $agenum to random(60,76)>><</if>>
<</nobr>><</widget>>
<<widget "parish">><<nobr>>
<<if $location is "inside the City walls">>
<<set $parish to weightedEither($wallParishes)>>
<<elseif $location is "in the eastern suburbs">>
<<set $parish to weightedEither($eParishes)>>
<<elseif $location is "in the northern suburbs">>
<<set $parish to weightedEither($nParishes)>>
<<elseif $location is "across the river in the southern suburbs">>
<<set $parish to weightedEither($sParishes)>>
<<elseif $location is "in another part of the western suburbs" or $location is "in the western suburbs">>
<<set $parish to weightedEither($wParishes)>>
<<elseif $location is "in the western suburbs, specifically Westminster" or $location is "in Westminster">>
<<set $parish to weightedEither($WestmParishes)>>
<</if>>
<</nobr>><</widget>>
<<widget "addApprenticeNPC">><<nobr>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: random(10,15), age: "adolescent", relationship: "apprentice", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<<set $apprentice to 2>>
<<set $office to "">>
<</nobr>><</widget>>
<<widget "addWorkerKidNPC">><<nobr>>
<<if random(1,2) eq 1>>
<<set $NPCs.push({ name: weightedEither($fNames), agenum: random(10,15), age: "adolescent", relationship: "friend's daughter", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: random(10,15), age: "adolescent", relationship: "friend's son", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<<if random(1,9) eq 1>>
<<set $NPCs.push({ name: $nbNames.pluck(), agenum: random(10,15), age: "adolescent", relationship: "friend's child", health: "healthy", location: $location, heshe: "they", hishers: "their"})>>
<</if>>
<<set $worker to 2>>
<</nobr>><</widget>>
<<widget "addWardNPC">><<nobr>>
<<if random(1,2) eq 1>>
<<set $NPCs.push({ name: weightedEither($fNames), agenum: random(10,15), age: "adolescent", relationship: "ward", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set $NPCs.push({ name: weightedEither($mNames), agenum: random(10,15), age: "adolescent", relationship: "ward", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<<if random(1,9) eq 1>>
<<set $NPCs.push({ name: $nbNames.pluck(), agenum: random(10,15), age: "adolescent", relationship: "ward", health: "healthy", location: $location, heshe: "they", hishers: "their"})>>
<</if>>
<<set $ward to 2>>
<</nobr>><</widget>>
/* random character generation widget */
<<widget "random-character">><<nobr>>
/* set gender, age, relationship */
<<set $gender to either("male", "female")>>
<<set $age to weightedEither({"child": 14, "adolescent": 16, "young adult": 25, "middle-aged adult": 35, "elderly adult": 10})>>
<<playerAge>>
<<if $agenum lte 15>>
<<set $relationship to "single">> /* disallowing betrothals for random char */
<<else>>
<<set $relationship to weightedEither({"single": 17, "married": 32, "widowed": 9})>>
<</if>>
/* set religion, origin, and origin-based name */
<<set $religion to weightedEither({"member of the Church of England": 9209, "member of a dissident Protestant church": 758, "Catholic": 33})>>
<<set $skipServices to 0>>
<<set $origin to weightedEither({"London": 30, "the English countryside": 200, "another English town or city": 20, "Scotland": 20, "Ireland": 20, "the Dutch Republic": 5, "France": 4, "somewhere else": 1})>>
<<playerName>>
/* set socio, location, and location-based parish */
<<set $socio to weightedEither({"day labourers": 1820, "servants": 1820, "artisans": 600, "merchants": 80, "nobles": 8, "beggars": 400})>>
<<set $location to weightedEither({"inside the City walls": 3458, "in Westminster": 2796, "in the western suburbs": 2405, "in the northern suburbs": 4810, "in the eastern suburbs": 3140, "across the river in the southern suburbs": 2563})>>
<<parish>>
<</nobr>><</widget>><<nobr>>
<<linkappend "You've been taken by a press gang!">>
<br><br>
<<if $agenum lte 15>>
<<addMaster>>
<<set _MasterTrade to either("baker", "chandler", "grocer", "tailor", "weaver")>>
Luckily, you manage to prove to them that you are too young to be <<defImpressed "impressed">> into His Majesty's Navy. They <<if $socio is "beggars">>turn you over to your <<defParish "Parish">> <<defOverseersOfThePoor "Overseers of the Poor">>, who decide that you are at risk of becoming one of the idle poor and have you <<storyline-return "bound into service">> with a local _MasterTrade's household.<<else>><<storyline-return "release you back into the streets.">><</if>>
<<elseif $agenum gte 55 or $gender isnot "male">>
Luckily, you manage to prove to them that you are <<if $agenum gte 55>>too old<<else>>a woman and not eligible<</if>> to be <<defImpressed "impressed">> into His Majesty's Navy. <<storyline-return "They release you back into the streets.">>
<<elseif $navyDismissed>>Luckily, you manage to prove to them that you have already been dismissed from the Navy as too disabled to continue to serve. <<storyline-return "They release you back into the streets.">>
<<elseif $origin is "France" or $origin is "the Holy Roman Empire" or $origin is "Italy" or $origin is "Spain" or $origin is "the Americas" or $origin is "the Dutch Republic">><<set $impressedFromIndex to $monthIndex>>As you are not a subject of the British monarch, you know you should not have been impressed. <<linkappend "You bribe a literate crewmate to write a letter to the Naval Board on your behalf, protesting your impressment.">>
<br><br>
<<linkappend "Your captain, on hearing about the letter, sends you back to London.">>
<<if $origin is "the Dutch Republic">>While you successfully argue your case in front of the Naval Board, they are not pleased to hear they had a Dutchman on their ships. They imprison you as a spy and only release you at the end of the war in 1667.
<br><br>
[[How typical was your experience of the Great Plague of London? Let's find out!->stats]]
<<else>> You successfully argue your case in front of the Naval Board and are <<storyline-return "set at liberty">>.
<br><br>
<</if>><</linkappend>><</linkappend>>
<<else>><<set $impressedFromIndex to $monthIndex>>As a subject of the British monarch, there is no escape from your impressment. <<linkappend "You are put to work aboard the HMS Royal Sovereign.">><<naval-experience>><</linkappend>>
<</if>>
<</linkappend>>
<</nobr>><<nobr>><<random-events>><<corpse-work>><<if not _randomEventFired>><<if $billSubscribed is 0>><<bill-subscribe>><<else>>As if war wasn’t bad enough, you begin to hear rumors around the city that several houses have been shut up because their inhabitants have <<defPlague "plague">>.
<br><br>
<span id="decision">Do you want to investigate?
<<link "Yes">><<replace "#decision">><<plague-risk-check>><<set $decisions.push({text: "May 1665: Investigated the plague rumors", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>After a few days, you decide to go see the truth of it for yourself and are horrified to find the rumors are true: several houses throughout the city had been locked up. Red crosses and the phrase //Lord Have Mercy Upon Us// have been painted on their front doors, to ensure that everyone knows this is a plague house.
<br><br>
<<if $location isnot "in the western suburbs">><<no-plague-yet>><br><br>
<<if $socio isnot "beggars">>
[[You know that plague only grows worse as the weather warms and you dread the coming of June and the first real heat of summer.->June 1665]]
<</if>>
<<else>><<linkappend "Worse, the first case of plague has appeared in your parish.">><br><br><<include "First Plague Day">><</linkappend>>
<</if>><a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/Lord_haue_mercy_on_London.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/Lord_haue_mercy_on_London.jpg" width="100%" alt="Woodcut broadside depicting scenes of plague in London"></a>
//"Lord Haue Mercy on London", c. 1665//<</replace>><</link>> | <<link "No">><<replace "#decision">><<set $decisions.push({text: "May 1665: Took their word about the plague", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You decide to take their word for it and not investigate further.
<br>
<<if $location isnot "in the western suburbs">><<no-plague-yet>><br><br>
<<if $socio isnot "beggars" and ($socio isnot "day labourers" or $gender isnot "male")>>
[[You know that plague only grows worse as the weather warms and you dread the coming of June and the first real heat of summer.->June 1665]]
<</if>>
<<else>><<linkappend "Worse, the first case of plague has appeared in your parish.">><br><br><<include "First Plague Day">><</linkappend>>
<</if>><</replace>><</link>>
</span>
<<fumigant>>
<</if>><</if>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $billSubscribed is 0>><<bill-subscribe>><<else>>
On June 3rd, everyone throughout the city hears the sound of cannon fire—not the celebratory firing of cannons in ceremony but the sounds of battle. It is obvious that the English and Dutch <<defFleet "fleets">> have engaged in battle, but where? How close are they to London? Who is winning? No one knows. <<if $origin is "the Dutch Republic">>You keep your head down and hide from your neighbors as much as possible, for fear that they will turn on you.<</if>>
<br><br>
<span id="decision"> Do you try to find out more?
<<link "Yes">><<replace "#decision">><<plague-risk-check>><<set $decisions.push({text: "Jun 1665: Sought out war news", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/9/99/James_II_by_Peter_Lely.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/9/99/James_II_by_Peter_Lely.jpg" style="width:100%; height:auto;" alt="Portrait of James II, Duke of York"></a>
<br>
//Peter Lely - "James II", c. 1650-1675//
</div>
You keep your ears open for news of the war. It takes almost a week, but news finally arrives of a great battle that killed many important men, especially on the ship of the <<defDukeOfYork "Duke of York, James Stuart">>, the current heir to the throne—at least until the King and Queen manage to have children of their own. According to rumor, the battle came so close to killing the Duke that he was covered with blood and the head of a man named Mr. Boyle flew off and struck down the Duke. You happily repeat the rumors to anyone who will listen as bonfires break out in the street and people make merry, freely sharing their food and wine in celebration.
<br><br>
<<if $agenum gte 16 and $agenum lte 59 and $gender isnot "female" and $disability is 0 and $socio isnot "nobles" and $socio isnot "merchants">><span id="volunteer">Do you want to <<if $socio is "servants">>break your contract with your $masterTitle so you can <</if>>be there for the next battle? <<link "Yes">><<if $socio is "servants">><<record-decision "Jun 1665: Broke contract and volunteered for the navy" 0 -2>><<replace "#volunteer">>You have enlisted on [[in the Royal Navy->navy-volunteer]]<</replace>><<else>><<set $decisions.push({text: "Jun 1665: Volunteered for the navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#volunteer">>You have enlisted [[in the Royal Navy->navy-volunteer]]<</replace>><</if>><</link>> | <<link "No">><<set $decisions.push({text: "Jun 1665: Stayed out of the fighting", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#volunteer">>
<br><br><<linkappend "That is the last good day of the month, though.">><<june-1665-helper>>
<</linkappend>>
<</replace>><</link>></span>
<<else>>
<<linkappend "That is the last good day of the month, though.">><<june-1665-helper>>
<</linkappend>>
<br><br>
<</if>>
<</replace>><</link>>
| <<link "No">><<replace "#decision">><<set $decisions.push({text: "Jun 1665: Ignored the war gossip", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>> You don't listen to the gossip, but it's hard to ignore the shouts when news finally arrives of a great battle that killed many important men.
<br><br>
<<linkappend "That is the last good day of the month, though.">><<june-1665-helper>>
<</linkappend>>
<br><br>
<</replace>><</link>></span>
<</if>>
<<fumigant>><</if>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $billSubscribed is 0>><<bill-subscribe>><<else>>
<<if $role is "corpsebearer" or $role is "searcher" or $role is "nurse" or $role is "warder">>
<<if ndef $textGroup>><<set $textGroup = 1>><</if>>
<<switch $textGroup>>
People are dying so fast now that burials have to happen night and day to keep corpses from piling up throughout the city.<br><br>
<<case 1>><<if $role is "corpsebearer">>As you take the dead to the graveyards<<elseif $role is "searcher">>Almost all the bodies you inspect are of <<defPlague "plague">> victims and<<elseif $role is "warder">>As you stand guard outside quarantined houses, you see the dead being carried out in ever greater numbers and<<else>>Your patients die almost as fast as you are assigned to care for them and<</if>> you marvel at how much money is being wasted through the clothing that is buried with them. It’s illegal to take goods off the dead, and you know it’s dangerous as well.
<br><br>
You decide to:
<ul>
<li><<link "take some of the clothing to sell. You figure no one will notice, and you need the money." `passage()`>><<set $plagueInfection to random(0,1)>><<set $money +=12>><<record-decision "Aug 1665: Stole clothing from the dead" 12 -1 50>><</link>></li>
<li><<link "leave things where they are." `passage()`>><<set $decisions.push({text: "Aug 1665: Left the dead's belongings alone", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><</link>></li>
</ul>
<<default>>
So many people are sick and shut up in their houses that the city has imposed a 9pm curfew for healthy people, so that the sick can go out for a bit of air.
<br><br>
<<unset $textGroup>><<august-1665-helper>><</switch>><<if def $textGroup>><<set $textGroup +=1>><</if>>
<<else>>
People are dying so fast now that burials have to happen night and day to keep corpses from piling up throughout the city.<br><br>
So many people are sick and shut up in their houses that the city has imposed a 9pm curfew for healthy people, so that the sick can go out for a bit of air. <span id="curfew">Do you adhere to the curfew? <<link "Yes">><<replace "#curfew">><<set $decisions.push({text: "Aug 1665: Obeyed the curfew", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You keep to the curfew.
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/1/1d/Nine_images_of_the_plague_in_London%2C_17th_century_Wellcome_L0016640_%28cropped%29_7.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/1/1d/Nine_images_of_the_plague_in_London%2C_17th_century_Wellcome_L0016640_%28cropped%29_7.jpg" width="100%" alt="Engraving depicting scenes of plague in London"></a>
//"Nine Images of the Plague in London", 17th century//
<br><br>
<<august-1665-helper>>
<</replace>><</link>> | <<link "No">><<replace "#curfew">><<plague-risk-check>><<record-decision "Aug 1665: Broke curfew to seek news" 0 -1 _riskPct>>You step out, despite the curfew, hoping to hear more news. You learn that there is sickness in the <<defFleet "fleet">> and everyone worries what that means for the war.
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/1/1d/Nine_images_of_the_plague_in_London%2C_17th_century_Wellcome_L0016640_%28cropped%29_7.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/1/1d/Nine_images_of_the_plague_in_London%2C_17th_century_Wellcome_L0016640_%28cropped%29_7.jpg" width="100%" alt="Engraving depicting scenes of plague in London"></a>
//"Nine Images of the Plague in London", 17th century//
<br><br>
<<august-1665-helper>>
<</replace>><</link>></span>
<</if>>
<</if>>
<<fumigant>><</if>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $billSubscribed is 0>><<bill-subscribe>><<else>>
The deaths continue in such great numbers that you can hardly believe it.<br><br>
<<if $role is "corpsebearer">>You are shocked to see that some bold people have begun attending <<defPlague "plague">> funerals, as if it were a child’s game or dare. <br><br>
<<sep-1665-helper>>
<<elseif $role is "warder">>Some of those locked in their houses have grown desperate and you have had to physically restrain people trying to break out of quarantine.<br><br><<sep-1665-helper>>
<<elseif $role is "searcher">>You have examined so many bodies, you sometimes wonder if anyone in your parish will survive.<br><br><<sep-1665-helper>>
<<elseif $role is "nurse">>Some of your patients, furious at being locked in, have been trying to lean out windows to breathe and spit upon the healthy people walking past.<br><br><<sep-1665-helper>>
<<else>>
<span id="gossip">Do you continue to go out in the city? <<link "No, better stay inside for now">><<replace "#gossip">><<set $decisions.push({text: "Sep 1665: Stayed indoors", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You stay indoors.
<br><br><<sep-1665-helper>><</replace>><</link>> | <<link "Yes, you still need to go out to conduct business">><<replace "#gossip">><<plague-risk-check>><<set $decisions.push({text: "Sep 1665: Went out despite the danger", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>While out you see that a few brave souls have begun to attend plague funerals.
<span id="game">Do you join them? <<link "Yes, I'll be fine">><<set $plagueInfection to random(1,4)>><<set $decisions.push({text: "Sep 1665: Attended plague funerals", money: 0, repDelta: 0, repBefore: $reputation, infectPct: 25})>><<replace "#game">>You attend a few funerals for friends, confident that the low attendance will ensure your safety. Plus, it helps to be able to see the people you're mourning. <br><br>
<<sep-1665-helper>>
<</replace>><</link>> | <<link "No, it's not safe">><<set $decisions.push({text: "Sep 1665: Avoided plague funerals", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#game">> You don't attend, but are secretly glad that the dead aren't being buried alone.
<<sep-1665-helper>>
<</replace>><</link>></span><</replace>><</link>></span>
<</if>>
<</if>>
<<fumigant>><</if>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
October is miserably rainy and cold. <<defPlague "Plague">> numbers are—thanks be to God—finally starting to come down, but are still terrifyingly high and you see sick people brazenly out and about on the streets.<br><br>
<span id="pesthouse">Do you report the sick to the <<defPesthouse "pesthouse">>? <<link "Yes, I don't want them getting me sick">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<plague-risk-check>><<set $decisions.push({text: "Oct 1665: Reported the sick to the pesthouse", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<replace "#pesthouse">>You start reporting the sick people you see to the pesthouse, hoping to keep the streets free from their presence. You feel a bit bad about confining them to such an awful place, but your own safety is worth it.
Rumors swirl about the Pope and the King of France dying, <<if $religion is "Catholic">>much to your alarm as a good Catholic<<if $origin is "France">> and subject of the French monarchy<</if>>, but to your relief you discover<<else>>but alas<</if>> they are only rumors.<br><br>
You hope the cold will deepen—and <<defPlague "plague">> numbers continue to fall—as you head into [[November 1665]].
<</replace>><</link>> | <<link "No, as long as they keep away from me">><<plague-risk-check>><<set $decisions.push({text: "Oct 1665: Ignored the sick on the streets", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>><<replace "#pesthouse">>You ignore the sick people you see, hoping that they keep to themselves.
<br><br>
Rumors swirl about the Pope and the King of France dying, <<if $religion is "Catholic">>much to your alarm as a good Catholic<<if $origin is "France">> and subject of the French monarchy<</if>>, but to your relief you discover<<else>>but alas<</if>> they are only rumors.<br><br>
You hope the cold will deepen—and <<defPlague "plague">> numbers continue to fall—as you head into [[November 1665]].
<</replace>><</link>></span>
/* Beggar text */
/* Day labourer text */
/* Servant text */
/* Artisan text */
/* Merchant text */
/* Noble text */
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
The weather is terrible but <<defPlague "plague">> numbers are coming down and people start to trickle back into town.
<span id="visit">Do you go out to visit your returning friends and neighbors? <<link "Yes, I've missed them greatly">><<plague-risk-check>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $decisions.push({text: "Nov 1665: Visited returning neighbors", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<replace "#visit">>You go out in the streets to greet your returning friends and neighbors, glad to be reunited after these long months.
You don't expect great things this Christmas, but you are still looking forward to [[December 1665]].<br><br><</replace>><</link>> | <<link "No, it's still not safe for socializing">><<set $decisions.push({text: "Nov 1665: Avoided socializing with returning neighbors", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#visit">>You don't go out in the streets to welcome back your friends and neighbors, but you do shout your greetings down from your window. You are glad to see them back. You don't expect great things this Christmas, but you are still looking forward to [[December 1665]].<br><br><</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<defPlague "Plague">> numbers are up, despite two great frosts, and the Christmas festivities are all cancelled. You hope it's the last gasp of the outbreak, even as you reflect at how much different things are now than the were last year.<br><br>
<span id= "decision">Do you want to celebrate Christmas despite the risk? <<link "Yes">><<replace "#decision">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<party-costs>><<plague-risk-check "crowd">><<set $decisions.push({text: "Dec 1665: Held a Christmas feast despite the plague", money: -_partyCost, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<if $hoh is 4>>You convince your husband, and you<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle, and you<<elseif $hoh isnot 1>>You convince your family, and you<<else>>You<</if>> are planning a feast for a few friends to make up for the dour attitude across the city. You're looking forward to the opportunity to forget the plague for a few hours and feast on your favorite food <<set _food = ["roasted herring", "pigeon pie", "lamprey pie", "roasted veal", "hogs pudding"]>><<listbox "$food">><<optionsfrom _food>><</listbox>>.<<if $socio is "nobles">><br><br>
The King decides to take the Court to <<defOxford "Oxford">> to celebrate the Christmas festivities and settles into the <<defDeaneryAtChristChurchCollege "Deanery at Christ Church College">>, the king's traditional lodgings when he is in residence. The rest of the Court is scattered in lodgings throughout the city.<br><br><span id="gift2">Do you wish to purchase a New Year's gift and send it to the King? <<link "Yes">><<replace "#gift2">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money -= 4800>><<set $decisions.push({text: "Dec 1665: Sent a New Year's gift to the King", money: -4800, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You send a fine jeweled cup to the King as a New Year's gift. In return, you receive a present of gilt silver plate.<</replace>><</link>> | <<link "No">><<replace "#gift2">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: "Dec 1665: Did not send a New Year's gift to the King", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You decide not to send a gift this year.<</replace>><</link>></span><</if>>
<br><br>
Maybe things will be better in [[1666->January 1666]].<</replace>><</link>> | <<link "No">><<replace "#decision">><<set $decisions.push({text: "Dec 1665: Skipped the Christmas feast to stay safe", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<if $hoh is 4>>You convince your husband to stay safe and save money and forego a large feast for the holiday.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle to stay safe and save money and forego a large feast for the holiday.<<elseif $hoh isnot 1>>You convince your family to stay safe and save money and forego a large feast for the holiday.<<else>>You decide to stay safe and save money and forego a large feast for the holiday.<</if>><<if $socio is "nobles">><br><br>
The King decides to take the Court to <<defOxford "Oxford">> to celebrate the Christmas festivities and settles into the <<defDeaneryAtChristChurchCollege "Deanery at Christ Church College">>, the king's traditional lodgings when he is in residence. The rest of the Court is scattered in lodgings throughout the city.<br><br><span id="gift1">Do you wish to purchase a New Year's gift and send it to the King? <<link "Yes">><<replace "#gift1">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money -= 4800>><<set $decisions.push({text: "Dec 1665: Sent a New Year's gift to the King", money: -4800, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You send a fine jeweled cup to the King as a New Year's gift. In return, you receive a present of gilt silver plate.<</replace>><</link>> | <<link "No">><<replace "#gift1">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: "Dec 1665: Did not send a New Year's gift to the King", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You decide not to send a gift this year.<</replace>><</link>></span><</if>>
<br><br>
Maybe things will be better in [[1666->January 1666]].<</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<defPlague "Plague">> numbers continue to come down. <<defNoble "Noble">> coaches fill the streets, <<defPorter "porters">> are everywhere hauling the belongings of those who are returning to the city, all the shops are reopening, and <<defBeggars "beggars">> overflow the highways.<br><br>
<<if $socio is "day labourers" or $socio is "beggars">><span id="help">Do you want to earn some extra money by offering your services as a porter? <<link "Yes">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money +=12>><<plague-risk-check>><<set $decisions.push({text: "Jan 1666: Offered porter services", money: 12, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<replace "#help">>You keep busy offering the returning families your services as a porter, earning a few coins as you do so. You are glad to see the city so lively again.
A bad storm blows down tiles from houses and shuts down <<defRiverTraffic "river traffic">>, but all in all, it's a good month.<br><br>You look forward to even better things in [[February 1666]].<</replace>><</link>> | <<link "No">><<set $decisions.push({text: "Jan 1666: Stayed out of people's way", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#help">>You decide to keep out of people's way so as to avoid being run over by the many carts and carriages in the street. A bad storm blows down tiles from houses and shuts down <<defRiverTraffic "river traffic">>, but all in all, it's a good month.<br><br>You look forward to even better things in [[February 1666]].<</replace>><</link>></span>
<<elseif $socio is "nobles">>
After six months of travel, the king finally returns the Court to <<defHamptonCourt "Hampton Court Palace">>, so that he can be near to the City of London and the government officials working out of Westminster.<br><br><span id="greet">Do you ride out to greet them? <<link "Yes">><<replace #greet>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money -=60>><<set $decisions.push({text: "Jan 1666: Rode to Hampton Court", money: -60, repDelta: 1, repBefore: _repBefore, infectPct: 0})>>You ride out to greet the returning royal family and reconnect with you friends and allies in Court. Things finally feel like they are returning to normal and you look forward to continued favor and promotion in [[February 1666]].<</replace>><</link>> | <<link "No">><<replace #greet>><<set $decisions.push({text: "Jan 1666: Absented yourself from Court", money: 0, repDelta: 0, repBefore: $reputation, infectPct: 0})>>You remain in London and send letters to your friends and allies in Court, welcoming their return and excusing your absence as a desire to avoid exposing them to any lingering infection. You ensure them that you are looking forward to reconnecting with them whenever they feel safe to return to the city and you look forward to continued favor and promotion in [[February 1666]].<</replace>><</link>></span>
<<else>><span id="help">Do you offer to help any of your returning neighbors with their luggage? <<link "Yes">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<plague-risk-check>><<set $decisions.push({text: "Jan 1666: Helped returning neighbors", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<replace "#help">>You offer to help your returning neighbors carry some of their luggage. It is a good opportunity to catch up on all their news from their time in the country, and you are glad to talk to someone after the city has been so empty for so long. A bad storm blows down tiles from houses and shuts down <<defRiverTraffic "river traffic">>, but all in all, it's a good month.<br><br>You look forward to even better things in [[February 1666]].<</replace>><</link>> | <<link "No">><<set $decisions.push({text: "Jan 1666: Did not help returning neighbors", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#help">>You don't offer to help your returning neighbors, but you shout your greetings down to them, glad to see the city so lively again after it had been empty for so long. A bad storm blows down tiles from houses and shuts down <<defRiverTraffic "river traffic">>, but all in all, it's a good month.<br><br>You look forward to even better things in [[February 1666]].<</replace>><</link>></span>
<</if>>
<a href="https://upload.wikimedia.org/wikipedia/commons/c/ca/London_welcomes_home_runaways_Wellcome_L0002722.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/London_welcomes_home_runaways_Wellcome_L0002722.jpg" width="100%" alt="Woodcut of Londoners welcoming home those who fled the plague"></a>
//Henry Petowe - "London Welcomes Home Her Runaways", 1625//
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
The king has returned to London! People rejoice and return to their churches, knowing that if the king is willing to move back into his city palace of <<defWhitehall "Whitehall">>, then the <<defPlague "plague">> outbreak must be almost over. A great snow hides all the graves and it's as if the last year was all a terrible dream.<br><br>
And, as if you needed more opportunities to celebrate, it's almost <<defLent "Lent.">> <span id= "decision">Do you want to hold one last feast before it's time to begin fasting? <<link "Yes">><<replace "#decision">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<party-costs>><<plague-risk-check "crowd">><<set $decisions.push({text: "Feb 1666: Held a pre-Lent feast", money: -_partyCost, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<if $hoh is 4>>You convince your husband, and you<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle, and you<<elseif $hoh isnot 1>>You convince your family, and you<<else>>You<</if>> are planning a feast for a few friends. You're excited about all the things on the menu but especially your favorite dessert <<set _food = ["minced pie", "sweetmeats", "currant cake", "syllabub", "tansy"]>><<listbox "$food">><<optionsfrom _food>><</listbox>>.<br><br>
Your <<defParish "parish">> priest hasn't returned yet, though, and his reputation plummets as the days tick over into [[March 1666]].<br><br>
<</replace>><</link>> | <<link "No">><<replace "#decision">><<set $decisions.push({text: "Feb 1666: Skipped the pre-Lent feast", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<if $hoh is 4>>You convince your husband to skip the feast.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle to skip the feast.<<elseif $hoh isnot 1>>You convince your family to skip the feast.<<else>>You decide against holding a feast.<</if>> <span id="church">Do you instead go to the Queen's Catholic service for Ash Wednesday, the official beginning of Lent? <<link "Yes">><<replace "#church">><<set _repBefore to $reputation>><<if $religion isnot "Catholic">><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><</if>><<set $decisions.push({text: "Feb 1666: Attended the Queen's Catholic service", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>>You decide to go to the Queen's church for Ash Wednesday. <<if $religion isnot "Catholic">>Unfortunately your neighbors see you entering a Catholic church and judge you harshly for worshipping like a <<defPapists "papists">>. <</if>><br><br>Your <<defParish "parish">> priest hasn't returned yet, though, and his reputation plummets as the days tick over into [[March 1666]].<br><br><</replace>><</link>> | <<link "No">><<replace "#church">><<set $decisions.push({text: "Feb 1666: Stayed home for the holiday", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You instead enjoy a quiet holiday inside, safe from the crowds and the plague. <br><br>Your <<defParish "parish">> priest hasn't returned yet, though, and his reputation plummets as the days tick over into [[March 1666]].<br><br><</replace>><</link>></span>
<</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>><div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/d/d4/Catherine_of_Braganza_-_Lely_1663-65.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Catherine_of_Braganza_-_Lely_1663-65.jpg" style="width:100%; height:auto;" alt="Portrait of Queen Catherine of Braganza"></a>
<br>
//Peter Lely - "Catherine of Braganza", 1663-5//
</div>
The Queen of Portugal, mother to England's beloved <<defQueenCatherine "Queen Catherine">>, has died.
<br>
<br>
<span id="pray">Do you go to church and <<if $religion is "Catholic">>light a candle<<else>>pray<</if>> for the queen? <br><<link "Yes">><<replace "#pray">><<plague-risk-check>><<set $decisions.push({text: "Mar 1666: Went to church to pray for the Queen of Portugal", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>You go to church and <<if $religion is "Catholic">>light a candle<<else>>pray<</if>> for the late queen. <<march-1666-helper>><</replace>><</link>> | <<link "No">><<replace "#pray">>You don't want to risk going to church, but you privately do pray that God shows mercy on her <<if $religion isnot "Catholic">><<defPapists "papist">><</if>>soul. <<march-1666-helper>><<set $decisions.push({text: "Mar 1666: Prayed privately for the Queen of Portugal", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>
<</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
There's no denying it now. <<defPlague "Plague">> cases are definitely on the rise. Luckily, Sweden has declared itself on England's side in the war against the Dutch so at least things are looking more promising there. The Lenten fast is over it's time to celebrate Christ's resurrection on earth with Easter and the return of spring.
<span id="Easter">Do you want to attend Easter services at your parish church, despite the risk of plague?
<br><br>
<<if $agenum gte 16>>
<<link "Attend the service and take communion">><<replace "#Easter">><<plague-risk-check>><<set $decisions.push({text: "Apr 1666: Attended Easter service and took communion", money: -2, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>You gather with your neighbors to celebrate and unite in the glory of God. The last year has been terrible and the danger is not over, but for today at least you can <<storyline-return "set aside your troubles." 1 -2>><</replace>><</link>> | <</if>><<link "Attend the service but skip communion">><<replace "#Easter">><<plague-risk-check>><<set $decisions.push({text: "Apr 1666: Attended Easter service, skipped communion", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
You gather with your neighbors to celebrate Easter <<if $agenum lte 15>>but are <<storyline-return "too young to take communion.">><<else>><<if $religion isnot "member of the Church of England">>but can't bring yourself to join in their heretical communion<<else>>but you are too angry about the death around you to put aside your sins and take communion<</if>>. <<if $reputation gte 6>>Luckily, your churchwardens take mercy on you and <<storyline-return "don't fine you for skipping.">><<else>>Your reputation is so poor among your neighbors that they report you for skipping communion and <<storyline-return "you are fined £20." 1 -4800>><</if>><</if>><</replace>><</link>> | <<link "Skip church">><<replace "#Easter">><<set $decisions.push({text: "Apr 1666: Skipped Easter services", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<if $religion isnot "member of the Church of England">>You can't bear to even set foot in a heretical church. <</if>><<if $reputation gte 6>>Luckily, your churchwardens know that you only stay away because you fear the plague and <<storyline-return "don't fine you for skipping.">><<else>>Your reputation is so poor among your neighbors that they report you for skipping communion and <<storyline-return "you are fined £20." 1 -4800>><</if>><</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<defPlague "Plague">> is increasing throughout the city, but that doesn't stop all of London from celebrating the king's birthday and the anniversary of the <<defRestoration "Restoration">> on May 29th with bonfires. <<defBeggars "Beggars">> throng the streets but, for once, no one seems to mind.
<<if $religion isnot "member of the Church of England">><span id="celebrate">While the king's return didn't lead to $religion religious liberty, do you still want to celebrate? <<link "Yes">><<replace "#celebrate">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<party-costs>><<plague-risk-check "crowd">><<set $decisions.push({text: "May 1666: Celebrated the King's birthday", money: -_partyCost, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>>You <<if $hoh is 4>>convince your husband<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>convince your $masterTitle<<elseif $hoh isnot 1>>convince your family<<else>>know<</if>> that the king's birthday is an important holiday, and take part in the toasting and feasting.
You are still recovering from the festivities when the days tip over into [[June 1666]].<</replace>><</link>> | <<link "No">><<replace "#celebrate">><<record-decision "May 1666: Declined to celebrate the King's birthday" 0 -1>>You<<if $hoh is 4>> convince your husband<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>> convince your $masterTitle<<elseif $hoh isnot 1>> convince your family<<if $hoh isnot 1>> not to celebrate but you<</if>><</if>>r neighbors notice when you don't join the revelers in the streets. While you claim you were afraid of plague, rumors fly about your religion and politics. It's not a great way to lead into [[June 1666]].<</replace>><</link>></span>
<<else>>
The king's birthday is an important holiday and several of your neighbors are planning feasts. <span id="celebrate">Do you want to hold your own feast? <<link "Yes">><<replace "#celebrate">><<party-costs>><<plague-risk-check "crowd">><<set $decisions.push({text: "May 1666: Hosted a feast for the King's birthday", money: -_partyCost, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>You host a feast at your house and repeatedly toast the king to celebrate not just his return from exile, but also the restoration of a proper Church of England. You are still recovering from the festivities when the days tip over into [[June 1666]].<</replace>><</link>> | <<link "No">><<replace "#celebrate">><<plague-risk-check "crowd">><<set $decisions.push({text: "May 1666: Hosted a feast for the King's birthday", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>There are so many people reveling in the streets that you don't feel the need to host your own feast. You join them in repeatedly toasting the king to celebrate not just his return from exile, but also the restoration of a proper Church of England. You are still recovering from the festivities when the days tip over into [[June 1666]].<</replace>><</link>></span>
<</if>><</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
The summer heat has hit London and everyone is feeling lethargic. Still, there are some things to do, like gossip with your neighbors. <span id="decision">Do you listen to the gossip? <<link "Yes">><<replace "#decision">><<plague-risk-check>><<set $decisions.push({text: "Jun 1666: Listened to the war gossip", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
You hear rumors that the <<defFleet "fleet">> has engaged the Dutch in battle again and the streets are full of people arguing over whether the four days of rumbling was cannon fire or thunder. Yes, the hot weather could have led to four days of distant thunder but the skies are clear and <<defPressGangs "press gangs">> roam the street, <<if $agenum gte 16 and $gender isnot "female" and $socio isnot "nobles" and $socio isnot "merchants">><<linkappend "grabbing any man they can.">>grabbing any man they can.
<br><br>
<<if random(1,2) eq 1>><<set $impressed += 1>><<set $decisions.push({text: "Jun 1666: Impressed by a press gang", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>Unfortunately, the press gangs are just waiting for the chance to sieze upon idle gossipers [[like you->impressed]].<<else>>You keep a wary eye out for groups of strange men idling about and quickly slip away whenever you notice someone paying too much attention to you.<br><br><<june-1666-helper>><</if>>
<</linkappend>>
<<else>>grabbing any man they can.<br><br><<june-1666-helper>><</if>>
<</replace>>
<</link>> | <<link "No">><<replace "#decision">><<set $decisions.push({text: "Jun 1666: Ignored the gossip", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>
The sky has been rumbling for days and you wonder whether the sound was cannon fire or thunder. Yes, the hot weather could have led to four days of distant thunder but the skies are clear. You assume that this is why when you look out your window you can see <<defPressGangs "press gangs">> roaming the street, grabbing any man they can.
<<june-1666-helper>>
<</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
The heat of the city is oppressive but the worst is not the heat but the wails of women whose husbands have been <<defImpressed "impressed">> into the <<defFleet "Fleet">>. Many of the men who have been impressed attempt to escape but are recaptured.
Those who remain in the city hear the sounds of another battle in the distance—but any battle that is close enough for you can hear the cannon fire is too close.
<br><br>
<<if $agenum gte 16 and $agenum lte 59 and $gender isnot "female" and $disability is 0 and $origin is "London" and $religion isnot "Quaker" and $socio isnot "nobles" and $socio isnot "merchants">><span id="volunteer">Do you want to join the Navy and defend the city where you were born and raised?
<br><br>
<<if $socio is "servants">><<link "Break your contract with your master and volunteer for the Navy">><<record-decision "Jul 1666: Broke contract and volunteered for the navy" 0 -2>><<replace "#volunteer">>You have enlisted on [[HMS Royal Sovereign->navy-volunteer]]<</replace>><</link>><<else>><<link "Volunteer for the navy">><<set $decisions.push({text: "Jul 1666: Volunteered for the navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#volunteer">>You have enlisted on [[HMS Royal Sovereign->navy-volunteer]]<</replace>><</link>><</if>> | <<link "Stay out of the fighting">><<set $decisions.push({text: "Jul 1666: Stayed out of the fighting", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<replace "#volunteer">>You wonder if you will make it to [[August 1666]].
<</replace>><</link>></span>
<<else>><span id="pray">With the sounds of battle so close to home, do you pray for London's safety? <<link "Yes">><<replace "#pray">><<plague-risk-check>><<record-decision "Jul 1666: Prayed for London's safety" 0 1 _riskPct>>You join your neighbors in prayer for the city's deliverance, finding comfort in shared devotion during these dark times. You wonder if you will make it to [[August 1666]].<</replace>><</link>> | <<link "No">><<replace "#pray">><<set $decisions.push({text: "Jul 1666: Did not pray for London", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You keep to yourself and hope for the best. You wonder if you will make it to [[August 1666]].<</replace>><</link>></span>
<</if>>
<a href="https://upload.wikimedia.org/wikipedia/commons/3/34/St._James_Day_Fight%2C_Pic_1.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/3/34/St._James_Day_Fight%2C_Pic_1.jpg" width="100%" alt="Engraving of a naval battle between English and Dutch ships"></a>
//"Zee-Slag tussen de Engelse en Nederlandtse Vloot, op den 4 Aug. 1666", 1666//
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
As the summer heat engulfs the city, <<defPlague "plague">> numbers continue to rise. But at least there's good news on the war front, as you hear that the <<defFleet "fleet">> has burnt more Dutch ships.
<br><br>
All of London celebrates with bonfires in the street. <<if $origin is "the Dutch Republic">>You are uncertain how to feel about the defeat of your birthplace, but you know better than to say that to any of your English neighbors. <</if>><span id="bonfire">Do you join the celebrations? <<link "Yes">><<replace "#bonfire">><<plague-risk-check>><<record-decision "Aug 1666: Celebrated the burning of the Dutch fleet" 0 1 _riskPct>>You join the crowds in celebrating victory over the Dutch, making merry with your neighbors. In the distance, you can hear the cannons fired from the Tower of London to salute the victorious Fleet. Even after the echoes fade, the excitement is enough to buoy you through the last hot month of the year until [[September 1666]].<</replace>><</link>> | <<link "No">><<replace "#bonfire">><<if $origin is "the Dutch Republic">><<record-decision "Aug 1666: Avoided the Dutch fleet celebrations" 0 -1>>You decide not to chance the mood of the crowd and stay inside, but your neighbors take note of your absence and you're afraid your reputation will suffer for it.<<else>><<set $decisions.push({text: "Aug 1666: Avoided the Dutch fleet celebrations", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You have no desire to mingle with your possible plague-striken neighbors and stay inside.<</if>> In the distance, you can hear the cannons fired from the Tower of London to salute the victorious Fleet. Even after the echoes fade, the excitement is enough to buoy you through the last hot month of the year until [[September 1666]].<</replace>><</link>></span>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $location is "inside the City walls" or $fireParishes.includes($parish)>>
Early one Sunday morning, you wake to the frantic ringing of church bells. This isn't the ordinary <<defCallToService "call to service">>—<<if $religion is "member of the Church of England">>something you were looking forward to attending after you slept in<<else>>as if you'd ever attend a service in the Church of England!<</if>>—but rather a call to arms. When you stumble outside, you discover the city has caught fire around you.
<<if $agenum lte 15>>You immediately wake the nearest adult, who takes charge. You grab <<if $age is "child">>your favorite toy<<else>>some of your clothes<</if>>, then it's time to flee, with the fire nipping at your heels. You will have nightmares about this moment for weeks.
<<set $preFireLocation to $location>><<set $preFireParish to $parish>><<if $socio is "beggars" or $socio is "day labourers">><<else>><<set $location to "in Westminster">><<set $parish to weightedEither($WestmParishes)>><</if>>
<<else>>
<<if $socio is "servants">>You immediately alert your $masterTitle, who sends you out to find as many additional carts or boats as you can, to carry away their goods. <<if $reputation lte 2>>Unfortunately, everyone is so busy saving their own households, they have little to spare for you. All you have is the single cart you already own. <<else>>Luckily, you have friends and neighbors who hold you in high esteem and are willing to lend you carts.<</if>> The <<defHousehold "household">> loads <<if $reputation lte 2>>it<<else>>them<</if>> up and you all flee with the fire nipping at your heels.
<<elseif $socio is "artisans">>You quickly organize your household to carry away all the most important things you own—agonizing over the tools of your trade that must be left behind—and flee with the fire nipping at your heels.
<<elseif $socio is "day labourers">>You quickly organize your household to carry away all the most important things you own—sure, it isn't much, but you can't afford to replace any clothing you let burn much less your precious pots and pans—and flee with the fire nipping at your heels.
<<elseif $socio is "beggars">>You quickly organize your household to carry away all the most important things you own—sure, it isn't much, but you can't afford to replace any clothing you let burn—and flee with the fire nipping at your heels.
<<else>>You immediately send servants to find as many carts or boats as they can, to carry away your goods, and begin gathering your most important possessions—your money, your papers, your <<defTallySticks "tally sticks">>. <<if $reputation lte 2>>Unfortunately, everyone is so busy saving their own households, they have little to spare for your servants who return empty-handed. All you have is the single cart you already own, which will barely carry anything.<<else>>Luckily, the servants soon return with several carts and you manage to send your most precious household goods out of the path of danger. <</if>> After much agonizing, you task a servant to dig holes in the yard to bury your wine, Parmezan cheese, and most expensive books. Then you and the rest of your <<defHousehold "household">> gather all the things you can hold and flee with the fire nipping at your heels.
<</if>>
<<if $socio is "beggars" or $socio is "day labourers">> You and your family take refuge in the open fields just outside the city and watch in horror as it burns for days.
<<set $preFireLocation to $location>><<set $preFireParish to $parish>>
<<else>> Your household takes refuge in a friend's house in Westminster and watch in horror as the city burns for days.
<<set $preFireLocation to $location>><<set $preFireParish to $parish>><<set $location to "in Westminster">><<set $parish to weightedEither($WestmParishes)>><</if>>
<</if>>
<<else>>
One Sunday morning, you awaken and are getting ready for church when you look out the window and realize there is a great fire in the distance. After dressing, you go out to find a neighbor who tells you that over 300 houses have burnt down in the night, by <<defLondonBridge "London Bridge">>.
Curious, you walk <<if $location is "across the river in the southern suburbs">>down to the riverside<<else>>to the <<defTowerOfLondon "Tower of London">> and climb up onto a high place<</if>>, where you can see the houses on the end of the <<defLondonBridge "London Bridge">> all aflame. People are frantically flinging their belongings into the river and carrying the sick away in their beds as they run along the muddy riverbank.
You ask around and discover the fire began in the King's Baker's house on Pudding Lane, but everyone believes the French were responsible and are looking for someone to blame. <<if $origin is "France">>You quietly return home and bar the door, determined not to go out again until the streets are safe.<</if>>
<<if $socio is "beggars">>A neighbor's cousin asks if you will help haul his belongings out of the path of the fire. Do you [[agree to help->October 1666][$reputation to Math.clamp($reputation + 1, 0, 10)]] or [[save your strength in case you need it to save your own things->October 1666][$reputation to Math.clamp($reputation - 1, 0, 10)]]?
<<elseif $socio is "day labourers">>A neighbor's cousin asks if you will help haul his belongings out of the path of the fire. Do you [[agree to help->October 1666][$reputation to Math.clamp($reputation + 1, 0, 10)]] or [[save your strength in case you need it to save your own things->October 1666][$reputation to Math.clamp($reputation - 1, 0, 10)]]?
<<else>> A neighbor's cousin asks if he can borrow your cart. Do you [[agree to help->October 1666][$reputation to Math.clamp($reputation + 1, 0, 10)]] or [[keep your cart in case you need it to save your own things->October 1666][$reputation to Math.clamp($reputation - 1, 0, 10)]]?
<</if>>
<</if>>
<<if $preFireLocation neq "">>Everyone is still reeling from the shock of the Great Fire at the beginning of [[October 1666]].<</if>>
<</if>>
<a href="https://upload.wikimedia.org/wikipedia/commons/b/b6/Great_Fire_London.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/b/b6/Great_Fire_London.jpg" width="100%" alt="Painting of the Great Fire of London engulfing the city"></a>
//Josepha Jane Battlehooke - "The Great Fire of London", 1675//
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $preFireLocation neq "">>
<<if $socio is "beggars">>You spend the next several weeks living in a field. The local <<defParish "parish">> church serves food three times a day to keep you and the others from starving, but winter is coming and you know that you'll freeze to death if you don't manage to find permanent shelter before then. <<if $reputation lte 2>>Unfortunately, the first frost comes and you are still homeless because no one would take you in on account of your low reputation. <<if $origin is not "London">> Your only choices are to [[return to your home in $origin->go quietly]] or to <<else>>You <</if>>pray you don't [[freeze]].
<<else>>Luckily, just as the first frost hits the city, you manage to find a friend-of-a-friend who is willing to let you sleep on the floor until you can get more [[permanent lodgings->November 1666]].
<<set $location to "in the eastern suburbs">><<set $parish to weightedEither($eParishes)>><<generate-landlord-household>>
<</if>>
<<elseif $socio is "day labourers">>
You spend the next several weeks living in a field. Luckily, there is plenty of work clearing away the debris of the fire and you<<if $agenum lte 15>> and your family<</if>> manage to scrape together enough money to afford new lodgings in the eastern suburbs of the city. It's just a single room and you're a little worried that the building will fall down around you one night, but at least it's better than freezing to death in the fields. You're grateful to live long enough to see [[November 1666]].<<set $location to "in the eastern suburbs">><<set $parish to weightedEither($eParishes)>><<generate-landlord-household>>
<<else>>You<<if $agenum lte 15>> and your family<</if>> spend the next several weeks working to clear out the wreckage of your former home. Even though you work as fast as you can, you won't be able to rebuild before winter. <<if $reputation lte 2>>Your poor reputation means that no one is willing to let you stay as a guest with them for long. <<if $agenum lte 15>>Luckily, due to your young age, friends of the family allow you to stay with them through the [[winter->November 1666]].<<else>><<if $socio is "nobles">> You end up having to leave the city for the winter<<elseif $socio is "merchants">> You end up having to sleep in your office all winter<<else>> You end up having to stay in crappy lodgings that are practically a hovel and well beneath your station<</if>> and are [[very unhappy about it->November 1666]].<</if>><<else>>Because of your good reputation, friends allow you to stay with them through the [[winter->November 1666]].<</if>><</if>>
<<else>>
<<if $location is "inside the City walls">>
Despite being afraid your home will burn, you find yourself in the enviable position of living in one of the few remaining <<defParish "parishes">> within the city walls.
<</if>>
There's so many people homeless that there's money to be made for someone who's willing to rent out a few rooms of their house, especially with such rainy weather and the increasing cold. <<if $socio is "nobles">>You instruct your man of business to make sure none of your tenants are illegally subletting.<<elseif $socio is "beggars">>Not that you have room for such a thing, unfortunately.<<elseif $socio is "servants" and ($hoh is 3 or $hoh is 0)>>Not that it's your house to make such decisions about, of course.<</if>>
The weather may be miserable, but every disaster has a silver lining. Between the fires that still <<defSmolder "smolder">> in the city's cellars and the rainy weather, <<defPlague "plague">> cases are plummeting and you've heard that the theatres are finally going to reopen! <<if $socio isnot "nobles" and $socio isnot "beggars" and ($socio isnot "servants" or ($hoh isnot 3 and $hoh isnot 0))>>
<br><br>
<<lodger-choice>>
<<else>>You greatly look forward to [[November 1666]]<</if>>
<</if>>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
One November day, the church bells peal out in alarm again... not from the destroyed part of the city within its ancient walls, but from the king's palace at <<defWhitehall "Whitehall">>, especially the area around <<defHorseGuards "Horse Guards">>. Everyone rushes to put out the fire at all costs, unwilling to have a repeat of September's disaster. Thankfully, no lives are lost<<if $socio is "beggars">> and for a few hours, the warmth of the flames even helps you forget about the massive coal shortage that has left you shivering in your home everynight<</if>>.
Even better, the king declares the official thanksgiving day for the end of the <<defPlague "plague">>. Yes, some people are still dying, but the numbers are low enough and the epidemic has been going on long enough that most everyone is grateful for its official end.
<br><br>Do you celebrate by: <ul>
<li><<storyline-return "spending the day praying and meditating on God's power and mercy" 1 0 1>></li>
<<if $socio is "nobles">><<set _cost to 240>><<elseif $socio is "artisans" or $socio is "merchants">><<set _cost to 120>><<else>><<set _cost to 12>><</if>>
<li><<storyline-return "going out drinking with your neighbors" 1 _cost -1>></li>
<li><<storyline-return "taking a day to enjoy the reopened theatres" 1 _cost -1>></li>
</ul>
<</if>>
<<fumigant>>
<</nobr>><<nobr>>
<<if $fledBroke>>Unfortunately, you<<if $agenum lte 15>> and your family<</if>> have run out of money and are forced to return to the city.<br><br><<set $fledBroke to false>><</if>>
<<random-events>>
<<if not _randomEventFired>>
As Advent begins, you look forward to actually being able to properly celebrate Christmas this year.
Fires still <<defSmolder "smolder">> in cellars throughout the city. Trouble is brewing in Scotland. The <<defGeneralBill "general bill of this year's deaths">> show many <<defLamentable "lamentable">> <<defPlague "plague">> deaths. But you have made it through 1666 and you thank God you are still alive!
Congratulations. You have [[survived the Great Plague of London->stats]]
<</if>>
<</nobr>><<widget "servant-master-death">><<nobr>>
<<if $socio is "servants">>
<<set _smdSingle to ($relationship is "single" or $relationship is "betrothed")>>
/* Select target array: single servants use $NPCs, married use $NPCsMaster */
<<set _smdTarget to _smdSingle ? "$NPCs" : "$NPCsMaster">>
<<set _smdNPCs to State.getVar(_smdTarget)>>
<<set _smdMasterAlive to false>>
<<set _smdMasterDied to false>>
<<set _smdMistressAlive to false>>
<<set _smdMistressDied to false>>
<<set _smdFatherAlive to false>>
<<set _smdFatherIdx to -1>>
<<set _smdMotherAlive to false>>
<<set _smdMotherIdx to -1>>
<<set _smdAdultSons to []>>
<<for _sdi = 0; _sdi < _smdNPCs.length; _sdi++>>
<<if _smdNPCs[_sdi].relationship is "master">>
<<if _smdNPCs[_sdi].health isnot "deceased">><<set _smdMasterAlive to true>><<else>><<set _smdMasterDied to true>><</if>>
<<elseif _smdNPCs[_sdi].relationship is "mistress">>
<<if _smdNPCs[_sdi].health isnot "deceased">><<set _smdMistressAlive to true>><<else>><<set _smdMistressDied to true>><</if>>
<<elseif _smdNPCs[_sdi].relationship is "master's father" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdFatherAlive to true>><<set _smdFatherIdx to _sdi>>
<<elseif _smdNPCs[_sdi].relationship is "master's mother" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdMotherAlive to true>><<set _smdMotherIdx to _sdi>>
<<elseif _smdNPCs[_sdi].relationship is "master's son" and _smdNPCs[_sdi].health isnot "deceased" and (_smdNPCs[_sdi].age is "young adult" or _smdNPCs[_sdi].age is "middle-aged adult" or _smdNPCs[_sdi].age is "elderly adult")>>
<<set _smdAdultSons.push({idx: _sdi, agenum: (_smdNPCs[_sdi].agenum || 0)})>>
<</if>>
<</for>>
<<if _smdAdultSons.length gt 0>>
<<set _smdAdultSons to _smdAdultSons.sort((a, b) => b.agenum - a.agenum)>>
<</if>>
/* Succession runs when no living household head remains (master or mistress),
but at least one was deceased this session */
<<set _smdRunSuccession to false>>
<<if (not _smdMasterAlive and not _smdMistressAlive) and (_smdMasterDied or _smdMistressDied)>>
<<set _smdRunSuccession to true>>
<</if>>
<<if _smdRunSuccession>>
<<set _smdOldTitle to $masterTitle>>
<<set _smdSucceeded to false>>
<<if _smdFatherAlive>>
/* Master's father becomes new master;
surviving master's sons/daughters become master's grandsons/granddaughters */
<<set _smdNPCs[_smdFatherIdx].relationship to "master">>
<<for _sdi = 0; _sdi < _smdNPCs.length; _sdi++>>
<<if _smdNPCs[_sdi].relationship is "master's son" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's grandson">>
<<elseif _smdNPCs[_sdi].relationship is "master's daughter" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's granddaughter">>
<</if>>
<</for>>
<<set $masterTitle to "master">><<set $masterGender to "male">>
<<set _smdSucceeded to true>>
<<NPCpronouns>>
<br><br>Following the death of your _smdOldTitle, your <<print _smdOldTitle>>'s father has taken over as head of the household.<br><br>
<<elseif _smdMotherAlive>>
/* Master's mother becomes new widowed mistress;
surviving master's sons/daughters become master's grandsons/granddaughters */
<<set _smdNPCs[_smdMotherIdx].relationship to "mistress">>
<<for _sdi = 0; _sdi < _smdNPCs.length; _sdi++>>
<<if _smdNPCs[_sdi].relationship is "master's son" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's grandson">>
<<elseif _smdNPCs[_sdi].relationship is "master's daughter" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's granddaughter">>
<</if>>
<</for>>
<<set $masterTitle to "mistress">><<set $masterGender to "female">>
<<set _smdSucceeded to true>>
<<NPCpronouns>>
<br><br>Following the death of your _smdOldTitle, your <<print _smdOldTitle>>'s mother has taken over as head of the household.<br><br>
<<elseif _smdAdultSons.length gt 0>>
/* Oldest adult son becomes new master;
remaining master's sons/daughters become master's brothers/sisters */
<<set _smdSonIdx to _smdAdultSons[0].idx>>
<<set _smdNPCs[_smdSonIdx].relationship to "master">>
<<for _sdi = 0; _sdi < _smdNPCs.length; _sdi++>>
<<if _smdNPCs[_sdi].relationship is "master's son" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's brother">>
<<elseif _smdNPCs[_sdi].relationship is "master's daughter" and _smdNPCs[_sdi].health isnot "deceased">>
<<set _smdNPCs[_sdi].relationship to "master's sister">>
<</if>>
<</for>>
<<set $masterTitle to "master">><<set $masterGender to "male">>
<<set _smdSucceeded to true>>
<<NPCpronouns>>
<br><br>Following the death of your _smdOldTitle, your <<print _smdOldTitle>>'s oldest son has become the new head of the household.<br><br>
<<else>>
/* No qualifying relatives — dissolve household and find new master */
<<if _smdSingle>>
<<set $NPCs to []>><<set $NPCsMaster to []>>
<<addMasterHousehold>>
<<set $NPCs to $NPCsMaster.slice()>><<set $NPCsMaster to []>>
<<else>>
<<set $NPCsMaster to []>>
<<addMasterHousehold>>
<</if>>
<<NPCpronouns>>
<br><br>Following the death of your _smdOldTitle without any surviving relatives to take over the household, you have found a new position with a new employer.<br><br>
<</if>>
/* After a successful succession (not dissolution), prefix deceased non-servants
with "late ". "mistress" maps to "late master's wife"; all others prepend "late ". */
<<if _smdSucceeded>>
<<for _sdi = 0; _sdi < _smdNPCs.length; _sdi++>>
<<if _smdNPCs[_sdi].health is "deceased" and _smdNPCs[_sdi].relationship isnot "male servant" and _smdNPCs[_sdi].relationship isnot "female servant">>
<<if _smdNPCs[_sdi].relationship is "mistress">>
<<set _smdNPCs[_sdi].relationship to "late master's wife">>
<<else>>
<<set _smdNPCs[_sdi].relationship to "late " + _smdNPCs[_sdi].relationship>>
<</if>>
<</if>>
<</for>>
<</if>>
<</if>>
<<set-hoh>>
<</if>>
<</nobr>><</widget>>
<<widget "check-widowed">><<nobr>>
<<if $relationship is "married">>
<<for _cwi = 0; _cwi < $NPCs.length; _cwi++>>
<<if ($NPCs[_cwi].relationship is "husband" or $NPCs[_cwi].relationship is "wife") and $NPCs[_cwi].health.indexOf("deceased") is 0>>
<<set $relationship to "widowed">>
<</if>>
<</for>>
<<for _cwi = 0; _cwi < $FledFamily.length; _cwi++>>
<<if ($FledFamily[_cwi].relationship is "husband" or $FledFamily[_cwi].relationship is "wife") and $FledFamily[_cwi].health.indexOf("deceased") is 0>>
<<set $relationship to "widowed">>
<</if>>
<</for>>
<</if>>
<<set-hoh>>
<</nobr>><</widget>><<nobr>>Because you refused to work, your <<defParish "parish's">> <<defOverseersOfThePoor "Overseers of the Poor">> have committed you to the <<defGaol "gaol">>!<br><br>
Do you:
[[beg for forgiveness and agree to work->ForgiveMe][$decisions.push({text: "Begged for forgiveness and agreed to work", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]<br>
<<if $gender is "male" and $agenum gte 16 and $agenum lte 59>>
[[stand firm in your refusal to risk your life->impressed][$impressed += 1; $decisions.push({text: "Stood firm and was impressed", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]<br>
<<elseif $origin is "London">>
[[stand firm in your refusal to risk your life->transported][$decisions.push({text: "Stood firm and was transported", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]<br>
<<else>>
[[stand firm in your refusal to risk your life->deported][$decisions.push({text: "Stood firm and was deported", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]
<</if>>
<</nobr>><<nobr>>
<<random-events>>
<<corpse-work>>
<<if not _randomEventFired>>
<<if $billSubscribed is 0>><<bill-subscribe>><<else>>
<span id="plague-day-replace">
Despite the English <<defFleet "fleet's">> victory, the war grinds on and rumors begin to circulate that the French are considering siding with the Dutch. <<if $origin is "France" or $origin is "the Dutch Republic">>You make sure to talk loudly of your loyalty to the King and the superiority of the English fleet, whenever your neighbors mention the war.<</if>>
<br><br>
<span id="decision">Do you go looking for more information?
<<link "Yes">><<replace "#decision">><<plague-risk-check>><<set $decisions.push({text: "Jul 1665: Sought out war news", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
There aren't as many rumors as there might have been, given how many people have fled the city and how afraid the people who remain are of coming near each other.<br><br><<july-1665-helper>><</replace>><</link>> | <<link "No">><<replace "#decision">><br><br><<july-1665-helper>><</replace>><</link>></span>
</span>
<<fumigant>>
<</if>><</if>>
<</nobr>><<nobr>>
<<silently>>
/* Check whether the authority figure is among the infected being sent away */
<<set _authoritySick to false>>
<<if $hoh is 0 or $hoh is 2>>
<<for _npc range $NPCs>>
<<if _npc.health is "infected" and ($gender is "male" and (_npc.relationship is "father" or _npc.relationship is "step-father") or $gender isnot "male" and (_npc.relationship is "father" or _npc.relationship is "step-father" or _npc.relationship is "mother" or _npc.relationship is "step-mother") or _npc.relationship is "uncle" or _npc.relationship is "aunt" or _npc.relationship is "widowed aunt" or _npc.relationship is "guardian" or _npc.relationship is "guardian's wife" or _npc.relationship is "cousin" or _npc.relationship is "cousin's wife")>>
<<set _authoritySick to true>>
<</if>>
<</for>>
<<elseif $hoh is 3>>
<<for _npc range $NPCs>>
<<if _npc.health is "infected" and (_npc.relationship is "master" or _npc.relationship is "mistress")>>
<<set _authoritySick to true>>
<</if>>
<</for>>
<<elseif $hoh is 4>>
<<for _npc range $NPCs>>
<<if _npc.health is "infected" and _npc.relationship is "husband">>
<<set _authoritySick to true>>
<</if>>
<</for>>
<</if>>
<</silently>>
It is a difficult decision, but <<set-caretaker>><<if $hoh is 1>>you decide<<elseif _authoritySick>>with your <<print $caretakerLabel>> among the sick, you decide<<else>><<if $hoh is 3>>your $masterTitle decides<<else>>your family decide<</if>><</if>> it's for the best to send your sick to the <<defPesthouse "pesthouse">>.
<br><br>
<<if $reputation lte 2>>To your horror, rumors swirl that your family have actually murdered a member of your household and hidden the body! <<if $murder gte 1>> Remembering the rumors of murder that circulated last time your family sent someone to the household, you <</if>><<if $murder lte 1>>You<</if>> send to the master of the pesthouse to produce a certificate for you that proves the rumor is a lie.
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $murder =1>>
<</if>>
/* Charge 12p per person sent to the pesthouse, if funds are available */
<<silently>>
<<set _pesthouseCount to 0>>
<<for _pi = 0; _pi < $NPCs.length; _pi++>><<if $NPCs[_pi].health is "infected">><<set _pesthouseCount += 1>><</if>><</for>>
<<for _pi = 0; _pi < $NPCsServants.length; _pi++>><<if $NPCsServants[_pi].health is "infected">><<set _pesthouseCount += 1>><</if>><</for>>
<<set _pesthouseFee to _pesthouseCount * 12>>
<<if $socio is "servants" and ($hoh is 3 or $hoh is 0)>>
/* Master pays pesthouse fees */
<<elseif $money gte _pesthouseFee>><<set $money -= _pesthouseFee>><</if>>
<</silently>>
<<silently>>
/* Resolve infected household NPCs at the pesthouse */
<<set _phDead = []>><<set _phRec = []>>
<<for _pi = 0; _pi < $NPCs.length; _pi++>>
<<if $NPCs[_pi].health is "infected">>
<<if random(1,2) eq 1>>
<<set $NPCs[_pi].health to "deceased">>
<<set _phDead.push(_pi)>>
/* Silent quick burial for pesthouse deaths */
<<set $NPCs[_pi].funeralDone to true>>
<<master-pays 9>>
<<set $decisions.push({text: "Quick burial for " + $NPCs[_pi].name, money: (_masterPaid ? 0 : -9), repDelta: 0, repBefore: $reputation, infectPct: null})>>
<<else>>
<<set $NPCs[_pi].health to "recovered">>
<<set _phRec.push(_pi)>>
<</if>>
<</if>>
<</for>>
/* Resolve infected servants at the pesthouse */
<<set _phSvDead = []>><<set _phSvRec = []>>
<<for _pi = 0; _pi < $NPCsServants.length; _pi++>>
<<if $NPCsServants[_pi].health is "infected">>
<<if random(1,2) eq 1>>
<<set $NPCsServants[_pi].health to "deceased">>
<<set _phSvDead.push(_pi)>>
<<set $NPCsServants[_pi].funeralDone to true>>
<<master-pays 9>>
<<set $decisions.push({text: "Quick burial for " + $NPCsServants[_pi].name, money: (_masterPaid ? 0 : -9), repDelta: 0, repBefore: $reputation, infectPct: null})>>
<<else>>
<<set $NPCsServants[_pi].health to "recovered">>
<<set _phSvRec.push(_pi)>>
<</if>>
<</if>>
<</for>>
<<check-widowed>>
<<set-hoh>>
<<if random(1,2) eq 1>><<set $plagueInfection to 1>><</if>>
<</silently>>
<br><br>
<<if _phDead.length gt 0>>Despite the pesthouse's care, your <<for _n, _idx range _phDead>><<if _phDead.length eq 1>><<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name has died.<<elseif _n < _phDead.length - 1>><<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name, <<else>>and <<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _phSvDead.length gt 0>>Your servant <<for _n, _idx range _phSvDead>><<if _phSvDead.length eq 1>>$NPCsServants[_idx].name has also died in the pesthouse.<<elseif _n < _phSvDead.length - 1>>$NPCsServants[_idx].name, <<else>>and $NPCsServants[_idx].name have also died in the pesthouse.<</if>><</for>><br><br><</if>>
<<if _phRec.length gt 0>>Thankfully, your <<for _n, _idx range _phRec>><<if _phRec.length eq 1>><<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name has survived.<<elseif _n < _phRec.length - 1>><<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name, <<else>>and <<npc-rel-label $NPCs[_idx].relationship>> $NPCs[_idx].name have survived.<</if>><</for>><br><br><</if>>
<<if _phSvRec.length gt 0>>Your servant <<for _n, _idx range _phSvRec>><<if _phSvRec.length eq 1>>$NPCsServants[_idx].name has also survived.<<elseif _n < _phSvRec.length - 1>>$NPCsServants[_idx].name, <<else>>and $NPCsServants[_idx].name have also survived.<</if>><</for>><br><br><</if>>
<<orphan-check>>
<<storyline-return>>
<</nobr>>
<a href="https://upload.wikimedia.org/wikipedia/commons/5/58/The_pest_house_and_plague_pit%2C_Moorfields%2C_London._Wellcome_V0013229.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/5/58/The_pest_house_and_plague_pit%2C_Moorfields%2C_London._Wellcome_V0013229.jpg" width="100%" alt="Wood engraving of the pest house and plague pit at Moorfields, London"></a>
<br>
//"The Pest House and Plague Pit, Moorfields, London"//
<<widget "sickFam">><<nobr>>
<<set $plagueRevealed to 1>>
As morning dawns, a terrible realization settles over your <<defHousehold "household">>. Your
<<silently>><<check-NPCs>>
/* Check whether the player's authority figure is among the infected */
<<find-authority>>
<<set _authoritySick to false>>
<<if _authorityIdx gte 0 and $NPCs[_authorityIdx].health is "infected">>
<<set _authoritySick to true>>
<</if>><</silently>>
<<set _allInfected to []>>
<<set _relLabel to function(r) { return ($socio === "servants" && (r === "male servant" || r === "female servant")) ? "fellow servant" : r; }>>
<<for _idx range _infectedFamily>>
<<set _allInfected.push({rel: _relLabel($NPCs[_idx].relationship), name: $NPCs[_idx].name})>>
<</for>>
<<for _idx range _infectedServants>>
<<set _allInfected.push({rel: ($socio === "servants" ? "fellow servant" : "servant"), name: $NPCsServants[_idx].name})>>
<</for>>
<<for _idx range _infectedMaster>>
<<set _allInfected.push({rel: _relLabel($NPCsMaster[_idx].relationship), name: $NPCsMaster[_idx].name})>>
<</for>>
<<if _allInfected.length eq 1>>_allInfected[0].rel _allInfected[0].name is infected with the <<defPlague "plague">>.<br>
<<elseif _allInfected.length gte 2>><<for _n, _inf range _allInfected>><<if _n lt _allInfected.length - 1>>_inf.rel, _inf.name, <<else>>and _inf.rel, _inf.name, are infected with the <<defPlague "plague">>.<</if>><</for>><br>
<</if>>
<<if _infectedExtended.length gte 1>><br>Word also reaches you that plague has struck your extended family. Your
<<for _n, _idx range _infectedExtended>>
<<if _infectedExtended.length eq 1>>
$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name is infected with the <<defPlague "plague">>.<br>
<<elseif _n < _infectedExtended.length - 1>>$NPCsExtended[_idx].relationship, $NPCsExtended[_idx].name,<<else>> and $NPCsExtended[_idx].relationship, $NPCsExtended[_idx].name are infected with the plague.<br>
<</if>>
<</for>>
<</if>>
<br>
As a good Christian, it is your duty to look after the poor, sick, and needy. But as a good Christian, you also know it is a sin to needlessly risk your life. <<set-caretaker>><<if $hoh is 1>>Do you<<elseif _authoritySick>>With your <<print $caretakerLabel>> too ill to <<if $hoh is 3>>give orders, the decision falls to you<<elseif $hoh is 4>>make decisions, you must decide for yourself<<else>>make decisions, the responsibility falls to you<</if>>. Do you<<else>>Do you convince your <<if $hoh is 0>>household<<elseif $hoh is 2>>family<<else>><<print $caretakerLabel>><</if>> to<</if>>:<ul>
<li>[[Quarantine with your household->Quarantine, Week 1][$reputation to Math.clamp($reputation + 3, 0, 10)]]</li>
<li>[[Send the sick to the pesthouse->FamPesthouse][$reputation to Math.clamp($reputation - 3, 0, 10)]]</li>
</ul>
<</nobr>><</widget>>
<<widget "check-NPCs">><<nobr>><<silently>>
<<check-infected "$NPCs">><<set _infectedFamily to _infectedResult>>
<<check-infected "$NPCsServants">><<set _infectedServants to _infectedResult>>
<<check-infected "$NPCsMaster">><<set _infectedMaster to _infectedResult>>
<<check-infected "$NPCsExtended">><<set _infectedExtended to _infectedResult>>
<<set _anyInfected to (_infectedFamily.length + _infectedServants.length + _infectedMaster.length + _infectedExtended.length) gt 0>>
<</silently>><</nobr>><</widget>>
/* if sending household away or back to place of origin, change their location for status updates */
<<widget "fled-family">><<silently>>
/* Guard: block sending household away if any NPC or servant is infected */
<<check-NPCs>>
<<set _famFleeBlocked to (_infectedFamily.length + _infectedServants.length) gt 0>>
<</silently>><<if _famFleeBlocked>><<set $fled to 4>>You prepare your household to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. They will leave tomorrow.<br><br>
<<sickFam>>
<<else>><<silently>>
<<if $origin isnot "London">><<set $hhlocation to $origin>><<else>><<set $hhlocation to "in the countryside">><</if>>
/* Find the authority figure who stays behind */
<<find-authority>>
<<set _stayIdx to _authorityIdx>>
/* hoh 2: adult living with parents — nobody stays (all family can flee together) */
<<if $hoh is 2>><<set _stayIdx to -1>><</if>>
/* hoh 0: if no named authority found by priority, fall back to oldest living adult */
<<if $hoh is 0 and _stayIdx is -1>>
<<set _bestAge to -1>>
<<for _fi = 0; _fi < $NPCs.length; _fi++>>
<<if ($NPCs[_fi].age is "young adult" or $NPCs[_fi].age is "middle-aged adult" or $NPCs[_fi].age is "elderly adult") and $NPCs[_fi].health isnot "deceased" and ($NPCs[_fi].agenum || 0) gt _bestAge>>
<<set _bestAge to ($NPCs[_fi].agenum || 0)>>
<<set _stayIdx to _fi>>
<</if>>
<</for>>
<</if>>
/* Move everyone except the stay-behind to FledFamily */
<<for _fi = 0; _fi < $NPCs.length; _fi++>>
<<if _fi isnot _stayIdx>>
<<set $FledFamily.push($NPCs[_fi])>>
<</if>>
/* If the child has servants, keep the oldest one */
<</for>>
<<if _stayIdx gte 0>>
<<set $NPCs to [$NPCs[_stayIdx]]>>
<<else>>
<<set $NPCs to []>>
<</if>>
/* Servant handling */
<<if $hoh is 0>>
/* Child PC: keep oldest servant, move rest to FledServants */
<<if $NPCsServants.length gt 0>>
<<for _fs = 1; _fs < $NPCsServants.length; _fs++>>
<<set $FledServants.push($NPCsServants[_fs])>>
<</for>>
<<set $NPCsServants to $NPCsServants.slice(0, 1)>>
<</if>>
<<else>>
/* For nobles/merchants/artisans, keep 1-2 servants while the rest flee with the family */
<<if ($socio is "nobles" or $socio is "merchants" or $socio is "artisans") and $NPCsServants.length gt 0>>
<<set _keepCount to random(1,2)>>
<<if _keepCount gt $NPCsServants.length>><<set _keepCount to $NPCsServants.length>><</if>>
<<set _totalServants to $NPCsServants.length>>
<<for _fs to _keepCount; _fs lt _totalServants; _fs++>>
<<set $FledServants.push($NPCsServants[_fs])>>
<</for>>
<<set $NPCsServants to $NPCsServants.slice(0, _keepCount)>>
<</if>>
<</if>>
<<check-widowed>>
<<set-hoh>>
<</silently>><</if>>/* end fled-family infection guard */
<</widget>>
<<widget "health-update">><<nobr>>
<<silently>><<if ndef _deceased>><<set _deceased to []>><</if>><<if ndef _recovered>><<set _recovered to []>><</if>><<for _d range _deceased>>
<<if $NPCs[_d].health isnot "deceased-pq">><<set $NPCs[_d].health to "deceased">><</if>>
<</for>>
<<for _r range _recovered>>
<<set $NPCs[_r].health to "recovered">>
<</for>>
/* Process servant health updates */
<<set _deceasedSv to []>><<set _recoveredSv to []>>
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "infected">>
<<if _remedyEffect is 1 and random(1,3) is 1>><<set $NPCsServants[_si].health to "deceased">><<set _deceasedSv.push(_si)>>
<<elseif _remedyEffect is 0 and random(1,2) is 1>><<set $NPCsServants[_si].health to "deceased">><<set _deceasedSv.push(_si)>>
<<else>><<set $NPCsServants[_si].health to "recovered">><<set _recoveredSv.push(_si)>>
<</if>>
<</if>>
<</for>>
/* Process master household health updates */
<<set _deceasedMs to []>><<set _recoveredMs to []>>
<<for _mi = 0; _mi < $NPCsMaster.length; _mi++>>
<<if $NPCsMaster[_mi].health is "infected">>
<<if random(1,2) eq 1>><<set $NPCsMaster[_mi].health to "deceased">><<set _deceasedMs.push(_mi)>>
<<else>><<set $NPCsMaster[_mi].health to "recovered">><<set _recoveredMs.push(_mi)>><</if>>
<</if>>
<</for>>
/* Process extended family health updates */
<<set _deceasedEx to []>><<set _recoveredEx to []>>
<<for _ei = 0; _ei < $NPCsExtended.length; _ei++>>
<<if $NPCsExtended[_ei].health is "infected">>
<<if random(1,2) eq 1>><<set $NPCsExtended[_ei].health to "deceased">><<set _deceasedEx.push(_ei)>>
<<else>><<set $NPCsExtended[_ei].health to "recovered">><<set _recoveredEx.push(_ei)>><</if>>
<</if>>
<</for>>
<<check-widowed>>
<</silently>>
/* Report servant deaths and recoveries */
<<if _deceasedSv.length gt 0>>Your <<for _n, _idx range _deceasedSv>><<if _deceasedSv.length eq 1>>servant $NPCsServants[_idx].name has died.<<elseif _n < _deceasedSv.length - 1>>servant $NPCsServants[_idx].name, <<else>>and servant $NPCsServants[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recoveredSv.length gt 0>>Your <<for _n, _idx range _recoveredSv>><<if _recoveredSv.length eq 1>>servant $NPCsServants[_idx].name has recovered.<<elseif _n < _recoveredSv.length - 1>>servant $NPCsServants[_idx].name, <<else>>and servant $NPCsServants[_idx].name have recovered.<</if>><</for>><br><br><</if>>
/* Report master household deaths and recoveries */
<<if _deceasedMs.length gt 0>>In your $masterTitle's <<defHousehold "household">>, <<for _n, _idx range _deceasedMs>><<if _deceasedMs.length eq 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name has died.<<elseif _n < _deceasedMs.length - 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name, <<else>>and <<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recoveredMs.length gt 0>>In your $masterTitle's <<defHousehold "household">>, <<for _n, _idx range _recoveredMs>><<if _recoveredMs.length eq 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name has recovered.<<elseif _n < _recoveredMs.length - 1>><<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name, <<else>>and <<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name have recovered.<</if>><</for>><br><br><</if>>
/* Report extended family deaths and recoveries */
<<if _deceasedEx.length gt 0>>Your <<for _n, _idx range _deceasedEx>><<if _deceasedEx.length eq 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name has died.<<elseif _n < _deceasedEx.length - 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name, <<else>>and $NPCsExtended[_idx].relationship $NPCsExtended[_idx].name have died.<</if>><</for>><br><br><</if>>
<<if _recoveredEx.length gt 0>>Your <<for _n, _idx range _recoveredEx>><<if _recoveredEx.length eq 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name has recovered.<<elseif _n < _recoveredEx.length - 1>>$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name, <<else>>and $NPCsExtended[_idx].relationship $NPCsExtended[_idx].name have recovered.<</if>><</for>><br><br><</if>><</nobr>><</widget>>
<<widget "sickOtherHH">><<nobr>>
<<set $plagueRevealed to 1>>
<<silently>>
<<check-NPCs>>
/* Check whether the player's authority figure is sick */
<<set _authoritySick to false>>
<<if $hoh is 3>>
/* For servants with hoh 3, the master/mistress lives in $NPCs — check if they are among the infected */
<<for _idx range _infectedMaster>>
<<if $NPCs[_idx].relationship is "master" or $NPCs[_idx].relationship is "mistress">>
<<set _authoritySick to true>>
<</if>>
<</for>>
<<else>>
/* For all other hoh values, the authority figure is in $NPCs */
<<find-authority>>
<<if _authorityIdx gte 0 and $NPCs[_authorityIdx].health is "infected">>
<<set _authoritySick to true>>
<</if>>
<</if>>
<</silently>>
<span id="other-hh-choice">
<<if _infectedMaster.length gte 1>>Word reaches you that plague has struck your $masterTitle's <<defHousehold "household">>. Your
<<for _n, _idx range _infectedMaster>>
<<if _infectedMaster.length eq 1>>
<<npc-rel-label $NPCsMaster[_idx].relationship>> $NPCsMaster[_idx].name is infected with the <<defPlague "plague">>.<br>
<<elseif _n < _infectedMaster.length - 1>><<npc-rel-label $NPCsMaster[_idx].relationship>>, $NPCsMaster[_idx].name,<<else>> and <<npc-rel-label $NPCsMaster[_idx].relationship>>, $NPCsMaster[_idx].name are infected with the plague.<br>
<</if>>
<</for>>
<</if>>
<<if _infectedExtended.length gte 1>>Word reaches you that plague has struck your extended family. Your
<<for _n, _idx range _infectedExtended>>
<<if _infectedExtended.length eq 1>>
$NPCsExtended[_idx].relationship $NPCsExtended[_idx].name is infected with the <<defPlague "plague">>.<br>
<<elseif _n < _infectedExtended.length - 1>>$NPCsExtended[_idx].relationship, $NPCsExtended[_idx].name,<<else>> and $NPCsExtended[_idx].relationship, $NPCsExtended[_idx].name are infected with the plague.<br>
<</if>>
<</for>>
<</if>>
<br>
As a good Christian, it is your duty to look after the poor, sick, and needy. But as a good Christian, you also know it is a sin to needlessly risk your life. <<set-caretaker>><<if $hoh is 1>>Do you<<elseif _authoritySick>>With your <<print $caretakerLabel>> too ill to <<if $hoh is 3>>give orders, the decision falls to you<<elseif $hoh is 4>>make decisions, you must decide for yourself<<else>>make decisions, the responsibility falls to you<</if>>. Do you<<else>>Do you persuade your <<if $hoh is 0>>household<<elseif $hoh is 2>>family<<else>><<print $caretakerLabel>><</if>> to let you<</if>>:<ul>
<<set _masterLinkText to "Go nurse your " + $masterTitle + "'s household">><<if _infectedMaster.length gte 1 and _infectedExtended.length gte 1>><li><<link _masterLinkText "Quarantine, Week 1">><<set _swapTarget to "master">><<swap-to-other-hh>><<set $reputation to Math.clamp($reputation + 3, 0, 10)>><</link>></li>
<li><<link "Go nurse your extended family" "Quarantine, Week 1">><<set _swapTarget to "extended">><<swap-to-other-hh>><<set $reputation to Math.clamp($reputation + 3, 0, 10)>><</link>></li>
<<elseif _infectedMaster.length gte 1>><li><<link _masterLinkText "Quarantine, Week 1">><<swap-to-other-hh>><<set $reputation to Math.clamp($reputation + 3, 0, 10)>><</link>></li>
<<else>><li><<link "Go nurse your extended family" "Quarantine, Week 1">><<swap-to-other-hh>><<set $reputation to Math.clamp($reputation + 3, 0, 10)>><</link>></li>
<</if>> <li><<link "Remain in your own household">><<silently>><<set _deadOther to []>><<set _recovOther to []>><<for _mi = 0; _mi < $NPCsMaster.length; _mi++>><<if $NPCsMaster[_mi].health is "infected">><<if random(1,2) eq 1>><<set $NPCsMaster[_mi].health to "deceased">><<set _deadOther.push(($socio === "servants" && ($NPCsMaster[_mi].relationship === "male servant" || $NPCsMaster[_mi].relationship === "female servant") ? "fellow servant" : $NPCsMaster[_mi].relationship) + " " + $NPCsMaster[_mi].name)>><<else>><<set $NPCsMaster[_mi].health to "recovered">><<set _recovOther.push(($socio === "servants" && ($NPCsMaster[_mi].relationship === "male servant" || $NPCsMaster[_mi].relationship === "female servant") ? "fellow servant" : $NPCsMaster[_mi].relationship) + " " + $NPCsMaster[_mi].name)>><</if>><</if>><</for>><<for _ei = 0; _ei < $NPCsExtended.length; _ei++>><<if $NPCsExtended[_ei].health is "infected">><<if random(1,2) eq 1>><<set $NPCsExtended[_ei].health to "deceased">><<set _deadOther.push($NPCsExtended[_ei].relationship + " " + $NPCsExtended[_ei].name)>><<else>><<set $NPCsExtended[_ei].health to "recovered">><<set _recovOther.push($NPCsExtended[_ei].relationship + " " + $NPCsExtended[_ei].name)>><</if>><</if>><</for>><<check-widowed>><</silently>><<replace "#other-hh-choice">>You decide to remain in your own household and pray for the sick.<<if _deadOther.length gt 0>> Despite your prayers, <<for _n, _name range _deadOther>><<if _deadOther.length eq 1>>your _name has<<elseif _n < _deadOther.length - 1>>your _name, <<else>>and your _name have<</if>><</for>> died.<</if>><<if _recovOther.length gt 0>> Thankfully, <<for _n, _name range _recovOther>><<if _recovOther.length eq 1>>your _name has<<elseif _n < _recovOther.length - 1>>your _name, <<else>>and your _name have<</if>><</for>> survived.<</if>><<storyline-return>><</replace>><</link>></li>
</ul></span>
<</nobr>><</widget>>
<<widget "swap-to-other-hh">><<nobr>><<silently>>
/* Save original household */
<<set $SavedNPCs to clone($NPCs)>>
<<set $SavedServants to clone($NPCsServants)>>
/* Determine which household to join (_swapTarget set when both are infected) */
<<check-NPCs>>
<<if (typeof _swapTarget !== 'undefined' and _swapTarget is "extended") or _infectedMaster.length eq 0>>
<<set $NPCs to clone($NPCsExtended)>>
<<set $NPCsExtended to []>>
<<set $quarantineSwapped to "extended">>
<<else>>
<<set $NPCs to clone($NPCsMaster)>>
<<set $NPCsMaster to []>>
<<set $quarantineSwapped to "master">>
<</if>>
<<set $NPCsServants to []>>
<<set-hoh>>
<<set-caretaker>>
<</silently>><</nobr>><</widget>><<widget "storyline-return">><<nobr>>
/* Argument 0: Text for the link (Defaults to "Continue.") */
<<set _linkText to _args[0] || "Continue.">>
/* Argument 1: Number of months to advance (Defaults to 1) */
<<set _timeOffset to (typeof _args[1] !== "undefined") ? _args[1] : 1>>
/* Argument 2: Money to add/subtract (Defaults to 0) */
<<set _moneyOffset to _args[2] || 0>>
/* Argument 3: Reputation to add/subtract (Defaults to 0) */
<<set _reputationOffset to _args[3] || 0>>
/* Argument 4: Increased plague risk as a percentage (Defaults to 0, e.g. 5 = 5% increased risk) */
<<set _plagueRisk to _args[4] || 0>>
/* Calculate the next passage index */
<<set _nextIndex to $monthIndex + _timeOffset>>
/* Failsafe: Cap the index so the game doesn't break if an event pushes them past Dec 1666 */
<<if _nextIndex >= $timeline.length>>
<<set _nextIndex to $timeline.length - 1>>
<</if>>
/* Output the link */
<<link _linkText $timeline[_nextIndex]>>
<<set $money += _moneyOffset>>
<<set $reputation to Math.clamp($reputation + _reputationOffset, 0, 10)>>
<<if _plagueRisk gt 0>>
<<if random(1, 100) lte _plagueRisk>>
<<set $plagueInfection to 1>>
<</if>>
<</if>>
/* Advance pregnancy for skipped months (random-events handles 1 month on landing) */
<<if $pregnant gt 0 and _timeOffset gt 1>>
<<set _pregCap to ($pregnant lt 4) ? 3 : 8>>
<<set $pregnant to Math.min($pregnant + _timeOffset - 1, _pregCap)>>
<</if>>
<<if _timeOffset is 0>>
<<set $randomEventCompleted to true>>
<</if>>
<</link>>
<</nobr>><</widget>><<nobr>><<silently>><<set $plagueInfection to 2>><</silently>>
You attempt to hide your illness from everyone, hoping that if you just ignore it then the lump will go away.<br><br>
Unfortunately, that's not how <<defPlague "plague">> works. The lump gets bigger and is soon joined by even more lumps. They are now undeniably plague <<defBuboes "buboes">>.
<br><br>
<<if $socio is "nobles">>The King is furious at your deception and [[banishes you to your country estate->banished]]. <<else>>Your neighbors realize you attempted to hide your sickness and decide you can no longer be trusted. Not only do they shut up your household, they also conspire to have you [[removed to the pesthouse->YouPesthouse]]<<if $socio is "merchants">> despite your high social status <</if>> to keep the plague from spreading further.<</if>>
<</nobr>><<nobr>><<set $plagueInfection to 2>>All but the most loyal—or desperate—servants flee from your country estate. The villagers refuse to receive your servants and even the local priest hesitates to come pray for you.
<<linkreplace "You take to your sickbed as your fever spikes and you fear for your life.">><<linkreplace "It occurs to you that perhaps you ought to write your will.">>
<<if random(1,2) is 1>>Luckily, you will be too delirious to notice that the remainder of your servants all abandon you in the hours before your [[death]].
<<else>>Luckily, despite your disgrace, your final few servants stay by your side, praying for your life and administering every <<defPlague "plague">> remedy known to mankind.
<br><br>
<<set $playerPlagueStatus to "recovered">>You don't know which helps more, but after a few days you feel your fever break and your <<defBuboes "buboes">> begin to go down. Thanks be to God, you have survived the plague.
<br><br>
<<orphan-check>>
Now you just have to figure out how to overcome your disgrace and find your way back into the King's good graces. Groveling will obviously have to be involved, but that won't be enough. Do you also:<br>
<ul>
<<if $hoh is 1>>
<li><<linkreplace "help him find his next mistress">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $money -= $income>><<set $decisions.push({text: "Helped the King find his next mistress", money: 0 - $income, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<set $pesthouseReparation to 1>>[[You hire an artist to paint portraits of the most beautiful women at court to present to the King and hope it will help restore you to favor.->Reconnecting]]<</linkreplace>></li>
<li><<linkreplace "give him money to fund the war effort">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money -= $income>><<set $decisions.push({text: "Gave the King money to fund the war effort", money: 0 - $income, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<set $pesthouseReparation to 1>>[[You pour money into the war effort and hope it will help restore you to favor.->Reconnecting]]<</linkreplace>></li><</if>>
<li><<linkreplace "write a letter to the Queen begging her to intercede on your behalf">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: "Wrote to the Queen begging her to intercede", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<set $pesthouseReparation to 1>>[[You write to the Queen and hope that her favor will help restore you to the King's favor.->Reconnecting]]<</linkreplace>></li>
<li><<linkreplace "write a letter to the King with poems composed in his honor">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $decisions.push({text: "Wrote poems in the King's honor", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<set $pesthouseReparation to 1>>[[You collect several poems composed in the King's honor and add a new one of your own, which you send to the King in hopes of regaining his favor.->Reconnecting]]<</linkreplace>></li>
</ul>
<</if>>
<</linkreplace>>
<</linkreplace>>
<</nobr>><<silently>><<set $plagueInfection to 2>><<if $money gte 12>><<set $money -= 12>><</if>><</silently>>
<<nobr>>
The <<defPesthouse "pesthouse">> is a terrible place to be confined, with countless sick people all crammed in close together so you can hear their every moan. They die terrifyingly fast and their cots refill just as quickly. You toss and turn in your dirty, sweat-soaked sheets, as your fever spikes and you fear for your life.
<br><br>
<<if $socio is "merchants">>It occurs to you that perhaps you ought to have written your will, but your reputation is so poor and the pesthouse is so terrifying that no one can be convinced to bring you the writing materials you need.<br><br><<elseif $socio is "artisans">>It occurs to you that perhaps you ought to have written your will, but your reputation is so poor and the pesthouse is so terrifying that you can't convince a <<defScrivener "scrivener">> to come help you.<br><br><</if>>
<<if random(1,2) is 1>>Luckily, you will grow too delirious to notice how miserable you are in the hours before your [[death]].<<else>>You spend all your remaining energy in prayer that God will spare you from death. <<set $playerPlagueStatus to "recovered">>Despite the neglect of the overworked pesthouse staff, after a few days you feel your fever break and your <<defBuboes "buboes">> begin to go down. Thanks be to God, you have survived the <<defPlague "plague">>.
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/5/58/The_pest_house_and_plague_pit%2C_Moorfields%2C_London._Wellcome_V0013229.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/5/58/The_pest_house_and_plague_pit%2C_Moorfields%2C_London._Wellcome_V0013229.jpg" width="100%" alt="Wood engraving of the pest house and plague pit at Moorfields, London"></a>
<br>
//"The Pest House and Plague Pit, Moorfields, London"//
<br><br>
<<orphan-check>>
Now you just have to figure out how to overcome your disgrace when you return home to your neighborhood. You decide to start by:<br>
<ul>
<<if $hoh is 1>>
<<linkreplace "giving one month's income to the poor">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<set $money -= $income>><<set $decisions.push({text: "Gave one month's income to the poor as penance", money: 0 - $income, repDelta: 1, repBefore: _repBefore, infectPct: null})>>
<<set $pesthouseReparation to 1>>[[You pray your penance is enough to restore your good name.->Reconnecting]]
<</linkreplace>>
<</if>>
<<linkreplace "performing public penance in church">><<set $decisions.push({text: "Performed public penance in church", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>
<<set $pesthouseReparation to 1>>[[You pray your penance is enough to restore your good name.->Reconnecting]]
<</linkreplace>>
</ul>
<</if>>
<</nobr>>Since you refuse to work in London, the local authorities decide to have you deported back to $origin.
<br>
Do you:
[[try to escape and return to London->escape]]
[[go quietly]]You try to escape
<<if random(1,2) == 1>>but are immediately caught. The local authorities decide the safest course of action now is to have you [[transported]] to the New World.
<<else>>and manage to sneak back into London.
<<if $reputation gte 3>> Luckily, one of your neighbors takes pity on you and lets you stay with them while you seek work and a new place to stay. <<set $socio to "day labourers">><<set-hoh>> You <<storyline-return "settle into your new life">>.
<<else>>Unfortunately, you are now homeless, no longer receiving alms from your <<defParish "parish's">> <<defOverseersOfThePoor "Overseers for the Poor">>, and cannot legally beg anymore. It doesn't take long before you are caught and thrown in gaol.
<br>
Do you:
<<link "beg for forgiveness and agree to work">>
<<storyline-return>>
<</link>>
[[stand firm in your refusal to risk your life->transported]]
<</if>>
<</if>><<nobr>>
<<if $debtFled is 1>>
<<if $origin is "London">>You slip away from London under cover of darkness, leaving behind your townhouse and your debts. With no other connections, you make your way to the countryside and try to start a new life.
<<else>>
You slip away from London under cover of darkness and return to $origin, hoping your creditors will never find you there.<</if>>
<br><br>
Your reputation is ruined and you will never return to London, but at least you are free—and you didn't die of plague!
<<else>>
<<if $origin is "London">>There's no <<defPlague "plague">> in the New World, so you decide to take a chance and move to the colonies. It's a rough journey and difficult to start over again somewhere so different. You will always miss London.
<<else>>
You return to $origin and never see London again.<</if>>
<br><br>
But at least you didn't die of plague!
<</if>>
<br><br>
[[How typical was your experience of the Great Plague of London? Let's find out!->stats]]
<</nobr>><<nobr>>
<h2>How Representative Was Your Experience?</h2>
<p>The following sections place your experience in historical context, using data from the Bills of Mortality and other primary sources.</p>
<<stats-historical-totals>>
<<stats-parish-risk>>
<<stats-household-mortality>>
<<stats-cumulative-risk>>
<<risk-visualization>>
<hr>
<h4>The Impact of Your Decisions</h4>
<<if $decisions.length gt 0>><ol>
<<for _i to 0; _i lt $decisions.length; _i++>><<set _d to $decisions[_i]>><li><<if typeof _d is "object">><<print _d.text>><<if _d.money neq 0 or _d.repDelta neq 0 or _d.infectPct neq null>><ul><<if _d.money lt 0>><<set _mc to 0 - _d.money>><li>Cost: <<conversion _mc>></li><<elseif _d.money gt 0>><<set _mc to _d.money>><li>Earned: <<conversion _mc>></li><</if>><<if _d.repDelta gt 0>><li>Reputation increased<<set _rA to _d.repBefore + _d.repDelta>><<set _lblB to (_d.repBefore >= 9 ? "a worthy soul" : _d.repBefore >= 6 ? "of good credit and quality" : _d.repBefore >= 3 ? "bad credit is better than none" : "a worthless and base rogue")>><<set _lblA to (_rA >= 9 ? "a worthy soul" : _rA >= 6 ? "of good credit and quality" : _rA >= 3 ? "bad credit is better than none" : "a worthless and base rogue")>><<if _lblB isnot _lblA>> from <<print "‘" + _lblB + "’">> to <<print "‘" + _lblA + "’">><</if>></li><<elseif _d.repDelta lt 0>><li>Reputation decreased<<set _rA to _d.repBefore + _d.repDelta>><<set _lblB to (_d.repBefore >= 9 ? "a worthy soul" : _d.repBefore >= 6 ? "of good credit and quality" : _d.repBefore >= 3 ? "bad credit is better than none" : "a worthless and base rogue")>><<set _lblA to (_rA >= 9 ? "a worthy soul" : _rA >= 6 ? "of good credit and quality" : _rA >= 3 ? "bad credit is better than none" : "a worthless and base rogue")>><<if _lblB isnot _lblA>> from <<print "‘" + _lblB + "’">> to <<print "‘" + _lblA + "’">><</if>></li><</if>><<if _d.infectPct neq null>><<if _d.infectPct gt 0>><li><<print _d.infectPct>>% chance of plague infection</li><<elseif _d.infectPct is 0>><li>Reduced risk of plague infection</li><</if>><</if>></ul><</if>><<else>><<print _d>><</if>></li>
<</for>></ol>
<<else>>
<p>No decisions recorded yet.</p><</if>>
<</nobr>>
The local authorities decide to have you bound into <<defIndenturedServitude "indentured servitude">> and shipped to the colony of Virginia.
<br>
If you don't die during the perilous months' long journey across the Atlantic, you'll probably die of disease or violence within the first couple of years after your arrival.
<br>
Though if by God's grace you do survive it all, at the end you will be given your freedom and enough land to start growing crops.
<br>
Good luck! You'll need it...
[[How typical was your experience of the Great Plague of London? Let's find out!->stats]]<<widget "sickPC">><<nobr>>
<<set $plagueRevealed to 1>>
<<set $playerPlagueStatus to "infected">>
Lord have mercy! A strange lump has appeared on your
<<set _x to random(1,3)>>
<<if _x == 3>>neck and there's no hiding that you have caught the dreaded [[plague->Sickness]].
<<else>><<if _x == 2>>leg
<<else>>armpit<</if>>.
<br><br>
Do you:
<ul><li>warn people you have [[plague->Sickness]]</li>
<li>[[try to hide it ->Hide][$reputation to Math.clamp($reputation - 3, 0, 10)]]</li>
</ul>
<</if>>
<</nobr>><</widget>><<widget "beggar-choice">><<nobr>>
The alms you receive from your parish are just enough to pay for your housing and keep you from starvation, but you're always hungry<<if $money lte 12>> and one unexpected expense away from disaster<</if>>. You know there has to be a better way, but you're not sure what that way is.
Do you:
<ul>
<li><<if random(1,3) == 1>>[[beg on the highways, even though you know it's illegal|impressed][$impressed += 1]]<<else>>[[beg on the highways, even though you know it's illegal->begging-success]]<</if>>
</li>
<<if $gender is "female">><li>[[put your trust in the charity of your neighbors->good-neighbors][$reputation to Math.clamp($reputation + 1, 0, 10)]]</li>
<li><<storyline-return "take in extra laundry from your neighbors" 1 48 0>><<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Took in extra laundry", money: 48, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>></li><</if>>
<<if $religion is "member of the Church of England">><li><<storyline-return "offer to wash the church linens and sweep clean your church" 1 32 0>><<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Washed church linens", money: 32, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>></li><</if>>
<li><<if $disability is 0 and $religion isnot "Quaker" and $gender isnot "female">>[[volunteer to join the Navy->navy-volunteer]]/*[set $decisions.push({text: "Dec 1664: Volunteered for the navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]*/
<<elseif $disability is 0 and $religion isnot "Quaker" and $gender is "female">>
[[disguise yourself as a man and join the English Navy->navy-volunteer]]/*[set $decisions.push({text: "Dec 1664: Disguised as a man to join the navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]*/<</if>></li>
<li><<storyline-return "hope that you can survive on the resources you have">></li>
</ul>
<</nobr>><</widget>><<nobr>><<set $beggarsluck to random(6,10)>><<if $disability isnot 0>><<set $beggarsluck to $beggarsluck * 2>><</if>><<set $money to Math.clamp($money + $beggarsluck, -1000000,1000000)>>Despite begging daily on the highway, you only earned an extra ''$beggarsluck'' pence.<br><br>
While this is enough for a little extra bread, you are painfully aware that this came at a cost to your reputation with your neighbors.<br><br><<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
<<unset $beggarsluck>>
<<storyline-return>>
<</nobr>><<nobr>><<set _charity to random(1,2)>><<set $beggarsluck to random(2,6)>><<if $disability isnot 0>><<set $beggarsluck to $beggarsluck * 2>><</if>><<set $money to Math.clamp($money + $beggarsluck, -1000000,1000000)>>
One of your neighbors <<if $reputation gte 6>>provides you with leftovers from a feast<<else>><<if _charity is 1>>gives you some moldy bread<<else>>lets you have an old dress, which you sell for a bit of extra bread<<plague-risk-check>><</if>><</if>>. Because you didn't have to spend as much money on food, you manage to save an extra $beggarsluck pence.<<unset $beggarsluck>>
<<storyline-return>>
<</nobr>><<widget "beggar-roles">><<nobr>>
<<if $disability is 0 and $religion isnot "Catholic" and $skipServices isnot 1 and $agenum gt 16>> and the <<defOverseersOfThePoor "Overseers of the Poor">> inform you after services one Sunday that you have been assigned adidtional work as one of the parish's <<if $reputation gte 6>><<if $gender is "female">><<set $role to "searcher">>searchers of the dead. Your job is to look at plague corpses and determine if they died of plague or some other cause of death.
<br>
<div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg" style="width:100%; height:auto;" alt="Engraving of men loading plague victims onto a cart"></a>
//Nathaniel Parr - "Plague in 1665", 1747//
</div>
<<else>><<set $role to "warder">><<set $reputation to Math.clamp($reputation - 1, 0, 10)>>warders. Your job is to stand guard outside shut up houses to prevent anyone from escaping.
<</if>>
<<else>><<if $gender is "female">><<set $role to "nurse">>nurses. Your job is to bring food, medicine, clean clothing, and anything else necessary to comfort the sick and the dying.
<<else>><<set $role to "corpsebearer">>corpsebearers. Your job is to remove the dead from shut up house and take them to be buried.
<br>
<div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg" style="width:100%; height:auto;" alt="Engraving of a corpse bearer carrying away the dead"></a>
//R. Price - "A Corpse Bearer", 1655//
</div>
<</if>>
<</if>>
<</if>>
<<if $disability isnot 0>>Many of your neighbors begin to flee the city and those who remain curse at you to leave when you try begging at their doors.<</if>>
<br><br>You decide to:
<ul>
<li>[[Remain in the city->Stay][$fled to 4; $decisions.push({text: "Remained in the city", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]</li>
<<if $origin isnot "London">><li>[[Flee the city and return to $origin->Flight][$fled to 6; $decisions.push({text: "Fled back to place of origin", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})]]</li><</if>>
</ul>
<</nobr>><</widget>><<nobr>>You quietly freeze to death, but at least it was a painless way to go.<br><br>
<<death-announcement>>
<</nobr>><<if $reputation gte 3>>Your reputation is <span style="color:#ffffff;">good</span>.<<elseif $reputation lt 3>>Your reputation is <span style="color:red">bad</span>.<</if>><br>
<<income>>
/* Wealth at beginning of month: $money */
Income: $income
Monthly spending: $expenses
/* Disposable: _disposable */
/* Remaining total: _remainder */
/*<<set $money to _remainder>>*/
<<nobr>>
Total wealth: $money (<<conversion>>)
<</nobr>>
<<if $preFireLocation neq "">><<nobr>>
<br>Pre-fire location: $preFireLocation
<br>Pre-fire parish: $preFireParish
<</nobr>><</if>>
<<link "Inventory">>
<<run Dialog.setup("Inventory", "inventory"); Dialog.wiki(Story.get("Inventory").text); Dialog.open()>>
<</link>>
Forgiveness is a Christian virtue and you are lucky that your neighbors practice it. You publicly apologize and are officially forgiven, though it will take a while longer before your reputation is restored.
<<storyline-return>><<widget "debtor">><<nobr>>
<<calculate-ceiling>>
/* consequences for exceeding debt ceiling */
<<if $socio is "nobles" and $money lte (_debtCeiling*4)>>
While nobles are expected to lead a lavish lifestyle, you've been spending so far beyond your income that it's finally caught up to you. <<prison>>
<<elseif ($socio is "artisans" or $socio is "merchants") and $money lte (_debtCeiling*3)>>
<<prison>>
<<elseif $money lte (_debtCeiling*2)>>
You never have much money to spare, but things have gone more poorly than usual lately. <<prison>>
<</if>>
<</nobr>><</widget>>
<<widget "prison">><<nobr>>
<<set _headerEventActive to true>>
/* Release half the servants for nobles/merchants/artisans to reduce expenses */
<<removeServants>>
/* Forced child service: remove children/adolescents/young adults lte 21 for qualifying classes */
<<forced-child-service>>
<<if not _forcedServicePC>>
<<set _hohNPCName to "">>
<<set _hohNPCRel to "">>
<<set _hohNPCIdx to -1>>
<<set _servantHandled to false>>
<<set _servantDismissed to false>>
/* Servant special case (hoh 3): master/mistress handles the debt or dismisses the servant */
<<if $hoh is 3>>With your creditors literally pounding at the door, your $masterTitle discovers you've fallen into debt.
<<if $reputation gte 6>><<set _servantHandled to true>>Because you've been such a hard worker, your $masterTitle decides to pay them off for you.<<set $money to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": " + $masterTitle.toUpperFirst() + " paid off your debts", money: 0, repDelta: -2, repBefore: $reputation, infectPct: null})>>While you are grateful, you are embarassed that the whole household now knows about your <<storyline-return "inability to manage your money." 0 0 -2>>
<<else>>
<<set _servantDismissed to true>><<set $socio to "day labourers">><<leave-service>>Not only are you embarassed that the whole household found out about your money troubles, but your $masterTitle decides you can no longer be trusted and dismisses you from service. You'll have to find work as a day labourer if you're to have any hope of paying off your debts.<br><br>
<</if>>
<</if>>
/* After servant dismissal, $hoh has been recalculated — proceed with new status */
/* Find the head-of-household NPC for non-independent players (hoh 0, 2, 4) */
<<if not _servantHandled>>
<<if not _servantDismissed and $hoh is 4>>
<<for _pi to 0; _pi lt $NPCs.length; _pi++>>
<<if _hohNPCName is "" and $NPCs[_pi].relationship is "husband" and $NPCs[_pi].health isnot "deceased">>
<<set _hohNPCName to $NPCs[_pi].name>>
<<set _hohNPCRel to "husband">>
<<set _hohNPCIdx to _pi>>
<</if>>
<</for>>
<<elseif not _servantDismissed and ($hoh is 0 or $hoh is 2)>>
/* Priority 1: father or step-father */
<<for _pi to 0; _pi lt $NPCs.length; _pi++>>
<<if _hohNPCName is "" and ($NPCs[_pi].relationship is "father" or $NPCs[_pi].relationship is "step-father") and $NPCs[_pi].health isnot "deceased">>
<<set _hohNPCName to $NPCs[_pi].name>>
<<set _hohNPCRel to $NPCs[_pi].relationship>>
<<set _hohNPCIdx to _pi>>
<</if>>
<</for>>
/* Priority 2: mother or step-mother */
<<if _hohNPCName is "">>
<<for _pi to 0; _pi lt $NPCs.length; _pi++>>
<<if _hohNPCName is "" and ($NPCs[_pi].relationship is "mother" or $NPCs[_pi].relationship is "step-mother") and $NPCs[_pi].health isnot "deceased">>
<<set _hohNPCName to $NPCs[_pi].name>>
<<set _hohNPCRel to $NPCs[_pi].relationship>>
<<set _hohNPCIdx to _pi>>
<</if>>
<</for>>
<</if>>
/* Priority 3: uncle, aunt, or guardian */
<<if _hohNPCName is "">>
<<for _pi to 0; _pi lt $NPCs.length; _pi++>>
<<if _hohNPCName is "" and ($NPCs[_pi].relationship is "uncle" or $NPCs[_pi].relationship is "aunt" or $NPCs[_pi].relationship is "widowed aunt" or $NPCs[_pi].relationship is "guardian" or $NPCs[_pi].relationship is "guardian's wife" or $NPCs[_pi].relationship is "cousin" or $NPCs[_pi].relationship is "cousin's wife") and $NPCs[_pi].health isnot "deceased">>
<<set _hohNPCName to $NPCs[_pi].name>>
<<set _hohNPCRel to $NPCs[_pi].relationship>>
<<set _hohNPCIdx to _pi>>
<</if>>
<</for>>
<</if>>
<</if>>
/* Non-independent player with a qualifying HoH NPC — HoH goes to prison */
<<if _hohNPCName isnot "">>
Your household has fallen so far into debt that creditors have demanded _hohNPCRel, _hohNPCName, be thrown into debtor's prison. <<if $reputation gte 6>><<set $creditorWaitCount += 1>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: $timeline[$monthIndex] + ": Creditors agreed to wait (reputation -1)", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<if $creditorWaitCount is 1>>To your relief, your _hohNPCRel's creditors agree to <<storyline-return "wait a little longer">> due to your family's good reputation. <<elseif $creditorWaitCount is 2>>Your _hohNPCRel's creditors are growing impatient, but they agree to <<storyline-return "wait a little longer">> — though you sense their patience is wearing thin. <<else>>Your _hohNPCRel's creditors are furious and barely agree to <<storyline-return "wait">> — warning that this is the last time. <</if>><<elseif $reputation gte 4>><<debt-sell-option>><<else>>_hohNPCName is committed to the Fleet. <<set $inDebtorsPrison to 1>><<set $debtorPrisonMonths to 0>><<set $debtorPrisonCount += 1>><<set $plagueInfection to random(0,1)>><<if $socio isnot "nobles" and _hohNPCIdx isnot -1 and $NPCs[_hohNPCIdx].gender is "male" and $NPCs[_hohNPCIdx].agenum gte 15 and $NPCs[_hohNPCIdx].agenum lte 55 and random(1,2) is 1>>However, _hohNPCName has barely arrived when a Navy recruiter spots him and has him impressed into His Majesty's Navy. <<set $inDebtorsPrison to 0>><<if $NPCs[_hohNPCIdx].health is "safe from harm">><<set $NPCs[_hohNPCIdx].health to "healthy">><<set $NPCs[_hohNPCIdx].location to $location>><</if>><<set $NPCsExtended.push($NPCs[_hohNPCIdx])>><<set $NPCs.splice(_hohNPCIdx, 1)>><<NPCpronouns>><<set-hoh>><<set $decisions.push({text: $timeline[$monthIndex] + ": " + _hohNPCName + " impressed from debtor's prison into the Navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>Your _hohNPCRel is gone, but your debts remain. <<storyline-return "You pray for his safe return." 1 0 -2>><<else>>_hohNPCName is forced to reside there until the debts are reduced. <<storyline-return "You hope it won't take long." 1 0 -2>><</if>>
<</if>>
/* Independent head of household (hoh 1) or no qualifying NPC found — player goes to prison */
<<else>>
To your humiliation, you've fallen so far into debt that your creditors have demanded you be thrown in debtor's prison. <<if $reputation gte 6>><<set $creditorWaitCount += 1>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: $timeline[$monthIndex] + ": Creditors agreed to wait (reputation -1)", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<if $creditorWaitCount is 1>>To your relief, your creditors agree to <<storyline-return "wait a little longer">> due to your good reputation. <<elseif $creditorWaitCount is 2>>Your creditors are growing impatient, but they agree to <<storyline-return "wait a little longer">> — though you sense their patience is wearing thin. <<else>>Your creditors are furious and barely agree to <<storyline-return "wait">> — warning that this is the last time. <</if>><<elseif $reputation gte 4>><<debt-sell-option>><<elseif $gender is "male" and $agenum gte 16 and $agenum lte 59 and ($socio is "beggars" or $socio is "day labourers" or $socio is "artisans" or $socio is "merchants")>><<debt-navy-option>><<else>><<debt-navy-npc-option>>
<</if>>
<</if>>
<</if>>
<</if>><</nobr>><</widget>>
/* Sell land (nobles) or goods (non-nobles) to zero out debts — offered when reputation is 4 or 5 */
/* First time: sell land/goods option. Second time: nobles get townhouse/flee, non-nobles go straight to prison */
<<widget "debt-sell-option">><<nobr>>
<<if $debtSellUsed gte 1>>
/* Second+ time — nobles get desperate options, non-nobles go straight to prison */
<<if $socio is "nobles">>
<span id="debt-sell">Your creditors have lost all patience. You have two desperate options remaining: sell your London townhouse and retire permanently to the country, or flee London entirely to escape your debts.<br><br>
<<link "Sell the townhouse">><<replace "#debt-sell">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 3, 0, 10)>><<set $money to 0>><<set $creditorWaitCount to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": Sold London townhouse — retired to the country", money: 0, repDelta: -3, repBefore: _repBefore, infectPct: null})>>With a heavy heart, you sell your London townhouse. The proceeds satisfy your creditors, but you can no longer afford to live in the city. You pack your remaining belongings and retire permanently to your country estate.<br><br>It is a humiliating end to your life in London, but at least you didn't die of plague!<br><br>[[How typical was your experience of the Great Plague of London? Let's find out!->stats]]<</replace>><</link>> | <<link "Flee the city">><<replace "#debt-sell">><<set $debtFled to 1>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 3, 0, 10)>><<set $decisions.push({text: $timeline[$monthIndex] + ": Fled London to escape debts", money: 0, repDelta: -3, repBefore: _repBefore, infectPct: null})>>Rather than face the Fleet or the humiliation of selling your townhouse, you [[slip away from London under cover of darkness->go quietly]].<</replace>><</link>>
</span>
<<else>>
<span id="debt-sell">Your creditors have lost all patience. You have nothing left to sell. You can either face the Fleet, or flee London entirely to escape your debts.<br><br>
<<link "Face the Fleet">><<replace "#debt-sell">><<debt-prison-commit>><</replace>><</link>> | <<link "Flee the city">><<replace "#debt-sell">><<set $debtFled to 1>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 3, 0, 10)>><<set $decisions.push({text: $timeline[$monthIndex] + ": Fled London to escape debts", money: 0, repDelta: -3, repBefore: _repBefore, infectPct: null})>>Rather than face the Fleet, you [[slip away from London under cover of darkness->go quietly]].<</replace>><</link>>
</span>
<</if>>
<<else>>
<<set $debtSellUsed to 1>>
<<if $socio is "nobles">>
<span id="debt-sell">Your creditors are losing patience. However, you still have enough standing that a desperate measure might save you: you could sell some of your family's land in the countryside to pay off your debts. It would be a humiliation, but better than the Fleet.<br><br>
<<link "Sell the land">><<replace "#debt-sell">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 2, 0, 10)>><<set $money to 0>><<set $creditorWaitCount to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": Sold land to pay off debts", money: 0, repDelta: -2, repBefore: _repBefore, infectPct: null})>>With a heavy heart, you arrange the sale of some of your family's land in the countryside. The proceeds are just enough to satisfy your creditors. The loss of property is a stain on your family's honor, but at least you are free of debt. <<storyline-return>><</replace>><</link>> | <<link "Refuse">><<replace "#debt-sell">>You refuse to sell your family's birthright. <<debt-prison-commit>><</replace>><</link>>
</span>
<<else>>
<span id="debt-sell">Your creditors are losing patience. However, you still have enough standing that a desperate measure might save you: you could sell all the clothes and household goods you can spare to pay off your debts. You'd be left with barely more than the clothes on your back, but it would be better than the Fleet.<br><br>
<<link "Sell everything you can">><<replace "#debt-sell">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 2, 0, 10)>><<set $money to 0>><<set $creditorWaitCount to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": Sold household goods to pay off debts", money: 0, repDelta: -2, repBefore: _repBefore, infectPct: null})>>You strip your home of everything you can bear to part with — spare clothing, linens, pewter, even your good shoes — and sell it all. The proceeds are just enough to satisfy your creditors. It is humiliating, but at least you are free of debt. <<storyline-return>><</replace>><</link>> | <<link "Refuse">><<replace "#debt-sell">>You refuse to sell your belongings. <<debt-prison-commit>><</replace>><</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
/* Navy option for eligible PCs (male, 16-59, beggars/day labourers/artisans/merchants) */
<<widget "debt-navy-option">><<nobr>>
<span id="navy-debtor">As you are being led to the Fleet, a Navy recruiter stops the guards. He looks you up and down and offers you a deal: volunteer for His Majesty's Navy and your debts will be forgiven. <<income>><<set _navyBonus to $income * 2>>You'll even earn <<print _navyBonus>>d. as a signing bonus—two months' pay.<br><br>
<<link "Volunteer for the Navy">><<replace "#navy-debtor">><<income>><<set _navyBonus to $income * 2>><<set $money += _navyBonus>><<set $decisions.push({text: $timeline[$monthIndex] + ": Volunteered for the Navy to escape debtor's prison", money: _navyBonus, repDelta: 0, repBefore: $reputation, infectPct: null})>>You accept the recruiter's offer. Your debts are forgiven and you pocket the signing bonus. You have enlisted on [[HMS Royal Sovereign->navy-volunteer]]<</replace>><</link>> | <<link "Refuse">><<replace "#navy-debtor">><<set $decisions.push({text: $timeline[$monthIndex] + ": Refused Navy recruitment", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>You refuse the recruiter's offer. You are committed to the Fleet. <<pc-prison-impressment true "refused">><</replace>><</link>></span>
<</nobr>><</widget>>
/* Navy NPC substitute option — find an eligible male NPC aged 16-59 (not noble) to send to the Navy */
<<widget "debt-navy-npc-option">><<nobr>>
<<set _navyNPCIdx to -1>>
<<set _navyNPCName to "">>
<<set _navyNPCRel to "">>
/* Skip NPC search if servant was just dismissed — treat as household of one */
<<if not _servantDismissed>>
<<for _ni to 0; _ni lt $NPCs.length; _ni++>>
<<if _navyNPCIdx is -1 and $NPCs[_ni].health isnot "deceased" and $NPCs[_ni].health isnot "deceased-pq">>
<<if $NPCs[_ni].gender is "male" and $NPCs[_ni].agenum gte 16 and $NPCs[_ni].agenum lte 59 and not $NPCs[_ni].disability>>
<<if $NPCs[_ni].relationship isnot "landlord" and $NPCs[_ni].relationship isnot "master">>
<<set _navyNPCIdx to _ni>>
<<set _navyNPCName to $NPCs[_ni].name>>
<<set _navyNPCRel to $NPCs[_ni].relationship>>
<</if>>
<</if>>
<</if>>
<</for>>
<</if>>
<<if _navyNPCIdx isnot -1>>
<span id="navy-npc-debtor">As you face the prospect of the Fleet, a Navy recruiter offers a way out: if your _navyNPCRel, _navyNPCName, volunteers for His Majesty's Navy, your household's debts will be forgiven.<br><br>
<<link "Send him to the Navy">><<replace "#navy-npc-debtor">><<set $money to 0>><<set $creditorWaitCount to 0>><<if $NPCs[_navyNPCIdx].health is "safe from harm">><<set $NPCs[_navyNPCIdx].health to "healthy">><<set $NPCs[_navyNPCIdx].location to $location>><</if>><<set $NPCsExtended.push($NPCs[_navyNPCIdx])>><<set $NPCs.splice(_navyNPCIdx, 1)>><<NPCpronouns>><<set-hoh>><<set $decisions.push({text: $timeline[$monthIndex] + ": Sent " + _navyNPCName + " to the Navy to clear debts", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>With a heavy heart, you watch _navyNPCName march away with the recruiter. Your debts are forgiven, but the cost to your family is great. <<storyline-return "You pray for his safe return.">><</replace>><</link>> | <<link "Refuse">><<replace "#navy-npc-debtor">>You cannot bear to send _navyNPCName away. You are committed to the Fleet. <<pc-prison-impressment false>><</replace>><</link>></span>
<<else>>
You are committed to the Fleet. <<pc-prison-impressment>>
<</if>>
<</nobr>><</widget>>
/* Commit player to prison — used as fallback when sell option is refused */
<<widget "debt-prison-commit">><<nobr>>
<<if $disability is 0 and $gender is "male" and $agenum gte 16 and $agenum lte 59 and ($socio is "beggars" or $socio is "day labourers" or $socio is "artisans" or $socio is "merchants")>><<debt-navy-option>><<else>><<debt-navy-npc-option>>
<</if>>
<</nobr>><</widget>>
/* Debtor's prison monthly check — called from PassageHeader each month while $inDebtorsPrison is 1 */
<<widget "debtor-prison-check">><<nobr>>
<<if $debtorPrisonCount gte 2>>
/* Second+ time in prison: permanent imprisonment, no release */
<<set $debtorPrisonMonths += 1>>
<<if $debtorPrisonMonths is 1>>You languish in the Fleet with no prospect of release. No relative comes to your rescue this time, and your creditors show no mercy.<br><br><</if>>
<<else>>
/* Recalculate debt ceiling */
<<calculate-ceiling>>
<<if not _debtExceeded>>
/* Debt has improved enough — automatic release */
<<set $inDebtorsPrison to 0>>
<<set $debtorPrisonMonths to 0>>
<<set $creditorWaitCount to 0>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Released from debtor's prison (debts reduced)", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>
Your debts have been reduced enough that your creditors have agreed to release you from the Fleet. You return home, chastened but free.<br><br>
<<else>>
<<set $debtorPrisonMonths += 1>>
<<if $debtorPrisonMonths gte 3>>
/* After 3 months, a distant relative dies and leaves a bequest */
<<set $inDebtorsPrison to 0>>
<<set $debtorPrisonMonths to 0>>
<<set $creditorWaitCount to 0>>
<<set _repBefore to $reputation>>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
<<set $money to 0>>
<<set _relType to either("uncle", "aunt", "cousin")>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Released from prison via inheritance from deceased " + _relType, money: 0, repDelta: -1, repBefore: _repBefore, infectPct: null})>>
Word reaches you in prison that a distant _relType has died. To your astonishment, the bequest is just enough to settle your debts. Your creditors accept the payment and you are released from the Fleet. You emerge into the daylight, thinner and humbled, but free. <<set $reputation to Math.clamp($reputation, 0, 10)>><br><br>
<</if>>
<</if>>
<</if>>
<</nobr>><</widget>>
/* cancel subscriptions if in debt */
<<widget "debt-check">><<nobr>>
<<if $money lt 0 and $debtWarned is 0>>
<<set $debtWarned to 1>>
<<set _debtCancelled to []>>
<<if $skipServices is 1>>
<<set $skipServices to 0>>
<<set $debtForcedAttend to 1>>
<</if>>
You have fallen into debt and can no longer afford the monthly recusancy fines for skipping Church of England services. It's time for you to reconsider attending your parish church.
<br><br>
<</if>>
<</nobr>><</widget>>
/* break quarantine if run out of funds */
<<widget "quarantine-debt-check">><<nobr>>
<<if $money lt 0>>
<<calculate-ceiling>>
<<if _debtExceeded and $playerPlagueStatus isnot "infected" and $playerPlagueStatus isnot "recovered">>
<br><br><span id="break-quarantine">You are running desperately low on money. With no income coming in, your debts are mounting. Do you risk breaking quarantine to earn some money?<br><br>
<<link "Yes">><<replace "#break-quarantine">>There's no reason for you to be shut up in your house when you are healthy and willing to work. You decide to risk sneaking out one day while the warder is distracted handing off his guard duties to the next man coming on duty.
<<if random(1,2) is 1>>
Unfortunately, you are caught and have to bribe the warders with a shilling before they will agree not to report you.
<<set _repBefore to $reputation>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Caught breaking quarantine", money: -12, repDelta: -1, repBefore: _repBefore, infectPct: null})>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $money -= 12>>
<<else>>
<<income>>
<<set _qHalfIncome to Math.round($income / 2)>>
<<set $money += _qHalfIncome>>
You successfully evaded the warder outside your house and managed to do a little work before sneaking back home again. It isn't much, but it should help stave off your creditors.
<<set $decisions.push({text: $timeline[$monthIndex] + ": Broke quarantine for income", money: _qHalfIncome, repDelta: 0, repBefore: $reputation, infectPct: null})>>
<</if>>
<</replace>><</link>> | <<link "No">><<replace "#break-quarantine">>While you are tempted to sneak out, you can't bear the thought of betraying your neighbors by deliberately exposing them to plague. You tighten your belt and pray your creditors will be patient.<</replace>><</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
/* pc-prison-impressment — commits the PC to debtor's prison with an
infection roll and a chance of Navy impressment.
_args[0] = strip office (boolean, optional, default true)
_args[1] = "refused" to include flavor text about having just refused
to volunteer (optional)
Sets $inDebtorsPrison, $debtorPrisonMonths, $debtorPrisonCount,
$plagueInfection. May set $impressed and link to the impressed passage. */
<<widget "pc-prison-impressment">><<nobr>>
<<set _stripOffice to (typeof _args[0] !== 'undefined') ? _args[0] : true>>
<<set _refusedVolunteer to (_args.length gt 1 and _args[1] is "refused")>>
<<if _stripOffice and $office isnot "">>Because of this disgrace, the vestry of $parish removes you from your position as $office. <<set $office to "">><</if>><<set $inDebtorsPrison to 1>><<set $debtorPrisonMonths to 0>><<set $debtorPrisonCount += 1>><<set $plagueInfection to random(0,1)>><<if $socio isnot "nobles" and $gender is "male" and $agenum gte 15 and $agenum lte 55 and random(1,2) is 1>><<set $inDebtorsPrison to 0>><<set $impressed += 1>><<set $decisions.push({text: $timeline[$monthIndex] + ": Impressed from debtor's prison into the Navy", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>However, you have barely arrived when a Navy recruiter comes through looking for able-bodied men. <<if _refusedVolunteer>>Despite having just refused to volunteer, you have no choice in the matter. <</if>>Your debts remain, but you are no longer in the Fleet — you have been [[impressed into His Majesty's Navy->impressed]].<<else>>You are forced to reside there until you reduce your debts. <<storyline-return "You hope it won't take long." 1 0 -2>><</if>>
<</nobr>><</widget>><<nobr>><<set $quarantine to 1>><<quarantine-costs>><<check-NPCs>><span id="plague-replace">Your neighbors shut up the entrances to your house and paint a red cross with the words //Lord Have Mercy// on the front door.<br><br>
You are desperate to save the sick but don't know what will actually work.
<br>
<<hh-treatments>>
<<link "You tend to the sick and suffering.">><<replace "#plague-replace">>
<<silently>>
/* Check if player has used a helpful remedy to decrease chance of death */
<<for _s range _infectedFamily>>
<<if _remedyEffect is 1 and random(1,3) is 1>>
<<set $NPCs[_s].health to "deceased1">>
<<elseif _remedyEffect is 0 and random(1,2) is 1>>
<<set $NPCs[_s].health to "deceased1">>
<<else>>
<<set $NPCs[_s].health to "recovered1">>
<</if>>
<</for>>
/* Check for family members who died or recovered */
<<set _deceased = []>>
<<set _recovered = []>>
<<for _d, _household range $NPCs>>
<<if _household.health is "deceased1">><<set _deceased.push(_d)>>
<</if>>
<<if _household.health is "recovered1">><<set _recovered.push(_d)>>
<</if>>
<</for>>
/* Check for fumigants to prevent spread to household */
<<for _i = 0; _i < $NPCs.length; _i++>>
<<if $NPCs[_i].health is "healthy">>
<<if $fumes.Fancy.quantity gt 0 or $fumes.Generic.quantity gt 0 or $fumes.Incense.quantity gt 0 or $fumes.Purse.quantity gt 0>>
<<if random(1,4) is 1>><<set $NPCs[_i].health to "infected">>
<</if>>
<<else>>
<<if random(1,2) is 1>><<set $NPCs[_i].health to "infected">>
<</if>>
<</if>>
<</if>>
<</for>>
/* Check for fumigants to prevent spread to servants */
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "healthy">>
<<if $fumes.Fancy.quantity gt 0 or $fumes.Generic.quantity gt 0 or $fumes.Incense.quantity gt 0 or $fumes.Purse.quantity gt 0>>
<<if random(1,4) is 1>><<set $NPCsServants[_si].health to "infected">><</if>>
<<else>>
<<if random(1,2) is 1>><<set $NPCsServants[_si].health to "infected">><</if>>
<</if>>
<</if>>
<</for>>
/* check for fumigants to prevent spread to player */
<<if $plagueInfection is 0>>
<<if $fumes.Fancy.quantity gt 0 or $fumes.Generic.quantity gt 0 or $fumes.Incense.quantity gt 0 or $fumes.Purse.quantity gt 0>>
<<if random(1,4) is 1>><<set $plagueInfection to 1>>
<</if>>
<<else>>
<<if random(1,2) is 1>><<set $plagueInfection to 1>>
<</if>>
<</if>>
<</if>>
<</silently>>
/* reveal which family members have died or survived*/
<<if _deceased.length gt 0>>The week is full of sorrows. Despite your care, your
<<for _x, _d range _deceased>>
<<if _deceased.length eq 1>><<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name has died.
<<elseif _x < _deceased.length - 1>><<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name,
<<else>>and <<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name have died.
<</if>>
<</for>>
<br><br>
<</if>>
/* show which family members recovered */
<<if _recovered.length gt 0>><<if _deceased.length gt 0>>There is some good news, though.<</if>> The treatments seem to be helping, and your
<<for _r, _d range _recovered>>
<<if _recovered.length eq 1>><<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name has started to recover from their illness.<br><br>
<<elseif _r < _recovered.length - 1>><<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name
<<else>>and <<npc-rel-label $NPCs[_d].relationship>>, $NPCs[_d].name have started to recover from their illness.<br><br>
<</if>>
<</for>>
<</if>>
<<smuggle-children>>
You must remain in <<defQuarantine "quarantine">> for at least three more weeks, however, and only time will tell if the disease has spread.
<br><br><<health-update>>
/* Check if player was infected, send to next passage depending */
<<if $plagueInfection is 1>>[[You pray that God does have mercy on your household as you continue to nurse the sick.->Sickness]]
<<else>>[[You pray that God does have mercy on your household as you continue to nurse the sick.->Quarantine Continues]]
<</if>>
<<fumigant>>
<</replace>>
<</link>>
</span>
<</nobr>><<nobr>><<set $quarantine to $quarantine + 1>>
<<quarantine-costs>>
/* check if any family members were infected the previous week */
<<silently>>
<<set _deceased = []>>
<<set _recovered = []>>
<<check-NPCs>>
/* Set dynamic health suffixes based on quarantine week */
<<set _deathState to "deceased" + $quarantine>>
<<set _recoverState to "recovered" + $quarantine>>
<</silently>>
/* Flavor text based on quarantine week */
<<if $quarantine is 2>>The first week was agony. The second is no better.<br><br><<elseif $quarantine is 3>>As you enter the third week of <<defQuarantine "quarantine">>, even the smallest glimmer of hope is a welcome relief.<br><br><<elseif $quarantine is 4>>After nearly a month in <<defQuarantine "quarantine">>, you begin to believe you might survive this.<br><br><<elseif $quarantine is 5>>You have now been in <<defQuarantine "quarantine">> for over a month, and there is no sign that the <<defPlague "plague">>'s spread is slowing. <<if $plagueInfection is 0>>It seems a miracle that you have not fallen ill yourself.<</if>><br><br><<else>>You have been in <<defQuarantine "quarantine">> so long, you've lost track of time. The days are interminable.<br><br><</if>>
<<if _infectedFamily.length eq 0>>
/* No new infections branch */
<<if $quarantine lt 4>><<if $quarantine is 3>>While the recovery process is slow for those who were ill, the infection does not seem to have spread any further. You must remain in <<defQuarantine "quarantine">>, and [[only time will tell if the disease has spread.->Quarantine Continues]]<<else>>You must remain in <<defQuarantine "quarantine">> for at least two more weeks, and [[only time will tell if the disease has spread.->Quarantine Continues]]<</if>>
<<else>>The infection seems to have burned itself out, and you can now focus on the recovery of those who survived.<br><br>
<<if $plagueInfection is 1>>[[You wonder what has happened while you were away from the world.->Sickness]]<<else>>[[You wonder what has happened while you were away from the world.->Reconnecting]]<</if>>
<</if>>
<<health-update>>
<<fumigant>>
<<else>>
/* Infected family members branch */
<<if $quarantine gte 4>>Unfortunately, even more members of your household have fallen ill. Your <<else>>The illness has spread through your household and your <</if>>
<<for _z, _y range _infectedFamily>>
<<if _infectedFamily.length eq 1>><<npc-rel-label $NPCs[_y].relationship>> $NPCs[_y].name is now infected.<br>
<<elseif _z < _infectedFamily.length - 1>><<npc-rel-label $NPCs[_y].relationship>> $NPCs[_y].name, <<else>>and <<npc-rel-label $NPCs[_y].relationship>> $NPCs[_y].name are now infected.
<</if>>
<</for>>
/* call in widget showing treatment options if family members are infected */
<<hh-treatments>>
<<linkappend "You tend to the sick and suffering.">><br><br>
<<silently>>
<<fumigant-check>>
/* Check if player has used a helpful remedy to decrease chance of death */
<<for _s range _infectedFamily>>
<<if _remedyEffect is 1 and random(1,3) is 1>><<set $NPCs[_s].health to _deathState>>
<<elseif _remedyEffect is 0 and random(1,2) is 1>><<set $NPCs[_s].health to _deathState>>
<<else>><<set $NPCs[_s].health to _recoverState>>
<</if>>
<</for>>
/* Check for family members who died or recovered */
<<for _d, _household range $NPCs>>
<<if _household.health is _deathState>><<set _deceased.push(_d)>><</if>>
<<if _household.health is _recoverState>><<set _recovered.push(_d)>><</if>>
<</for>>
/* Check for fumigants to prevent spread to household */
<<for _i = 0; _i < $NPCs.length; _i++>>
<<if $NPCs[_i].health is "healthy">>
<<if _fumes gt 0 and random(1,4) eq 1>><<set $NPCs[_i].health to "infected">>
<<elseif _fumes lt 1 and random(1,2) eq 1>><<set $NPCs[_i].health to "infected">>
<</if>>
<</if>>
<</for>>
/* Check for fumigants to prevent spread to servants */
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "healthy">>
<<if _fumes gt 0 and random(1,4) eq 1>><<set $NPCsServants[_si].health to "infected">>
<<elseif _fumes lt 1 and random(1,2) eq 1>><<set $NPCsServants[_si].health to "infected">>
<</if>>
<</if>>
<</for>>
/* check for fumigants to prevent spread to player */
<<if $plagueInfection is 0>>
<<if _fumes gt 0 and random(1,4) is 1>><<set $plagueInfection to 1>>
<<elseif _fumes lt 1 and random(1,2) is 1>><<set $plagueInfection to 1>>
<</if>>
<</if>>
<</silently>>
/* reveal which family members have died or survived */
<<if _deceased.length gt 0>>Despite your care, your
<<for _x, _d range _deceased>>
<<if _deceased.length eq 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name has died.<<elseif _x < _deceased.length - 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name,<<else>> and <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name have died.
<</if>>
<</for>>
<br><br>
<</if>>
/* show which family members recovered */
<<if _recovered.length gt 0>>
<<if _deceased.length gt 0>>There is some good news, though. <</if>>The treatments seem to be helping, and your
<<for _r, _d range _recovered>>
<<if _recovered.length eq 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name has started to recover from their illness.<<elseif _r < _recovered.length - 1>> <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name<<else>> and <<npc-rel-label $NPCs[_d].relationship>> $NPCs[_d].name have started to recover from their illness.
<</if>>
<</for>>
<br><br>
<</if>>
/* Remaining quarantine text for early weeks */
<<if $quarantine is 2>>You must remain in <<defQuarantine "quarantine">> for at least two more weeks, however, and only time will tell if the disease has spread.
<<elseif $quarantine is 3>>You wonder what has been taking place in the outside world and hope for even a small bit of news as you enter the final weeks of quarantine.
<</if>>
/* Check if player or additional family were infected, route to next passage */
<<silently>><<unset _infectedFamily>><<unset _household>>
<<check-NPCs>><</silently>>
<<if $plagueInfection is 1>><<if $quarantine is 2>>[[You fear more of your family will die. You are even more afraid you will fall ill next.->Sickness]]<<elseif $quarantine is 3>>[[The days continue to pass with agonizing slowness.->Sickness]]<<else>>[[You wonder what has happened while you were away from the world.->Sickness]]<</if>>
<<elseif $quarantine lt 4>><<if $quarantine is 2>>[[You fear more of your family will die. You are even more afraid you will fall ill next.->Quarantine Continues]]<<else>>[[The days continue to pass with agonizing slowness.->Quarantine Continues]]<</if>>
<<elseif _infectedFamily.length gt 0>>[[You wonder what has happened while you were away from the world.->Quarantine Continues]]
<<else>>[[You wonder what has happened while you were away from the world.->Reconnecting]]
<</if>>
<<fumigant>>
<<health-update>>
<</linkappend>>
<</if>>
<</nobr>>
/* preferment-offer — fires when a noble seeking preferment at court receives
an offer for a position. The player can accept (paying 2400 gratuity + 2400
purchase price = 4800 total) or decline and keep searching.
Guard: if the noble fled to the countryside (not following the court),
no offer should appear until February 1666 (monthIndex >= 11). */
<<widget "preferment-offer">><<nobr>>
<<if $seekingPreferment is 1>>
All your hard work in making friends at Court has paid off. The Earl of Clarendon writes to inform you that a <<if $gender is "male">>clerkship<<else>>position in the queen's household<</if>> has come open. Like many such positions, you can hire someone to do the actual work while you retain the honor and the income of your new office. He is willing to help you secure this position—for a price, of course.
<br><br>
<span id="preferment-offer">
<<set _repBefore to $reputation>>
<<if $money gte 4800>>
Do you wish to accept the position?
<<link "Yes">><<replace "#preferment-offer">><<set $seekingPreferment to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": Accepted a court position as " + _position, money: -4800, repDelta: 1, repBefore: _repBefore, infectPct: null})>>You are delighted to be appointed to a new position at Court and hope it will help <<storyline-return "advance both your own and your family's fortunes." 0 -4800 1>><</replace>><</link>> | <<link "No">><<replace "#preferment-offer">><<set $decisions.push({text: $timeline[$monthIndex] + ": Declined a court position", money: 0, repDelta: 0, repBefore: _repBefore, infectPct: null})>>You decide you aren't ready to take up a position at Court at this moment but <<storyline-return "will continue to seek preferment." 0>><</replace>><</link>> | <<link "No and stop seeking preferment">><<replace "#preferment-offer">><<set $seekingPreferment to 0>><<set $decisions.push({text: $timeline[$monthIndex] + ": Stopped seeking preferment at court", money: 0, repDelta: 0, repBefore: _repBefore, infectPct: null})>>You decide that now is not a good time to be seeking preferment at Court and that you should instead focus on your <<storyline-return "current affairs in London and your estate in the countryside." 0>><</replace>><</link>>
<<else>>
Unfortunately, you cannot currently afford the necessary payments to secure the position. The Earl immediately offers it to someone else but sends you a letter of encouragement to let you know he will remember you again in the future when you have perhapds <<storyline-return "increased your savings." 0>>
<</if>>
</span>
<</if>>
<</nobr>><</widget>><<widget "death-announcement">><<nobr>>
<<if hasVisited("May 1666")>>
<<if $reputation lte 2>>You died with such a poor reputation that most of your neighbors didn't care. The rest of them probably cursed your name and hoped you were suffering in hell. Luckily,
<<else>>You died with a good enough reputation that your neighbors say prayers for your soul. Because of the <<defPlague "plague">> ordinances, none of your neighbors could attend your funeral but
<</if>>
<<if $socio is "nobles">>as a member of the nobility, you were interred in a position of honor in a vault within your family's private chapel.
<<elseif $socio is "merchants">>you were rich enough to be buried within the walls of your <<defParish "parish">> churchyard. Your heirs, of course, paid extremely well for that privilege.
<<elseif $socio is "artisans">>your body was at least carefully wrapped in a burial shroud before being put into the communal plague pits, late at night with no one to witness your burial.
<<else>>your body was at least put into the communal plague pits, instead of being left out to rot.<</if>>
<<else>>
<<if $reputation gte 3>>
You died with a good enough reputation that your neighbors say prayers for your soul.
<<if $socio is "nobles">>As a member of the nobility, you were interred in a position of honor in a vault within your family's private chapel.
<<elseif $socio is "merchants">>You were rich enough to be buried within the walls of your <<defParish "parish">> churchyard. Your heirs, of course, paid extremely well for that privilege.
<<elseif $socio is "artisans">>Your body was carefully wrapped in a burial shroud and buried on the ground of your <<defParish "parish">> churchyard.
<<else>>Your body was buried in your <<defParish "parish">> churchyard.
<</if>>
<<else>>You died with such a poor reputation that most of your neighbors didn't care. The rest of them probably cursed your name and hoped you were suffering in hell.
<</if>>
<</if>>
<br><br>
<<if $religion is "Catholic">>As a God-fearing Catholic, you know you are destined to spend time in purgatory before you can ascend to heaven but you hope that will not take too long<<if $reputation lte 2>>, despite your poor reputation on earth.<</if>><<else>>As a good Protestant, you know that Christ the Redeemer has died for you and your admittance to heaven is guaranteed.<</if>><br><br>
[[How typical was your experience of the Great Plague of London? Let's find out!->stats]]
<</nobr>><</widget>>
/* calculate-ceiling — computes the debt ceiling and whether debt exceeds it.
Sets: _debtCeiling (negative number), _debtExceeded (boolean).
Calls <<income>> and <<expenses>> for non-beggar/non-child-servant classes. */
<<widget "calculate-ceiling">><<silently>>
<<if $socio is "beggars">>
<<set _debtCeiling to -60>>
<<elseif $socio is "servants" and ($age is "child" or $age is "adolescent")>>
<<set _debtCeiling to -60>>
<<else>><<income>><<expenses>><<set _debtCeiling to ($income) * -1>>
<</if>>
<<set _debtExceeded to false>>
<<if $socio is "nobles" and $money lte (_debtCeiling * 4)>><<set _debtExceeded to true>>
<<elseif ($socio is "artisans" or $socio is "merchants") and $money lte (_debtCeiling * 3)>><<set _debtExceeded to true>>
<<elseif $money lte (_debtCeiling * 2)>><<set _debtExceeded to true>>
<</if>>
<</silently>><</widget>>
<<nobr>>
/* flight failure due to plague infection */
<<set _fleeInfected to false>>
<<if $plagueInfection eq 1>><<set _fleeInfected to true>><</if>>
<<silently>><<check-NPCs>><<set _hasInfectedNPC to (_infectedFamily.length + _infectedServants.length) gt 0>><</silently>>
<<if _fleeInfected>>You prepare to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. You will leave tomorrow. <<sickPC>>
<<elseif _hasInfectedNPC>>You prepare your household to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. They will leave tomorrow.<br><br><<sickFam>>
<<else>>
/* successful flight */
<<set $fledFromIndex to $monthIndex>>
<<if $office isnot "">>
You have abandoned $parish and been removed from your position as $office.
<<set $office to "">>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
<br><br>
<</if>>
<<if $socio is "nobles">>You<<if $agenum lte 15>> convince your family to<<else>> have decided to<</if>> flee to your country estate.
<<elseif $socio is "servants">>Your $masterTitle flees London with you and the rest of <<if $masterGender is "female">>her<<else>>his<</if>> <<defHousehold "household">>.
<<elseif $socio is "beggars" and $fled is 2>>You<<if $agenum lte 15>> convince your family <<else>> decide <</if>>to flee the city to save yourself. Unfortunately, with no money and no reputation to speak of anymore, you only have the option of illegally begging along the road to survive./*note this conditional includes servants who flee their masters*/
<<else>>You decide to flee the city.<</if>> From the safety of <<if $origin isnot "London">>$origin<<else>>the countryside<</if>>, you closely follow the news of London's <<defPlague "plague">> outbreak. As the death toll rises, you worry about the people you know back in the city but are relieved that you are out of harm's way.<br><br>
In fact, you<<if $socio is "servants">>r $masterTitle is<<else>><<if $agenum lte 15>> and your family<</if>> are<</if>> determined to stay away at least:
<ul>
<<if $fledFromIndex lt 7>><li>[[until the end of the summer, when plague death should start coming down again->stay-away sequence][$fledReturn to "summer"]]</li><</if>>
<<if $fledFromIndex lt 9>><li>[[until the winter, when plague typically goes away->stay-away sequence][$fledReturn to "winter"]]</li><</if>>
<<if $fledFromIndex lt 11>><li>[[until the King and his court decide it's safe to return to the city->stay-away sequence][$fledReturn to "court-return"]]</li><</if>>
<<if $fledFromIndex lt 21>><li>[[until the official Day of Thanksgiving for the end of the plague outbreak->stay-away sequence][$fledReturn to "official-end"]]</li>
<li>[[until there are no more plague deaths in London->stay-away sequence][$fledReturn to "official-end"]]</li><</if>>
<li>[[for good->go quietly]]</li>
</ul>
<</if>> /* end infection guard */
<</nobr>>/* global flee choice widget */
<<widget "flee-choice">><<nobr>>
/* set initial/late flight context, find caretaker, calculate one-time flee cost */
<<set _ctx to $args[0]>><<set-caretaker>><<income>>
/* Servants */
<<if $socio is "servants">>
<<if _ctx is "initial">>
Your $masterTitle decides to <<if random(1,2) is 1>><<set _masterflee to 1>>flee<<else>><<set _masterflee to 0>>stay<</if>>.
<br><br>
<<if $hoh isnot 3 and _masterflee is 1>>Because you do not live in your $masterTitle's household, you are left behind when they flee. You help pack and then head home, hoping you will be able to <<link "survive as a day labourer." "Stay"><<leave-service>><<for _smi = 0; _smi < $NPCsMaster.length; _smi++>><<if $NPCsMaster[_smi].health isnot "deceased" and $NPCsMaster[_smi].health isnot "deceased-pq">><<set $NPCsMaster[_smi].health to "safe from harm">><<set $NPCsMaster[_smi].location to "the countryside">><</if>><</for>><<set $fled to 4>><<set $socio to "day labourers">><<record-decision "Left behind by fleeing master" 0 0>><</link>>
<<else>>
As a member of your $masterTitle's household, your only choices are to follow <<if $masterGender is "female">>her<<else>>his<</if>> lead <<if _masterflee is 0>>and remain in the city, or to run away<<else>>and flee the city, or to stay in the city<</if>> and hope you are not caught for having broken your contract.<br><br>
You decide to:
<<if _masterflee is 1>>
<ul>
<li><<link `"Follow your " + $masterTitle + "'s lead and leave the city"` "Flight">><<set $fled to 1>><<record-decision `"Fled the city with " + $masterTitle` 0 0>><</link>></li>
<<if $servantPromotion is 0>><li><<link "Break your contract and remain in the city" "Stay">><<set $fled to 3>><<set $socio to "beggars">><<leave-service>><<record-decision "Broke contract and stayed in the city" 0 -2>><</link>></li><</if>>
</ul>
<<else>>
<ul>
<li><<link `"Remain in the city with your " + $masterTitle` "Stay">><<set $fled to 0>><<record-decision `"Stayed in the city with " + $masterTitle` 0 0>><</link>></li>
<<if $servantPromotion is 0>><li><<link "Break your contract and flee the city" "Flight">><<set $fled to 2>><<set $socio to "beggars">><<set $money -= $income>><<leave-service>><<record-decision "Broke contract and fled the city" (-$income) -2>><</link>></li><</if>>
</ul>
<</if>><</if>>
<<else>>/* late context for servants */
<<if $servantPromotion is 0>>
It's not too late to
<ul><li><<link "Break your contract and flee the city" "Flight">><<set $fled to 2>><<set $socio to "beggars">><<set $money -= $income>><<leave-service>><<record-decision "Broke contract and fled the city" (-$income) -2>><</link>></li></ul>
<<else>> As an apprentice, you must follow your $masterTitle's decisions.<</if>>
<</if>><</if>>
/* Day Labourers and Beggars */
<<if $socio is "day labourers" or $socio is "beggars">>
<<if _ctx is "initial">>
<<if $origin isnot "London">> You still have family back home in $origin and have to consider whether or not to abandon your home and whatever possessions you cannot carry to take refuge with your family.<<else>> If you abandon your home and whatever possessions you cannot carry, you <<if $socio is "beggars">>can go to be a beggar <<else>>should be able to find work <</if>>in some other city.<</if>><br><br>
<<decision-time>>
<<else>>
It's not too late to flee <<if $origin isnot "London">>back to $origin<<else>>to some other city<</if>>.<br><br>
<<decision-time>>
<</if>>
<</if>>
/* Artisans */
<<if $socio is "artisans">>
<<if _ctx is "initial">>
Your neighbors have begun to flee the city. Many are <<if $origin isnot "London">>returning to their family in $origin <</if>> or finding refuge with friends in the countryside and small towns surrounding London. Not everyone is leaving though. Some remain behind to seek profit or advancement, while sending the rest of their <<defHousehold "households">> to safety.
<br><br>
<<if $origin is "London" and $reputation lte 5>>While you do have a few friends nearby, they are unwilling to take you in. Maybe if you improved your reputation, you'll be able to convince someone to shelter you but until then you'll have to <<storyline-return "take your chances in London.">>
<<elseif $origin isnot "London">>You still have family in $origin<<else>>You have several friends in the countryside<</if>> who would take you in if you wanted to flee.<br><br>
<<decision-time>>
<<else>>
<<if $origin is "London" and $reputation lte 5>>While you do have a few friends nearby, they are unwilling to take you in. Maybe if you improved your reputation, you'll be able to convince someone to shelter you but until then you'll have to <<storyline-return "take your chances in London.">>
<<else>>
It's not too late for you to flee.
<br><br>
<<decision-time>>
<</if>><</if>><</if>>
/* Merchants and Nobles */
<<if $socio is "merchants" or $socio is "nobles">>
<<if _ctx is "initial">>
Your neighbors have begun to flee the city. Many are <<if $socio is "nobles">>returning to their country homes or else <</if>>renting houses in the countryside and small towns surrounding London. Not everyone is leaving though. Some remain behind to seek profit or advancement, while sending the rest of their <<defHousehold "households">> to safety.
<br><br>
<<else>>/* late context for merchants and nobles */
It's not too late for you to flee.
<br><br>
<</if>>
<<decision-time>>
<</if>>
<</nobr>><</widget>>
<<widget "decision-time">><<nobr>>
/* need to check <<if $NPCs.length gt 0>> to have a household or <<if $NPCs.length gt 1>> if have caretaker + household */
You <<if $hoh is 1>>decide <<else>>convince your $caretakerLabel <</if>>to:
<ul>
<<if $fled isnot 5>><li><<link "remain in the city with your entire household" "Stay">>
<<set $fled to 4>>
<<record-decision "Remained in the city with household" 0 0>>
<</link>></li>
<<if $socio isnot "beggars" or $origin isnot "London">>
<li><<link `"remain in the city" + ($hoh isnot 1 ? " with you" : "") + ", but send the rest of your household away"` "Stay">>
<<set $fled to 5>>
<<set $money -= $income>>
<<record-decision "Sent household away but stayed" (-$income) 0>>
<</link>></li>
<li><<link "flee the city with your entire household" "Flight">>
<<set $fled to 6>>
<<set $money -= $income>>
<<record-decision "Fled the city with household" (-$income) -1>>
<</link>></li>
<<if $socio is "nobles">><li><<link "follow the Court with your entire household" "stay-away sequence">>
<<set $fled to 6>>
<<set $followedCourt to 1>>
<<set $fledFromIndex to $monthIndex>>
<<set $money -= $income>>
<<set $fledReturn to "court-return">>
<<record-decision "Fled to follow the court" (-$income) -1>>
<</link>></li><</if>><</if>>
<<else>>
<li><<link "join the rest of your household" "Flight">><<set $fled to 6>><<set $money -= $income>><<record-decision "Fled to join household" (-$income) -1>><</link>></li>
<</if>>
</ul>
<</nobr>><</widget>>/* record-decision — captures $reputation before mutation, applies a
reputation change via Math.clamp(0, 10), and pushes the decision record
with the true repBefore and actual clamped repDelta.
Usage:
<<record-decision text moneyRecord repChange>>
<<record-decision text moneyRecord repChange infectPct>>
- text: decision description string
- moneyRecord: money amount to record (does NOT modify $money)
- repChange: intended reputation change (widget applies it)
- infectPct: infection percentage (optional, defaults to null) */
<<widget "record-decision">><<nobr>>
<<set _repBefore to $reputation>>
<<set $reputation to Math.clamp($reputation + _args[2], 0, 10)>>
<<set _infectVal to (typeof _args[3] !== 'undefined') ? _args[3] : null>>
<<set $decisions.push({text: _args[0], money: _args[1], repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _infectVal})>>
<</nobr>><</widget>><<widget "no-plague-yet">><<nobr>>
Luckily, there are no <<defPlague "plague">> cases in your <<defParish "parish">>... yet.
/* Beggar story */
<<if $socio is "beggars">>But your neighbors are no longer willing to give you food or money when you come begging to their doors.<br>
<<beggar-choice>>
<</if>>
/*Day Labourer*/
<<if $socio is "day labourers">>Many people are beginning to remove their goods to the countryside, though, which makes extra opportunities for you to earn money. <<if $gender is "male">>A man you've never met before offers you three times your normal wages to help haul his goods out of the city.<br>
Do you:<ul>
<li><<if random(1,2) eq 1>>[[decide to accept this generous offer.|impressed][$impressed += 1]]<<else>>[[decide to accept this generous offer.|June 1665][$money to Math.clamp($money + 720, -1000000, 1000000); $reputation to Math.clamp($reputation - 1, 0, 10)]]<</if>></li>
<li>[[choose to continue working for one of your regular customers instead.|June 1665]]</li>
</ul>
<</if>><<else>>You help one of your neighbors pack and they pay you with some of the food that would have otherwise spoiled on their journey.<</if>>
/* Servants */
<<if $socio is "servants">>You anxiously await your $masterTitle's decision about whether the <<defHousehold "household">> will flee or stay.
<</if>>
/* Artisans */
<<if $socio is "artisans">>You will soon need to decide if you want to flee or at least send the rest of your <<defHousehold "household">> away before things get worse.
<</if>>
/* Merchants */
<<if $socio is "merchants">>You will soon need to decide if you want to flee or at least send the rest of your <<defHousehold "household">> away before things get worse.
<</if>>
/* Nobles */
<<if $socio is "nobles">>You will soon need to decide if it is worth the risk of staying in London, near enough to visit the Court regularly, or if you or your <<defHousehold "household">> should flee before things get worse.
<</if>>
<</nobr>><</widget>><!-- SIDEBAR -->
<div id="sidebar">
<div class="sidebar-header">
<!-- EMPTY DIV -->
<div></div>
<!-- NAME OF YOUR GAME -->
<h1 class="story-title" data-passage="gameTitle"></h1>
<!-- MENU TOGGLE ICON -->
<div class="sidebar-toggle">
<span id="sidebar-toggle-icon" class="lnr lnr-menu-circle" style="color: white;"></span>
</div>
</div>
<!-- HISTORY BUTTONS THAT ALLOW USER TO GO BACKWARDS AND FORWARDS -->
<!-- COMMENT THESE OUT IF YOU DON'T WANT THEM IN YOUR GAME -->
<div class="sidebar-history-nav">
<span id="backwards-button" class="lnr lnr-arrow-left" style="color: white;"></span>
<span id="forwards-button" class="lnr lnr-arrow-right" style="color: white;"></span>
</div>
<div id="sidebar-body">
<!-- GAME LOGO IMAGE --><br>
<div class="story-logo" data-passage="storyLogo"></div>
<!-- AUTHOR NAME -->
<h2 class="story-author" data-passage="storyAuthor"></h2>
<nav class="sidebar-nav"><ul class="story-tools">
<li>
<span id="restart-button" class="lnr lnr-redo" style="color: white;"></span>
<span class="tooltiptext">Restart</span>
</li>
<!-- <li>
<span id="saves-button" class="lnr lnr-download" style="color: white;"></span>
<span class="tooltiptext">Saves</span>
</li> -->
<li>
<span id="settings-button" class="lnr lnr-cog" style="color: white;"></span>
<span class="tooltiptext">Settings</span>
</li>
</ul>
<ul class="story-menu" data-passage="storyMenu">
</ul>
</nav>
</div> <!-- SIDEBAR-BODY END TAG -->
</div> <!-- SIDEBAR END TAG -->
<div id="mystory" role="main">
<div id="passages">
<div id="passage-start" data-passage="start" class="passage">
</div>
</div>
</div><<widget "plague-work-choice">><<nobr>>One of the $parish churchwardens stops you after services one Sunday and offers to hire you on an ongoing basis. You would be one of the parish's <<if $reputation gte 6>><<if $gender is "female">>searchers of the dead. Your job would be to look at plague corpses and determine if they died of plague or some other cause of death<<else>>warders. Your job would be to stand guard outside shut up houses to prevent anyone from escaping<</if>><<else>><<if $gender is "female">>nurses. Your job would be to bring food, medicine, clean clothing, and anything else necessary to comfort the sick and the dying<<else>>corpsebearers. Your job would be to remove the dead from shut up house and take them to be buried<</if>><</if>>.<br><br>
<span id="plague-work-interaction">You decide to:
<ul>
<li><<link "accept the job">><<set $fled to 4>><<if $reputation gte 6>><<if $gender is "female">><<set $role to "searcher">><<record-decision "Accepted a plague work job" 0 0>><<else>><<set $role to "warder">><<record-decision "Accepted a plague work job" 0 -1>><</if>><<else>><<if $gender is "female">><<set $role to "nurse">><<else>><<set $role to "corpsebearer">><</if>><<record-decision "Accepted a plague work job" 0 0>><</if>><<replace "#plague-work-interaction">><<plague-work>>While you remain in the city, you can take measures to protect yourself<<if $NPCs.length gt 1>> and your household<</if>> from the <<defPlague "plague">>. You can pray for deliverance, use homemade remedies, or visit the <<defApothecary "Apothecary">>, who sells fumigants and medicines to prevent you from getting sick or to treat those who have fallen ill. Do you want to:<<preventative>><br><br>You know the plague will only worsen as the weather warms and <<storyline-return "summer advances.">><</replace>><</link>></li>
<li><<link "refuse the job">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $fled to 4>><<set $decisions.push({text: "Refused the plague work job", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<replace "#plague-work-interaction">>For now, there is steady work helping people prepare to leave the city, but you worry about what you will do once those who are able to flee have done so.<br><br>While you remain in the city, you can take measures to protect yourself<<if $NPCs.length gt 1>> and your household<</if>> from the <<defPlague "plague">>. You can pray for deliverance, use homemade remedies, or visit the <<defApothecary "Apothecary">>, who sells fumigants and medicines to prevent you from getting sick or to treat those who have fallen ill. Do you want to:<<preventative>><br><br>You know the plague will only worsen as the weather warms and <<storyline-return "summer advances.">><</replace>><</link>></li></ul></span>
<</nobr>><</widget>>
<<widget "plague-work">><<nobr>>
<<if $location is "inside the City walls">><<set _cwCrew to 2>><<else>><<set _cwCrew to random(4, 6)>><</if>>
<<if $role is "corpsebearer">>As a corpsebearer, every night, you and your fellow corpsebearer<<if _cwCrew gt 2>>s<</if>> must go round to the locked up houses of your <<defParish "parish">> and call for them to bring out their dead, while praying to God that you remain safe.
<br>
<div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/7/7a/Wilson_%22The_plague...%22%3B_a_corpses_bearer_Wellcome_L0016624.jpg" style="width:100%; height:auto;" alt="Engraving of a corpse bearer carrying away the dead"></a>
//R. Price - "A Corpse Bearer", 1655//
</div>
<<elseif $role is "searcher">>As a searcher, every time you and your fellow searcher<<if _cwCrew gt 2>>s<</if>> are called to someone's house to determine a cause of death, you pray to God to protect you. You are starting to have nightmares about seeing <<defBuboes "buboes">> and the tokens of <<defPlague "plague">> on your neighbors.
<br>
<div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/6/67/Plague_in_1665_%28BM_1875%2C0508.1513%29.jpg" style="width:100%; height:auto;" alt="Engraving of men loading plague victims onto a cart"></a>
//Nathaniel Parr - "Plague in 1665", 1747//
</div>
<<elseif $role is "nurse">>The <<defOverseersOfThePoor "Overseers of the Poor">> assign you to your first <<defPlague "plague">> patient to nurse. You must tend to the sick in their own homes, bringing them food, changing their linens, and applying what remedies you can. The work is grim and thankless, but someone must care for those whom God has afflicted.
<br>
<div style="float:right; max-width:50%; margin:0 0 0.5em 1em;">
<a href="https://iiif.wellcomecollection.org/image/ddddaws6/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/ddddaws6/full/1024%2C/0/default.jpg" style="width:100%; height:auto;" alt="Etching of a man consuming antidotes to the plague"></a>
//J. Franklin - "A Man Consuming Many Antidotes to the Plague", 1841//
</div>
<<elseif $role is "warder">>As a warder, you stand guard outside the locked up houses of your <<defParish "parish">>, making sure no one escapes their quarantine. A great red cross is painted on each door, with the words "Lord have mercy upon us" written above it. You must remain at your post day and night, listening to the pleas and cries of those locked within, and pray to God that the sickness does not reach you through the door.
<br>
<a href="https://iiif.wellcomecollection.org/image/wsbkbmqj/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/wsbkbmqj/full/1024%2C/0/default.jpg" width="50%" style="float:right; margin-left:10px; margin-bottom:10px;" alt="Illustration of a plague scene in London"></a>
//"A Plague Scene"//
<</if>>
<</nobr>><</widget>><a href="https://rrchnm.org/" target="_blank"><img src="https://avatars.githubusercontent.com/u/296531?s=280&v=4" height="50px" alt="Roy Rosenzweig Center for History and New Media logo"></a>Gaming
the Great PlagueRoy Rosenzweig
Center for History
and New Media<<nobr>><div class="status-box"><<if $reputation gte 9>><div class="rep-best">''Reputation:'' <br> a worthy soul</div><<elseif $reputation gte 6 and $reputation lte 8>><div class="rep-good">''Reputation:''<br>of good credit and quality</div><<elseif $reputation gte 3 and $reputation lte 5>><div class="rep-poor">''Reputation:''<br>bad credit is better than none</div><<elseif $reputation lte 2>><div class="rep-worst">''Reputation:''<br>a worthless and base rogue</div><</if>></div><br>
<div class="status-box"><div class="income"><<defDisposableIncome "Disposable Income">>:<br> /* @@#money; <<= $money>> @@ */ @@ #conversion; <<conversion>> @@</div></div>
<!-- PLACE LINKS TO YOUR MENU BELOW, BUT REMEMBER TO WRAP IN <LI> TAGS -->
<li><<link "Apothecary">>
<<run Dialog.setup("Apothecary", "apothecary"); Dialog.wiki(Story.get("Apothecary").text); Dialog.open()>>
<</link>></li>
<li><<link "Inventory">>
<<run Dialog.setup("Inventory", "inventory"); Dialog.wiki(Story.get("Inventory").text); Dialog.open()>>
<</link>></li>
<li><<link "Household Status">>
<<run Dialog.setup("Household", "household"); Dialog.wiki(Story.get("Household Status").text); Dialog.open()>>
<</link>></li>
<<if passage() isnot "FamPesthouse" and passage() isnot "Quarantine, Week 1" and passage() isnot "Quarantine Continues" and passage() isnot "sickPC" and passage() isnot "Hide" and passage() isnot "YouPesthouse" and passage() isnot "death">><<if (visited("May 1665") and not visited("November 1666") and $fled isnot 6 and $fled isnot 1 and $fled isnot 2) or $getaway.length gt 0>><li><<link "Flight">>
<<run Dialog.setup("Flight", "flight"); Dialog.wiki(Story.get("Flight Menu").text); Dialog.open()>>
<</link>></li><</if>><</if>>
<</nobr>><<widget "initDeathData">><<nobr>>
<<set $parishRate = {"St Alban Wood Street": [1000,1000,1000,335,251,24,23,42,251,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows Barking": [1000,1000,1000,1000,1000,29,14,18,94,1000,626,470,1000,940,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows Bread Street": [1000,1000,1000,1000,1000,109,62,109,437,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows the Great": [1000,1000,1000,1000,393,68,11,20,116,393,1000,983,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows Honey Lane": [1000,1000,1000,1000,1000,98,98,197,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows the Less": [1000,1000,1000,1000,313,34,11,18,134,470,157,313,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows Lombard Street": [1000,1000,1000,1000,393,16,15,49,1000,197,1000,1000,393,1000,1000,1000,1000,1000,1000,1000,1000,1000], "All Hallows Staining": [1000,1000,1000,1000,277,35,18,27,119,830,1000,1000,1000,1000,1000,1000,119,1000,1000,1000,1000,1000], "All Hallows London Wall": [1000,1000,1000,1000,127,17,15,31,120,677,406,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Alphage": [1000,1000,1000,1000,371,16,33,186,371,557,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Andrew Hubbard": [1000,1000,1000,1000,147,197,98,66,590,295,295,1000,1000,1000,1000,590,590,1000,1000,1000,1000,1000], "St Andrew Undershaft": [1000,1000,1000,1000,111,18,16,45,245,612,612,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Andrew Wardrobe": [1000,1000,1000,1000,442,17,12,45,253,442,885,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Anne Aldersgate": [1000,1000,1000,1000,1000,17,10,25,153,229,459,1000,1000,1000,1000,1000,1000,459,1000,1000,1000,1000], "St Ann Blackfriars": [1000,1000,1000,1000,96,19,10,19,112,353,530,1000,1000,1000,424,1000,1000,1000,1000,1000,1000,1000], "St Antholin": [1000,1000,1000,1000,1000,24,17,95,284,1000,1000,1000,1000,1000,1000,284,142,1000,1000,1000,1000,1000], "St Austin": [1000,1000,1000,1000,284,57,26,95,1000,1000,284,284,1000,1000,284,1000,1000,1000,1000,1000,1000,1000], "St Bartholomew Exchange": [1000,1000,1000,1000,1000,60,23,34,60,1000,481,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Benet Fink": [1000,1000,1000,317,1000,106,127,79,634,1000,634,634,634,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Benet Gracechurch": [1000,1000,1000,71,284,57,24,17,71,142,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Benet Paul's Wharf": [1000,1000,1000,765,218,23,25,57,382,1000,1000,1000,1000,765,1000,1000,1000,1000,1000,1000,1000,1000], "St Benet Sherehog": [1000,1000,1000,1000,1000,1000,1000,1000,1000,284,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Botolph Billingsgate": [1000,1000,1000,1000,1000,168,31,23,72,168,126,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "Christ Church": [1000,1000,1000,765,90,20,18,36,191,765,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Christopher": [1000,1000,1000,1000,87,39,18,27,350,117,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Clement Eastcheap": [1000,1000,1000,1000,328,82,41,109,164,109,109,328,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Dionis Backchurch": [1000,1000,1000,1000,1000,113,75,56,1000,1000,677,1000,1000,1000,1000,1000,677,339,1000,1000,1000,1000], "St Dunstan East": [1000,1000,1000,1000,1000,159,35,42,149,318,743,557,1000,743,1000,1000,1000,1000,1000,1000,1000,1000], "St Edmund the King": [1000,1000,1000,1000,1000,146,44,29,73,218,87,437,437,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Ethelburga": [1000,1000,1000,1000,31,10,19,50,251,1000,251,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Faith under St Paul's": [1000,1000,1000,1000,1000,60,22,28,218,164,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Vedast alias Foster": [1000,1000,1000,1000,137,11,18,39,91,273,546,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Gabriel Fenchurch": [1000,1000,1000,393,1000,98,33,28,56,393,1000,1000,1000,1000,1000,1000,1000,393,1000,1000,1000,1000], "St George Botolph Lane": [1000,1000,1000,1000,1000,1000,71,19,47,142,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Gregory by St Paul's": [1000,1000,1000,1000,234,38,28,52,258,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Helen": [1000,1000,1000,1000,109,14,25,68,546,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St James Duke's Place": [1000,1000,1000,1000,224,32,10,15,128,448,224,896,1000,1000,896,1000,448,1000,1000,1000,1000,1000], "St James Garlickhithe": [1000,1000,1000,1000,874,73,21,18,67,291,1000,437,1000,1000,291,1000,1000,1000,1000,1000,1000,1000], "St John Baptist": [1000,1000,1000,1000,677,32,26,34,56,226,677,677,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St John Evangelist": [1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St John Zachary": [1000,1000,1000,503,126,46,26,26,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Katherine Coleman": [1000,1000,1000,1000,1000,60,9,13,64,961,320,1000,1000,961,1000,1000,1000,1000,1000,481,1000,1000], "St Katherine Creechurch": [1000,1000,1000,1000,1000,61,17,32,95,238,380,1000,1000,1000,1000,1000,1000,634,1000,1000,1000,1000], "St Lawrence Jewry": [1000,1000,1000,1000,1000,58,58,109,246,983,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Lawrence Pountney": [1000,1000,1000,1000,1000,27,15,18,92,415,138,1000,1000,1000,830,1000,1000,1000,1000,1000,1000,1000], "St Leonard Eastcheap": [1000,1000,1000,1000,1000,306,31,22,153,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Leonard Foster Lane": [1000,1000,1000,1000,115,8,9,16,81,808,808,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Magnus": [1000,1000,1000,1000,393,44,41,49,157,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Margaret Lothbury": [1000,1000,1000,1000,721,42,29,42,180,361,240,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Margaret Moses": [1000,1000,1000,1000,1000,44,31,76,153,153,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Margaret New Fish Street": [1000,1000,1000,1000,1000,142,15,28,189,1000,1000,1000,1000,1000,284,1000,1000,1000,1000,1000,1000,1000], "St Margaret Pattens": [1000,1000,1000,1000,1000,1000,27,37,1000,371,186,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Abchurch": [1000,1000,1000,1000,1000,109,30,39,218,109,655,655,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Aldermanbury": [1000,1000,1000,503,335,34,19,46,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Aldermay": [1000,1000,1000,1000,437,24,13,27,62,1000,146,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary le Bow": [1000,1000,1000,1000,459,21,92,115,459,153,1000,1000,1000,1000,1000,459,1000,1000,1000,1000,1000,1000], "St Mary Bothaw": [1000,1000,1000,1000,1000,48,40,69,1000,240,1000,1000,481,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Colechurch": [1000,1000,1000,1000,1000,109,27,109,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Hill": [1000,1000,1000,1000,1000,72,21,24,56,168,251,503,1000,1000,1000,1000,503,503,1000,1000,1000,1000], "St Mary Mounthaw": [1000,1000,1000,1000,87,37,12,66,1000,262,262,131,262,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Somerset": [1000,1000,1000,1000,399,33,14,22,84,532,798,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Staining": [1000,1000,1000,1000,153,15,11,76,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Woolchurch": [1000,1000,481,1000,1000,1000,37,30,240,481,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Woolnoth": [1000,1000,1000,1000,1000,92,24,38,229,1000,459,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Martin Ironmonger Lane": [1000,1000,1000,1000,240,1000,48,48,1000,1000,1000,1000,240,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Martin Ludgate": [1000,1000,1000,1000,557,37,22,30,279,279,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Martin Orgar": [1000,1000,1000,1000,1000,18,21,46,546,273,273,546,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Martin Outwich": [1000,1000,1000,1000,371,34,22,74,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Martin Vintry": [1000,1000,1000,1000,166,23,9,22,119,1000,1000,1000,1000,1000,1000,1000,830,1000,1000,1000,1000,1000], "St Matthew Friday Street": [1000,1000,1000,1000,1000,197,197,49,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Magdalen Milk Street": [1000,1000,1000,1000,1000,32,52,415,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Magdalen Old Fish Street": [1000,1000,1000,1000,918,28,24,28,76,229,918,918,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Bassishaw": [1000,1000,1000,92,20,15,19,59,830,1000,830,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Cornhill": [1000,1000,1000,1000,1000,87,29,61,262,1000,787,1000,1000,393,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Crooked Lane": [1000,1000,1000,144,126,84,22,22,101,144,503,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Queenhithe": [1000,1000,1000,1000,513,34,21,32,205,171,1000,1000,1000,1000,513,1000,1000,1000,1000,1000,1000,1000], "St Michael Quern": [1000,1000,1000,1000,186,371,34,93,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Royal": [1000,1000,1000,1000,1000,22,9,15,96,481,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Michael Wood Street": [1000,1000,1000,1000,175,26,44,22,175,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mildred Bread Street": [1000,1000,1000,1000,1000,52,17,52,262,262,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mildred Poultrey": [1000,1000,1000,1000,175,48,35,33,524,524,1000,524,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Nicholas Acons": [1000,1000,1000,1000,306,306,18,61,76,1000,1000,306,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Nicholas Cole Abbey": [1000,1000,1000,1000,677,40,17,25,135,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Nicholas Olave": [1000,1000,1000,1000,1000,26,16,21,131,393,393,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Olave Hart Street": [1000,1000,1000,1000,202,29,13,15,101,115,404,1000,1000,1000,1000,1000,1000,1000,808,1000,1000,1000], "St Olave Jewry": [1000,1000,1000,1000,1000,63,49,91,634,634,1000,1000,1000,1000,1000,634,1000,1000,1000,1000,1000,1000], "St Olave Silver Street": [1000,1000,1000,918,184,13,23,57,918,1000,1000,1000,1000,1000,1000,918,1000,1000,1000,1000,1000,1000], "St Pancras Soper Lane": [1000,1000,1000,1000,1000,87,44,52,262,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Peter Ad Vincula": [1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Peter Cheap": [1000,1000,1000,142,1000,71,19,19,284,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Peter Cornhill": [1000,1000,1000,1000,112,49,31,36,157,262,787,1000,1000,1000,1000,787,1000,1000,1000,1000,1000,1000], "St Peter Paul's Wharf": [1000,1000,1000,1000,1000,28,12,24,126,251,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Peter Poor": [1000,1000,1000,1000,160,69,19,44,481,1000,1000,1000,1000,1000,481,481,481,160,1000,1000,1000,1000], "St Stephen Coleman Street": [1000,1000,1000,1000,224,30,18,29,112,484,726,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Stephen Walbrook": [1000,1000,1000,1000,1000,415,42,83,415,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Swithin": [1000,1000,1000,1000,90,100,13,100,224,299,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Thomas Apostle": [1000,1000,1000,1000,58,17,19,28,158,1000,1000,1000,1000,1000,1000,211,1000,1000,1000,1000,1000,1000], "Trinity": [1000,1000,1000,1000,1000,62,16,29,226,1000,677,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Clement Danes": [1000,1000,778,233,93,31,25,50,376,729,1000,1000,1000,1000,1000,1000,833,1000,1000,1000,1000,1000], "St Paul Covent Garden": [1000,1000,1000,969,121,34,30,76,291,969,1000,1000,1000,1000,1000,1000,1000,969,1000,1000,1000,1000], "St Martin in the Fields": [1000,1000,1000,377,49,24,36,101,424,905,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Savoy": [1000,1000,1000,350,70,27,29,60,194,350,1000,874,1000,1000,874,1000,1000,1000,1000,1000,1000,1000], "St Margaret Westminster": [1000,1000,1000,299,61,14,13,26,128,383,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "Holy Trinity Minories": [1000,1000,1000,1000,44,9,4,7,52,1000,1000,262,1000,1000,262,262,262,1000,1000,1000,1000,1000], "St Katharine Tower": [1000,1000,1000,1000,397,20,19,40,182,624,1000,1000,1000,1000,1000,1000,728,728,1000,1000,1000,1000], "St Mary Whitechapel": [1000,1000,1000,1000,97,9,10,35,198,698,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Dunstan Stepney": [1000,1000,1000,1000,181,18,12,19,74,249,342,780,1000,1000,1000,1000,1000,895,1000,1000,1000,1000], "St Botolph Aldgate": [1000,1000,1000,1000,147,14,9,27,207,408,903,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St John at Hackney": [1000,1000,1000,1000,175,50,39,53,218,874,874,1000,583,874,874,1000,874,874,1000,1000,1000,1000], "St Andrew Holbom": [1000,1000,1000,275,40,13,23,66,318,877,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "Bridewell Precinct": [1000,1000,1000,248,106,20,8,29,124,248,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Bride": [1000,1000,1000,600,86,15,18,50,474,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Dunstan West": [1000,1000,1000,1000,175,30,24,41,175,827,965,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Sepulchre": [1000,1000,1000,214,39,14,28,109,689,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Bartholomew Great": [1000,1000,1000,393,70,9,28,151,393,1000,1000,1000,1000,1000,1000,1000,393,983,983,393,1000,1000], "St Bartholomew Less": [1000,1000,1000,1000,481,17,20,42,160,961,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Botolph Aldersgate": [1000,1000,1000,584,76,13,16,37,371,340,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Botolph Bishopsgate": [1000,1000,1000,496,55,10,15,48,313,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Giles Cripplegate": [1000,1000,1000,687,44,11,26,101,657,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Giles in the Field": [1000,1000,399,44,21,20,44,102,452,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St James Clerkenwell": [1000,1000,1000,326,20,10,28,109,622,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Leonard Shoreditch": [1000,1000,1000,1000,55,10,15,56,386,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Islington": [1000,1000,1000,317,28,5,6,21,75,634,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St George Southwark": [1000,1000,1000,1000,105,13,10,38,218,629,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Olave Southwark": [1000,1000,1000,1000,238,23,14,35,174,477,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Saviour Southwark": [1000,1000,1000,1000,287,15,9,16,72,236,287,1000,1000,1000,1000,1000,1000,601,1000,1000,1000,1000], "St Thomas Southwark": [1000,1000,1000,393,79,13,7,15,69,295,590,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Lambeth": [1000,1000,1000,1000,1000,89,32,27,54,152,178,303,737,430,126,147,161,368,1000,1000,1000,1000], "St Mary Magdalen Bermondsey": [1000,1000,1000,1000,1000,26,11,18,89,278,392,666,1000,1000,392,417,208,155,833,666,1000,1000], "St Mary Newington": [1000,1000,1000,1000,367,14,11,36,467,642,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000], "St Mary Rotherhithe": [1000,1000,1000,1000,49,42,13,13,29,73,55,175,437,218,87,291,109,97,1000,125,1000,1000]}>>
<<set $corpseBuried to {"All Hallows Barking": [0,0,12,8,12,87,181,128,27,3,16,8,6,5,7,4,14,7,2,11,7,8], "All Hallows Bread Street": [0,0,2,1,0,10,8,4,1,0,0,1,1,1,1,1,1,1,0,0,0,0], "All Hallows Honey Lane": [0,0,0,0,0,2,3,1,0,0,1,0,0,1,1,0,1,0,0,0,0,0], "All Hallows Lombard Street": [0,0,1,0,4,30,31,9,1,2,0,0,3,0,1,0,4,0,0,0,0,0], "All Hallows London Wall": [0,0,10,7,25,150,160,77,19,8,7,4,5,8,9,6,4,10,2,7,6,4], "All Hallows Staining": [0,0,3,2,11,36,66,40,14,0,5,0,0,1,2,3,9,4,2,1,2,5], "All Hallows the Great": [0,0,9,11,14,58,206,108,21,2,5,7,3,0,4,2,4,9,0,0,0,6], "All Hallows the Less": [0,0,4,4,6,35,90,58,14,2,6,5,3,3,1,0,1,4,0,0,0,0], "Bridewell Precinct": [0,0,3,3,10,48,103,37,8,2,2,2,2,2,0,0,1,0,0,0,0,1], "Christ Church": [0,0,11,13,50,191,191,99,22,9,6,8,8,10,15,1,17,7,0,0,0,2], "Holy Trinity Minories": [0,0,1,0,7,37,71,38,11,0,3,3,1,1,3,3,4,0,1,0,2,2], "St Alban Wood Street": [0,0,4,11,12,56,61,32,6,2,1,2,1,3,3,0,5,0,0,0,0,2], "St Alphage": [0,0,6,1,9,126,80,23,7,2,3,6,6,1,1,4,0,2,0,0,1,2], "St Andrew Holbom": [0,0,85,129,562,1472,901,344,92,26,36,45,29,27,32,28,55,73,26,45,39,55], "St Andrew Hubbard": [0,0,1,3,6,9,15,16,5,3,2,0,2,5,4,1,3,4,0,0,0,0], "St Andrew Undershaft": [0,0,3,4,20,84,92,39,6,4,4,1,1,1,4,4,3,3,1,4,3,1], "St Andrew Wardrobe": [0,0,5,7,14,139,189,58,11,5,7,3,2,1,2,3,11,3,0,0,0,3], "St Ann Blackfriars": [0,0,12,8,46,142,239,135,26,3,11,2,3,3,11,6,9,4,0,0,0,7], "St Anne Aldersgate": [0,0,1,1,8,89,112,38,9,5,7,1,2,4,3,0,11,4,0,0,0,2], "St Antholin": [0,0,2,1,1,15,23,3,2,0,0,0,1,1,1,5,3,0,0,0,0,0], "St Austin": [0,0,4,2,2,6,15,6,2,0,1,3,2,0,2,0,2,1,0,0,0,0], "St Bartholomew Exchange": [0,0,5,2,1,11,22,17,10,0,2,1,1,0,1,1,4,2,0,0,0,2], "St Bartholomew Great": [0,0,2,11,46,272,90,22,7,3,4,3,3,5,4,2,10,13,6,17,9,5], "St Bartholomew Less": [0,0,2,3,12,75,51,27,8,1,3,2,1,0,1,2,2,2,0,2,3,1], "St Benet Fink": [0,0,0,3,0,11,12,11,1,0,3,4,2,0,1,0,0,1,0,0,0,0], "St Benet Gracechurch": [0,0,2,6,3,5,17,18,5,4,2,0,2,1,0,1,0,2,0,0,0,0], "St Benet Paul's Wharf": [0,0,6,10,29,109,110,47,7,4,2,6,2,4,3,2,2,2,0,0,0,2], "St Benet Sherehog": [0,0,1,0,0,0,4,1,0,1,1,1,0,2,0,0,0,0,0,0,0,0], "St Botolph Aldersgate": [0,0,17,18,91,372,276,119,15,16,33,13,10,6,12,5,17,18,8,19,11,11], "St Botolph Aldgate": [0,0,65,62,208,1365,2048,723,127,41,52,36,46,48,39,39,58,80,32,57,47,58], "St Botolph Billingsgate": [0,0,4,3,0,8,20,25,11,3,6,0,1,1,3,0,3,0,0,0,0,2], "St Botolph Bishopsgate": [0,0,41,85,323,1411,987,319,55,27,29,21,19,14,16,24,30,40,11,27,18,21], "St Bride": [0,0,32,57,167,731,622,250,49,14,27,21,27,20,18,22,22,20,0,0,0,17], "St Christopher": [0,0,1,0,5,13,20,15,2,1,0,0,1,1,3,1,1,3,0,0,0,2], "St Clement Danes": [0,0,70,94,182,481,572,290,62,24,28,27,24,17,29,17,45,33,13,35,21,31], "St Clement Eastcheap": [0,0,2,0,1,8,8,8,5,2,3,3,0,0,2,0,0,2,0,0,0,2], "St Dionis Backchurch": [0,0,3,1,3,10,26,20,6,1,5,0,1,1,2,0,3,3,0,0,0,0], "St Dunstan East": [0,0,8,11,7,30,82,70,19,9,7,9,9,6,6,7,10,6,0,0,0,5], "St Dunstan Stepney": [0,0,163,148,356,2139,2748,1803,494,132,182,111,81,84,106,82,182,161,60,144,116,144], "St Dunstan West": [0,0,25,23,55,236,283,175,47,7,17,16,13,11,16,5,16,24,0,10,6,22], "St Edmund the King": [0,0,2,3,0,6,14,17,10,3,5,2,1,1,0,1,1,0,0,0,0,2], "St Ethelburga": [0,0,3,2,26,76,52,18,6,0,3,2,2,0,0,1,2,1,0,1,3,1], "St Faith under St Paul's": [0,0,1,1,4,16,39,27,5,3,2,2,2,1,3,1,5,1,0,0,0,3], "St Gabriel Fenchurch": [0,0,2,4,1,7,17,21,9,1,0,0,0,1,0,1,1,2,0,0,0,1], "St George Botolph Lane": [0,0,1,0,0,1,8,19,8,2,1,0,1,0,0,0,0,1,0,0,0,0], "St George Southwark": [0,0,10,24,90,548,642,166,34,6,8,12,14,14,23,9,18,14,11,18,15,13], "St Giles Cripplegate": [0,0,121,211,1310,3956,1433,393,87,30,74,39,41,49,52,29,85,117,40,109,81,60], "St Giles in the Field": [0,0,229,658,1188,1143,521,250,69,18,47,35,30,22,30,28,65,59,16,66,46,40], "St Gregory by St Paul's": [0,0,8,8,27,90,117,55,16,3,3,5,5,6,3,2,4,1,0,0,0,1], "St Helen": [0,0,3,2,5,42,26,10,3,1,4,5,2,2,1,1,2,2,4,1,3,1], "St James Clerkenwell": [0,0,22,77,400,754,295,108,34,9,18,19,7,16,14,17,19,22,8,29,27,13], "St James Duke's Place": [0,0,8,5,8,40,102,74,7,2,7,1,5,1,4,0,6,4,3,4,3,2], "St James Garlickhithe": [0,0,4,2,5,19,55,57,21,7,3,5,1,4,3,1,2,1,0,0,0,3], "St John Baptist": [0,0,3,0,2,26,31,33,19,3,3,1,0,0,3,1,3,1,0,0,0,1], "St John Evangelist": [0,0,2,1,0,0,0,2,0,0,0,1,0,1,1,1,0,0,0,0,0,0], "St John Zachary": [0,0,1,3,5,13,27,21,4,0,2,0,2,1,1,2,3,0,0,0,0,0], "St John at Hackney": [0,0,11,8,16,50,55,42,11,7,7,9,10,5,16,5,5,17,4,8,10,7], "St Katharine Tower": [0,0,19,20,32,284,323,161,39,12,16,8,10,10,15,20,32,35,2,18,22,14], "St Katherine Coleman": [0,0,5,3,5,31,126,84,16,5,5,3,4,4,4,2,0,1,0,6,11,6], "St Katherine Creechurch": [0,0,8,5,2,43,141,70,30,13,9,3,4,9,8,1,12,9,2,5,4,3], "St Lawrence Jewry": [0,0,7,1,1,30,24,12,6,1,0,2,1,1,2,1,2,3,0,0,0,2], "St Lawrence Pountney": [0,0,3,3,3,51,70,60,10,3,8,3,1,4,4,2,1,0,0,0,0,1], "St Leonard Eastcheap": [0,0,0,1,2,3,13,16,2,0,1,1,0,1,1,1,1,2,0,0,0,0], "St Leonard Foster Lane": [0,0,4,1,10,110,103,58,14,2,2,2,4,1,3,2,8,2,0,0,0,1], "St Leonard Shoreditch": [0,0,36,57,279,1222,659,196,41,14,28,17,27,15,13,18,28,43,18,28,27,21], "St Magnus": [0,0,1,3,6,25,24,21,5,0,3,1,1,0,0,2,3,5,1,2,0,0], "St Margaret Lothbury": [0,0,2,1,2,25,28,20,4,2,4,1,5,0,0,2,3,1,0,0,0,0], "St Margaret Moses": [0,0,1,0,0,8,11,8,2,2,0,0,1,2,1,0,2,0,0,0,0,1], "St Margaret New Fish Street": [0,0,5,0,3,12,51,30,4,1,2,1,3,2,4,1,0,0,0,0,0,3], "St Margaret Pattens": [0,0,1,1,0,3,22,16,1,1,6,2,0,0,0,2,7,1,0,0,0,1], "St Margaret Westminster": [0,0,91,139,390,1381,1369,745,169,51,64,33,34,27,41,39,44,67,25,59,49,54], "St Martin Ironmonger Lane": [0,0,0,1,2,2,5,6,0,0,0,1,1,1,0,1,2,0,0,0,0,0], "St Martin Ludgate": [0,0,0,3,4,36,74,45,10,6,3,1,2,8,0,4,2,2,0,0,0,1], "St Martin Orgar": [0,0,1,1,2,39,37,15,2,1,3,5,3,1,3,1,1,1,0,0,0,1], "St Martin Outwich": [0,0,0,1,5,15,23,8,1,0,0,0,0,1,1,0,1,4,0,1,1,0], "St Martin Vintry": [0,0,2,3,14,82,182,88,23,3,4,1,3,2,3,0,8,6,0,0,0,0], "St Martin in the Fields": [0,0,132,241,820,1550,991,417,137,36,56,52,44,62,65,37,78,112,31,63,75,56], "St Mary Abchurch": [0,0,0,3,3,14,31,27,6,7,4,3,1,2,3,0,3,1,0,0,0,1], "St Mary Aldermanbury": [0,0,3,2,11,51,65,28,4,2,3,1,1,1,4,2,6,3,0,0,0,2], "St Mary Aldermay": [0,0,3,1,3,24,37,22,8,0,3,1,2,1,0,1,1,2,0,0,0,0], "St Mary Bothaw": [0,0,4,1,0,14,17,7,3,2,0,0,3,1,0,2,1,0,0,0,0,1], "St Mary Colechurch": [0,0,0,0,0,2,10,3,1,0,0,0,0,0,1,0,1,0,0,0,0,0], "St Mary Hill": [0,0,0,2,2,12,33,22,12,4,4,1,1,1,3,1,4,2,0,0,0,0], "St Mary Islington": [0,0,8,10,59,283,213,71,25,8,13,7,4,4,6,6,7,14,11,12,14,2], "St Mary Lambeth": [0,0,22,17,24,96,189,226,112,34,42,30,15,23,65,48,49,32,12,21,17,18], "St Mary Magdalen Bermondsey": [0,0,40,32,51,369,726,473,107,40,35,27,23,16,42,34,73,82,24,38,28,28], "St Mary Magdalen Milk Street": [0,0,2,2,1,16,12,5,0,0,0,0,0,3,1,0,1,0,0,0,0,0], "St Mary Magdalen Old Fish Street": [0,0,2,1,2,43,50,43,13,4,3,3,2,2,4,2,2,0,0,0,0,2], "St Mary Mounthaw": [0,0,0,0,3,13,24,7,1,1,1,3,1,0,1,0,1,0,0,0,0,1], "St Mary Newington": [0,0,24,11,31,436,486,169,17,13,17,9,6,8,10,7,21,13,3,9,15,17], "St Mary Rotherhithe": [0,0,6,13,29,35,76,88,39,13,24,12,7,8,19,9,25,14,2,18,7,8], "St Mary Savoy": [0,0,7,15,35,83,78,32,12,7,7,4,8,8,5,4,6,7,2,6,6,9], "St Mary Somerset": [0,0,11,6,7,58,129,85,22,5,8,1,4,0,4,3,6,2,0,0,0,1], "St Mary Staining": [0,0,2,0,2,14,19,5,0,0,0,1,0,0,0,0,1,1,0,0,0,0], "St Mary Whitechapel": [0,0,62,81,246,1863,1634,505,109,34,38,31,33,27,33,31,60,72,26,55,63,52], "St Mary Woolchurch": [0,0,2,0,1,7,18,22,3,3,2,2,0,1,5,0,0,1,0,0,0,2], "St Mary Woolnoth": [0,0,3,5,2,7,30,18,5,0,3,0,4,2,1,0,3,0,0,0,0,1], "St Mary le Bow": [0,0,1,0,1,30,10,5,1,4,2,3,2,4,0,1,5,0,0,0,0,1], "St Matthew Friday Street": [0,0,2,1,2,3,2,8,2,0,2,0,1,3,0,0,0,3,0,0,0,0], "St Michael Bassishaw": [0,0,5,15,50,72,58,22,5,1,6,3,5,4,1,2,1,4,0,0,0,0], "St Michael Cornhill": [0,0,0,0,2,19,37,20,5,2,3,2,3,4,1,1,5,3,0,0,0,2], "St Michael Crooked Lane": [0,0,4,10,9,21,53,48,14,5,4,5,0,3,2,1,3,2,0,0,0,3], "St Michael Queenhithe": [0,0,4,2,10,52,59,40,8,7,9,3,3,3,4,2,4,0,0,0,0,2], "St Michael Quern": [0,0,2,1,4,3,15,9,1,1,1,2,2,1,0,1,3,2,0,0,0,0], "St Michael Royal": [0,0,0,0,3,28,65,40,7,1,2,2,0,0,1,2,3,1,0,0,0,0], "St Michael Wood Street": [0,0,3,2,5,34,28,31,5,0,4,1,3,1,3,0,2,4,0,0,0,0], "St Mildred Bread Street": [0,0,1,2,0,8,20,10,3,0,1,0,1,2,0,0,1,3,0,0,0,2], "St Mildred Poultrey": [0,0,2,2,4,13,20,19,1,0,1,2,2,2,1,0,5,1,0,0,0,1], "St Nicholas Acons": [0,0,1,0,2,1,22,6,6,0,1,1,0,0,0,1,0,0,0,0,0,1], "St Nicholas Cole Abbey": [0,0,2,0,3,22,43,32,6,0,2,3,1,1,1,1,1,0,0,0,0,0], "St Nicholas Olave": [0,0,0,1,1,21,30,22,4,1,2,1,2,0,0,0,0,0,0,0,0,0], "St Olave Hart Street": [0,0,2,3,17,39,67,62,16,9,5,3,4,2,0,2,3,6,2,3,2,4], "St Olave Jewry": [0,0,3,1,0,15,17,8,1,1,1,1,1,1,0,1,1,0,0,0,0,0], "St Olave Silver Street": [0,0,4,3,30,107,55,21,5,0,1,2,6,0,1,3,1,1,0,0,0,1], "St Olave Southwark": [0,0,68,65,169,1355,1858,757,158,44,50,44,34,34,44,43,58,57,25,50,54,45], "St Pancras Soper Lane": [0,0,0,0,0,6,7,7,2,1,0,2,0,0,0,2,2,0,0,0,0,0], "St Paul Covent Garden": [0,0,15,13,37,107,103,55,18,7,5,2,8,3,6,2,11,15,4,14,8,11], "St Peter Cheap": [0,0,0,5,0,9,18,18,1,0,1,1,1,2,0,0,3,2,0,0,0,0], "St Peter Cornhill": [0,0,1,1,9,23,36,33,8,5,1,1,0,1,3,1,5,5,1,1,1,4], "St Peter Paul's Wharf": [0,0,2,1,2,25,47,26,4,3,2,3,3,0,1,0,1,0,0,0,0,1], "St Peter Poor": [0,0,3,1,5,9,29,14,2,0,2,1,2,1,4,3,4,6,0,3,0,2], "St Saviour Southwark": [0,0,59,54,127,1046,1566,862,197,47,76,44,30,31,36,41,53,70,18,58,55,65], "St Sepulchre": [0,0,98,180,724,1884,915,279,68,19,47,41,35,38,38,23,42,56,18,35,30,23], "St Stephen Coleman Street": [0,0,10,12,26,127,182,114,27,2,9,5,4,6,4,5,6,10,0,3,1,6], "St Stephen Walbrook": [0,0,2,2,1,3,12,6,2,0,3,0,2,0,0,1,4,1,0,0,0,0], "St Swithin": [0,0,1,1,16,16,26,15,8,2,3,2,1,2,1,0,3,2,0,0,0,2], "St Thomas Apostle": [0,0,2,3,17,50,44,27,7,3,1,1,0,0,0,6,2,1,0,0,0,0], "St Thomas Southwark": [0,0,5,14,23,105,186,91,21,4,7,3,1,1,2,3,8,0,1,7,2,6], "St Vedast alias Foster": [0,0,5,2,5,58,37,16,6,3,2,0,2,0,1,1,0,0,0,0,0,1], "Trinity": [0,0,0,0,2,16,45,27,8,1,2,4,1,0,0,3,3,3,0,0,0,0]}>>
<<set $corpsePlague to {"All Hallows Barking": [0,0,0,1,0,65,139,105,20,0,3,4,0,2,0,0,0,0,0,0,0,0], "All Hallows Bread Street": [0,0,0,0,0,4,7,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0], "All Hallows Honey Lane": [0,0,0,0,0,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "All Hallows Lombard Street": [0,0,0,0,1,24,27,8,0,2,0,0,1,0,0,0,0,0,0,0,0,0], "All Hallows London Wall": [0,0,0,0,16,122,133,66,17,2,5,1,0,1,1,0,1,0,0,0,0,1], "All Hallows Staining": [0,0,0,0,3,24,47,31,7,0,0,0,0,0,0,0,7,0,0,0,0,1], "All Hallows the Great": [0,0,0,0,5,29,185,98,17,2,1,2,0,0,1,0,0,1,0,0,0,3], "All Hallows the Less": [0,0,0,0,3,28,84,51,7,2,6,3,0,0,0,0,0,0,0,0,0,0], "Bridewell Precinct": [0,0,0,3,7,38,97,26,6,2,0,0,0,0,0,0,0,0,0,0,0,1], "Christ Church": [0,0,0,4,34,155,169,86,16,3,1,1,2,0,0,0,2,0,0,0,0,1], "Holy Trinity Minories": [0,0,0,0,6,28,59,35,5,0,0,1,0,0,1,1,1,0,0,0,0,0], "St Alban Wood Street": [0,0,0,3,4,42,43,24,4,1,0,1,0,1,0,0,0,0,0,0,0,0], "St Alphage": [0,0,0,0,3,68,34,6,3,1,0,1,0,0,0,1,0,0,0,0,0,1], "St Andrew Holbom": [0,0,3,67,466,1400,817,281,58,11,14,10,5,4,0,1,0,2,2,0,0,10], "St Andrew Hubbard": [0,0,0,0,4,3,6,9,1,2,2,0,0,0,0,1,1,0,0,0,0,0], "St Andrew Undershaft": [0,0,0,0,11,67,77,27,5,2,2,0,0,0,0,0,0,0,0,0,0,0], "St Andrew Wardrobe": [0,0,0,0,4,106,150,39,7,2,2,0,0,0,0,0,0,0,0,0,0,2], "St Ann Blackfriars": [0,0,0,0,22,109,202,112,19,3,4,0,0,0,5,2,1,2,0,0,0,3], "St Anne Aldersgate": [0,0,0,0,0,55,96,37,6,3,2,0,0,0,0,0,0,2,0,0,0,1], "St Antholin": [0,0,0,0,0,12,17,3,1,0,0,0,0,0,0,1,2,0,0,0,0,0], "St Austin": [0,0,0,0,1,5,11,3,0,0,1,1,0,0,1,0,0,0,0,0,0,0], "St Bartholomew Exchange": [0,0,0,0,0,8,21,14,8,0,1,0,0,0,0,0,0,0,0,0,0,0], "St Bartholomew Great": [0,0,0,5,28,222,69,13,5,0,1,0,0,1,0,0,5,2,2,5,0,0], "St Bartholomew Less": [0,0,0,0,2,58,49,23,6,1,0,0,0,0,0,0,0,0,0,0,0,0], "St Benet Fink": [0,0,0,2,0,6,5,8,1,0,1,1,1,0,0,0,0,0,0,0,0,0], "St Benet Gracechurch": [0,0,0,4,1,5,12,17,4,2,0,0,0,0,0,0,0,0,0,0,0,0], "St Benet Paul's Wharf": [0,0,0,2,7,67,60,27,4,1,0,0,0,2,0,0,0,0,0,0,0,0], "St Benet Sherehog": [0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0], "St Botolph Aldersgate": [0,0,0,7,54,313,251,110,11,9,0,3,0,0,1,0,0,1,1,1,0,3], "St Botolph Aldgate": [0,0,0,1,117,1251,1930,642,83,27,19,9,12,9,6,13,7,15,1,0,0,15], "St Botolph Billingsgate": [0,0,0,0,0,3,16,22,7,2,4,0,0,0,0,0,0,0,0,0,0,1], "St Botolph Bishopsgate": [0,0,1,24,216,1144,820,250,38,7,3,5,0,0,0,2,3,0,0,1,0,2], "St Bride": [0,0,0,15,105,616,487,179,19,6,6,1,1,1,2,0,0,0,0,0,0,1], "St Christopher": [0,0,0,0,4,9,19,13,1,1,0,0,0,0,0,0,0,0,0,0,0,2], "St Clement Danes": [0,0,15,50,126,373,476,233,31,14,2,4,4,0,2,5,14,8,1,3,0,3], "St Clement Eastcheap": [0,0,0,0,1,4,8,3,2,2,3,1,0,0,0,0,0,0,0,0,0,1], "St Dionis Backchurch": [0,0,0,0,0,6,9,12,0,0,1,0,0,0,0,0,1,2,0,0,0,0], "St Dunstan East": [0,0,0,0,0,14,63,53,15,5,3,4,2,3,0,2,1,0,0,0,0,2], "St Dunstan Stepney": [0,0,0,3,168,1714,2581,1623,412,82,89,39,19,22,17,6,16,34,12,16,4,41], "St Dunstan West": [0,0,3,5,33,190,246,140,33,5,6,4,0,1,2,0,0,0,0,0,0,2], "St Edmund the King": [0,0,0,0,0,3,10,15,6,2,5,1,1,0,0,0,0,0,0,0,0,0], "St Ethelburga": [0,0,0,0,16,51,27,10,2,0,2,0,0,0,0,0,0,0,0,0,0,0], "St Faith under St Paul's": [0,0,0,0,0,11,30,23,3,3,0,0,0,0,0,0,0,0,0,0,0,1], "St Gabriel Fenchurch": [0,0,0,1,0,4,12,14,7,1,0,0,0,0,0,0,0,1,0,0,0,0], "St George Botolph Lane": [0,0,0,0,0,0,4,15,6,2,0,0,0,0,0,0,0,0,0,0,0,0], "St George Southwark": [0,0,0,3,54,440,586,149,26,2,0,0,1,2,4,0,1,1,0,0,0,7], "St Giles Cripplegate": [0,0,2,43,673,2621,1150,294,45,10,15,7,1,4,1,0,3,6,4,2,0,4], "St Giles in the Field": [0,0,51,461,983,1000,466,199,45,7,7,3,1,4,6,3,4,1,1,2,0,7], "St Gregory by St Paul's": [0,0,0,0,11,67,93,50,10,1,0,0,0,1,0,0,0,0,0,0,0,0], "St Helen": [0,0,0,0,5,39,22,8,1,0,0,0,0,0,0,0,0,0,0,0,0,0], "St James Clerkenwell": [0,0,0,21,341,694,246,63,11,1,3,2,1,0,0,0,0,2,1,2,0,1], "St James Duke's Place": [0,0,0,0,4,28,90,60,7,1,4,1,0,0,1,0,2,0,0,0,0,1], "St James Garlickhithe": [0,0,0,0,1,12,41,48,13,3,0,2,0,0,3,0,0,0,0,0,0,0], "St John Baptist": [0,0,0,0,1,21,26,20,12,3,1,1,0,0,0,0,0,0,0,0,0,0], "St John Evangelist": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St John Zachary": [0,0,0,1,4,11,19,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St John at Hackney": [0,0,0,0,10,35,45,33,8,1,2,1,3,2,2,0,2,2,0,0,0,1], "St Katharine Tower": [0,0,0,0,11,222,228,110,24,6,1,0,1,3,1,1,6,6,0,1,0,1], "St Katherine Coleman": [0,0,0,0,0,16,109,73,15,0,3,0,0,1,0,0,0,0,0,2,0,1], "St Katherine Creechurch": [0,0,0,0,0,31,113,59,20,8,5,0,0,0,1,0,1,3,0,0,0,0], "St Lawrence Jewry": [0,0,0,0,0,17,17,9,4,1,0,0,0,0,0,0,0,0,0,0,0,0], "St Lawrence Pountney": [0,0,0,0,0,31,54,45,9,1,6,0,0,0,1,0,0,0,0,0,0,1], "St Leonard Eastcheap": [0,0,0,0,0,1,10,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Leonard Foster Lane": [0,0,0,0,7,96,92,49,10,1,1,0,0,0,0,0,0,0,0,0,0,0], "St Leonard Shoreditch": [0,0,0,7,168,967,612,165,24,6,3,2,0,1,1,1,5,1,0,0,0,1], "St Magnus": [0,0,0,0,2,18,19,16,5,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Margaret Lothbury": [0,0,0,0,1,17,25,17,4,2,3,0,0,0,0,0,0,0,0,0,0,0], "St Margaret Moses": [0,0,0,0,0,7,10,4,2,2,0,0,0,0,0,0,0,0,0,0,0,0], "St Margaret New Fish Street": [0,0,0,0,0,4,39,20,3,0,0,0,0,0,2,0,0,0,0,0,0,0], "St Margaret Pattens": [0,0,0,0,0,0,14,10,0,0,2,0,0,0,0,0,0,0,0,0,0,1], "St Margaret Westminster": [0,0,0,59,289,1222,1310,690,138,34,14,2,2,5,12,6,8,10,3,3,1,12], "St Martin Ironmonger Lane": [0,0,0,0,1,0,5,5,0,0,0,0,1,0,0,0,0,0,0,0,0,0], "St Martin Ludgate": [0,0,0,0,2,30,51,37,4,4,0,0,0,0,0,0,0,0,0,0,0,0], "St Martin Orgar": [0,0,0,0,0,31,26,12,1,1,2,1,0,0,0,0,0,0,0,0,0,1], "St Martin Outwich": [0,0,0,0,1,11,17,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Martin Vintry": [0,0,0,0,10,73,176,76,14,0,0,0,0,1,0,0,2,0,0,0,0,0], "St Martin in the Fields": [0,0,1,72,550,1152,756,268,64,21,7,3,4,9,7,2,2,11,5,1,1,9], "St Mary Abchurch": [0,0,0,0,0,6,22,17,3,6,1,1,0,0,0,0,0,0,0,0,0,0], "St Mary Aldermanbury": [0,0,0,2,3,30,52,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0], "St Mary Aldermay": [0,0,0,0,1,18,33,16,7,0,3,0,0,0,0,0,0,0,0,0,0,0], "St Mary Bothaw": [0,0,0,0,0,10,12,7,0,1,0,0,1,0,0,0,0,0,0,0,0,1], "St Mary Colechurch": [0,0,0,0,0,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Mary Hill": [0,0,0,0,0,7,24,21,9,3,2,1,0,0,0,0,1,1,0,0,0,0], "St Mary Islington": [0,0,0,4,46,265,200,59,17,2,0,0,0,0,0,1,0,0,0,0,0,0], "St Mary Lambeth": [0,0,0,0,4,58,159,194,95,27,29,17,7,12,41,35,32,14,5,4,2,7], "St Mary Magdalen Bermondsey": [0,0,0,0,4,261,632,371,75,20,17,10,2,3,17,16,32,43,8,10,3,4], "St Mary Magdalen Milk Street": [0,0,0,0,0,13,8,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Mary Magdalen Old Fish Street": [0,0,0,0,1,33,38,33,12,4,1,1,0,0,0,0,0,0,0,0,0,0], "St Mary Mounthaw": [0,0,0,0,3,7,22,4,0,1,1,2,1,0,0,0,0,0,0,0,0,0], "St Mary Newington": [0,0,0,0,14,355,476,143,11,5,4,0,1,0,3,0,0,0,0,0,0,4], "St Mary Rotherhithe": [0,0,0,0,18,21,65,67,30,9,16,5,2,4,10,3,8,9,0,7,0,3], "St Mary Savoy": [0,0,0,5,25,65,61,29,9,4,0,2,1,0,2,0,0,0,0,0,0,1], "St Mary Somerset": [0,0,0,0,4,49,116,71,19,3,2,0,0,0,0,0,0,0,0,0,0,0], "St Mary Staining": [0,0,0,0,1,10,14,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Mary Whitechapel": [0,0,1,9,151,1670,1523,413,74,14,7,6,7,6,7,4,11,8,2,6,1,7], "St Mary Woolchurch": [0,0,1,0,0,0,13,16,2,1,0,0,0,0,0,0,0,0,0,0,0,0], "St Mary Woolnoth": [0,0,0,0,0,5,19,12,2,0,1,0,0,0,0,0,0,0,0,0,0,0], "St Mary le Bow": [0,0,0,0,1,22,5,4,1,3,0,0,0,0,0,1,0,0,0,0,0,0], "St Matthew Friday Street": [0,0,0,0,0,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Michael Bassishaw": [0,0,0,9,42,54,44,14,1,0,1,0,0,0,0,0,0,0,0,0,0,0], "St Michael Cornhill": [0,0,0,0,0,9,27,13,3,0,1,0,0,2,0,0,0,0,0,0,0,0], "St Michael Crooked Lane": [0,0,0,7,8,12,46,46,10,4,2,1,0,0,1,0,0,0,0,0,0,3], "St Michael Queenhithe": [0,0,0,0,2,30,48,32,5,5,1,1,0,1,2,0,0,0,0,0,0,1], "St Michael Quern": [0,0,0,0,2,1,11,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Michael Royal": [0,0,0,0,0,22,56,32,5,1,0,0,0,0,0,0,0,0,0,0,0,0], "St Michael Wood Street": [0,0,0,0,3,20,12,24,3,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Mildred Bread Street": [0,0,0,0,0,5,15,5,1,0,0,0,0,0,0,0,0,0,0,0,0,1], "St Mildred Poultrey": [0,0,0,0,3,11,15,16,1,0,0,1,0,0,0,0,0,0,0,0,0,1], "St Nicholas Acons": [0,0,0,0,1,1,17,5,4,0,0,1,0,0,0,0,0,0,0,0,0,0], "St Nicholas Cole Abbey": [0,0,0,0,1,17,41,27,5,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Nicholas Olave": [0,0,0,0,0,15,24,19,3,1,1,0,0,0,0,0,0,0,0,0,0,0], "St Olave Hart Street": [0,0,0,0,4,28,61,53,8,6,2,0,0,0,0,0,0,0,1,0,0,1], "St Olave Jewry": [0,0,0,0,0,10,13,7,1,1,0,0,0,0,0,1,0,0,0,0,0,0], "St Olave Silver Street": [0,0,0,1,5,70,40,16,1,0,0,0,0,0,0,1,0,0,0,0,0,0], "St Olave Southwark": [0,0,1,3,76,782,1275,516,104,28,9,7,7,7,0,0,8,4,1,0,0,10], "St Pancras Soper Lane": [0,0,0,0,0,3,6,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Paul Covent Garden": [0,0,0,3,24,86,97,38,10,3,0,0,0,0,1,0,2,3,0,0,0,0], "St Peter Cheap": [0,0,0,2,0,4,15,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Peter Cornhill": [0,0,0,0,7,16,25,22,5,1,1,0,0,0,0,1,0,0,0,0,0,2], "St Peter Paul's Wharf": [0,0,0,0,0,18,42,21,4,1,0,0,0,0,0,0,0,0,0,0,0,1], "St Peter Poor": [0,0,0,0,3,7,25,11,1,0,0,0,0,0,1,1,1,3,0,0,0,0], "St Saviour Southwark": [0,0,0,0,46,861,1490,833,184,32,46,13,7,5,9,5,9,22,2,12,8,27], "St Sepulchre": [0,0,5,87,482,1320,653,170,27,2,8,4,3,4,1,0,1,0,0,1,0,2], "St Stephen Coleman Street": [0,0,0,2,13,98,160,100,26,2,4,2,0,2,1,0,2,1,0,0,0,4], "St Stephen Walbrook": [0,0,0,0,0,1,10,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0], "St Swithin": [0,0,0,0,10,9,68,9,4,2,0,0,0,0,0,0,0,0,0,0,0,1], "St Thomas Apostle": [0,0,0,0,11,38,34,23,4,0,0,0,0,0,0,3,0,0,0,0,0,0], "St Thomas Southwark": [0,0,0,3,15,88,168,78,17,2,2,0,0,0,0,0,0,0,0,0,0,2], "St Vedast alias Foster": [0,0,0,0,4,48,31,14,6,2,1,0,0,0,0,0,0,0,0,0,0,0], "Trinity": [0,0,0,0,0,11,42,23,3,0,1,0,0,0,0,0,0,0,0,0,0,0]}>>
<</nobr>><</widget>>Player stats:
<ul>
<li>Name: $name</li>
<li>Age: $age</li>
<li>Social class: <<if $apprenticeship gt 0>>apprentice<<else>>$socio<</if>></li>
<<if $office isnot "">><li>Office: $office</li><</if>>
<li>Location: $location</li>
<li>Parish: $parish</li>
<li>Current plague status: $playerPlagueStatus</li>
</ul>
<<ListNPCs>> <<widget "stats-historical-totals">><<nobr>>
<h3>London As A Whole</h3>
<p>The <b><<defBillsOfMortality "Bills of Mortality">></b> record the staggering scale of the plague outbreak:</p>
<table width=90%><tr><th width=35%>Year</th><th width=30%>Total Burials</th><th width=35%>Plague Deaths</th></tr>
<tr><td>1664 (normal year)</td><td>18,297</td><td>6</td></tr>
<tr><td><b>1665 (plague year)</b></td><td><b>97,306</b></td><td><b>68,596</b></td></tr>
<tr><td>1666</td><td>12,738</td><td>1,998</td></tr>
</table>
<p>With an estimated population of around 400,000 people, roughly <b>1 in 4 Londoners died</b> in 1665 alone. Burials increased more than fivefold compared to a normal year.</p>
<p>Plague accounted for about 70% of all recorded deaths in 1665 and it's possible that the true toll was higher, with plague deaths misattributed to other causes. That said, regular non-plague causes of death continued throughout the epidemic. Some top killers included: </p>
<table width=90%><tr><th width=60%>Cause of Death</th><th width=20%>Deaths</th><th width=20%>In Game?</th></tr>
<tr><td>Fever</td><td>5,257</td><td>Yes</td></tr>
<tr><td>Consumption and Tissick</td><td>4,808</td><td>No</td></tr>
<tr><td>Teeth and Worms</td><td>2,614</td><td>Yes</td></tr>
<tr><td>Convulsions</td><td>2,036</td><td>Yes</td></tr>
<tr><td>Spotted Fever and Purples</td><td>1,929</td><td>Yes</td></tr>
<tr><td>Aged</td><td>1,545</td><td>Yes</td></tr>
<tr><td>Dropsy and Tympany</td><td>1,478</td><td>No</td></tr>
<tr><td>Griping in the Guts</td><td>1,288</td><td>Yes</td></tr>
<tr><td>Chrisomes and Infants</td><td>1,258</td><td>Yes</td></tr>
/*<tr><td>Surfeit</td><td>1,251</td><td>No</td></tr>
<tr><td>Smallpox</td><td>655</td><td>Yes</td></tr>
<tr><td>Childbed (maternal death)</td><td>625</td><td>Yes</td></tr>
<tr><td>Abortive and Stillborn</td><td>617</td><td>Yes</td></tr>*/
</table>
<</nobr>><</widget>>
<<widget "stats-parish-risk">><<nobr>>
<h3>Your Parish: $parish</h3>
<<silently>>
<<set _rates to $parishRate[$parish]>>
<<set _survProb to 1.0>>
<<for _ri to 0; _ri lt _rates.length; _ri++>>
<<if _rates[_ri] lt 1000>>
<<set _survProb to _survProb * (1.0 - (1.0 / _rates[_ri]))>>
<</if>>
<</for>>
<<set _infectProb to Math.round((1.0 - _survProb) * 100)>>
/* Find most dangerous month */
<<set _worstRate to 1000>>
<<set _worstMonth to "">>
<<for _ri to 0; _ri lt _rates.length; _ri++>>
<<if _rates[_ri] lt _worstRate>><<set _worstRate to _rates[_ri]>><<set _worstMonth to $timeline[_ri]>><</if>>
<</for>>
/* Get parish plague death count from the parish lists */
<<set _parishDeaths to 0>>
<<if def $wallParishes[$parish]>><<set _parishDeaths to $wallParishes[$parish]>>
<<elseif def $WestmParishes[$parish]>><<set _parishDeaths to $WestmParishes[$parish]>>
<<elseif def $eParishes[$parish]>><<set _parishDeaths to $eParishes[$parish]>>
<<elseif def $wParishes[$parish]>><<set _parishDeaths to $wParishes[$parish]>>
<<elseif def $nParishes[$parish]>><<set _parishDeaths to $nParishes[$parish]>>
<<elseif def $sParishes[$parish]>><<set _parishDeaths to $sParishes[$parish]>>
<</if>>
<</silently>>
<table width=90%><tr><th width=70%></th><th width=30%></th></tr>
<tr><td>Recorded plague deaths in your parish</td><td><<print _parishDeaths>></td></tr>
<tr><td>Cumulative chance of catching plague</td><td><<print _infectProb>>%</td></tr>
<tr><td>Most dangerous month</td><td><<print _worstMonth>></td></tr>
<tr><td>Peak monthly infection chance</td><td>1 in <<print _worstRate>></td></tr>
</table>
<p>Parishes inside the City walls were generally safer than the poorer suburbs, where plague arrived earlier and spread faster due to crowded housing.</p>
<</nobr>><</widget>>
<<widget "stats-household-mortality">><<nobr>>
<h3>Your Household</h3>
<<silently>>
<<set _totalStart to 0>>
<<set _totalDead to 0>>
<<set _plagueDead to 0>>
<<set _otherDead to 0>>
<<set _totalRecovered to 0>>
<<set _totalHealthy to 0>>
<<set _totalSafe to 0>>
<<set _totalFled to 0>>
/* Count NPCs */
<<for _mi to 0; _mi lt $NPCs.length; _mi++>>
<<set _totalStart += 1>>
<<set _h to $NPCs[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<<elseif _h is "safe from harm">><<set _totalSafe += 1>>
<<elseif _h is "healthy">><<set _totalHealthy += 1>>
<</if>>
<</for>>
/* Count fled family */
<<for _mi to 0; _mi lt $FledFamily.length; _mi++>>
<<set _totalStart += 1>><<set _totalFled += 1>>
<<set _h to $FledFamily[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<</if>>
<</for>>
/* Count servants */
<<for _mi to 0; _mi lt $NPCsServants.length; _mi++>>
<<set _totalStart += 1>>
<<set _h to $NPCsServants[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<<elseif _h is "healthy">><<set _totalHealthy += 1>>
<</if>>
<</for>>
/* Count fled servants */
<<for _mi to 0; _mi lt $FledServants.length; _mi++>>
<<set _totalStart += 1>><<set _totalFled += 1>>
<<set _h to $FledServants[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<</if>>
<</for>>
/* Count master household */
<<for _mi to 0; _mi lt $NPCsMaster.length; _mi++>>
<<set _totalStart += 1>>
<<set _h to $NPCsMaster[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<<elseif _h is "healthy">><<set _totalHealthy += 1>>
<</if>>
<</for>>
/* Count extended family */
<<for _mi to 0; _mi lt $NPCsExtended.length; _mi++>>
<<set _totalStart += 1>>
<<set _h to $NPCsExtended[_mi].health>>
<<if _h is "deceased" or _h.indexOf("deceased") is 0>><<set _totalDead += 1>>
<<if _h is "deceased-pq" or _h.indexOf("deceased-pq") is 0>><<set _plagueDead += 1>><<else>><<set _otherDead += 1>><</if>>
<<elseif _h.indexOf("recovered") is 0>><<set _totalRecovered += 1>>
<<elseif _h is "healthy">><<set _totalHealthy += 1>>
<</if>>
<</for>>
<<set _totalSurvived to _totalHealthy + _totalRecovered + _totalSafe>>
<</silently>>
<<if _totalStart gt 0>>
<table width=90%><tr><th width=70%>Category</th><th width=30%>Count</th></tr>
/*<tr><td>Total household members</td><td><<print _totalStart>></td></tr>*/
<tr><td>Died of plague</td><td><<print _plagueDead>></td></tr>
<tr><td>Died of other causes</td><td><<print _otherDead>></td></tr>
<tr><td>Survived</td><td><<print _totalSurvived>></td></tr>
<<if _totalFled gt 0>><tr><td>Fled London</td><td><<print _totalFled>></td></tr><</if>>
</table>
<ul style="margin-top: 0.5em; font-style: italic;">
<<group-mortality-line "Your immediate family" "$NPCs" "$FledFamily">>
<<group-mortality-line "Your servants" "$NPCsServants" "$FledServants">>
<<group-mortality-line "Your master's household" "$NPCsMaster">>
<<group-mortality-line "Your extended family" "$NPCsExtended">>
</ul>
<<if _totalDead gt 0>>
<p><i>Your household lost <<print Math.round((_totalDead / _totalStart) * 100)>>% of its members. Historically, households struck by plague often lost 30-50% of their members, and some were wiped out entirely.</i></p>
<<else>>
<p><i>Your household suffered no deaths. This was fortunate but not extraordinarily so. Many households escaped the plague entirely, especially in wealthier, less crowded parishes.</i></p>
<</if>>
<<else>>
<p>You had no household members.</p>
<</if>>
<</nobr>><</widget>>
<<widget "stats-cumulative-risk">><<nobr>>
<h3>Your Character</h3>
<<silently>>
/* Count decision-based exposures */
<<set _exposureCount to 0>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object" and _d.infectPct neq null and _d.infectPct gt 0>>
<<set _exposureCount += 1>>
<</if>>
<</for>>
/* Compute parish baseline survival (mirrors dataviz approach) */
<<set _rates to $parishRate[$parish]>>
<<set _tLen to $timeline.length>>
<<set _parishPct to []>>
<<for _i to 0; _i lt _tLen; _i++>>
<<if _rates[_i] lt 1000>>
<<set _parishPct.push(Math.round((1.0 / _rates[_i]) * 10000) / 100)>>
<<else>>
<<set _parishPct.push(0)>>
<</if>>
<</for>>
/* Account for fled months */
<<set _isFled to ($fled is 1 or $fled is 2 or $fled is 6)>>
<<if _isFled>>
<<set _returnIndex to _tLen>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object">>
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gt $fledFromIndex and _mIdx lt _returnIndex>><<set _returnIndex to _mIdx>><</if>>
<</if>>
<</if>>
<</for>>
<<for _i to $fledFromIndex + 1; _i lt _returnIndex; _i++>>
<<set _parishPct[_i] to 0>>
<</for>>
<</if>>
/* Account for impressed/navy months (player was aboard ship, 0% parish risk) */
<<if $impressedFromIndex gte 0>>
<<set _returnIndex to _tLen>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object">>
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gt $impressedFromIndex and _mIdx lt _returnIndex>><<set _returnIndex to _mIdx>><</if>>
<</if>>
<</if>>
<</for>>
<<for _i to $impressedFromIndex + 1; _i lt _returnIndex; _i++>>
<<set _parishPct[_i] to 0>>
<</for>>
<</if>>
/* Bin decisions by month (mirrors dataviz approach) */
<<set _decPctByMonth to []>>
<<for _i to 0; _i lt _tLen; _i++>>
<<set _decPctByMonth.push(0)>>
<</for>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object" and _d.infectPct neq null and _d.infectPct gt 0>>
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gte 0>>
<<set _decPctByMonth[_mIdx] to _decPctByMonth[_mIdx] + _d.infectPct>>
<</if>>
<</if>>
<</if>>
<</for>>
/* Compute parish-only and total survival */
<<set _survParish to 1.0>>
<<set _survAll to 1.0>>
<<for _i to 0; _i lt _tLen; _i++>>
<<if _parishPct[_i] gt 0>>
<<set _survParish to _survParish * (1.0 - (_parishPct[_i] / 100))>>
<<set _survAll to _survAll * (1.0 - (_parishPct[_i] / 100))>>
<</if>>
<<if _decPctByMonth[_i] gt 0>>
<<set _survAll to _survAll * (1.0 - (_decPctByMonth[_i] / 100))>>
<</if>>
<</for>>
<<set _cumParish to Math.round((1.0 - _survParish) * 100)>>
<<set _cumTotal to Math.round((1.0 - _survAll) * 100)>>
<<set _cumRisk to _cumTotal - _cumParish>>
<<if _cumRisk lt 0>><<set _cumRisk to 0>><</if>>
<</silently>>
<<if _exposureCount gt 0>>
<p>Over the course of the game, your decisions exposed you to plague infection <<print _exposureCount>> time<<if _exposureCount gt 1>>s<</if>>, for a combined cumulative risk of approximately <b><<print _cumRisk>>%</b>. This is over and above the <<print _cumParish>>% risk you faced just living in $parish.</p>
<</if>>
<</nobr>><</widget>>
<<widget "risk-visualization">><<nobr>>
<<silently>>
/* ── 1. Compute monthly parish baseline risk ── */
<<set _rates to $parishRate[$parish]>>
<<set _tLen to $timeline.length>>
<<set _parishPct to []>>
<<for _i to 0; _i lt _tLen; _i++>>
<<if _rates[_i] lt 1000>>
<<set _parishPct.push(Math.round((1.0 / _rates[_i]) * 10000) / 100)>>
<<else>>
<<set _parishPct.push(0)>>
<</if>>
<</for>>
/* ── 1b. Account for fled months ── */
<<set _isFled to ($fled is 1 or $fled is 2 or $fled is 6)>>
<<set _fullParishPct to _parishPct.slice()>>
<<if _isFled>>
/* Determine return month by scanning decisions for first month after fledFromIndex */
<<set _returnIndex to _tLen>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object">>
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gt $fledFromIndex and _mIdx lt _returnIndex>><<set _returnIndex to _mIdx>><</if>>
<</if>>
<</if>>
<</for>>
/* Zero out parish risk for months the player was away */
<<for _i to $fledFromIndex + 1; _i lt _returnIndex; _i++>>
<<set _parishPct[_i] to 0>>
<</for>>
<</if>>
/* ── 1c. Account for impressed/navy months ── */
<<if $impressedFromIndex gte 0>>
<<set _returnIndex to _tLen>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object">>
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gt $impressedFromIndex and _mIdx lt _returnIndex>><<set _returnIndex to _mIdx>><</if>>
<</if>>
<</if>>
<</for>>
<<for _i to $impressedFromIndex + 1; _i lt _returnIndex; _i++>>
<<set _parishPct[_i] to 0>>
<</for>>
<</if>>
/* ── 2. Bin decisions by month, split role vs other ── */
<<set _rolePct to []>>
<<set _decPct to []>>
<<for _i to 0; _i lt _tLen; _i++>>
<<set _rolePct.push(0)>>
<<set _decPct.push(0)>>
<</for>>
<<set _rolePatterns to ["Transported plague corpses", "Examined plague corpses", "Nursed a plague patient", "Guarded a plague house"]>>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object" and _d.infectPct neq null and _d.infectPct gt 0>>
/* Extract month from text (everything before the colon) */
<<set _colonIdx to _d.text.indexOf(":")>>
<<if _colonIdx gt 0>>
<<set _monthStr to _d.text.slice(0, _colonIdx)>>
<<set _mIdx to $timeline.indexOf(_monthStr)>>
<<if _mIdx gte 0>>
/* Check if it matches a role pattern */
<<set _isRole to false>>
<<for _rp to 0; _rp lt _rolePatterns.length; _rp++>>
<<if _d.text.indexOf(_rolePatterns[_rp]) gte 0>><<set _isRole to true>><</if>>
<</for>>
<<if _isRole>>
<<set _rolePct[_mIdx] to _rolePct[_mIdx] + _d.infectPct>>
<<else>>
<<set _decPct[_mIdx] to _decPct[_mIdx] + _d.infectPct>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>
/* ── 3. Find max total risk for chart scaling ── */
<<set _maxRisk to 0>>
<<for _i to 0; _i lt _tLen; _i++>>
<<set _total to _parishPct[_i] + _rolePct[_i] + _decPct[_i]>>
<<if _total gt _maxRisk>><<set _maxRisk to _total>><</if>>
<</for>>
/* Round max up to a nice ceiling */
<<if _maxRisk lt 5>><<set _chartMax to 5>>
<<elseif _maxRisk lt 10>><<set _chartMax to 10>>
<<elseif _maxRisk lt 20>><<set _chartMax to 20>>
<<elseif _maxRisk lt 50>><<set _chartMax to 50>>
<<else>><<set _chartMax to Math.ceil(_maxRisk / 10) * 10>>
<</if>>
/* ── 4. Compute cumulative risk for each layer (including full parish for fled comparison) ── */
<<set _survParish to 1.0>>
<<set _survRole to 1.0>>
<<set _survAll to 1.0>>
<<set _survFullParish to 1.0>>
<<for _i to 0; _i lt _tLen; _i++>>
<<if _fullParishPct[_i] gt 0>>
<<set _survFullParish to _survFullParish * (1.0 - (_fullParishPct[_i] / 100))>>
<</if>>
<<if _parishPct[_i] gt 0>>
<<set _survParish to _survParish * (1.0 - (_parishPct[_i] / 100))>>
<<set _survRole to _survRole * (1.0 - (_parishPct[_i] / 100))>>
<<set _survAll to _survAll * (1.0 - (_parishPct[_i] / 100))>>
<</if>>
<<if _rolePct[_i] gt 0>>
<<set _survRole to _survRole * (1.0 - (_rolePct[_i] / 100))>>
<<set _survAll to _survAll * (1.0 - (_rolePct[_i] / 100))>>
<</if>>
<<if _decPct[_i] gt 0>>
<<set _survAll to _survAll * (1.0 - (_decPct[_i] / 100))>>
<</if>>
<</for>>
<<set _cumParish to Math.round((1.0 - _survParish) * 100)>>
<<set _cumRole to Math.round((1.0 - _survRole) * 100) - _cumParish>>
<<if _cumRole lt 0>><<set _cumRole to 0>><</if>>
<<set _cumDec to Math.round((1.0 - _survAll) * 100) - _cumParish - _cumRole>>
<<if _cumDec lt 0>><<set _cumDec to 0>><</if>>
<<set _cumTotal to _cumParish + _cumRole + _cumDec>>
<<set _cumFullParish to Math.round((1.0 - _survFullParish) * 100)>>
<<set _fledReduction to _cumFullParish - _cumParish>>
<<if _fledReduction lt 0>><<set _fledReduction to 0>><</if>>
/* ── 5. Determine which months to show (skip zero-risk months at edges) ── */
<<set _firstActive to _tLen>>
<<set _lastActive to 0>>
<<for _i to 0; _i lt _tLen; _i++>>
<<set _total to _fullParishPct[_i] + _rolePct[_i] + _decPct[_i]>>
<<if _total gt 0>>
<<if _i lt _firstActive>><<set _firstActive to _i>><</if>>
<<if _i gt _lastActive>><<set _lastActive to _i>><</if>>
<</if>>
<</for>>
/* Include one month of padding on each side */
<<if _firstActive gt 0>><<set _firstActive to _firstActive - 1>><</if>>
<<if _lastActive lt _tLen - 1>><<set _lastActive to _lastActive + 1>><</if>>
<<set _visCount to _lastActive - _firstActive + 1>>
/* ── 6. Short month labels ── */
<<set _shortLabels to ["Dec 64", "Jan 65", "May 65", "Jun 65", "Jul 65", "Aug 65", "Sep 65", "Oct 65", "Nov 65", "Dec 65", "Jan 66", "Feb 66", "Mar 66", "Apr 66", "May 66", "Jun 66", "Jul 66", "Aug 66", "Sep 66", "Oct 66", "Nov 66", "Dec 66"]>>
/* ── 7. Check if player has any role/decision risk to show ── */
<<set _hasRole to false>>
<<set _hasDec to false>>
<<for _i to 0; _i lt _tLen; _i++>>
<<if _rolePct[_i] gt 0>><<set _hasRole to true>><</if>>
<<if _decPct[_i] gt 0>><<set _hasDec to true>><</if>>
<</for>>
<</silently>>
<h3>Your Plague Risk Over Time</h3>
<div style="position: relative; width: 100%; max-width: 600px; margin: 0 auto;">
/* ── Y-axis labels ── */
<div style="position: relative; height: 200px; margin-left: 40px; margin-bottom: 4px; display: flex; align-items: flex-end;">
/* Y-axis tick labels */
<div style="position: absolute; left: -40px; top: 0; height: 100%; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.7em; color: #aaa;">
<span><<print _chartMax>>%</span>
<span><<print Math.round(_chartMax / 2)>>%</span>
<span>0%</span>
</div>
/* ── Bar container ── */
<div style="display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; border-left: 1px solid #555; border-bottom: 1px solid #555; padding: 0 2px;">
<<for _i to _firstActive; _i lte _lastActive; _i++>>
<<set _pH to (_parishPct[_i] / _chartMax) * 200>>
<<set _rH to (_rolePct[_i] / _chartMax) * 200>>
<<set _dH to (_decPct[_i] / _chartMax) * 200>>
<<set _barW to "calc((100% - " + (_visCount * 2) + "px) / " + _visCount + ")">>
<div style="flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0;">
<<if _decPct[_i] gt 0>><div @title="_shortLabels[_i] + ' decisions: ' + _decPct[_i] + '%'" @style="'height: ' + _dH + 'px; background: #e41a1c; min-height: 1px;'"></div><</if>>
<<if _rolePct[_i] gt 0>><div @title="_shortLabels[_i] + ' role: ' + _rolePct[_i] + '%'" @style="'height: ' + _rH + 'px; background: #ff7f00; min-height: 1px;'"></div><</if>>
<<if _parishPct[_i] gt 0>><div @title="_shortLabels[_i] + ' parish: ' + (Math.round(_parishPct[_i] * 10) / 10) + '%'" @style="'height: ' + _pH + 'px; background: #a65628; min-height: 1px;'"></div><<else>><div style="height: 0;"></div><</if>>
</div>
<</for>>
</div>
</div>
/* ── X-axis labels ── */
<div style="display: flex; gap: 2px; margin-left: 40px; padding: 0 2px;">
<<for _i to _firstActive; _i lte _lastActive; _i++>>
<div style="flex: 1; text-align: center; font-size: 0.6em; color: #aaa; overflow: hidden; white-space: nowrap; min-width: 0;"><<print _shortLabels[_i]>></div>
<</for>>
</div>
/* ── Legend ── */
<div style="display: flex; gap: 12px; margin-top: 12px; margin-left: 40px; flex-wrap: wrap; font-size: 0.85em;">
<div><span style="display: inline-block; width: 12px; height: 12px; background: #a65628; vertical-align: middle; margin-right: 4px;"></span> Living in $parish</div>
<<if _hasRole>><div><span style="display: inline-block; width: 12px; height: 12px; background: #ff7f00; vertical-align: middle; margin-right: 4px;"></span> Your role as $role</div><</if>>
<<if _hasDec>><div><span style="display: inline-block; width: 12px; height: 12px; background: #e41a1c; vertical-align: middle; margin-right: 4px;"></span> Your other decisions</div><</if>>
</div>
</div>
/* ── Cumulative Risk Pie Chart ── */
<<set _cumSafe to 100 - _cumTotal>>
<<if _cumSafe lt 0>><<set _cumSafe to 0>><</if>>
/* Build conic-gradient stops */
<<set _stop1 to _cumParish>>
<<set _stop2 to _stop1 + _cumRole>>
<<set _stop3 to _stop2 + _cumDec>>
<h3>Your Cumulative Plague Risk</h3>
<div style="width: 100%; max-width: 600px; margin: 0 auto; text-align: center;">
<div @style="'display: inline-block; width: 200px; height: 200px; border-radius: 50%; background: conic-gradient(#a65628 0% ' + _stop1 + '%, #ff7f00 ' + _stop1 + '% ' + _stop2 + '%, #e41a1c ' + _stop2 + '% ' + _stop3 + '%, #333 ' + _stop3 + '% 100%); border: 1px solid #555;'" @title="'Total risk: ' + _cumTotal + '%'"></div>
/* ── Pie chart legend ── */
<div style="display: flex; gap: 12px; margin-top: 12px; justify-content: center; flex-wrap: wrap; font-size: 0.85em;">
<<if _cumParish gt 0>><div><span style="display: inline-block; width: 12px; height: 12px; background: #a65628; vertical-align: middle; margin-right: 4px;"></span> Parish: <<print _cumParish>>%</div><</if>>
<<if _cumRole gt 0>><div><span style="display: inline-block; width: 12px; height: 12px; background: #ff7f00; vertical-align: middle; margin-right: 4px;"></span> Role: <<print _cumRole>>%</div><</if>>
<<if _cumDec gt 0>><div><span style="display: inline-block; width: 12px; height: 12px; background: #e41a1c; vertical-align: middle; margin-right: 4px;"></span> Decisions: <<print _cumDec>>%</div><</if>>
<div><span style="display: inline-block; width: 12px; height: 12px; background: #333; border: 1px solid #555; vertical-align: middle; margin-right: 4px;"></span> Safe: <<print _cumSafe>>%</div>
</div>
/* ── Total risk callout ── */
<div style="margin-top: 8px; font-size: 0.9em;">
Total plague risk: <b><<print _cumTotal>>%</b>
</div>
<<set _awayReason to "">><<if _isFled and $impressedFromIndex gte 0>><<set _awayReason to "fleeing and serving aboard ship">><<elseif _isFled>><<set _awayReason to "fleeing">><<elseif $impressedFromIndex gte 0>><<set _awayReason to "serving aboard ship">><</if>>
<p><i>For comparison, the average resident of $parish faced a <<print _cumFullParish>>% cumulative chance of catching plague based on parish infection rates alone.<<if _cumRole + _cumDec gt 0 and _fledReduction gt 0>> Your role and decisions added <<print _cumRole + _cumDec>> percentage points of additional risk, while <<print _awayReason>> removed <<print _fledReduction>> percentage points of your parish's base infection risk.<<elseif _cumRole + _cumDec gt 0>> Your role and decisions added <<print _cumRole + _cumDec>> percentage points of additional risk.<<elseif _fledReduction gt 0>> <<set _awayReason to _awayReason.charAt(0).toUpperCase() + _awayReason.slice(1)>><<print _awayReason>> removed <<print _fledReduction>> percentage points of your parish's base infection risk.<</if>></i></p>
</div>
/* ── Original Cumulative Risk Thermometer (commented out) ── */
/*
<h3>Your Cumulative Plague Risk</h3>
<div style="width: 100%; max-width: 600px; margin: 0 auto;">
<div style="position: relative; height: 32px; background: #333; border: 1px solid #555; border-radius: 4px; overflow: hidden;">
<<if _cumParish gt 0>><div @title="'Parish risk: ' + _cumParish + '%'" @style="'display: inline-block; height: 100%; width: ' + _cumParish + '%; background: #a65628; float: left;'"></div><</if>>
<<if _cumRole gt 0>><div @title="'Role risk: +' + _cumRole + '%'" @style="'display: inline-block; height: 100%; width: ' + _cumRole + '%; background: #ff7f00; float: left;'"></div><</if>>
<<if _cumDec gt 0>><div @title="'Decision risk: +' + _cumDec + '%'" @style="'display: inline-block; height: 100%; width: ' + _cumDec + '%; background: #e41a1c; float: left;'"></div><</if>>
</div>
<div style="position: relative; height: 14px; font-size: 0.65em; color: #aaa; margin-top: 2px;">
<span style="position: absolute; left: 0;">0%</span>
<span style="position: absolute; left: 25%; transform: translateX(-50%);">25%</span>
<span style="position: absolute; left: 50%; transform: translateX(-50%);">50%</span>
<span style="position: absolute; left: 75%; transform: translateX(-50%);">75%</span>
<span style="position: absolute; right: 0;">100%</span>
</div>
<div style="margin-top: 8px; font-size: 0.9em;">
<span style="color: #a65628;">Parish: <<print _cumParish>>%</span>
<<if _cumRole gt 0>> + <span style="color: #ff7f00;">Role: <<print _cumRole>>%</span><</if>>
<<if _cumDec gt 0>> + <span style="color: #e41a1c;">Decisions: <<print _cumDec>>%</span><</if>>
= <b><<print _cumTotal>>%</b>
</div>
<p><i>For comparison, the average resident of $parish faced a <<print _cumFullParish>>% cumulative chance of catching plague based on parish infection rates alone.<<if _cumRole + _cumDec gt 0 and _fledReduction gt 0>> Your role and decisions added <<print _cumRole + _cumDec>> percentage points of additional risk, while fleeing removed <<print _fledReduction>> percentage points of your parish's base infection risk.<<elseif _cumRole + _cumDec gt 0>> Your role and decisions added <<print _cumRole + _cumDec>> percentage points of additional risk.<<elseif _fledReduction gt 0>> Fleeing removed <<print _fledReduction>> percentage points of your parish's base infection risk.<</if>></i></p>
</div>
*/
<</nobr>><</widget>>/*Infection Program: determines rate of plague infection based on parish-level historical data*/
<<widget "infection-program">><<nobr>>
<<silently>>
<<set _rate to $parishRate[$parish][$monthIndex]>>
<<if not hasVisited("Sickness")>>
<<if random(1, _rate) eq 1>>
<<set $plagueInfection to 1>>
<</if>>
<</if>>
<<for _i = 0; _i < $NPCs.length; _i++>>
<<if $NPCs[_i].health is "healthy">>
<<if random(1, _rate) lte 1>><<set $NPCs[_i].health to "infected">><</if>>
<</if>>
<</for>>
<<for _si = 0; _si < $NPCsServants.length; _si++>>
<<if $NPCsServants[_si].health is "healthy">>
<<if random(1, _rate) lte 1>><<set $NPCsServants[_si].health to "infected">><</if>>
<</if>>
<</for>>
<<for _mi = 0; _mi < $NPCsMaster.length; _mi++>>
<<if $NPCsMaster[_mi].health is "healthy">>
<<if random(1, _rate) lte 1>><<set $NPCsMaster[_mi].health to "infected">><</if>>
<</if>>
<</for>>
<<for _ei = 0; _ei < $NPCsExtended.length; _ei++>>
<<if $NPCsExtended[_ei].health is "healthy">>
<<if random(1, _rate) lte 1>><<set $NPCsExtended[_ei].health to "infected">><</if>>
<</if>>
<</for>>
<<check-NPCs>>
<</silently>>
<</nobr>><</widget>>
<<widget "quarantine-reconnect">><<nobr>>
/* Collect all dead NPCs for a single grouped funeral choice */
<<set _deadNPCs to []>>
<<for _qi = 0; _qi < $NPCs.length; _qi++>><<if ($NPCs[_qi].health is "deceased" or $NPCs[_qi].health is "deceased-pq") and !$NPCs[_qi].funeralDone>><<set _deadNPCs.push({npc: $NPCs[_qi], label: "your " + ($socio === "servants" && ($NPCs[_qi].relationship === "male servant" || $NPCs[_qi].relationship === "female servant") ? "fellow servant" : $NPCs[_qi].relationship)})>><</if>><</for>>
<<for _qi = 0; _qi < $NPCsServants.length; _qi++>><<if ($NPCsServants[_qi].health is "deceased" or $NPCsServants[_qi].health is "deceased-pq") and !$NPCsServants[_qi].funeralDone>><<set _deadNPCs.push({npc: $NPCsServants[_qi], label: "your " + ($socio === "servants" ? "fellow servant" : "servant")})>><</if>><</for>>
<<for _qi = 0; _qi < $NPCsMaster.length; _qi++>><<if ($NPCsMaster[_qi].health is "deceased" or $NPCsMaster[_qi].health is "deceased-pq") and !$NPCsMaster[_qi].funeralDone>><<set _deadNPCs.push({npc: $NPCsMaster[_qi], label: ($socio === "servants" && ($NPCsMaster[_qi].relationship === "male servant" || $NPCsMaster[_qi].relationship === "female servant") ? "your fellow servant" : "the " + $NPCsMaster[_qi].relationship)})>><</if>><</for>>
<<for _qi = 0; _qi < $NPCsExtended.length; _qi++>><<if ($NPCsExtended[_qi].health is "deceased" or $NPCsExtended[_qi].health is "deceased-pq") and !$NPCsExtended[_qi].funeralDone>><<set _deadNPCs.push({npc: $NPCsExtended[_qi], label: "your " + $NPCsExtended[_qi].relationship})>><</if>><</for>>
<<funeral-choice>>
<<orphan-check>>
<<servant-master-death>>
<<health-update>>
<<return-children>> /* NTS: need to do something so catch-up and storyline-return don't simultaneously fire before return-children decisions made */
<<catch-up>>
<<if _deadNPCs.length lte 0>><<storyline-return "You open your doors and reenter the outside world.">><</if>>
<</nobr>><</widget>>
/* plague-risk-check — centralizes the player plague infection probability
check that was previously copy-pasted across 30+ locations.
Usage:
<<plague-risk-check>> — standard parish-rate check
<<plague-risk-check "crowd">> — crowd bonus (+2% to displayed risk,
extra 1-in-50 infection roll)
Sets temp variables _rate and _riskPct for use by calling code. */
<<widget "plague-risk-check">><<nobr>>
<<set _rate to $parishRate[$parish][$monthIndex]>>
<<if _args.length gt 0 and _args[0] is "crowd">>
<<set _riskPct to Math.round((10000 / _rate) + 200) / 100>>
<<if random(1, _rate) eq 1>><<set $plagueInfection to 1>><</if>>
<<if random(1, 50) eq 1>><<set $plagueInfection to 1>><</if>>
<<else>>
<<set _riskPct to Math.round(10000 / _rate) / 100>>
<<if random(1, _rate) eq 1>><<set $plagueInfection to 1>><</if>>
<</if>>
<</nobr>><</widget>>
/* check-infected — scans one NPC array for infected members.
_args[0] = variable name string (e.g. "$NPCs")
Sets: _infectedResult (array of indices where health is "infected"). */
<<widget "check-infected">><<silently>>
<<set _ciArr to State.getVar(_args[0])>>
<<set _infectedResult to []>>
<<for _ci = 0; _ci < _ciArr.length; _ci++>>
<<if _ciArr[_ci].health is "infected">>
<<set _infectedResult.push(_ci)>>
<</if>>
<</for>>
<</silently>><</widget>><<widget "income">><<nobr>><<silently>>
<<if $socio is "nobles">>
/* Noble income — flat rate regardless of household */
<<set $income to 17600>>
<<elseif $socio is "merchants">>
/* Merchant income — flat rate regardless of household */
<<set $income to 4000>>
<<elseif $socio is "artisans">>
/* Artisan income — flat rate regardless of household */
<<set $income to 800>>
<<elseif $socio is "servants">>
/* Servant income — 60d (male) or 40d (female) per adult */
<<if $age is "young adult" or $age is "middle-aged adult" or $age is "elderly adult">>
<<if $gender is "male">><<set $income to 60>>
<<else>><<set $income to 40>>
<</if>>
<<else>>
<<set $income to 0>>
<</if>>
/* NPC adult income — only if NOT living in master's household */
<<if $hoh isnot 3 and $hoh isnot 0>>
<<for _ii = 0; _ii < $NPCs.length; _ii++>>
<<if $NPCs[_ii].health isnot "deceased" and $NPCs[_ii].health isnot "deceased-pq" and !$NPCs[_ii].relationship.startsWith("landlord")>>
<<if $NPCs[_ii].age is "young adult" or $NPCs[_ii].age is "middle-aged adult" or $NPCs[_ii].age is "elderly adult">>
<<if $NPCs[_ii].gender is "male">><<set $income += 60>>
<<else>><<set $income += 40>>
<</if>>
<</if>>
<</if>>
<</for>>
<</if>>
<<elseif $socio is "day labourers">>
/* Day labourer income — 180d (male) or 120d (female) per adult, 10d per child */
<<if $age is "young adult" or $age is "middle-aged adult" or $age is "elderly adult">>
<<if $gender is "male">><<set $income to 180>>
<<else>><<set $income to 120>>
<</if>>
<<elseif $age is "child" or $age is "adolescent">>
<<set $income to 10>>
<<else>>
<<set $income to 0>>
<</if>>
/* NPC income contributions */
<<for _ii = 0; _ii < $NPCs.length; _ii++>>
<<if $NPCs[_ii].health isnot "deceased" and $NPCs[_ii].health isnot "deceased-pq" and !$NPCs[_ii].relationship.startsWith("landlord")>>
<<if $NPCs[_ii].age is "young adult" or $NPCs[_ii].age is "middle-aged adult" or $NPCs[_ii].age is "elderly adult">>
<<if $NPCs[_ii].gender is "male">><<set $income += 180>>
<<else>><<set $income += 120>>
<</if>>
<<elseif $NPCs[_ii].age is "child" or $NPCs[_ii].age is "adolescent">>
<<set $income += 10>>
<</if>>
<</if>>
<</for>>
/* NPC servant income */
<<for _ii = 0; _ii < $NPCsServants.length; _ii++>>
<<if $NPCsServants[_ii].health isnot "deceased" and $NPCsServants[_ii].health isnot "deceased-pq">>
<<if $NPCsServants[_ii].age is "young adult" or $NPCsServants[_ii].age is "middle-aged adult" or $NPCsServants[_ii].age is "elderly adult">>
<<if $NPCsServants[_ii].gender is "male">><<set $income += 180>>
<<else>><<set $income += 120>>
<</if>>
<<elseif $NPCsServants[_ii].age is "child" or $NPCsServants[_ii].age is "adolescent">>
<<set $income += 10>>
<</if>>
<</if>>
<</for>>
<<elseif $socio is "beggars">>
/* Beggar income — 60d per adult, 20d per child/adolescent */
<<if $age is "young adult" or $age is "middle-aged adult" or $age is "elderly adult">>
<<set $income to 60>>
<<elseif $age is "child" or $age is "adolescent">>
<<set $income to 20>>
<<else>>
<<set $income to 0>>
<</if>>
/* NPC income contributions */
<<for _ii = 0; _ii < $NPCs.length; _ii++>>
<<if $NPCs[_ii].health isnot "deceased" and $NPCs[_ii].health isnot "deceased-pq" and !$NPCs[_ii].relationship.startsWith("landlord")>>
<<if $NPCs[_ii].age is "young adult" or $NPCs[_ii].age is "middle-aged adult" or $NPCs[_ii].age is "elderly adult">>
<<set $income += 60>>
<<elseif $NPCs[_ii].age is "child" or $NPCs[_ii].age is "adolescent">>
<<set $income += 20>>
<</if>>
<</if>>
<</for>>
<</if>>
<<if $lodger is 1>><<set $income to $income + $lodgerRent>><</if>>
/* Fled income adjustments */
<<if ($fled is 6 or $fled is 2) and $socio isnot "nobles" and $socio isnot "servants">>
/* Beggars, day labourers, artisans, merchants receive half income when fled */
<<set $income to Math.round($income / 2)>>
<<elseif $fled is 5>>
/* Player sent household away: add back half the income of fled NPCs */
<<set _fledNPCIncome to 0>>
<<if $socio is "day labourers">>
<<for _fi = 0; _fi < $FledFamily.length; _fi++>>
<<if $FledFamily[_fi].health isnot "deceased" and $FledFamily[_fi].health isnot "deceased-pq">>
<<if $FledFamily[_fi].age is "young adult" or $FledFamily[_fi].age is "middle-aged adult" or $FledFamily[_fi].age is "elderly adult">>
<<if $FledFamily[_fi].gender is "male">><<set _fledNPCIncome += 180>>
<<else>><<set _fledNPCIncome += 120>>
<</if>>
<<elseif $FledFamily[_fi].age is "child" or $FledFamily[_fi].age is "adolescent">>
<<set _fledNPCIncome += 10>>
<</if>>
<</if>>
<</for>>
<<for _fi = 0; _fi < $FledServants.length; _fi++>>
<<if $FledServants[_fi].health isnot "deceased" and $FledServants[_fi].health isnot "deceased-pq">>
<<if $FledServants[_fi].age is "young adult" or $FledServants[_fi].age is "middle-aged adult" or $FledServants[_fi].age is "elderly adult">>
<<if $FledServants[_fi].gender is "male">><<set _fledNPCIncome += 180>>
<<else>><<set _fledNPCIncome += 120>>
<</if>>
<<elseif $FledServants[_fi].age is "child" or $FledServants[_fi].age is "adolescent">>
<<set _fledNPCIncome += 10>>
<</if>>
<</if>>
<</for>>
<<elseif $socio is "beggars">>
<<for _fi = 0; _fi < $FledFamily.length; _fi++>>
<<if $FledFamily[_fi].health isnot "deceased" and $FledFamily[_fi].health isnot "deceased-pq">>
<<if $FledFamily[_fi].age is "young adult" or $FledFamily[_fi].age is "middle-aged adult" or $FledFamily[_fi].age is "elderly adult">>
<<set _fledNPCIncome += 60>>
<<elseif $FledFamily[_fi].age is "child" or $FledFamily[_fi].age is "adolescent">>
<<set _fledNPCIncome += 20>>
<</if>>
<</if>>
<</for>>
<<elseif $socio is "servants">>
<<for _fi = 0; _fi < $FledFamily.length; _fi++>>
<<if $FledFamily[_fi].health isnot "deceased" and $FledFamily[_fi].health isnot "deceased-pq">>
<<if $FledFamily[_fi].age is "young adult" or $FledFamily[_fi].age is "middle-aged adult" or $FledFamily[_fi].age is "elderly adult">>
<<if $FledFamily[_fi].gender is "male">><<set _fledNPCIncome += 60>>
<<else>><<set _fledNPCIncome += 40>>
<</if>>
<</if>>
<</if>>
<</for>>
<</if>>
/* Artisans, merchants, nobles have flat income — no fled NPC contribution */
<<set $income += Math.round(_fledNPCIncome / 2)>>
<</if>>
<</silently>><</nobr>><</widget>>
<<widget "expenses">><<nobr>><<silently>>
<<if $socio is "servants" and ($hoh is 1 or $hoh is 4)>>
/* Independent servant household — 20d per person */
<<set _hhCount to 1>>
<<for _ei = 0; _ei < $NPCs.length; _ei++>>
<<if $NPCs[_ei].health isnot "deceased" and $NPCs[_ei].health isnot "deceased-pq" and !$NPCs[_ei].relationship.startsWith("landlord")>>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<for _ei = 0; _ei < $NPCsServants.length; _ei++>>
<<if $NPCsServants[_ei].health isnot "deceased" and $NPCsServants[_ei].health isnot "deceased-pq">>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<set $expenses to 20 * _hhCount>>
<<elseif $socio is "servants" and ($age is "child" or $age is "adolescent")>>
/* Child/adolescent servant living with master — master covers expenses */
<<set $expenses to 0>>
<<elseif $socio is "servants">>
/* Servant living in master's household — only PC expenses */
<<set $expenses to 20>>
<<elseif $socio is "nobles" or $socio is "merchants" or $socio is "artisans">>
/* Base per household */
<<if $socio is "nobles">><<set _baseExp to 12000>><<set _perFamily to 240>><<set _perServant to 60>>
<<elseif $socio is "merchants">><<set _baseExp to 2800>><<set _perFamily to 90>><<set _perServant to 40>>
<<elseif $socio is "artisans">><<set _baseExp to 560>><<set _perFamily to 60>><<set _perServant to 40>>
<</if>>
/* Count living family members (including PC = 1) */
<<set _famCount to 1>>
<<for _ei = 0; _ei < $NPCs.length; _ei++>>
<<if $NPCs[_ei].health isnot "deceased" and $NPCs[_ei].health isnot "deceased-pq" and !$NPCs[_ei].relationship.startsWith("landlord")>>
<<set _famCount += 1>>
<</if>>
<</for>>
/* Count living servants */
<<set _svCount to 0>>
<<for _ei = 0; _ei < $NPCsServants.length; _ei++>>
<<if $NPCsServants[_ei].health isnot "deceased" and $NPCsServants[_ei].health isnot "deceased-pq">>
<<set _svCount += 1>>
<</if>>
<</for>>
<<set $expenses to _baseExp + (_perFamily * _famCount) + (_perServant * _svCount)>>
/* nobles following Court pay double expenses via fled-cost widget, no extra surcharge here */
<<if $seekingPreferment is 1>><<set $expenses += 2400>><</if>>
<<elseif $socio is "day labourers">>
/* Day labourer — 60d per household + 20d per person */
<<set _hhCount to 1>>
<<for _ei = 0; _ei < $NPCs.length; _ei++>>
<<if $NPCs[_ei].health isnot "deceased" and $NPCs[_ei].health isnot "deceased-pq" and !$NPCs[_ei].relationship.startsWith("landlord")>>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<for _ei = 0; _ei < $NPCsServants.length; _ei++>>
<<if $NPCsServants[_ei].health isnot "deceased" and $NPCsServants[_ei].health isnot "deceased-pq">>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<set $expenses to 60 + (20 * _hhCount)>>
<<elseif $socio is "beggars">>
/* Beggar — 40d per household + 20d per person */
<<set _hhCount to 1>>
<<for _ei = 0; _ei < $NPCs.length; _ei++>>
<<if $NPCs[_ei].health isnot "deceased" and $NPCs[_ei].health isnot "deceased-pq" and !$NPCs[_ei].relationship.startsWith("landlord")>>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<for _ei = 0; _ei < $NPCsServants.length; _ei++>>
<<if $NPCsServants[_ei].health isnot "deceased" and $NPCsServants[_ei].health isnot "deceased-pq">>
<<set _hhCount += 1>>
<</if>>
<</for>>
<<set $expenses to 40 + (20 * _hhCount)>>
<</if>>
<</silently>><</nobr>><</widget>>
<<widget "disposable">><<nobr>><<silently>>
<<set _disposable to ($income - $expenses)>>
<<set $money to Math.clamp($money + _disposable, -10000000, 10000000)>>
<</silently>><</nobr>><</widget>>
<<widget "conversion">><<nobr>><<silently>>
<<set _convertAmt to (_args.length ? _args[0] : $money)>><<set _neg to (_convertAmt lt 0)>><<set _convertAmt to Math.abs(_convertAmt)>><<set _shillings to Math.floor(_convertAmt/12)>><<set _pence to (_convertAmt - (_shillings*12))>>
<<set _pounds to Math.floor(_shillings/20)>><<set _shillings to (_shillings - Math.floor(_pounds*20))>>
<</silently>>
<<if _neg>>-<</if>>£_pounds, _shillings s., _pence d.<</nobr>><</widget>>
<<widget "money">><<nobr>>
<<set $money to ($money + _args[0])>>
<<replace "#conversion">><<conversion>><</replace>><</nobr>><</widget>>
<<widget "party-costs">><<nobr>>
<<if $socio is "nobles">>
<<set _partyCost to 2400>>
<<elseif $socio is "merchants">>
<<set _partyCost to 480>>
<<elseif $socio is "artisans">>
<<set _partyCost to 120>>
<<else>>
<<set _partyCost to 6>>
<</if>>
<<master-pays _partyCost>>
<<if _masterPaid>><<set _partyCost to 0>><</if>>
<</nobr>><</widget>>
<<widget "quarantine-costs">><<nobr>>
<<expenses>>
<<if $socio is "nobles">>
<<income>>
<<set _qWeekly to Math.round(($income - $expenses) / 4)>>
<<else>>
<<set _qWeekly to Math.round($expenses / 4) * -1>>
<</if>>
<<set $money to Math.clamp($money + _qWeekly, -10000000, 10000000)>>
<<quarantine-debt-check>>
<</nobr>><</widget>>
/* master-pays — deducts _args[0] pence from $money UNLESS the player
is a servant living in their master's household ($hoh is 3 or child
servant with $hoh is 0) or has moved into the master's household to
nurse plague ($quarantineSwapped is "master"), in which case the
master absorbs the cost.
Sets _masterPaid to true when the master absorbed the expense. */
<<widget "master-pays">><<nobr>>
<<if $socio is "servants" and ($hoh is 3 or $hoh is 0 or $quarantineSwapped is "master")>>
<<set _masterPaid to true>>
<<else>>
<<set _masterPaid to false>>
<<set $money -= _args[0]>>
<</if>>
<</nobr>><</widget>>
<<nobr>><h2>Fumigants:</h2><br>
<table width=90%><th width=70%>Item</th><th width=30%>Quantity</th><<for _key range $fumes>>
<tr><td>_key.name</td><td> _key.quantity</td></tr>
<</for>>
</table><br><br>
<h2>Remedies</h2>
<table width=90%><th width=70%>Item</th><th width=30%>Quantity</th><<for _key range $remedies>>
<tr><td>_key.name</td><td> _key.quantity</td></tr>
<</for>>
</table>
<</nobr>><<nobr>>
<<silently>>
<<set _hhSize to $NPCs.filter(function(n) { return n.health isnot "deceased"; }).length + 1>>
<<if $socio is "servants" and ($hoh is 3 or $hoh is 0)>><<set _hhSize to 1>><</if>>
<<set _celestialPrice to _hhSize*36>>
<<set _treaclePrice to _hhSize*6>>
<<set _incensePrice to _hhSize*3>>
<<set _pursePrice to _hhSize*60>>
<<set _fancyfumesPrice to 192 >>
<<set _genericfumesPrice to 24>>
<</silently>>
The <<defApothecary "apothecary">> sells items that may help your family avoid illness. For the <<defRemedies "remedies">> to be effective, however, you must purchase enough for all members of your <<defHousehold "household">>. The effects are also limited and must be used constantly for prevention.<br>
<table style="width:100%">
<tr><th style="width:40%">Item</th><th style="width:20%">Price</th><th style width="20%">Have (per person/month's supply)</th><th style="width:20%">Purchase </th></tr>
<tr><h3>Preventative Medicines</h3></tr>
<tr>
<td>
<<defCelestialWater "Celestial Water">>
</td>
<td><<conversion _celestialPrice>></td>
<td>$remedies.Celestial.quantity</td>
<td>
<<if $money gte _celestialPrice>>
<<link "Buy">><<money `-1 * _celestialPrice`>>
<<set $remedies.Celestial.quantity +=1>><<run $(Dialog.body()).empty(); Dialog.wiki(Story.get("Apothecary").text)>>
<</link>><<else>>You don't have enough to buy this.
<</if>>
</td>
</tr>
<tr><td><<defLondonTreacle "London Treacle">></td><td><<conversion _treaclePrice>></td><td>$remedies.Treacle.quantity</td>
<td id="treacle">
<<if $money gte _treaclePrice>><<link "Buy">><<money `-1 * _treaclePrice`>><<set $remedies.Treacle.quantity += 1>><<run $(Dialog.body()).empty(); Dialog.wiki(Story.get("Apothecary").text)>><</link>><<else>>You don't have enough to buy this.<</if>></td></tr>
<tr><h3>Fumigants</h3></tr>
<tr><td><<defPurseOfIncense "A purse of incense">></td><td><<conversion _pursePrice>></td><td>$fumes.Purse.quantity</td><td><<if $money gte _pursePrice>><<link "Buy">><<money `-1 * _pursePrice`>><<set $fumes.Purse.quantity +=1>><<run $(Dialog.body()).empty(); Dialog.wiki(Story.get("Apothecary").text)>><</link>><<else>>You don't have enough to buy this.<</if>></td></tr>
<tr><td><<defStGilesPowder "St. Giles Powder">></td><td><<conversion _fancyfumesPrice>></td><td>$fumes.Fancy.quantity</td><td id="fancy"><<if $money gte _fancyfumesPrice>><<link "Buy">><<money `-1 * _fancyfumesPrice`>><<set $fumes.Fancy.quantity += 1>><<run $(Dialog.body()).empty(); Dialog.wiki(Story.get("Apothecary").text)>><</link>><<else>>You don't have enough to buy this.<</if>></td></tr>
<tr><td><<defCheapFumigants "Cheap Fumigants">></td><td><<conversion _genericfumesPrice>></td><td>$fumes.Generic.quantity</td><td><<if $money gte _genericfumesPrice>><<link "Buy">><<money `-1 * _genericfumesPrice`>><<set $fumes.Generic.quantity += 1>><<run $(Dialog.body()).empty(); Dialog.wiki(Story.get("Apothecary").text)>><</link>><<else>>You don't have enough to buy this.<</if>></td></tr>
</table><br>
Remaining money: <<conversion>><br>
/*<<link "Close">><<run Dialog.close()>><</link>> superfluous code */
<</nobr>>
<a href="https://iiif.wellcomecollection.org/image/L0064305/full/1024%2C/0/default.jpg"><img src="https://iiif.wellcomecollection.org/image/L0064305/full/1024%2C/0/default.jpg" width="100%" alt="title page of The Christians Refuge: Or Heavenly Antidotes against the Plague with a frontispiece image of Death and the plea 'Lord have Mercy upon us'"></a>
//"The Christians Refuge: Or Heavenly Antidotes against the Plague"//<<widget "preventative">><<nobr>>
<ul><li><span id="church"><<link "Go to church and pray often">><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>><<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Went to church to pray often", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: _riskPct})>><<replace "#church">>You go to church and pray regularly through the month. Others admire your piety in the face of such a grave situation.<</replace>><</link>></span></li>
<li><span id="eat"><<link "Avoid eating berries, cabbage, cucumbers, melon, and spinach.">><<replace "#eat">>You avoid eating berries, cabbage, cucumbers, melons, and spinach to keep your humors well-balanced.<</replace>><</link>></span></li>
<li><<link "Visit the apothecary">><<run Dialog.setup("Apothecary", "apothecary"); Dialog.wiki(Story.get("Apothecary").text); Dialog.open()>><</link>></li></ul>
<<if $remedies.Celestial.quantity gt 0>><<set $remedies.Celestial.quantity -= 1>><br><br>You are also careful to drink <<defCelestialWater "celestial water">> every morning to protect yourself from infection.<<elseif $remedies.Treacle.quantity gt 0>><<set $remedies.Treacle.quantity -= 1>><br><br>You drink <<defLondonTreacle "London Treacle">> every morning to protect yourself from infection.<</if>>
<</nobr>><</widget>>
<<widget "player-treatments">><<nobr>>
<<set _livingNPCs to $NPCs.filter(function(n) { return n.health isnot "deceased"; })>><<if _livingNPCs.length gte 1>>
A member of your <<defHousehold "household">>
<<else>>
<<if $money gte 12>>
<<set $money -= 12>>You pay
<<else>>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>Your <<defParish "parish's">> <<defOverseersOfThePoor "Overseers of the Poor">> pay
<</if>>
an old woman to nurse you. She
<</if>> offers you some remedies to help ease your suffering and, hopefully, prevent your death. You:
<<set _remedyEffect to 0>>
<ul>
<li><<linkreplace "accept a purgative drink">>You are offered a <<defPurgative "purgative">> drink, which induces vomiting. It's incredibly unpleasant.<</linkreplace>></li>
<li><<if $remedies.Plaster.quantity gt 0>><<linkreplace "apply a plaster to the plague buboes for one week">><<set _remedyEffect to 1>><<set $remedies.Plaster.quantity -= 1>>Your <<defPlague "plague">> <<defBuboes "buboes">> are covered with a <<defBlisteringPlaster "blistering plaster">>, especially those around the ears, armpits, and groin. The plaster is left on half the day, which can break the buboes and draw out the <<defMalignity "malignity">>. Once broken open, your nurse applies another plaster to keep the buboes draining.<</linkreplace>><<elseif $money gt $remedies.Plaster.cost*21>><<linkreplace "purchase one week's worth of a blistering plaster for your plague buboes">>Your plague <<defBuboes "buboes">> are covered with a <<defBlisteringPlaster "blistering plaster">>, especially those around the ears, armpits, and groin. The plaster is left on half the day, which can break the buboes and draw out the <<defMalignity "malignity">>. Once broken open, your nurse applies another plaster to keep the buboes draining.<<set _remedyEffect to 1>><<money `-1 * $remedies.Plaster.cost*21`>><</linkreplace>><</if>></li>
<li><<if $remedies.Cordial.quantity gt 0>><<linkreplace "drink a cordial tincture for the first two days of your illness">><<set $remedies.Cordial.quantity -= 1>>Twice a day, you are given a dose of <<defTincture "tincture">>. After each dose, you are heavily covered for 3 hours to induce sweating, then wiped down with hot napkins.<</linkreplace>><<elseif $money gt $remedies.Cordial.cost*4>><<linkreplace "purchase and drink a cordial tincture for the first two days of your illness">>Twice a day, you are given a dose of <<defTincture "tincture">>. After each dose, you are heavily covered for 3 hours to induce sweating, then wiped down with hot napkins.<<money `-1 * $remedies.Cordial.cost*4`>><</linkreplace>><</if>></li>
<li><<if $remedies.Treacle.quantity gt 0>><<linkreplace "drink a posset of London Treacle for the first few days of illness">>You are given London Treacle dissolved in spoonfuls of warm vinegar, and drink 1/4 pint of this for the first few days of your illness.<<set $remedies.Treacle.quantity -= 1>><</linkreplace>><<elseif $money gt $remedies.Treacle.cost*16>><<linkreplace "purchase and drink a posset of London Treacle for the first few days of illness">>You are given <<defLondonTreacle "London Treacle">> dissolved in spoonfuls of warm vinegar, and drink 1/4 pint of this for the first few days of your illness.<<money `-1 * $remedies.Treacle.cost*16`>><</linkreplace>><</if>></li>
<li><<linkreplace "use a suppository">>You use a homemade <<defSuppository "suppository">> of a fig filled with salt to help rebalance your humors.<</linkreplace>></li>
<<if $remedies.Treacle.quantity gt 0>><li><<linkreplace "take an anti-diarrheal">>You drink some extra <<defPosset "posset">> mixed with herbs like plantain, sorrel, or knot grass.<</linkreplace>></li><</if>>
</ul>
<</nobr>><</widget>>
<<widget "hh-treatments">><<nobr>><<silently>><<set _plasterQuantity to _infectedFamily.length*21>><<set _treacleQuantity to _infectedFamily.length*16>><<set _cordialQuantity to _infectedFamily.length*4>><</silently>>
You have some <<defRemedies "remedies">> on hand in your household, and may be able to purchase others from the <<defApothecary "apothecary">>, if one of your neighbors is willing to conduct the transaction for you.
<<set _remedyEffect to 0>>
<ul>
<li><<linkreplace "offer a purgative drink">>You offer the sick a <<defPurgative "purgative">> drink, which induces vomiting. It's incredibly unpleasant.<</linkreplace>></li>
<li><<if $remedies.Plaster.quantity gt _plasterQuantity>><<linkreplace "apply a plaster to the plague buboes for one week">><<set _remedyEffect to 1>><<set $remedies.Plaster.quantity -= _plasterQuantity>>You apply a <<defBlisteringPlaster "blistering plaster">> to the plague <<defBuboes "buboes">> on the infected, especially those around the ears, armpits, and groin. If left on half the day, the plaster can break the buboes and draw out the <<defMalignity "malignity">>. Once broken open, you can apply another plaster to keep the buboe draining. If the buboes do not break, you may need to lance them.<</linkreplace>><<elseif $money gt $remedies.Plaster.cost*_plasterQuantity or ($socio is "servants" and ($hoh is 3 or $hoh is 0 or $quarantineSwapped is "master"))>><<linkreplace "purchase one week's worth of a blistering plaster for the plague buboes">>You apply a <<defBlisteringPlaster "blistering plaster">> to the plague <<defBuboes "buboes">> on the infected, especially those around the ears, armpits, and groin. If left on half the day, the plaster can break the buboes and draw out the <<defMalignity "malignity">>. Once broken open, you can apply another plaster to keep the buboe draining. If the buboes do not break, you may need to lance them.<<set _remedyEffect to 1>><<master-pays $remedies.Plaster.cost*_plasterQuantity>><<if not _masterPaid>><<replace "#conversion">><<conversion>><</replace>><</if>><</linkreplace>><</if>></li>
<li><<if $remedies.Cordial.quantity gt _cordialQuantity>><<linkreplace "give the sick a cordial tincture for the first two days of their illness">><<set $remedies.Cordial.quantity -= _cordialQuantity>>Twice a day, you give the sick a dose of <<defTincture "tincture">>. After each dose, you heavily cover their bodies for 3 hours to induce sweating, then wipe them down with hot napkins.<</linkreplace>><<elseif $money gt $remedies.Cordial.cost*_cordialQuantity or ($socio is "servants" and ($hoh is 3 or $hoh is 0 or $quarantineSwapped is "master"))>><<linkreplace "purchase and give a cordial tincture to the sick">>Twice a day, you give the sick a dose of <<defTincture "tincture">>. After each dose, you heavily cover their bodies for 3 hours to induce sweating, then wipe them down with hot napkins.<<master-pays $remedies.Cordial.cost*_cordialQuantity>><<if not _masterPaid>><<replace "#conversion">><<conversion>><</replace>><</if>><</linkreplace>><</if>></li>
<li><<if $remedies.Treacle.quantity gt _treacleQuantity>><<linkreplace "drink a posset of London Treacle for the first few days of illness">>You are given <<defLondonTreacle "London Treacle">> dissolved in spoonfuls of warm vinegar, and drink 1/4 pint of this for the first few days of your illness.<<set $remedies.Treacle.quantity -= _treacleQuantity>><</linkreplace>><<elseif $money gt $remedies.Treacle.cost*_treacleQuantity or ($socio is "servants" and ($hoh is 3 or $hoh is 0 or $quarantineSwapped is "master"))>><<linkreplace "purchase and give a posset of London Treacle to the sick">>You dissolve a few spoonfuls of <<defLondonTreacle "London Treacle">> in warm vinegar, and give the sick 1/4 pint of this for the first few days of their illness.<<master-pays $remedies.Treacle.cost*_treacleQuantity>><<if not _masterPaid>><<replace "#conversion">><<conversion>><</replace>><</if>><</linkreplace>><</if>></li>
<li><<linkreplace "give a suppository">>You give a homemade <<defSuppository "suppository">> of a fig filled with salt to the sick to help rebalance their humors.<</linkreplace>></li>
<li><<linkreplace "give an anti-diarrheal">>You mix extra <<defPosset "posset">> mixed with herbs like plantain, sorrel, or knot grass and offer it to the sick.<</linkreplace>></li>
</ul>
<</nobr>><</widget>>
<<widget "fumigant-check">><<silently>>
<<if $fumes.Fancy.quantity gt 0 or $fumes.Generic.quantity gt 0 or $fumes.Purse.quantity gt 0 or $fumes.Incense.quantity gt 0>><<set _fumes to 1>><<else>><<set _fumes to 0>><</if>><</silently>><</widget>>
<<widget "fumigant">><<silently>>
<<set _fumeUsed to "">>
<<if previous() isnot "Apothecary">><<if $fumes.Fancy.quantity gt 0>><<set _fumeUsed to "Fancy">><<set $fumes.Fancy.quantity -= 1>><<elseif $fumes.Generic.quantity gt 0>><<set _fumeUsed to "Generic">><<set $fumes.Generic.quantity -= 1>><<elseif $fumes.Purse.quantity gt 0>><<set _fumeUsed to "Purse">><<set $fumes.Purse.quantity -= 1>><<elseif $fumes.Incense.quantity gt 0>><<set _fumeUsed to "Incense">><<set $fumes.Incense.quantity -= 1>><</if>><</if>>
<<set _fumesLeft to $fumes.Fancy.quantity + $fumes.Generic.quantity + $fumes.Purse.quantity + $fumes.Incense.quantity>>
<</silently>><<if _fumesLeft gt 0>><<if $fumes.Fancy.quantity gt 0>><br><br>You fall asleep every night to the lingering perfume of the <<defStGilesPowder "St. Giles Powder">> you burnt to cleanse your home of miasmas.<<elseif $fumes.Generic.quantity gt 0>><br><br>You fall asleep every night to the lingering sulfurous odor of the <<defCheapFumigants "cheap fumigants">> you burnt to cleanse your home of miasmas.<<elseif $fumes.Purse.quantity gt 0>><br><br>You fall asleep every night to the perfume of the <<defPurseOfIncense "incense purse">> you wear to protect yourself from miasmas.<<elseif $fumes.Incense.quantity gt 0>><br><br>You fall asleep every night to the lingering perfume of the incense you burnt to cleanse your home of miasmas.<</if>><<elseif _fumeUsed isnot "">><br><br>You use the last of your <<if _fumeUsed is "Fancy">><<defStGilesPowder "St. Giles Powder">><<elseif _fumeUsed is "Generic">><<defCheapFumigants "cheap fumigants">><<elseif _fumeUsed is "Purse">><<defPurseOfIncense "incense purse">><<elseif _fumeUsed is "Incense">>incense<</if>> and wonder if you should purchase more from the Apothecary.
<</if>>
<</widget>> /* should move the fumigant announcement elswhere but leaving here as a NTS placeholder for now */<<widget "defApothecary">><<nobr>><span class="def" data-def="A person who prepares and sells drugs for medicinal purposes. Also the shop where such activities take place.">$args[0]</span><</nobr>><</widget>>
<<widget "defArtisan">><<nobr>><span class="def" data-def="A person employed in a skilled trade such as grocers, tailors, cordwainers, butchers, joiners, weavers, carpenters, bakers, goldsmiths, apothecaries, chandlers, and more. They were usually members of a guild and their business often involved the entire household, including spouses, children, and any apprentices and journeymen in residence. In 1688, statistician Gregory King estimated there were about 100,000 shopkeeper, tradesmen, and artisan households in England, which makes up ~7% of the English population.">$args[0]</span><</nobr>><</widget>>
<<widget "defAudleyEndInEssex">><<nobr>><span class="def" data-def="A 17th century country house in the county of Essex owned by the Earl of Suffolk. Charles II bought it in 1668 and used it as a home occasionally. The Suffolks regained possession of it in 1701.">$args[0]</span><</nobr>><</widget>>
<<widget "defBaptist">><<nobr>><span class="def" data-def="A dissenting Protestant group who believe in adult baptism by immersion and reject infant baptism. Worship outside the established Church of England is illegal.">$args[0]</span><</nobr>><</widget>>
<<widget "defBeggars">><<nobr>><span class="def" data-def="There are two types of beggars: itinerant beggars who roam the country illegally and members of the 'deserving poor' who are embedded in their local communities and licensed to beg in their home parish. The latter usually still have a permanent place of residence, often provided by the parish, but their income depends on the charity of their neighbors. It is not legal to beg outside of your parish and itinerant beggars are both feared and often harshly punished. In 1688, statistician Gregory King estimated there were about 400,000 paupers households and 30,000 wandering beggars, which makes up ~22% of the English population.">$args[0]</span><</nobr>><</widget>>
<<widget "defBetrothed">><<nobr>><span class="def" data-def="Engaged to be married, often with a formal contract. Betrothal was legally binding and breaking it could require church or legal proceedings.">$args[0]</span><</nobr>><</widget>>
<<widget "defBillsOfMortality">><<nobr>><span class="def" data-def="Weekly publications which recorded the number of burials and christenings in each of London's parishes, as well as the causes of death citywide and the current government-set price of bread.">$args[0]</span><</nobr>><</widget>>
<<widget "defBlasphemous">><<nobr>><span class="def" data-def="A person or act which shows contempt for God or other sacred/holy things and people">$args[0]</span><</nobr>><</widget>>
<<widget "defBlisteringPlaster">><<nobr>><span class="def" data-def="A hot, wet paste spread on leather which is then applied to infected areas of the skin such as buboes. The paste hardens and should rupture the buboes to enable them to drain. This plaster was usually made of either Mithridatium or Galene and was applied three times daily.">$args[0]</span><</nobr>><</widget>>
<<widget "defBuboes">><<nobr>><span class="def" data-def="Painful pus-filled swellings in the thighs, neck, groin, and armpits. They may turn black and rot away or rupture, spreading the infection around the body.">$args[0]</span><</nobr>><</widget>>
<<widget "defCallToService">><<nobr>><span class="def" data-def="Parish churches typically had bells, which they used to ring the hours throughout the day. These bells were also rung to indicate the time of church services and to alert people to fires or other emergencies.">$args[0]</span><</nobr>><</widget>>
<<widget "defCatholic">><<nobr>><span class="def" data-def="Members of the Catholic Church. The royal family has Catholic sympathies, but practicing Catholicism openly is technically illegal in England.">$args[0]</span><</nobr>><</widget>>
<<widget "defCelestialWater">><<nobr>><span class="def" data-def="Take every morning to prevent catching plague, as many drops as desired stirred into broth, posset, or half a glass of white wine. One month's dose.">$args[0]</span><</nobr>><</widget>>
<<widget "defCharity">><<nobr>><span class="def" data-def="Refers both to a gift or benevolent act given towards neighbors, particularly the poor, and to a general feeling of Christian love and kindness towards fellow Christians. In the sense used here, it means alms-giving, or the giving of small amounts of money or food to the local 'deserving poor.'">$args[0]</span><</nobr>><</widget>>
<<widget "defCheapFumigants">><<nobr>><span class="def" data-def="Fumigates your home with brimstone, saltpeter, and a little myrrh. The myrrh does little to cover the sulfuric smell. Burn 1 tsp twice daily as a preventative; burn 1 tsp 4-5 times each day in infected homes. One month's supply.">$args[0]</span><</nobr>><</widget>>
<<widget "defChurchOfEngland">><<nobr>><span class="def" data-def="Members of the official religion of England, established by Henry VIII. Worship at the parish church is legal and expected.">$args[0]</span><</nobr>><</widget>>
<<widget "defCivilWar">><<nobr>><span class="def" data-def="A series of armed civil conflicts in the 1640s and early 1650s that culminated in the execution of King Charles I, the flight of his son King Charles II, and the installation of Oliver Cromwell as the Lord Protector of England. The period was one of significant economic, political, and religious turmoil in England, Scotland, Wales, and Ireland. Eventually Cromwell died and Charles II was reinstated as the English monarch in 1660, an act called the Restoration.">$args[0]</span><</nobr>><</widget>>
<<widget "defCommonwealth">><<nobr>><span class="def" data-def="Refers to the government of Oliver Cromwell, who served as the Lord Protector of England from 1653-1658. This government was referred to as the Commonwealth (1649-1660) and was held together by Cromwell's strong personality and military control.">$args[0]</span><</nobr>><</widget>>
<<widget "defCoventGarden">><<nobr>><span class="def" data-def="A large open square in London. In 1630, the Earl of Bedford commissioned the architect Inigo Jones to build a church and several nice houses around a large square. This construction attracted wealthy buyers, who quickly moved out when a market, taverns, and sex workers moved into the south side of the square. The large open space could be used for outdoor meetings.">$args[0]</span><</nobr>><</widget>>
<<widget "defDayLabourer">><<nobr>><span class="def" data-def="A person who is hired and paid on a daily basis, usually for unskilled or semi-skilled labor. Their tasks might include agricultural work like plowing, sowing, harvesting; construction work; and lifting and hauling, such as collection of the dead. Their pay is dependent on winning work each day and thus might be very irregular and low. In 1688, statistician Gregory King estimated there were about 364,000 households led by laboring people and servants in England, which makes up ~20% of the English population.">$args[0]</span><</nobr>><</widget>>
<<widget "defDeaneryAtChristChurchCollege">><<nobr>><span class="def" data-def="Christ Church is one of the many colleges at the University of Oxford. Each of the university's colleges has its own dean, and the position often came with a residence, called a deanery. King Charles I made this deanery his palace during the English Civil War.">$args[0]</span><</nobr>><</widget>>
<<widget "defDisposableIncome">><<nobr>><span class="def" data-def="The amount of money you have left after paying your living expenses. Converted to pounds, shilling, and pence.">$args[0]</span><</nobr>><</widget>>
<<widget "defDissident">><<nobr>><span class="def" data-def="Differing from the ecclesiastical majority. In this case Protestant Christians who are not members of the dominant Anglican faith, for example Presbyterians.">$args[0]</span><</nobr>><</widget>>
<<widget "defDukeOfYork">><<nobr>><span class="def" data-def="The younger brother of King Charles II and heir to the English throne, who eventually reigned as King James II from 1685-88. Charles and his wife Catherine of Braganza had no children of their own, although Charles had many illegitimate children by several mistresses. James II was the last Catholic monarch of England and was deposed by his Protestant daughter, Mary, and her husband, William of Orange.">$args[0]</span><</nobr>><</widget>>
<<widget "defFasts">><<nobr>><span class="def" data-def="Fasting is the practice of restricting food and/or drink. During this period, Christians observed holy days such as Lent by refraining from eating red meat.">$args[0]</span><</nobr>><</widget>>
<<widget "defFleet">><<nobr>><span class="def" data-def="The English Royal Navy, which was primarily composed of heavily armed warships.">$args[0]</span><</nobr>><</widget>>
<<widget "defGaol">><<nobr>><span class="def" data-def="Jail">$args[0]</span><</nobr>><</widget>>
<<widget "defGeneralBill">><<nobr>><span class="def" data-def="A summary of all the weekly bills of mortality from the previous year, published annually in the week before Christmas. These bills published the numbers of burials by parish and included data on how people died, whether of plague or some other cause.">$args[0]</span><</nobr>><</widget>>
<<widget "defHamptonCourt">><<nobr>><span class="def" data-def="A palace south of London famed for its gardens. Cardinal Wolsey began construction on the palace in the early 16th century and King Henry VIII adopted it as his primary residence. King James I, King Charles I, Lord Protector Oliver Cromwell, King Charles II, and King James II also lived in the palace. After the Glorious Revolution in 1688 the co-monarchs William and Mary commissioned the architect Christopher Wren to build a new baroque-style palace on the site. Later monarchs continued to reside there until the mid-18th century. Queen Victoria opened the palace to the public in 1838 and it remains a popular tourist destination.">$args[0]</span><</nobr>><</widget>>
<<widget "defHenriettaMaria">><<nobr>><span class="def" data-def="The mother of King Charles II. Born a French princess, she became the wife of King Charles I of England until his execution in 1649. She then served as an advisor to her son, but her Catholicism and repeated attempts to convert people at court made her unpopular among the Protestant people of England. Charles I ordered that she be referred to in public as Queen Mary, but she disliked this title and signed her name as Henriette.">$args[0]</span><</nobr>><</widget>>
<<widget "defHorseGuards">><<nobr>><span class="def" data-def="A large barracks and stables for the Royal Cavalry which served as the entrance to the Palace of Whitehall. The building is defended by the King's Life Guard, a mounted ceremonial guard.">$args[0]</span><</nobr>><</widget>>
<<widget "defHousehold">><<nobr>><span class="def" data-def="All the people living in a home. If there is an adult male living in the home, he is generally considered the head of the household. Widowed women with young children and single women may also be heads of the household. Members of the household then include the head of household, their spouse, and their children, as well as members of the extended family such as grandparents, siblings, aunts, uncles, nieces, nephews, and cousins. Households may additionally include apprentices, journeymen, and servants.">$args[0]</span><</nobr>><</widget>>
<<widget "defImpressed">><<nobr>><span class="def" data-def="The seventeenth-century English Navy (and other militaries) often had labor shortages and had to force men to serve in its ranks. This mostly meant kidnapping, either by force, trickery, or coercion. After being impressed, sailors who were not British could petition to be let back out, but British subjects had to serve their term. Though the Navy typically impressed merchant seamen or fishermen, they sometimes abducted non-sailors. The practice was very unpopular and provoked much protest.">$args[0]</span><</nobr>><</widget>>
<<widget "defIndenturedServitude">><<nobr>><span class="def" data-def="A person who has signed a labor contract, such as that of an apprentice or servant, to work for a set number of years in exchange for housing, food, clothing, training in a trade, and/or some other material benefit.">$args[0]</span><</nobr>><</widget>>
<<widget "defInterregnum">><<nobr>><span class="def" data-def="The period 1649-1660 between the reigns of King Charles I and King Charles II. During this period, England was governed by the Commonwealth government, led by the Lord Protector Oliver Cromwell.">$args[0]</span><</nobr>><</widget>>
<<widget "defLamentable">><<nobr>><span class="def" data-def="Very bad or unsatisfactory, deplorable, causing sorrow">$args[0]</span><</nobr>><</widget>>
<<widget "defLent">><<nobr>><span class="def" data-def="A Christian holiday beginning on Ash Wednesday and ending just before Easter, meant to commemorate the time which Jesus spent in the wilderness. This period was supposed to be observed by fasting or abstinence.">$args[0]</span><</nobr>><</widget>>
<<widget "defLiveryCompany">><<nobr>><span class="def" data-def="Guilds or trade associations that regulate the practice of specific trades within the city of London and which wear distinctive livery (ceremonial dress). The 'Great Twelve' are the most powerful of these companies: mercers, grocers, drapers, fishmongers, goldsmiths, merchant taylors, skinners, haberdashers, salters, ironmongers, vintners, and clothworkers.">$args[0]</span><</nobr>><</widget>>
<<widget "defLondonBridge">><<nobr>><span class="def" data-def="In this period, the only bridge across the Thames connecting the two halves of London. It was preceded by several Roman and medieval bridges which were destroyed and rebuilt many times. The bridge in this period was built in 1209. The bridge had 19 piers with thick protective pilings around them. These restricted water flow so much that the water level could be up to 6 feet higher on one side of the bridge than the other. Many houses and shops stood on the bridge until they were removed in the 19th century.">$args[0]</span><</nobr>><</widget>>
<<widget "defLondonTreacle">><<nobr>><span class="def" data-def="A hot drink made of milk curdled with wine or ale, often including spices, which was often used as a remedy. After the 16th century, the milk was usually curdled using lemon juice rather than wine, and might be thickened with bread crumbs. During the plague outbreak, medical quacks sold London treacle, which could be added to the posset drink to further thicken it. London treacle was a compound of walnut, rue, salt, and fig.">$args[0]</span><</nobr>><</widget>>
<<widget "defLordMayor">><<nobr>><span class="def" data-def="The head of the city government of London">$args[0]</span><</nobr>><</widget>>
<<widget "defLucidity">><<nobr>><span class="def" data-def="Ability to think clearly, particularly after a period of confusion">$args[0]</span><</nobr>><</widget>>
<<widget "defMalignity">><<nobr>><span class="def" data-def="A substance that is evil in nature and effects; baleful, harmful, gravely injurious">$args[0]</span><</nobr>><</widget>>
<<widget "defMerchant">><<nobr>><span class="def" data-def="A person involved in wholesale trade, particularly between cities or countries. In 1688, statistician Gregory King estimated there were about 10,000 merchant households in England, which makes up ~1% of the English population.">$args[0]</span><</nobr>><</widget>>
<<widget "defNewChapelChurchyard">><<nobr>><span class="def" data-def="A city burial ground, not associated with any church or parish, that was located in northeastern London and used from 1569 to 1739. In that period, it received an estimated 25,000 burials. Over time it became commonly known as Bedlam or Bethlem burial ground because it was located in the precinct of the Priory of St. Mary of Bethlehem, later Bethlem Hospital.">$args[0]</span><</nobr>><</widget>>
<<widget "defNoble">><<nobr>><span class="def" data-def="A member of the hereditary class of landowners with high social and political status. They have noble titles either given to them by a monarch or inherited from their ancestors, such as duke/duchess, marquis/marchioness, earl/countess, or baron/baroness. In 1688, statistician Gregory King estimated there were about 160 noble households in England, which makes up less than 1/10 of 1% of the English population.">$args[0]</span><</nobr>><</widget>>
<<widget "defOverseersOfThePoor">><<nobr>><span class="def" data-def="Two parish officials elected to administer to the needs of the poor in their parish. These positions were created by the Poor Relief Act of 1597.">$args[0]</span><</nobr>><</widget>>
<<widget "defOxford">><<nobr>><span class="def" data-def="An English city about 60 miles north-west of London. It is home to the University of Oxford, the oldest university in England.">$args[0]</span><</nobr>><</widget>>
<<widget "defPapists">><<nobr>><span class="def" data-def="A derogatory term for Catholics.">$args[0]</span><</nobr>><</widget>>
<<widget "defParish">><<nobr>><span class="def" data-def="The smallest administrative unit of the English church. An official known as the parish clerk kept local records of christenings, burials, and marriages of everyone who lived within the parish. In this period, parish officials were responsible for maintaining the local social safety net, which included supporting and licensing beggars.">$args[0]</span><</nobr>><</widget>>
<<widget "defPesthouse">><<nobr>><span class="def" data-def="A hospital used for the treatment and isolation of people infected with plague or other infectious diseases">$args[0]</span><</nobr>><</widget>>
<<widget "defPlague">><<nobr>><span class="def" data-def="A deadly infection usually spread to humans by fleas infected with the bacterium yersinia pestis. It manifests in several different ways, including bubonic (lymph node), pneumonic (lungs), and septicemic (bloodstream) plague. Bubonic plague was the least deadly form, at only ~50% fatal, while pneumonic plague was 99% fatal and can be spread directly to other people by coughing and septicemic plague was 100% fatal. Plague killed hundreds of millions of people before the development of antibiotic treatments and still kills some people today. Symptoms include fever, headaches, vomiting, weakness, coughing, shortness of breath, chest pain, abdominal pain, swollen lymph nodes, gangrene, meningitis, and most famously, the appearance of large buboes, or painful pus-filled swellings in the thighs, neck, groin, and armpits. They may turn black and rot away or rupture, spreading the infection around the body.">$args[0]</span><</nobr>><</widget>>
<<widget "defPorter">><<nobr>><span class="def" data-def="A person employed to carry things in the service of others. They are usually employed in moving furniture, luggage, and other loads, especially when their employers are moving or traveling.">$args[0]</span><</nobr>><</widget>>
<<widget "defPortsmouth">><<nobr>><span class="def" data-def="An English port city about 75 miles south of London">$args[0]</span><</nobr>><</widget>>
<<widget "defPosset">><<nobr>><span class="def" data-def="A hot drink made of milk curdled with wine or ale, often including spices, which was often used as a remedy. After the 16th century, the milk was usually curdled using lemon juice rather than wine, and might be thickened with bread crumbs. During the plague outbreak, medical quacks sold London treacle, which could be added to the posset drink to further thicken it.">$args[0]</span><</nobr>><</widget>>
<<widget "defPresbyterians">><<nobr>><span class="def" data-def="Protestants who wanted their church to be ruled by presbyteries, or a collection of elders and ministers, rather than a hierarchical system of bishops. This system was popular in Scotland and an attempt to overturn it in favor of bishops sparked a series of uprisings in the British Isles that eventually turned into the Civil War.">$args[0]</span><</nobr>><</widget>>
<<widget "defPressGangs">><<nobr>><span class="def" data-def="An organized group of naval sailors who forcibly conscripted men of fighting age (18-55) to serve in the Royal Navy during times of war. They usually impressed merchant seamen and fishermen but sometimes abducted non-sailors from town.">$args[0]</span><</nobr>><</widget>>
<<widget "defProtestants">><<nobr>><span class="def" data-def="Dissidents from the Catholic faith. In England these were most commonly Anglicans (Church of England) or Presbyterians, but there were other smaller groups such as Quakers and Baptists.">$args[0]</span><</nobr>><</widget>>
<<widget "defPurgative">><<nobr>><span class="def" data-def="A medicine which causes emptying of the bowels, a laxative.">$args[0]</span><</nobr>><</widget>>
<<widget "defPurseOfIncense">><<nobr>><span class="def" data-def="A purse of incense to be worn around your neck to prevent catching plague. Must be re-incensed regularly. One month's supply.">$args[0]</span><</nobr>><</widget>>
<<widget "defQuaker">><<nobr>><span class="def" data-def="Members of the Religious Society of Friends, who reject formal clergy and sacraments. Their refusal to swear oaths or remove hats before magistrates makes them frequent targets of persecution.">$args[0]</span><</nobr>><</widget>>
<<widget "defQuarantine">><<nobr>><span class="def" data-def="A method of containing disease which involves keeping potentially infected people, animals, or goods contained and away from others for a sufficient period of time for the disease to manifest. The word comes from the Italian //quaranta// meaning 40 as the quarantine period for plague was 40 days.">$args[0]</span><</nobr>><</widget>>
<<widget "defQueenCatherine">><<nobr>><span class="def" data-def="Queen Catherine of Braganza was a Portuguese princess who married King Charles II in 1662, becoming the Queen of England, Scotland, and Ireland. After the death of her husband, she returned to her homeland and served as the regent of Portugal until her death. She was unpopular in England due to her strong Catholic faith. Catherine had no children, so Charles was succeeded by his brother, King James II.">$args[0]</span><</nobr>><</widget>>
<<widget "defRemedies">><<nobr>><span class="def" data-def="A medicine or treatment meant to promote healing or alleviate symptoms for a disease, disorder, or injury.">$args[0]</span><</nobr>><</widget>>
<<widget "defRestoration">><<nobr>><span class="def" data-def="The returning of King Charles II to the throne of England. After the death of the Lord Protector Oliver Cromwell, his son was not strong enough to hold together the Commonwealth government. The exiled Charles II issued the Declaration of Breda, in which he promised to pardon and uphold the property rights of everyone except the people who signed his father's execution warrant, in exchange for the throne.">$args[0]</span><</nobr>><</widget>>
<<widget "defRiverTraffic">><<nobr>><span class="def" data-def="Because there was only one bridge over the River Thames, London Bridge, Londoners often found it faster to cross the river or travel the length of the city by boat. As a result, the Thames was a busy river highway and was full of small transport boats as well as larger shipping barges.">$args[0]</span><</nobr>><</widget>>
<<widget "defSalisbury">><<nobr>><span class="def" data-def="An English city about 80 miles outside of London">$args[0]</span><</nobr>><</widget>>
<<widget "defScrivener">><<nobr>><span class="def" data-def="A person employed to copy or transcribe documents or to write documents for someone else, especially legal documents">$args[0]</span><</nobr>><</widget>>
<<widget "defServant">><<nobr>><span class="def" data-def="A person who is hired long-term to work on domestic duties or as a personal attendant. Their tasks might include cooking, cleaning, dressing, sewing, running errands, driving carts and carriages, taking care of household animals, etc. On many occasions, servants lived in the homes of their employers, meaning their lodgings were part of their wages. Their pay could vary significantly based on the wealth and social status of their employer. Many people were not servants for long periods of time, but rather were employed as servants while young until they had built up enough resources to form their own household.">$args[0]</span><</nobr>><</widget>>
<<widget "defSmolder">><<nobr>><span class="def" data-def="To burn slowly but without flame, produces smoke and heat">$args[0]</span><</nobr>><</widget>>
<<widget "defSomersetHouse">><<nobr>><span class="def" data-def="The traditional London residence of the Queen of England during the seventeenth century, also known as Denmark House. It was originally constructed by the Duke of Somerset in 1547 in the Tudor style and Queen Elizabeth I lived there as a young woman. Upon the ascension of King James I, he gave it to his wife, Queen Anne of Denmark, as her primary residence and renamed Denmark House in her honor. It was subsequently the primary residence of King Charles I's wife Queen Henrietta Maria. However, King Charles II's wife Catherine of Braganza only took up residence there after his death in 1685 and lived there until 1693. Since the 18th century, it has been rebuilt and enlarged in the Renaissance style.">$args[0]</span><</nobr>><</widget>>
<<widget "defStGilesPowder">><<nobr>><span class="def" data-def="Fumigates your home with a pleasant-smelling substance. Burn 1 tsp twice each day as a preventative; burn 1 tsp 4-5 times each day in infected homes. One month's supply.">$args[0]</span><</nobr>><</widget>>
<<widget "defSuppository">><<nobr>><span class="def" data-def="A type of medical application which involves inserting a small bundle of medicine into any bodily orifice other than the mouth. The medicine was intended to soften or turn liquid at body temperature, which would help with spreading it throughout the body.">$args[0]</span><</nobr>><</widget>>
<<widget "defTallySticks">><<nobr>><span class="def" data-def="A stick used to mark debts and payments, usually with notches on one side. Usually a debtor and lender would split the stick in half and each keep half the stick as a record of their agreement.">$args[0]</span><</nobr>><</widget>>
<<widget "defTincture">><<nobr>><span class="def" data-def="Literally, a beneficial medicine. In this specific case, a reference to a proprietary medicinal blend advertised by John Belson, Esquire, in 1665 during the London plague outbreak.">$args[0]</span><</nobr>><</widget>>
<<widget "defTowerOfLondon">><<nobr>><span class="def" data-def="A historic castle on the north bank of the Thames that was built in 1066. It has been used by many English monarchs as both a residence and a prison.">$args[0]</span><</nobr>><</widget>>
<<widget "defTuttlefields">><<nobr>><span class="def" data-def="Also known as Tothill Fields, it was a marshy area of Westminster on the north bank of the river Thames. The area was home to the prison known as Tothill Fields Bridewell, which operated between 1618 and 1884.">$args[0]</span><</nobr>><</widget>>
<<widget "defWhitehall">><<nobr>><span class="def" data-def="A large palace which served as the official London residence of English monarchs from 1530 to 1698, when nearly the entire complex was destroyed by fire. The area where the palace sat is still called Whitehall and has remained a center for the British government.">$args[0]</span><</nobr>><</widget>>
<<widget "defWidowed">><<nobr>><span class="def" data-def="Having lost a spouse to death. Widows and widowers often remarried quickly for economic reasons, since a single-person household was difficult to sustain.">$args[0]</span><</nobr>><</widget>>
<<widget "defVarReligion">><<nobr>><<if $religion is "member of the Church of England">><<defChurchOfEngland $args[0]>><<elseif $religion is "Catholic">><<defCatholic $args[0]>><<elseif $religion is "Presbyterian">><<defPresbyterians $args[0]>><<elseif $religion is "Baptist">><<defBaptist $args[0]>><<elseif $religion is "Quaker">><<defQuaker $args[0]>><</if>><</nobr>><</widget>>
<<widget "defVarSocio">><<nobr>><<if $socio is "beggars">><<defBeggars $args[0]>><<elseif $socio is "day labourers">><<defDayLabourer $args[0]>><<elseif $socio is "servants">><<defServant $args[0]>><<elseif $socio is "artisans">><<defArtisan $args[0]>><<elseif $socio is "merchants">><<defMerchant $args[0]>><<elseif $socio is "nobles">><<defNoble $args[0]>><</if>><</nobr>><</widget>>
<<widget "defVarRelationship">><<nobr>><<if $relationship is "betrothed">><<defBetrothed $args[0]>><<elseif $relationship is "widowed">><<defWidowed $args[0]>><<else>>$args[0]<</if>><</nobr>><</widget>><<nobr>>
/* Beggars */
The first case of <<defPlague "plague">> has appeared in your <<defParish "parish">>, <<if $socio is "beggars">><<if $agenum gte 16>><<beggar-roles>><<else>><<beggar-choice>><</if>><</if>>
/* Day Labourers */
<<if $socio is "day labourers">>and many of your neighbors have begun to flee the city.<<flee-choice "initial">>
<</if>>
/* Servants */
<<if $socio is "servants">>and many of your neighbors have begun to flee the city. <<flee-choice "initial">>
<</if>>
/* Artisans */
<<if $socio is "artisans">>and many of your neighbors have begun to flee the city.
<<flee-choice "initial">>
<</if>>
/* Merchants */
<<if $socio is "merchants">>and <<flee-choice "initial">>
<</if>>
/* Nobles */
<<if $socio is "nobles">>and many members of the Court have begun to flee the city.<br><br>
<<flee-choice "initial">>
<</if>>
<</nobr>><<nobr>><<check-NPCs>>
<<if _infectedFamily.length gt 0>>Unfortunately, you're going to be here a while longer. Your <<defHousehold "household">> is still infected.
[[You continue to tend to the sick->Quarantine Continues]]
<<elseif $pesthouseReparation is 1>>
/* Player arriving from pesthouse or banishment — skip quarantine checks */
<<set $pesthouseReparation to 0>>
You return to your <<defHousehold "household">> and begin reconnecting with the outside world.
<br><br>
<<quarantine-reconnect>>
<<else>>
Lord be praised, your <<defHousehold "household">> has survived the <<defPlague "plague">>. You still need to finish <<defQuarantine "quarantine">>, but begin reconnecting with the outside world.
<<if $quarantineSwapped is "master">>
<<silently>>
<<set $NPCsMaster to clone($NPCs)>>
<<set $NPCs to clone($SavedNPCs)>>
<<set $NPCsServants to clone($SavedServants)>>
<<set $quarantineSwapped to "">>
<<set $SavedNPCs to []>>
<<set $SavedServants to []>>
<<set-hoh>>
<<set-caretaker>>
<</silently>>
<<elseif $quarantineSwapped is "extended">>
<<silently>>
<<set $NPCsExtended to clone($NPCs)>>
<<set $NPCs to clone($SavedNPCs)>>
<<set $NPCsServants to clone($SavedServants)>>
<<set $quarantineSwapped to "">>
<<set $SavedNPCs to []>>
<<set $SavedServants to []>>
<<set-hoh>>
<<set-caretaker>>
<</silently>>
<</if>>
<br><br>
<<quarantine-reconnect>>
<</if>>
<</nobr>>
<<widget "find-authority">><<nobr>><<silently>>
/* find-authority — sets _authorityIdx to the index in $NPCs of the PC's
authority figure (the living NPC with social/legal authority over the PC),
or -1 if none applies.
hoh 0/2: priority search — father/step-father > mother/step-mother >
uncle/aunt/widowed-aunt/guardian/guardian's-wife/cousin/cousin's-wife
hoh 3: first living master or mistress in $NPCs
hoh 4: first living husband in $NPCs
hoh 1: always -1 (independent; no authority figure)
Skips NPCs whose health is "deceased" or "deceased-pq".
Loop variable _fai is consumed and left in scope after the call. */
<<set _authorityIdx to -1>>
<<if $hoh is 4>>
<<for _fai = 0; _fai < $NPCs.length; _fai++>>
<<if _authorityIdx is -1 and $NPCs[_fai].relationship is "husband" and $NPCs[_fai].health isnot "deceased" and $NPCs[_fai].health isnot "deceased-pq">>
<<set _authorityIdx to _fai>>
<</if>>
<</for>>
<<elseif $hoh is 3>>
<<for _fai = 0; _fai < $NPCs.length; _fai++>>
<<if _authorityIdx is -1 and ($NPCs[_fai].relationship is "master" or $NPCs[_fai].relationship is "mistress") and $NPCs[_fai].health isnot "deceased" and $NPCs[_fai].health isnot "deceased-pq">>
<<set _authorityIdx to _fai>>
<</if>>
<</for>>
<<elseif $hoh is 0 or $hoh is 2>>
/* Priority 1: father or step-father */
<<for _fai = 0; _fai < $NPCs.length; _fai++>>
<<if _authorityIdx is -1 and ($NPCs[_fai].relationship is "father" or $NPCs[_fai].relationship is "step-father") and $NPCs[_fai].health isnot "deceased" and $NPCs[_fai].health isnot "deceased-pq">>
<<set _authorityIdx to _fai>>
<</if>>
<</for>>
/* Priority 2: mother or step-mother */
<<if _authorityIdx is -1>>
<<for _fai = 0; _fai < $NPCs.length; _fai++>>
<<if _authorityIdx is -1 and ($NPCs[_fai].relationship is "mother" or $NPCs[_fai].relationship is "step-mother") and $NPCs[_fai].health isnot "deceased" and $NPCs[_fai].health isnot "deceased-pq">>
<<set _authorityIdx to _fai>>
<</if>>
<</for>>
<</if>>
/* Priority 3: uncle, aunt, or guardian/cousin group */
<<if _authorityIdx is -1>>
<<for _fai = 0; _fai < $NPCs.length; _fai++>>
<<if _authorityIdx is -1 and ($NPCs[_fai].relationship is "uncle" or $NPCs[_fai].relationship is "aunt" or $NPCs[_fai].relationship is "widowed aunt" or $NPCs[_fai].relationship is "guardian" or $NPCs[_fai].relationship is "guardian's wife" or $NPCs[_fai].relationship is "cousin" or $NPCs[_fai].relationship is "cousin's wife") and $NPCs[_fai].health isnot "deceased" and $NPCs[_fai].health isnot "deceased-pq">>
<<set _authorityIdx to _fai>>
<</if>>
<</for>>
<</if>>
<</if>>
<</silently>><</nobr>><</widget>><<widget "servant-marriage-moveout">><<nobr>>
/* servant-marriage-moveout — when a servant gets married, they leave their
master's household and establish their own independent household with
their new spouse. Must be called AFTER <<addPartnerNPC>> and
<<set $relationship to "married">>.
If reputation >= 6: master congratulates, servant keeps socio "servants"
but moves into own household.
If reputation < 6: master is furious, servant demoted to "day labourers"
with a -2 reputation penalty.
Sets _servantMarriageResult to "congratulated" or "furious" (or "" if
not a servant) so the calling passage can display appropriate text. */
<<set _servantMarriageResult to "">>
<<if $socio is "servants">>
/* Save the new spouse (last NPC added by addPartnerNPC) */
<<set _newSpouse to $NPCs[$NPCs.length - 1]>>
/* Remember master title before clearing */
<<set _oldMasterTitle to $masterTitle>>
/* Move all other NPCs (master's household) to extended */
<<for _smi to 0; _smi lt $NPCs.length - 1; _smi++>>
<<if $NPCs[_smi].health isnot "deceased">>
<<set $NPCsExtended.push($NPCs[_smi])>>
<</if>>
<</for>>
/* Start fresh household with just the spouse */
<<set $NPCs to [_newSpouse]>>
<<set $NPCsMaster to []>>
<<set $masterStatus to "">>
<<set $masterGender to "">>
<<set $masterTitle to "">>
<<if $reputation gte 6>>
/* Master is pleased — servant remains a servant but independent */
<<set _servantMarriageResult to "congratulated">>
<<else>>
/* Master is furious — servant demoted to day labourer */
<<set _servantMarriageResult to "furious">>
<<set $socio to "day labourers">>
<<set $reputation to Math.clamp($reputation - 2, 0, 10)>>
<</if>>
<<NPCpronouns>>
<<set-hoh>>
<</if>>
<</nobr>><</widget>>
/* removeServants — releases half the servants (rounded up) from a noble,
merchant, or artisan household to reduce expenses. Servants are removed
in alternating order: youngest, oldest, youngest, oldest, etc.
Removed servants are moved to $NPCsExtended. Produces narrative text
listing who was released. */
<<widget "removeServants">><<nobr>>
<<if ($socio is "nobles" or $socio is "merchants" or $socio is "artisans") and $NPCsServants.length gt 0>>
/* Build list of living servant indices */
<<set _rsLiving to []>>
<<for _ri = 0; _ri < $NPCsServants.length; _ri++>>
<<if $NPCsServants[_ri].health isnot "deceased" and $NPCsServants[_ri].health isnot "deceased-pq">>
<<set _rsLiving.push(_ri)>>
<</if>>
<</for>>
<<if _rsLiving.length gt 0>>
/* Number to release: half rounded up */
<<set _rsToRemove to Math.ceil(_rsLiving.length / 2)>>
/* Sort living servants by agenum ascending (youngest first) */
<<set _rsLiving.sort(function(a, b) { return ($NPCsServants[a].agenum || 0) - ($NPCsServants[b].agenum || 0); })>>
/* Pick servants in alternating youngest/oldest order */
<<set _rsPickIndices to []>>
<<set _rsLow to 0>>
<<set _rsHigh to _rsLiving.length - 1>>
<<set _rsPickYoungest to true>>
<<for ; _rsPickIndices.length lt _rsToRemove; >>
<<if _rsPickYoungest>>
<<set _rsPickIndices.push(_rsLiving[_rsLow])>>
<<set _rsLow += 1>>
<<else>>
<<set _rsPickIndices.push(_rsLiving[_rsHigh])>>
<<set _rsHigh -= 1>>
<</if>>
<<set _rsPickYoungest to !_rsPickYoungest>>
<</for>>
/* Collect names before removing */
<<set _rsRemovedNames to []>>
<<for _ri = 0; _ri < _rsPickIndices.length; _ri++>>
<<set _rsRemovedNames.push($NPCsServants[_rsPickIndices[_ri]].name)>>
<</for>>
/* Sort pick indices descending to splice safely */
<<set _rsPickIndices.sort(function(a, b) { return b - a; })>>
<<for _ri = 0; _ri < _rsPickIndices.length; _ri++>>
<<if $NPCsServants[_rsPickIndices[_ri]].health is "safe from harm">><<set $NPCsServants[_rsPickIndices[_ri]].health to "healthy">><<set $NPCsServants[_rsPickIndices[_ri]].location to $location>><</if>>
<<set $NPCsExtended.push($NPCsServants[_rsPickIndices[_ri]])>>
<<set $NPCsServants.splice(_rsPickIndices[_ri], 1)>>
<</for>>
To reduce your expenses, you release <<if _rsRemovedNames.length eq 1>>your servant _rsRemovedNames[0]<<else>><<for _ri = 0; _ri < _rsRemovedNames.length; _ri++>><<if _ri lt _rsRemovedNames.length - 1>>_rsRemovedNames[_ri], <<else>>and _rsRemovedNames[_ri]<</if>><</for>><</if>> from service.<br><br>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "noble-child-service-check">><<nobr>>
/* noble-child-service-check — for merchants and nobles, when $money lte 0,
offers to send the youngest non-infant child/adolescent to be a ward of
a relative. If the PC is a child/adolescent, uses orphan-widget-style
logic to create the new household. Only fires once per month. */
<<if $money lte 0 and ($socio is "merchants" or $socio is "nobles") and $childServiceOffered isnot $monthIndex>>
/* Find eligible NPC children/adolescents (not infant, not deceased) */
<<set _ncsEligible to []>>
<<for _ni = 0; _ni < $NPCs.length; _ni++>>
<<if ($NPCs[_ni].age is "child" or $NPCs[_ni].age is "adolescent") and $NPCs[_ni].health isnot "deceased">>
<<set _ncsEligible.push(_ni)>>
<</if>>
<</for>>
<<if $agenum lte 15>>
/* PC is a child/adolescent — offer to send them as a ward */
<<set $childServiceOffered to $monthIndex>>
<<set-caretaker>>
<<set _headerEventActive to true>>
<span id="nobleChildService">Your family is struggling with mounting debts and <<if $caretakerLabel isnot "">>your $caretakerLabel suggests sending you to live as a ward with a relative.<<else>>you wonder if you might be better off living as a ward with a relative.<</if>> Would you like to go? <<link "Yes">><<replace "#nobleChildService">>
/* Build new guardian household using orphan-widget logic */
<<set _newGuardian to either("uncle", "widowed aunt", "cousin", "family friend")>>
<<set _survivingKids to []>>
<<for _oi = 0; _oi < $NPCs.length; _oi++>>
<<if ($NPCs[_oi].age is "child" or $NPCs[_oi].age is "adolescent") and $NPCs[_oi].health isnot "deceased">>
<<set _survivingKids.push($NPCs[_oi])>>
<</if>>
<</for>>
/* Move remaining family to extended */
<<for _oi = 0; _oi < $NPCs.length; _oi++>>
<<if $NPCs[_oi].health isnot "deceased">>
<<set _found to false>>
<<for _sk = 0; _sk < _survivingKids.length; _sk++>>
<<if _survivingKids[_sk] is $NPCs[_oi]>><<set _found to true>><</if>>
<</for>>
<<if not _found>><<set $NPCsExtended.push($NPCs[_oi])>><</if>>
<</if>>
<</for>>
<<set $NPCs to []>>
<<if _newGuardian isnot "widowed aunt">>
<<set _newGuardianAgenum to random(30,76)>>
<<if _newGuardianAgenum gte 60>><<set _newGuardianAge to "elderly adult">>
<<else>><<set _newGuardianAge to "middle-aged adult">>
<</if>>
<<if _newGuardian is "uncle">>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "uncle", health: "healthy", location: $location})>>
<<elseif _newGuardian is "cousin">>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "cousin", health: "healthy", location: $location, heshe: "he", hishers: "his"})>>
<<else>>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "guardian", health: "healthy", location: $location})>>
<</if>>
<<if random(1,2) eq 1>>
<<set $minAge to _newGuardianAgenum - 20>>
<<if $minAge lte 15>><<set $minAge to 16>><</if>>
<<set $maxAge to _newGuardianAgenum + 30>>
<<if $maxAge gte 101>><<set $maxAge to 100>><</if>>
<<setAge>>
<<if _newGuardian is "uncle">>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "aunt", health: "healthy", location: $location})>>
<<elseif _newGuardian is "cousin">>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "cousin's wife", health: "healthy", location: $location})>>
<<else>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "guardian's wife", health: "healthy", location: $location})>>
<</if>>
<<set _auntAgenum to $NPCAgeNum>>
<<else>>
<<set _auntAgenum to _newGuardianAgenum>>
<</if>>
<<else>>
<<set _auntAgenum to random(30,76)>>
<<if _auntAgenum gte 60>><<set _newGuardianAge to "elderly adult">>
<<else>><<set _newGuardianAge to "middle-aged adult">>
<</if>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: _auntAgenum, age: _newGuardianAge, relationship: "widowed aunt", health: "healthy", location: $location})>>
<</if>>
<<if $socio is "merchants">>
<<set _newHHKids to random(1,4)>>
<<else>>
<<set _newHHKids to random(2,6)>>
<</if>>
<<for _k to 0; _k lt _newHHKids; _k++>>
<<set $minAge to _auntAgenum - 40>>
<<if $minAge lte 0>><<set $minAge to 0>><</if>>
<<set $maxAge to _auntAgenum - 20>>
<<setAge>>
<<if _newGuardian is "family friend">>
<<set $mkidRel to "friend's son">>
<<set $fkidRel to "friend's daughter">>
<<elseif _newGuardian is "cousin">>
<<set $mkidRel to "cousin's son">>
<<set $fkidRel to "cousin's daughter">>
<<else>>
<<set $mkidRel to "cousin">>
<<set $fkidRel to "cousin">>
<</if>>
<<if random(1,2) is 1>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: $fkidRel, health: "healthy", location: $location, heshe: "she", hishers: "her"})>>
<<else>>
<<set $NPCs.push({name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: $mkidRel, health: "healthy", location: $location, heshe: "he", hishers: "his"})>>
<</if>>
<</for>>
<<set $NPCs to $NPCs.concat(_survivingKids)>>
<<NPCpronouns>>
<<set-hoh>>
You have been sent to live as a ward with <<if _newGuardian is "family friend">>a family friend<<else>>your _newGuardian<</if>>. <<storyline-return Although you are nervous about the chance, you "hope it will provide you with a better future.">>
<</replace>><</link>> | <<link "No">><<replace "#nobleChildService">>Times are hard, but you <<storyline-return "don't want to leave your family." 0>><</replace>><</link>>
</span>
<<elseif _ncsEligible.length gt 0>>
/* PC is an adult — offer to send youngest non-infant child/adolescent as a ward */
/* Sort eligible indices by NPC agenum ascending to find youngest */
<<set _ncsEligible.sort(function(a, b) { return ($NPCs[a].agenum || 0) - ($NPCs[b].agenum || 0); })>>
<<set _ncsIdx to _ncsEligible[0]>>
<<set _ncsName to $NPCs[_ncsIdx].name>>
<<set _ncsRel to $NPCs[_ncsIdx].relationship>>
<<set $childServiceOffered to $monthIndex>>
<<set _headerEventActive to true>>
<span id="nobleChildService">Your family is struggling with mounting debts and you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> need to decide whether to send one of the children to live as a ward with a relative, where they would be better provided for.<br><br>Do you send your _ncsRel, _ncsName, to live as a ward? <<link "Yes">><<replace "#nobleChildService">>
<<if $NPCs[_ncsIdx].health is "safe from harm">><<set $NPCs[_ncsIdx].health to "healthy">><<set $NPCs[_ncsIdx].location to $location>><</if>><<set $NPCsExtended.push($NPCs[_ncsIdx])>><<set $NPCs.splice(_ncsIdx, 1)>><<NPCpronouns>>
You hate to send any of your family away, but you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> believe that _ncsRel, _ncsName, will be well cared for and that will mean <<storyline-return "one less mouth to feed at home." 0>><</replace>><</link>> | <<link "No">><<replace "#nobleChildService">>Life is hard, but you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> agree that sending _ncsRel, _ncsName, away is not the answer. You will find <<storyline-return "another way to make ends meet." 0>><</replace>><</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
/* leave-service — handles a servant leaving their master's household.
Clears $NPCsMaster. For single/betrothed servants, swaps $NPCs with
$NPCsExtended (returning to their own household). For married/widowed
servants, only clears the master array since they already have their
own household. Calls <<NPCpronouns>> and <<set-hoh>> afterward.
Does NOT change $socio — the caller must set that before or after. */
<<widget "leave-service">><<nobr>>
<<set $NPCsMaster to []>>
<<if $relationship is "single" or $relationship is "betrothed">>
<<set $NPCs to $NPCsExtended.slice()>>
<<set $NPCsExtended to []>>
<</if>>
<<NPCpronouns>><<set-hoh>>
<</nobr>><</widget>><<widget "orderNPCs">><<nobr>><<silently>>
/* orderNPCs — sorts an NPC array by household precedence instead of raw age.
Usage: <<orderNPCs "$NPCs">> (pass the variable name as a string)
Priority:
1. landlord / master
2. landlord's wife / mistress
3. relationship includes "father"
4. relationship includes "mother"
5. relationship includes "uncle"
6. relationship includes "aunt"
7. guardian / guardian's wife
8. everyone else without "servant" or "lodger" — by age
9. servants — by age
10. lodgers — by age
*/
<<set _arrName to _args[0]>>
<<set _arr to State.getVar(_arrName)>>
<<set _rankFn to function(npc) {
var r = (npc.relationship || "").toLowerCase();
if (r === "landlord" || r === "master") return 1;
if (r === "landlord's wife" || r === "mistress") return 2;
if (r.indexOf("father") >= 0) return 3;
if (r.indexOf("mother") >= 0) return 4;
if (r.indexOf("uncle") >= 0) return 5;
if (r.indexOf("aunt") >= 0) return 6;
if (r === "guardian" || r === "cousin") return 7;
if (r === "guardian's wife" || r === "cousin's wife") return 8;
if (r.indexOf("servant") >= 0) return 10;
if (r.indexOf("lodger") >= 0) return 11;
return 9;
}>>
<<run _arr.sort(function(a, b) {
var ra = _rankFn(a), rb = _rankFn(b);
if (ra !== rb) return ra - rb;
return (b.agenum || 0) - (a.agenum || 0);
})>>
<<run State.setVar(_arrName, _arr)>>
<</silently>><</nobr>><</widget>>
<<nobr>><<chunkText>> /* $fledFromIndex set in Flight passage (pid 63) or flee-choice-widget (pid 64) */
<<fled-cost>> /* initial flight cost? */
<<if $socio is "beggars">>You<<if $agenum lte 15>> and your family<</if>> lose money every day that you're away from the city, as no one wants to give <<defCharity "charity">> to a <<defBeggars "beggar">> from the city
<<elseif $socio is "day labourers">>You<<if $agenum lte 15>> and your family<</if>> lose money every day that you're away from the city and the people who normally would be willing to employ you for a day's labor
<<elseif $socio is "servants">>You dislike being so far from the city
<<elseif $socio is "artisans">>You<<if $agenum lte 15>> and your family<</if>> lose money every day that you're away from the city and unable to practice your trade
<<elseif $socio is "merchants">>It's deeply irritating to have to pay rent on a country house as well as your home back in the city
<<elseif $socio is "nobles">><<if $followedCourt is 1>>Following the court from palace to palace is expensive, but it keeps you close to the centers of power<<else>>It's to your great disadvantage to be so far from Court and the centers of power<</if>>
<</if>>, but luckily it's a price that you're able to pay for at least a little while to ensure your safety.
<<if $fledFromIndex lt 3>><<fled-cost>><</if>> /* May flight cost */
<<if $fledFromIndex lt 4>><<fled-cost>><</if>> /* June flight cost */
<<if $fledFromIndex lt 5>><<fled-cost>><</if>> /* July flight cost */
<<if $fledFromIndex lt 6>><<fled-cost>><</if>> /* August flight cost */
/* Skip past blank chunks for late fleers — $textGroup is auto-incremented by 1
after render, so set it to (target_chunk - 1) to land on the first relevant chunk.
Chunk thresholds: 2→lt7, 3→lt8, 4→lt9, 5→lt11, 6→lt12, 7→lt15, 8→lt18, 9→lt19, 10→lt20, 11→lt21 */
<<if $fledFromIndex gte 20>><<set $textGroup to 10>>
<<elseif $fledFromIndex gte 19>><<set $textGroup to 9>>
<<elseif $fledFromIndex gte 18>><<set $textGroup to 8>>
<<elseif $fledFromIndex gte 15>><<set $textGroup to 7>>
<<elseif $fledFromIndex gte 12>><<set $textGroup to 6>>
<<elseif $fledFromIndex gte 11>><<set $textGroup to 5>>
<<elseif $fledFromIndex gte 9>><<set $textGroup to 4>>
<<elseif $fledFromIndex gte 8>><<set $textGroup to 3>>
<<elseif $fledFromIndex gte 7>><<set $textGroup to 2>>
<</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 7>><<fled-cost>> /* Sept flight cost*/
When the death tolls top 7,000 a week in August and September, you're sure you made the right call.
<br><br>
By the beginning of October, death tolls have fallen to half that, though there are still a horrifying number of people dying every week. <<fled-broke "October 1665">><<if not _fledBroke and $fledReturn is "summer">>You <<if $hoh isnot 1>>and your $caretakerLabel <</if>>must decide if you are ready to return to the city.
<br><br>[[Return to London->October 1665]]<<else>><br><</if>>
<br><</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 8>><<fled-cost>> /* Oct flight cost */
You anxiously watch the fall in the number of deaths each week, thanking God when only a thousand people a week are dying at the beginning of November.
<<fled-cost>> /* Nov flight cost */
At the start of Advent, there are still 200 or 300 odd people dying each week but you are painfully aware that you are missing the Christmas feasting and merrymaking. <<fled-broke "December 1665">><<if not _fledBroke and ($fledReturn is "summer" or $fledReturn is "winter")>>You <<if $hoh isnot 1>>and your $caretakerLabel <</if>>must decide if you are ready to return to the city.
<br><br>[[Return to London->December 1665]]<<else>><br><</if>>
<br><</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 9>><<fled-cost>>/* Dec flight cost */
You reconcile yourself to a Christmas spent away from the City.
<br><br>
<<fled-cost>> /* Jan flight cost */
When the New Year dawns, you<<if $agenum lte 15>> and your family<</if>> are desperately homesick. You hear the King and court have returned to <<defHamptonCourt "Hampton Court Palace">>, near to the city, and rumors begin to fly about the king's entrance into London. <<fled-broke "February 1666">><<if not _fledBroke and ($fledReturn is "summer" or $fledReturn is "winter" or $fledReturn is "court-return")>>You <<if $hoh isnot 1>>and your $caretakerLabel <</if>>must decide if you are ready to return to the city.
<br><br>[[Return to London->February 1666]]<<else>><br><</if>>
<br><</if>>
<<next "stay away.">>
<<if $fledFromIndex lt 11>><<fled-cost>> /* Feb flight cost */
In February, you hear that the King has reentered the city and people begin asking you why you<<if $agenum lte 15>> and your family<</if>> have not returned when the danger has clearly passed. Your reputation plummets <<set $reputation to Math.clamp($reputation - 1, 0, 10)>> and people begin accusing you of cowardice.
<br><br>
<<fled-broke "March 1666">><<if not _fledBroke>>You are still determined to <</if>>
<</if>>
<<next>>
<<if $fledFromIndex lt 12>><<fled-cost>>/* March flight cost */
By March, the <<defBillsOfMortality "bills of mortality">> show plague deaths creeping back up again.
<<fled-broke "April 1666">><<if not _fledBroke>>You<<if $agenum lte 15>> and your family<</if>> know you made the right decision to stay away.<</if>>
<</if>>
<<if $fledFromIndex lt 13>><<fled-cost>><</if>> /* April flight cost */
<<fled-broke "May 1666">><<if not _fledBroke>><</if>>
<<if $fledFromIndex lt 14>><<fled-cost>><</if>> /* May flight cost */
<<fled-broke "June 1666">><<if not _fledBroke>><</if>>
<<next>>
<<if $fledFromIndex lt 15>><<fled-cost>>/* June flight cost */
As summer dawns over the city, plague deaths reach a height of over 1000 for the month of May. It's nothing compared to 1665, but the risk of death is still high enough that you are frustrated with all the people who demand your return.
<<fled-broke "July 1666">><<if not _fledBroke>>You are determined to ignore them and stay safely away.<</if>>
<</if>>
<<if $fledFromIndex lt 16>><<fled-cost>><</if>> /* July flight cost */
<<fled-broke "August 1666">><<if not _fledBroke>><</if>>
<<if $fledFromIndex lt 17>><<fled-cost>><</if>> /* Aug flight cost */
<<fled-broke "September 1666">><<if not _fledBroke>><</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 18>><<fled-cost>> /* Sept flight cost */
Then, in September, disaster strikes. Your first hint is a dark cloud rising into the air, just barely visible in the distance, but news soon arrives that the city is burning. You pray to God for the salvation of the city—and your home and everything you left behind in it—as the fire burns for days.
<<fled-broke "October 1666">><<if not _fledBroke>><</if>>
<</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 19>><<fled-cost>>/* Oct flight cost */
Finally, you receive word that your home<<if $fireParishes.includes($parish)>> and everything you left behind in it was destroyed. This is a devastating loss and it will cost you a significant amount of time and money to rebuild. If you return to the city in the meantime, you'll have to find somewhere else to live and the thought of searching for temporary lodgings while plague still lingers is terrifying.<<set $preFireLocation to $location>><<set $preFireParish to $parish>><<if $socio is "nobles" or $socio is "merchants" or ($socio is "servants" and ($masterStatus is "nobles" or $masterStatus is "merchants"))>><<set $location to "Westminster">><<set $parish to weightedEither($WestmParishes)>><<elseif $socio is "artisans" or ($socio is "servants" and $masterStatus is "artisans")>><<set $location to "in the northern suburbs">><<set $parish to weightedEither($nParishes)>><<else>><<set $location to "across the river in the southern suburbs">><<set $parish to weightedEither($sParishes)>><<generate-landlord-household>><</if>>
<<else>> remains standing. You thank God for your close escape from disaster.
<br><br>
While you<<if $agenum lte 15>> and your family<</if>> consider making a profit from renting out your residence to those who have been made homeless, you are uncomfortable doing so when you aren't around to make sure the tenant is taking proper care of your belongings. There is still plague about and who knows what other pestilence they could bring into your home? Besides, your home's survival might be God's way of encouraging you to return to the city
<<fled-broke "November 1666">><<if not _fledBroke>><</if>>
<</if>>
<</if>>
<<next "Stay away">>
<<if $fledFromIndex lt 20>><<fled-cost>> /*Nov flight cost */
The official Thanksgiving Day for the end of the plague is proclaimed in November, even though there are still people dying each week. <<if $fireParishes.includes($preFireParish)>>With your home destroyed, there is nothing to return to but rubble. But you<<if $agenum lte 15>> and your family<</if>> know you must make begin rebuilding your life at some point. <</if>>
<<fled-broke "December 1666">><<if not _fledBroke and $fledReturn isnot "no-plague">>You <<if $hoh isnot 1>>and your $caretakerLabel <</if>>must decide if you are ready to return to the city.
<br><br>[[Return to London->November 1666]]<<else>><br><</if>>
<br><</if>>
<<if $fledFromIndex lt 21>><<fled-cost>><</if>> /* Dec flight cost */
<<next "Stay away for good" "go quietly">>
<<if $fledFromIndex lt 21>>Life may have already gone on for the reckless, but it is only at the end of 1666 that you<<if $hoh isnot 1>> and your $caretakerLabel <</if>>finally consider making your way back to the city.
<br><br>[[Return to London->December 1666]]
<br>
<</if>>
<</chunkText>><</nobr>>/* npc-death-roll — processes natural (non-plague) death rolls for one NPC array.
_args[0] = variable name string (e.g. "$NPCs")
_args[1] = label prefix with trailing space (e.g. "your " or "the ")
_args[2] = true: use prefix+relationship in text/label; false: use "your servant"
Expects: _causeWeights, _deadNPCs already initialized by caller.
Sets: _ndContagion (disease name if a contagious death occurred, else ""). */
<<widget "npc-death-roll">><<nobr>>
<<set _ndArr to State.getVar(_args[0])>>
<<set _ndContagion to "">>
<<for _di = 0; _di lt _ndArr.length; _di++>><<if _ndArr[_di].health is "healthy">><<if _ndArr[_di].age is "infant">>
<<if random(1,1000) lte 56>>
<<set _cause to weightedEither(_causeWeights)>><<set _ndArr[_di].health to "deceased">><<if _args[2]>><<print _args[1].toUpperFirst() + _ndArr[_di].relationship>> _ndArr[_di].name<<else>>Your servant _ndArr[_di].name<</if>> has died of _cause.<br>
<<set _deadNPCs.push({npc: _ndArr[_di], label: _args[2] ? _args[1] + _ndArr[_di].relationship : "your " + ($socio === "servants" ? "fellow servant" : "servant")})>>
<<if (_cause is "smallpox" or _cause is "measles") and _ndContagion is "">><<set _ndContagion to _cause>><</if>><</if>>
<<elseif _ndArr[_di].age is "child">>
<<if random(1,1000) is 1>>
<<set _cause to weightedEither(_causeWeights)>><<set _ndArr[_di].health to "deceased">><<if _args[2]>><<print _args[1].toUpperFirst() + _ndArr[_di].relationship>> _ndArr[_di].name<<else>>Your servant _ndArr[_di].name<</if>> has died of _cause.<br>
<<set _deadNPCs.push({npc: _ndArr[_di], label: _args[2] ? _args[1] + _ndArr[_di].relationship : "your " + ($socio === "servants" ? "fellow servant" : "servant")})>>
<<if (_cause is "smallpox" or _cause is "measles") and _ndContagion is "">><<set _ndContagion to _cause>><</if>><</if>>
<<elseif _ndArr[_di].age is "elderly adult">>
<<if random(1,100) is 1>><<set _ndArr[_di].health to "deceased">><<if _args[2]>><<print _args[1].toUpperFirst() + _ndArr[_di].relationship>> _ndArr[_di].name<<else>>Your servant _ndArr[_di].name<</if>> has died of old age.<br>
<<set _deadNPCs.push({npc: _ndArr[_di], label: _args[2] ? _args[1] + _ndArr[_di].relationship : "your " + ($socio === "servants" ? "fellow servant" : "servant")})>>
<</if>><</if>><</if>><</for>>
<</nobr>><</widget>>
/* npc-contagion-spread — spreads a contagious disease (smallpox/measles) to
remaining healthy NPCs in one array after an initial death.
_args[0] = variable name string (e.g. "$NPCs")
_args[1] = label prefix with trailing space (e.g. "your " or "the ")
_args[2] = true: use prefix+relationship; false: use "your servant"
_args[3] = contagion disease name ("smallpox"/"measles"), or "" for none
Expects: _deadNPCs already initialized by caller. */
<<widget "npc-contagion-spread">><<nobr>>
<<if _args[3] isnot "">>
<<set _ncArr to State.getVar(_args[0])>>
<<set _contagionDead to []>><<set _contagionSurvived to []>>
<<for _di = 0; _di lt _ncArr.length; _di++>><<if _ncArr[_di].health is "healthy">>
<<set _cr to random(1,100)>>
<<if _args[3] is "smallpox">>
<<if _cr lte 30>><<set _ncArr[_di].health to "deceased">><<set _contagionDead.push(_di)>>
<<elseif _cr lte 90>><<set _contagionSurvived.push(_di)>><</if>>
<<elseif _args[3] is "measles">>
<<if _cr lte 10>><<set _ncArr[_di].health to "deceased">><<set _contagionDead.push(_di)>>
<<elseif _cr lte 90>><<set _contagionSurvived.push(_di)>><</if>><</if>><</if>><</for>>
<<if _contagionDead.length gt 0>>Tragically, <<for _gi = 0; _gi lt _contagionDead.length; _gi++>><<set _idx to _contagionDead[_gi]>><<if _gi gt 0>> and <</if>><<if _args[2]>><<print _args[1]>>_ncArr[_idx].relationship _ncArr[_idx].name<<else>>your servant _ncArr[_idx].name<</if>><</for>> <<if _contagionDead.length eq 1>>has<<else>>have<</if>> also died of <<print _args[3]>>.<br><<for _gi = 0; _gi lt _contagionDead.length; _gi++>><<set _idx to _contagionDead[_gi]>><<set _deadNPCs.push({npc: _ncArr[_idx], label: _args[2] ? _args[1] + _ncArr[_idx].relationship : "your " + ($socio === "servants" ? "fellow servant" : "servant")})>><</for>><</if>>
<<if _contagionSurvived.length gt 0>><<for _gi = 0; _gi lt _contagionSurvived.length; _gi++>><<set _idx to _contagionSurvived[_gi]>><<if _gi gt 0>> and <</if>><<if _args[2]>><<print _args[1]>>_ncArr[_idx].relationship _ncArr[_idx].name<<else>>your servant _ncArr[_idx].name<</if>><</for>> <<if _contagionSurvived.length eq 1>>has<<else>>have<</if>> contracted <<print _args[3]>> but survived.<br><br><</if>>
<</if>>
<</nobr>><</widget>><<nobr>><<set-caretaker>>
/* Plague infection check — sickPC/sickFam take priority over all stay content */
<<set _fleeInfected to false>>
<<if $plagueInfection eq 1>><<set _fleeInfected to true>><</if>>
<<silently>><<check-NPCs>><<set _hasInfectedNPC to (_infectedFamily.length + _infectedServants.length) gt 0>><</silently>>
<<if _fleeInfected>><<if $fled is 5>>You prepare to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. You will leave tomorrow. <</if>><<sickPC>>
<<elseif _hasInfectedNPC>><<if $fled is 5>><<set $fled to 4>><</if>>You prepare your household to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. They will leave tomorrow.<br><br><<sickFam>>
<<else>>
<<if $fled is 5>><<fled-family>>
<</if>>
<<set _plagueWorkShown to false>>
/* Beggars */
<<if $socio is "beggars">>
<<if $fled is 3>>
You <<if $hoh is 1>>decide <<else>>convince your $caretakerLabel <</if>>to break your contract with your $masterTitle and remain in the city, despite the danger<<if $NPCs.length gt 0>> to yourself and your family<</if>>.<br><br>
Unfortunately, with no income and no reputation to speak of anymore, you <<if $NPCs.length gt 0>>and your family <</if>> only have the option of begging to survive. You sell all your worldly goods and throw yourself on the mercy of your neighbors.
<<else>>You can't afford to leave the city and even if you could, where would you go? Here at least you have shelter and the right to alms from $parish.
<</if>>
/* Day Labourers */
<<elseif $socio is "day labourers">>
<<if $religion isnot "Catholic" and $skipServices isnot 1 and $agenum gt 16 and $socio is "day labourers">>
<<set _plagueWorkShown to true>>
<<plague-work-choice>>
<<else>>
For now, there is steady work helping people prepare to leave the city, but you worry about what you will do once those who are able to flee have done so.
<</if>>
/* Servants Stay*/
<<elseif $socio is "servants">>
You <<if $hoh is 1>>decide <<else>>convince your $caretakerLabel <</if>>to remain in the city with your $masterTitle and <<if $masterGender is "female">>her<<else>>his<</if>> household, despite the danger.
/* everyone else */
<<else>>
You <<if $hoh is 1>>decide <<else>>convince your $caretakerLabel <</if>>to remain in the city<<if $fled is 4>> with your <<defHousehold "household">>, despite the danger<<else>>, and send the rest of your household to the countryside away from the danger. <<if $FledServants.length gt 0>>You also send them with <<if $FledServants.length eq 1>>a servant <<else>>$FledServants.length servants <</if>>to attend to their needs.<</if>> You promise to meet them should the situation grow worse.<</if>>
<<if $socio is "artisans">>There are fewer customers coming into your shop every day, but you are still earning more than you could if you fled the city.
<<elseif $socio is "merchants">>Your business will not run itself and there is no one you trust to manage it in your absence.
<<elseif $socio is "nobles">>It is a dangerous gamble, but you are hoping that remaining in the city when most everyone else has fled will advance your reputation and future prospects at court.
<</if>>
<</if>>
/* Common continuation for all stay paths (plague-work-choice handles its own via <<replace>>) */
<<if not _plagueWorkShown>><br><br>
While you remain in the city, you can take measures to protect yourself<<if $NPCs.length gt 1>> and your household<</if>> from the <<defPlague "plague">>. You can pray for deliverance, use homemade remedies, or visit the <<defApothecary "Apothecary">>, who sells fumigants and medicines to prevent you from getting sick or to treat those who have fallen ill. Do you want to:
<<preventative>>
You know the plague will only worsen as the weather warms and <<storyline-return "summer advances.">>
<</if>>
<</if>>
<</nobr>><<widget "flee-blocked">><<nobr>>
/* flight failure due to plague infection */
<<set _fleeInfected to false>>
<<if $plagueInfection eq 1>><<set _fleeInfected to true>><</if>>
<<silently>><<check-NPCs>><<set _hasInfectedNPC to (_infectedFamily.length + _infectedServants.length) gt 0>><</silently>>
<<if _fleeInfected>>You prepare to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. You will leave tomorrow. <<sickPC>>
<<elseif _hasInfectedNPC>>You prepare your household to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. They will leave tomorrow.<br><br><<sickFam>>
<</if>><</nobr>><</widget>>
<<set _fleeBlocked to false>>
<<if $fled is 5>><<silently>><<check-NPCs>><<set _fleeBlocked to (_infectedFamily.length + _infectedServants.length) gt 0>><</silently>>
<<if _fleeBlocked>><<set $fled to 4>>You prepare your household to flee the city. It takes some time to sort out the travel logistics, but finally everything is in order. They will leave tomorrow.<br><br>
<<sickFam>>
<<else>><<fled-family>>
<</if>>
<</if>>
<<widget "fled-cost">><<nobr>>
<<income>><<expenses>>
<<if $followedCourt is 1>> /* costs 2x expenses to follow Court */
<<set $expenses to $expenses * 2>>
<</if>>
<<disposable>>
<</nobr>><</widget>>
<<widget "fled-broke">><<nobr>>
<<set _fledBroke to ($money lte 0 and $timeline.indexOf($args[0]) gt $fledFromIndex)>>
<<if _fledBroke>><<set $followedCourt to 0>><<set $fledBroke to true>><<goto $args[0]>><</if>>
<</nobr>><</widget>><<widget "corpse-work">><<nobr>><<if ($role is "corpsebearer" or $role is "searcher") and $corpseBuried and $corpseBuried[$parish]>>
<<set _cwBuried to $corpseBuried[$parish][$monthIndex]>>
<<set _cwPlague to $corpsePlague[$parish][$monthIndex]>>
<<if _cwBuried gt 0>>
<<set _cwPay to Math.min(_cwBuried, 60) * 2>>
<<set $money to Math.clamp($money + _cwPay, -Infinity, Infinity)>>
/* Occupational infection: re-roll parish infection check (doubles effective chance) */
<<set _cwRate to $parishRate[$parish][$monthIndex]>>
<<set _cwInfectPct to Math.round(100 / _cwRate)>>
<<if $role is "corpsebearer" and $plagueInfection isnot 1>>
<<if not _randomEventFired>>You and your fellow corpsebearers transported <<print _cwBuried>> corpses this month and you were paid <<conversion _cwPay>> by the churchwardens for your service to the parish.
<<if _cwPlague gt 0>> <<print _cwPlague>> of the dead had plague, may the Lord have mercy on their souls and protect you from sickness.<</if>><</if>>
<<if $playerPlagueStatus is "healthy" and _cwPlague gt 0>>
<<if random(1, _cwRate) eq 1>>
<<set $plagueInfection to 1>>
<</if>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Transported plague corpses", money: _cwPay, repDelta: 0, repBefore: $reputation, infectPct: _cwInfectPct})>>
<</if>>
<<elseif $role is "searcher" and $plagueInfection isnot 1>>
<<if not _randomEventFired>>You and your fellow searchers examined <<print _cwBuried>> corpses this month and you were paid <<conversion _cwPay>> by the churchwardens for your service to the parish.
You determined <<print _cwPlague>> of the dead had plague, may the Lord have mercy on their souls and protect you from sickness.<</if>>
<<if $playerPlagueStatus is "healthy" and _cwPlague gt 0>>
<<if random(1, _cwRate) eq 1>>
<<set $plagueInfection to 1>>
<</if>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Examined plague corpses", money: _cwPay, repDelta: 0, repBefore: $reputation, infectPct: _cwInfectPct})>>
<</if>>
<</if>>
<<if not _randomEventFired>><br><br><</if>>
<</if>>
<</if>>
/* Nurse role: patient assignment based on plague deaths, with player choice */
<<if not _randomEventFired>><<if $role is "nurse" and $corpsePlague and $corpsePlague[$parish] and $plagueInfection isnot 1>><<if $shutUpHouse eq 0>>
<<set _nwPlague to $corpsePlague[$parish][$monthIndex]>>
<<if _nwPlague gt 0 and $playerPlagueStatus is "healthy" and random(1, 100) lte _nwPlague>>
<span id="nurse-choice">The parish officials order you to nurse a parishioner who is sick with the <<defPlague "plague">>. Do your Christian duty and aid the sick?<br><br>
<<link "Yes">><<replace "#nurse-choice">><<set $shutUpHouse to 1>>
<<set _repBefore to $reputation>>
<<set $reputation to Math.clamp($reputation + 1, 0, 10)>>
<<set $money += 48>>
<<if random(1, 2) eq 1>>
<<set $plagueInfection to 1>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Nursed a plague patient (infected)", money: 48, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: 50})>><<set $shutUpHouse to 0>><<else>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Nursed a plague patient (survived)", money: 48, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: 50})>><</if>>You bring food and medicines to the shut up house, wash their laundry, and provide what comfort you can as their only link to the outside world. It's a strange thing, to risk your life for 4 shillings. Your neighbors both thank you for your charity while avoiding you as a potential plague risk.
<</replace>><</link>> | <<link "No">><<replace "#nurse-choice">>
<<set _repBefore to $reputation>>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Refused to nurse a plague patient", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: 0})>>
You pretend to feel unwell and beg off nursing the sick, but the churchwardens suspect you're lying and your reputation suffers for it.
<</replace>><</link>></span><br><br>
<</if>><<elseif $shutUpHouse eq 1>>After forty days of guarding your neighbor's house, the quarantine ends and you are relived to return to your regular work.<<set $shutUpHouse to 0>><</if>>
<</if>><</if>>
/* Warder role: guard a shut-up house, parallel to nurse patient assignment */
<<if not _randomEventFired>><<if $role is "warder" and $corpsePlague and $corpsePlague[$parish] and $plagueInfection isnot 1>><<if $shutUpHouse eq 0>>
<<set _wwPlague to $corpsePlague[$parish][$monthIndex]>>
<<if _wwPlague gt 0 and $playerPlagueStatus is "healthy" and random(1, 100) lte _wwPlague>>
<<set _wwRate to $parishRate[$parish][$monthIndex]>>
<<set _wwInfectPct to Math.round(100 / _wwRate)>>
<span id="warder-choice">A household in your <<defParish "parish">> has been shut up for the <<defPlague "plague">>. The churchwardens order you to stand guard outside the door. Do you do as you are told?<br><br>
<<link "Yes">><<replace "#warder-choice">><<set $shutUpHouse to 1>>
<<set _repBefore to $reputation>>
<<set $money += 48>>
<<if random(1, _wwRate) eq 1>>
<<set $plagueInfection to 1>><<set $shutUpHouse to 0>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Guarded a plague house (infected)", money: 48, repDelta: 0, repBefore: _repBefore, infectPct: _wwInfectPct})>>
<<else>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Guarded a plague house (survived)", money: 48, repDelta: 0, repBefore: _repBefore, infectPct: _wwInfectPct})>>
<</if>>You and one of your neighbors take turns standing guard outside the shut up house each day. It's a strange thing, to risk your life for 4 shillings. Your neighbors understand the necessity of what you do, but they also have started to avoid you as a potential plague risk.<</replace>><</link>> | <<link "No">><<replace "#warder-choice">>
<<set _repBefore to $reputation>>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Refused to guard a plague house", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: 0})>>
You pretend to feel unwell and beg off standing guard, but the churchwardens suspect you're lying and your reputation suffers for it.
<</replace>><</link>></span><br><br>
<</if>><<elseif $shutUpHouse eq 1>>After forty days of guarding your neighbor's house, the quarantine ends and you are relived to return to your regular work.<<set $shutUpHouse to 0>><</if>>
<</if>><</if>>
/* Bill of Mortality subscription report */
<<if not _randomEventFired>><<if $billSubscribed is 1 and $plagueInfection isnot 1 and $role isnot "searcher" and $role isnot "corpsebearer" and $corpseBuried and $corpseBuried[$parish]>>
<<set _bomBuried to $corpseBuried[$parish][$monthIndex]>>
<<set _bomPlague to $corpsePlague[$parish][$monthIndex]>>
<<set $money -= 4>>
<<if _bomBuried gt 0>>
The Bills of Mortality report <<print _bomBuried>> burials in $parish this month<<if _bomPlague gt 0>>, <<print _bomPlague>> of plague<</if>>.
<<else>>
The Bills of Mortality report no burials in $parish this month.
<</if>>
<br><br>
<</if>><</if>>
<</nobr>><</widget>>
/* widget to dismiss a servant with poor reputation */
<<widget "dismiss-servant">><<nobr>>
<<if $socio is "servants" and $reputation lte 2>>
<<if random(1,2) is 1>>
<<set $socio to "day labourers">><<leave-service>>Due to your poor reputation, your $masterTitle has dismissed you and you have been unable to find a new position. You will have to hope you can survive as a day labourer.
<br><br>
<</if>>
<</if>>
<</nobr>><</widget>>
/* widget to promote a servant with stellar reputation to apprentice status */
<<widget "promote-servant">><<nobr>>
<<if $socio is "servants" and $apprenticeship is 0 and $servantPromotion is 0 and $reputation gte 10 and ($relationship is "single" or $relationship is "betrothed") and $agenum gte 14 and $agenum lte 21>>
<span id="promoteServant">Your $masterTitle is so impressed with your work that <<if $masterGender is "female">>she<<else>>he<</if>> is willing to take you on as an apprentice without paying the regular entrance fine. Do you accept?<br><br>
<<link "Yes, accept the apprenticeship">><<replace "#promoteServant">>
<<set $servantPromotion to 1>>
<<set $apprenticeship to 1>>
<<set $seekingMarriage to 0>>
<<set _repBefore to $reputation>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Promoted from servant to apprentice by " + $masterTitle, money: 0, repDelta: 0, repBefore: _repBefore, infectPct: null})>>
Your $masterTitle formally takes you on as <<if $masterGender is "female">>her<<else>>his<</if>> apprentice. You will continue to live in <<if $masterGender is "female">>her<<else>>his<</if>> household, but now you are learning a trade rather than merely serving. It is a remarkable opportunity, earned by your hard work and good reputation.<br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>> | <<link "No, remain a servant">><<replace "#promoteServant">>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Declined apprenticeship offer from " + $masterTitle, money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>
You decline your $masterTitle's generous offer and continue in your current role as a servant.<br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>>
</span>
<</if>>
<</nobr>><</widget>><<widget "steward">><<nobr>>
Zounds! The steward of <<if $agenum lte 15>>you and <</if>>your<<if $agenum lte 15>> family's<</if>> country estate has died and you must return home to manage affairs yourself.
<br><br>
<span id="fondness">Were you fond of your steward? <<link "Yes">><<replace "#fondness">>You were fond of your steward so you <<if $agenum lte 15>>and your family<</if>> are sad he is now dead, and even sadder that he can no longer manage your estate. It will be hard to replace him. You decide to hold a funeral to honor his contributions to your family.<<set $money -= 4800>><<set $reputation to Math.clamp($reputation + 1, 0, 10)>>
<br><br>
How long do you spend putting your estate's affairs in order?<ul>
<li><<storyline-return "One month" 1>></li>
<li><<storyline-return "Two months" 2>></li>
<li><<storyline-return "Three months" 3>></li>
</ul>
<</replace>><</link>> | <<link "No">><<replace "#fondness">>You weren't fond of your steward and are looking forward to the opportunity to replace him, but it will still require a great deal of work to find someone capable soon.
<br><br>
How long do you spend putting your estate's affairs in order?<ul>
<li><<storyline-return "One month" 1 -9 -1>></li>
<li><<storyline-return "Two months" 2 -9 -1>></li>
<li><<storyline-return "Three months" 3 -9 -1>></li>
</ul>
<</replace>><</link>></span>
<</nobr>><</widget>><<widget "march-1666-helper">><<nobr>>The Court is plunged into mourning<<if $socio is "nobles">>. After a month in London, the King moves on to one of his father's old houses of <<defAudleyEndInEssex "Audley End, in Essex">>. Once an enormous and grand palace, it is in bad shape after the <<defCivilWar "Civil War">> and <<defInterregnum "Interregnum">>. But the <<defPlague "plague">> has proved the wisdom of the King having more royal palaces outside of London and the Court is happy to follow him...<<else>> and the city quiets as well... <</if>> because <<defPlague "plague">> numbers are starting to go up again.
So much for the city being safe again.<br>
<br>
It's not a great lead up for [[April 1666]].
<</nobr>><</widget>>
<<widget "sep-1665-helper">><<nobr>>
The <<defLordMayor "Lord Mayor">> has ordered fires to be lit throughout the city, to fill the air with smoke and sweep away any miasmas that might be making the plague worse.
<br><br>
You can continue to try and avoid the plague by visiting the <<defApothecary "Apothecary">> for fumigants and medicines, or you can:
<<preventative>>
[[Continue to October 1665->October 1665]]
<</nobr>><</widget>>
<<widget "june-1666-helper">><<nobr>>
One thing is for certain, though. The weather is so hot that <<defPlague "plague">> cases are on the rise again and you know it will only get worse in [[July 1666]].
<br><br>
<a href="https://collections.rmg.co.uk/media/287/368/bhc0286.jpg"><img src="https://collections.rmg.co.uk/media/287/368/bhc0286.jpg" width="100%" alt="Painting of warships engaged in the Four Days Battle at sea"></a>
//Abraham Storck - "The 'Royal Prince' and Other Vessels at the Four Days Battle, 1–4 June 1666", c. 1670//
<</nobr>><</widget>><<widget "accident">><<nobr>>
<<set $accident to random(0,5)>><<if $accident is 1>>Send not to know for whom the church bells toll. They toll for you.
<br><br>Unfortunately you have suffered from a fatal accident <<if $socio is "day labourers">>while out on a job<</if>>. <<set $death to random(1,5)>><<if $death is 1>>You drowned in <<if $socio is "day labourers">>a brewer's mash while attempting to help one of your neighbors make beer<<else>>a well while attempting to draw water for your household<</if>>. <<elseif $death is 2>>You were bitten by a dog and your wound went bad. <<elseif $death is 3>>You fell from <<if $socio is "day labourers">>scaffolding while working to replace a man's roof<<else>>a window while leaning out to see what was causing a commotion in the street<</if>>. <<elseif $death is 4>>You were run over by an out-of-control cart. <<else>>You fell down a flight of stairs and hit your head.<</if>><br><br>At least you didn't die of the plague.<br><br>
<<death-announcement>>
<<else>>
You have suffered an accident <<if $socio is "day labourers">>while out on a job<</if>>, but thanks be to God, you are still alive. <<set $accident to random(1,5)>><<if $accident is 1>>You fell from a window while leaning out to see what was causing a commotion in the street. <<elseif $accident is 2>>You were kicked by a horse when you passed too close behind it. <<elseif $accident is 3>>You fell down a flight of stairs and broke your arm. <<elseif $accident is 4>>You were hit by the wheel of a wagon as its driver navigated through a crowded street. <<else>>You fell out of a boat while crossing the Thames and breathed some water before your friends managed to haul you to safety. <</if>> Fortunately, this is something you can recover from with rest and care. <<if $reputation lte 2>>Unfortunately your reputation is too low for anyone to offer you assistance so you must recover on your own and <<else>>Your <<if $NPCs.length gt 0>>family<<else>>neighbors<</if>> take good care of you, but <</if>>you lose money every day you aren't working.<<set $money -=3>><br><br>Soon you are ready to rejoin <<if $socio is "day labourers">>the other <<defDayLabourer "day labourers">> in their search for work. <<storyline-return "Continue." 0>><<else>>your <<print $masterTitle || "master">>'s household. <<storyline-return "Continue." 0>><</if>>
<</if>>
<</nobr>><</widget>>/* from bio but have changed how names are assigned since then */
<<if $gender is "nonbinary">>
<<set _x to random(1,4)>>
<<if _x is 1>>Your friends and family call you <<set _name = ["Charles", "Charlotte"]>><<listbox "$name">><<optionsfrom _name>><</listbox>>
<<elseif _x is 2>>Your friends and family call you <<set _name = ["Phillip", "Phillippa"]>><<listbox "$name">><<optionsfrom _name>><</listbox>><<elseif _x is 3>>Your friends and family call you <<set _name = ["John", "Joan"]>><<listbox "$name">><<optionsfrom _name>><</listbox>>
<<else>>Your friends and family call you <<set _name = ["Thomas", "Thomasina"]>><<listbox "$name">><<optionsfrom _name>><</listbox>>
<</if>>
<<else>>
<</if>><<widget "elderly">><<nobr>>
Send not to know for whom the church bells toll. They toll for you. Unfortunately your old age has caught up with you. You have managed not to die of a wide range of diseases and other ailments, but at long last you have died of natural causes.
<br><br>
At least you didn't die of plague.<br><br>
<<death-announcement>>
<</nobr>><</widget>><<widget "runover">><<nobr>>
<<set $runover to random(0,5)>>
<<if $runover is 1>>
Send not to know for whom the church bells toll. They toll for you.
<br><br>
<<if passage() is "September 1666">>
<<if $location is "inside the City walls">>Early one Sunday morning, you wake to the frantic ringing of church bells. This isn't the ordinary <<defCallToService "call to service">>—<<if $religion is "member of the Church of England">>something you were looking forward to attending after you slept in<<else>>as if you'd ever attend a service in the Church of England!<</if>>—but rather a call to arms.
<br><br>
Unfortunately, there are dangers other than the fire. As you stumble through the streets to flee the conflagration, you are run over by a cart, an accident from which you will not recover.
<br><br>
<<else>>One Sunday morning, you awaken and are getting ready for church when you look out the window and realize there is a great fire in the distance. After dressing, you go out to find a neighbor who tells you that over 300 houses have burnt down in the night, by <<defLondonBridge "London Bridge">>.
<br><br>
Unfortunately, there are dangers even outside the city walls. As you walk out to get a closer look at the conflagration, you are run over by a cart fleeing the flames, an accident from which you will not recover.
<</if>>
<<else>>
Unfortunately, begging in the street comes with risks in a bustling city like London, and you have been run over by a cart, an accident from which you will not recover.
<</if>>
<br><br>At least you didn't die of plague.<br><br>
<<death-announcement>>
<<else>>
<<if passage() is "September 1666">>
<<if $location is "inside the City walls">>Early one Sunday morning, you wake to the frantic ringing of church bells. This isn't the ordinary <<defCallToService "call to service">>—<<if $religion is "member of the Church of England">>something you were looking forward to attending after you slept in<<else>>as if you'd ever attend a service in the Church of England!<</if>>—but rather a call to arms.
<br><br>
Unfortunately, there are dangers other than the fire. As you stumble through the streets to flee the conflagration, you are run over by a cart and suffer a serious injury.
<<else>>One Sunday morning, you awaken and are getting ready for church when you look out the window and realize there is a great fire in the distance. After dressing, you go out to find a neighbor who tells you that over 300 houses have burnt down in the night, by <<defLondonBridge "London Bridge">>.
<br><br>
Unfortunately, there are dangers even outside the city walls. As you walk out to get a closer look at the conflagration, you are run over by a cart fleeing the flames and suffer a serious injury.
<</if>>
<br><br>
You thank God that you have survived his wrath! <<if $reputation lte 2>><<set $money -=1>> Unfortunately, your reputation is so low that your neighbors take no more pity on you and you earn very few spare coins while you recover. <<storyline-return "Continue." 0>><<else>><<set $money +=2>>Fortunately, your reputation is so high among your neighbors that the sight of you after your injury invokes great pity (and a few extra coins). Nevertheless, you are glad that you will soon heal. <<storyline-return "Continue." 0>><</if>>
<<else>>
Alack! Begging in the streets in a city as bustling as London comes with its dangers. You have been run over by a cart and suffered a serious injury. <<if $reputation lte 2>>Unfortunately, your reputation is so low that your neighbors take no more pity on you and you earn very few spare coins while you recover. <<set $money -=1>><<else>><<set $money +=2>>Fortunately, your reputation is so high among your neighbors that the sight of you after your injury invokes great pity (and a few extra coins). Nevertheless, you are glad that you will soon heal.<</if>> You hear that in some areas of the city they are installing a new innovation—the sidewalk—which will help to keep people off the street and prevent more accidents like yours. <<storyline-return "Continue." 0>>
<</if>>
<</if>>
<</nobr>><</widget>><<widget "fever">><<nobr>>
<<if random(0,10) is 1>><<set _eventCausedDeath to true>>Send not to know for whom the church bells toll. They toll for you. You have come down with a mysterious fever. <<if $reputation gte 3>>Despite the care of your friends and family,<<else>>Your reputation is so low that no one will lend you aid in your sickness and<</if>> you die.<br><br>At least you didn't die of plague.<br><br>
<<death-announcement>>
<<else>>
<<set $money -=2>>Alack! You have come down with a mysterious fever.<<if $reputation gte 3>> Your reputation is high enough that your friends and family take diligent care of you in your sickness and<<else>> Your reputation is so low that no one lends you aid in your sickness but<</if>> you slowly recover.
<br><br>
<<storyline-return "Continue." 0>>
<</if>>
<</nobr>><</widget>><<nobr>>
<<set $death to random(1,10)>>
<<set $discovery to random(1,10)>>
<<if $discovery is 1 and $agenum lte 15>>When you show up to board your ship, the captain instantly realizes you are <<linkappend "too young to volunteer.">>too young to volunteer. You are scolded and <<storyline-return "sent home to your parents." 1 0 -1>><</linkappend>>
<<elseif $discovery is 1 and $agenum gte 55>>When you show up to board your ship, the captain instantly realizes you are <<linkappend "too old to volunteer.">>too old to volunteer. He thanks you for volunteering but firmly refuses to let you board and <<storyline-return "sails away without you." 1 0 1>><</linkappend>>
<<elseif $discovery is 1 and $gender is "female">>When you show up to board your ship, the captain instantly <<linkappend "realizes you are female.">>realizes you are female. He has you cast back onto the dock while everyone <<storyline-return "stops to watch and gossip about you." 1 0 -1>><</linkappend>>
<<else>>
<<set $impressedFromIndex to $monthIndex>><<income>><<income>> /* sign-up bonus of 2 months income */
You have enlisted on the HMS Royal Sovereign and join the English fleet in taking the fight to your Dutch enemies. You soon gain a reputation as a <<if $reputation gte 6>>fierce fighter and a loyal crewman.<<elseif $reputation gte 3>>good man to drink and play cards with, but not the best man to stand beside in battle.<<else>>a no-good layabout who is best avoided.<</if>><br><br>Your ship spends so long at sea that you completely lose track of <<linkappend "what's happening back home in London.">>what's happening back home in London.<br><br>
<<if $pregnant gt 4>>
However, there's only so long you can hide the fact that you're pregnant. As soon as you start to show, your captain realizes you should never have been allowed to enlist. The next time the ship makes port, he has you cast out onto the dock while everyone <<storyline-return "stops to watch and gossip about you." 2 0 -2>>
<<else>>
<<naval-experience>><</if>>
<</linkappend>>
<</if>>
<</nobr>><<widget "hold-office">><<nobr>>
<<set _officeEventFired to false>>
/* Check for office removal due to low reputation */
<<if $office isnot "" and $reputation lte 4>>
Because of your poor reputation, the vestry of $parish decided to <<storyline-return "remove you from your position" 0 0 -1>> as $office. <<set $office to "">>
<</if>>
/* Check eligibility for church office: CoE male, age 30+, artisan/merchant gated in random-events where called, rep 8+, no current office */
<<if $office is "" and $religion is "member of the Church of England" and $gender is "male" and $agenum gte 30 and $reputation gte 8>>
<<set _officeRoll to random(1,4)>>
<<if _officeRoll is 1>>
<<set _officeEventFired to true>>
<<set _officeType to either("Churchwarden", "Overseer of the Poor")>>
<span id="officeChoice">The vestry of $parish has called you to serve as one of the <<defParish "parish's">> <<print _officeType>>. Do you accept?
<<link "Yes">><<replace "#officeChoice">>
<<set $office to _officeType>>
You accept the position of <<print _officeType>> in $parish and the <<storyline-return "responsibilities to your parish that come with it." 0 0 1>><br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>> | <<link "No">><<replace "#officeChoice">>
You don't want the hassle of holding office in your parish and <<storyline-return "pay a fine to avoid serving." 0 -24>><br><br>
<</replace>><</link>></span>
<</if>>
<</if>>
<</nobr>><</widget>>/* Orphan-check widget: called at the end of plague/sickness/quarantine sequences.
If the player is a child or adolescent and no living adult (young adult,
middle-aged adult, or elderly adult) remains in $NPCs, regenerate their
household according to their socio status. */
<<widget "orphan-check">><<nobr>>
/* If household was swapped for other-HH quarantine, undo the swap first */
<<if $quarantineSwapped is "master">>
<<silently>>
<<set $NPCsMaster to clone($NPCs)>>
<<set $NPCs to clone($SavedNPCs)>>
<<set $NPCsServants to clone($SavedServants)>>
<<set $quarantineSwapped to "">>
<<set $SavedNPCs to []>>
<<set $SavedServants to []>>
<</silently>>
<<elseif $quarantineSwapped is "extended">>
<<silently>>
<<set $NPCsExtended to clone($NPCs)>>
<<set $NPCs to clone($SavedNPCs)>>
<<set $NPCsServants to clone($SavedServants)>>
<<set $quarantineSwapped to "">>
<<set $SavedNPCs to []>>
<<set $SavedServants to []>>
<</silently>>
<</if>>
<<if $agenum lte 15>>
<<set _hasLivingAdult to false>>
<<for _oi = 0; _oi < $NPCs.length; _oi++>>
<<if ($NPCs[_oi].age is "young adult" or $NPCs[_oi].age is "middle-aged adult" or $NPCs[_oi].age is "elderly adult") and $NPCs[_oi].health isnot "deceased">>
<<set _hasLivingAdult to true>>
<</if>>
<</for>>
<<if not _hasLivingAdult>>
<<if $socio is "servants">>
/* Servant: find a new master's household */
/* Preserve smuggled children before wiping NPCs */
<<if $getaway.length gt 0>>
<<for _oi = 0; _oi < $NPCs.length; _oi++>>
<<if $NPCs[_oi].health is "safe from harm">>
<<set $NPCsExtended.push($NPCs[_oi])>>
<</if>>
<</for>>
<</if>>
<<set $NPCs to []>>
<<set $NPCsMaster to []>>
<<addMasterHousehold>>
<<set $NPCs to $NPCsMaster.slice()>>
<<set $NPCsMaster to []>>
<<NPCpronouns>>
<<set-hoh>>
<br><br>Because your $masterTitle died, you have found a new position in another household.<br><br>
<<elseif $socio is "beggars" or $socio is "day labourers">>
/* Beggar/Day Labourer: become a servant in an artisan household */
<<addMaster>>
<<set _MasterTrade to either("baker", "chandler", "grocer", "tailor", "weaver")>>
<br><br>Because you have been orphaned, your <<defParish "Parish">> <<defOverseersOfThePoor "Overseers of the Poor">> have found you a position as a servant in a local _MasterTrade's household.<br><br>
<<else>>
/* Artisan/Merchant/Noble: move to new household of same socio status */
<<set _newGuardian to either("uncle", "widowed aunt", "cousin", "family friend")>>
/* Collect surviving child/adolescent NPCs from original household */
<<set _survivingKids to []>>
<<for _oi = 0; _oi < $NPCs.length; _oi++>>
<<if ($NPCs[_oi].age is "child" or $NPCs[_oi].age is "adolescent") and $NPCs[_oi].health isnot "deceased">>
<<set _survivingKids.push($NPCs[_oi])>>
<</if>>
<</for>>
<<set $NPCs to []>>
/* Build the new household starting with the guardian and their family */
<<if _newGuardian isnot "widowed aunt">>
<<set _newGuardianAgenum to random(30,76)>>
<<if _newGuardianAgenum gte 60>><<set _newGuardianAge to "elderly adult">>
<<else>><<set _newGuardianAge to "middle-aged adult">>
<</if>>
<<if _newGuardian is "uncle">>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "uncle", health: "healthy", location: $location})>>
<<elseif _newGuardian is "cousin">>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "cousin", health: "healthy", location: $location, heshe: "he", hishers: "his"})>>
<<else>>
<<set $NPCs.push({name: weightedEither($mNames), agenum: _newGuardianAgenum, age: _newGuardianAge, relationship: "guardian", health: "healthy", location: $location})>>
<</if>>
<<if random (1,2) eq 1>>
<<set _fRel to "aunt">>
<<set $minAge to _newGuardianAgenum-20>>
<<if $minAge lte 15>>
<<set $minAge to 16>>
<</if>>
<<set $maxAge to _newGuardianAgenum+30>>
<<if $maxAge gte 101>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<if _newGuardian is "uncle">>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "aunt", health: "healthy", location: $location})>>
<<elseif _newGuardian is "cousin">>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "cousin's wife", health: "healthy", location: $location})>>
<<else>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "guardian's wife", health: "healthy", location: $location})>>
<</if>>
<<set _auntAgenum to $NPCAgeNum>>
<<else>>
<<set _auntAgenum to _newGuardianAgenum>>
<</if>>
<<else>>
<<set _auntAgenum to random(30,76)>>
<<if _auntAgenum gte 60>>
<<set _newGuardianAge to "elderly adult">>
<<else>><<set _newGuardianAge to "middle-aged adult">>
<</if>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: _auntAgenum, age: _newGuardianAge, relationship: "widowed aunt", health: "healthy", location: $location})>>
<</if>>
<<if $socio is "artisans">>
<<set _newHHKids to random(1,2)>>
<<elseif $socio is "merchants">>
<<set _newHHKids to random(1,4)>>
<<else>>
<<set _newHHKids to random(2,6)>>
<</if>>
<<for _k to 0; _k lt _newHHKids; _k++>>
<<set $minAge to _auntAgenum-40>>
<<if $minAge lte 0>>
<<set $minAge to 0>>
<</if>>
<<set $maxAge to _auntAgenum-20>>
<<setAge>>
<<if _newGuardian is "family friend">>
<<set $mkidRel to "friend's son">>
<<set $fkidRel to "friend's daughter">>
<<elseif _newGuardian is "cousin">>
<<set $mkidRel to "cousin's son">>
<<set $fkidRel to "cousin's daughter">>
<<else>>
<<set $mkidRel to "cousin">>
<<set $fkidRel to "cousin">>
<</if>>
<<if random(1,2) is 1>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: $fkidRel, health: "healthy", location: $location, heshe: "she", hishers: "her"})>>
<<else>>
<<set $NPCs.push({name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: $mkidRel, health: "healthy", location: $location, heshe: "he", hishers: "his"})>>
<</if>>
<</for>>
/* Move surviving child/adolescent NPCs from original household into new household */
<<set $NPCs to $NPCs.concat(_survivingKids)>>
<<NPCpronouns>>
<<set-hoh>>
<br><br>Because you have been orphaned, you have moved in with <<if _newGuardian is "family friend">>a family friend<<else>>your _newGuardian<</if>>.<br><br>
<</if>>
<</if>>
<</if>>
<</nobr>><</widget>><<widget "worker-kid">><<nobr>>
Despite everything, you <<if $socio is "day labourers">>keep finding opportunities for work<<else>>know you are lucky to be steadily employed as a servant<</if>>. A friend from the countryside writes to you<<if $agenum lte 15>>r family<</if>> and asks if you will take in their child so they can also seek work in London.
<br><br>
<span id="worker">Do you want to accept them into your home? <<link "Yes">><<replace "#worker">><<addWorkerKidNPC>><<set $worker to 0>><<if $hoh is 4>>You convince your husband to accept them into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle to accept them into your home.<<elseif $hoh isnot 1>>You convince your family to accept them into your home.<<else>>You accept them into your home.<</if>> It's another mouth to feed, but you are glad to <<storyline-return "do a friend a favor." 0 -48 1>><</replace>><</link>> | <<link "No">><<replace "#worker">><<if $hoh is 4>>You convince your husband not to accept them into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle not to accept them into your home.<<elseif $hoh isnot 1>>You convince your family not to accept them into your home.<<else>>You don't accept them into your home.<</if>> Things are too hard right now. You can't afford another mouth to feed and you don't have the time to teach someone else the lay of the city.<<storyline-return "Continue." 0>><</replace>><</link>></span>
<</nobr>><</widget>>
<<widget "apprentice">><<nobr>>
Despite everything, business continues. A friend from the countryside writes to you<<if $agenum lte 15>>r family<</if>> and asks if you will take in their son as your apprentice.
<br><br>
<span id="apprentice">Do you want to accept him into your home? <<link "Yes">><<replace "#apprentice">><<addApprenticeNPC>><<set $apprentice to 0>><<if $hoh is 4>>You convince your husband to accept him into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle to accept him into your home.<<elseif $hoh isnot 1>>You convince your family to accept him into your home.<<else>>You accept him into your home.<</if>> It's another mouth to feed, but you could use the help and are glad to <<storyline-return "do a friend a favor." 0 -48 1>><</replace>><</link>> | <<link "No">><<replace "#apprentice">><<if $hoh is 4>>You convince your husband not to accept him into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle not to accept him into your home.<<elseif $hoh isnot 1>>You convince your family not to accept him into your home.<<else>>You don't accept him into your home.<</if>> Things are too hard right now. You can't afford another mouth to feed and you don't have the time to teach someone else your trade.<<storyline-return "Continue." 0>><</replace>><</link>></span>
<</nobr>><</widget>>
<<widget "ward">><<nobr>>
Despite everything, court life proceeds as usual. A friend living the countryside writes to you<<if $agenum lte 15>>r family<</if>> and asks if you will take in their child as your ward and help them get a place at court - and maybe even an advantageous marriage.
<br><br>
<span id="ward">Do you want to accept them into your home? <<link "Yes">><<replace "#ward">><<addWardNPC>><<set $ward to 0>><<if $hoh is 4>>You convince your husband to accept them into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle to accept them into your home.<<elseif $hoh isnot 1>>You convince your family to accept them into your home.<<else>>You accept them into your home.<</if>> It will cost a small fortune to outfit a newcomer to court and provide the king the necessary gifts but you will control their purse strings and are glad to <<storyline-return "do a friend a favor." 0 -12000 1>>.<</replace>><</link>> | <<link "No">><<replace "#ward">><<if $hoh is 4>>You convince your husband not to accept them into your home.<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>>You convince your $masterTitle not to accept them into your home.<<elseif $hoh isnot 1>>You convince your family not to accept them into your home.<<else>>You don't accept them into your home.<</if>> Your own affairs are not quite in order and you need to focus on setting them right before adding another person to the household. You don't have the time to teach someone else the ways of court.<<storyline-return "Continue." 0>><</replace>><</link>></span>
<</nobr>><</widget>>
<<widget "catch-up">><<nobr>>
/* Argument 0: month index the player last experienced (defaults to $monthIndex) */
/* Argument 1: month index the player is returning to (defaults to $monthIndex + 1) */
<<set _cuFrom to (def _args[0] && _args[0] !== null) ? _args[0] : $monthIndex>>
<<set _cuTo to (def _args[1] && _args[1] !== null) ? _args[1] : $monthIndex + 1>>
<<if _cuTo gt _cuFrom + 1>>
<br>''Your neighbors are eager to catch you up on everything you missed.''<br>
<<for _cuIdx = _cuFrom + 1; _cuIdx < _cuTo; _cuIdx++>>
<br>''<<print $timeline[_cuIdx]>>:'' <<print $catchUpSummaries[_cuIdx]>>
<<if $corpseBuried and $corpseBuried[$parish]>>
<<set _cuBuried to $corpseBuried[$parish][_cuIdx]>>
<<set _cuPlague to $corpsePlague[$parish][_cuIdx]>>
<<if _cuBuried gt 0>>
And while their household was spared any deaths, there were <<print _cuBuried>> buried<<if _cuPlague gt 0>>, <<print _cuPlague>> of plague<</if>>, in $parish.
<</if>>
<</if>>
<</for>>
<br>
<</if>>
<</nobr>><</widget>><<widget "marriage-market">><<nobr>><<if $relationship is "married">><<set $seekingDecision to 1>><<else>>As an unmarried adult, you may wish to get married. Marriage brings with it lots of advantages, including a life partner, social connections through their family, (probably) children, and <<if $socio is "nobles" or $socio is "merchants">>wealth from your <<if $gender is "female">>husband's income<<else>>wife's dowry<</if>><<else>>additional income that will help protect you from <<if $socio is "beggars">>starvation<<else>>poverty<</if>><</if>>.<<if $gender is "female">> The downside is all your property will become your husband's and you will be legally dependent on him until he dies... or you do.<</if>>
<br><br>
<span id="marriage">Do you wish to seek a <<if $gender is "female">>husband<<else>>wife<</if>>?
<<link "Yes">><<replace "#marriage">><<set $seekingMarriage to 1>><<set $seekingDecision to 1>><<storyline-return "You are looking to be married soon and will be seeking out a spouse." 0>><</replace>><</link>> | <<link "No">><<replace "#marriage">><<set $seekingMarriage to 0>><<set $seekingDecision to 1>><<storyline-return "You are content to remain single for now." 0>>
<</replace>><</link>>
</span>
<</if>>
<</nobr>><</widget>>
<<widget "preferment-market">><<nobr>>Though you are of noble birth, your family remained in England during the <<defInterregnum "Interregnum">> and so the king prefers to appoint other people to honors and offices that come open at Court. To gain preferment, you'll need to make influential friends who can advocate on your behalf with the king. It will be expensive, but the rewards could be worth it.
<br><br>
<span id="preferment">Do you wish to seek preferment at Court?
<<link "Yes">><<set $seekingPreferment to 1>><<set $seekingDecision to 3>><<replace "#preferment">><<storyline-return "You begin to send gifts to some of the king's favorites, in hopes of gaining their support in the future." 0>><</replace>><</link>> | <<link "No">><<set $seekingPreferment to 0>><<set $seekingDecision to 3>><<replace "#preferment">><<storyline-return "You are content with your current status and see no need to spend money chasing after more honors or court office." 0>><</replace>><</link>></span>
<</nobr>><</widget>>
<<widget "apprenticeship-market">><<nobr>>Young people between the ages of 14 and 21 are eligible to be bound as apprentices in the city of London. While it is usually boys who take advantage of this opportunity, there are some girls who also seek apprenticeships. For a period of around 7 years, you would be legally bound to your master and provide <<if $masterGender is "female">>her<<else>>him<</if>> your service. In return you will learn <<if $masterGender is "female">>her<<else>>his<</if>> trade, gain connections in <<if $masterGender is "female">>her<<else>>his<</if>> social circles, and eventually become a full member of one of London <<defLiveryCompany "livery company">>.<<if $gender is "male">> This will give you the right to vote in local elections, run for office within the city, and perhaps even one day become Lord Mayor of London.<</if>>
<br><br>
<span id="apprenticeship">Do you wish to seek an apprenticeship?
<<link "Yes">><<set $seekingApprenticeship to 1>><<set $seekingDecision to 2>><<replace "#apprenticeship">><<storyline-return "You are interested in becoming an apprentice and ask for your family to seek out a master for you." 0>>
<</replace>><</link>> | <<link "No">><<set $seekingApprenticeship to 0>><<set $seekingDecision to 2>><<replace "#apprenticeship">><<storyline-return "You are content to remain with your family and working directly to support them." 0>><</replace>><</link>>
</span>
<</nobr>><</widget>><<widget "wedding">><<nobr>>
You have found a <<if $gender is "female">>husband<<elseif $gender is "male">>wife<<else>>spouse<</if>>! <<set _repBefore to $reputation>><<unset $seekingMarriage>><<unset $wedding>>
<span id="format">Do you want to
<ul>
<li><<link "be married in your parish church">><<party-costs>><<plague-risk-check "crowd">><<set $decisions.push({text: $timeline[$monthIndex] + ": Married in parish church", money: -48, repDelta: 2, repBefore: _repBefore, infectPct: _riskPct})>><<set $relationship to "married">><<addPartnerNPC>><<set-hoh>><<servant-marriage-moveout>><<replace "#format">>For the three weeks before the wedding, your <<defParish "parish">> priest reads the banns and then you are married in a nice ceremony in the church of $parish. After the dancing and feasting, you <<storyline-return "go home" 0 -48 2>> with your new <<if $gender is "female">>husband<<elseif $gender is "male">>wife<<else>>spouse<</if>>.<<if _servantMarriageResult is "congratulated">><br><br>Your _oldMasterTitle congratulates you on your marriage and wishes you well. You move out of your _oldMasterTitle's house and establish your own household, though you continue to serve your _oldMasterTitle faithfully.<<elseif _servantMarriageResult is "furious">><br><br>Your _oldMasterTitle is furious that you married without permission. You are dismissed from service immediately and must now make your way as a <<defDayLabourer "day labourer">>.<</if>><</replace>><</link>></li>
<li><<link "pay for a private wedding license">><<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Paid for a private wedding license", money: -96, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>><<set $relationship to "married">><<addPartnerNPC>><<set-hoh>><<servant-marriage-moveout>><<replace "#format">>You don't want to have to wait three weeks to have the banns read, or to celebrate in your possibly <<defPlague "plague">>-stricken <<defParish "parish">> church. You pay 8s. to obtain a special license and have <<storyline-return "a small ceremony at home." 0 -96>><<if _servantMarriageResult is "congratulated">><br><br>Your _oldMasterTitle congratulates you on your marriage and wishes you well. You move out of your _oldMasterTitle's house and establish your own household, though you continue to serve your _oldMasterTitle faithfully.<<elseif _servantMarriageResult is "furious">><br><br>Your _oldMasterTitle is furious that you married without permission. You are dismissed from service immediately and must now make your way as a <<defDayLabourer "day labourer">>.<</if>><</replace>><</link>></li>
<li><<link "elope at Fleet prison">><<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Eloped at Fleet prison", money: -72, repDelta: -1, repBefore: _repBefore, infectPct: _riskPct})>><<set $relationship to "married">><<addPartnerNPC>><<set-hoh>><<servant-marriage-moveout>><<replace "#format">>Rather than going through the fuss of a formal wedding, you go to the Fleet prison where you find a priest willing to marry you in a nearby tavern without <<storyline-return "asking too many questions." 0 -72 -1>><<if _servantMarriageResult is "congratulated">><br><br>Your _oldMasterTitle congratulates you on your marriage and wishes you well. You move out of your _oldMasterTitle's house and establish your own household, though you continue to serve your _oldMasterTitle faithfully.<<elseif _servantMarriageResult is "furious">><br><br>Your _oldMasterTitle is furious that you married without permission. You are dismissed from service immediately and must now make your way as a <<defDayLabourer "day labourer">>.<</if>><</replace>><</link>></li></ul></span>
<</nobr>><</widget>><<widget "NPC-death">><<nobr>>
/* Only run in non-quarantine, non-active-plague passages */
<<if !tags().includes("quarantine") and $plagueInfection is 0 and _infectedFamily.length lte 0 and _infectedMaster.length lte 0 and _infectedExtended.length lte 0>>
/* Determine year from passage tags */
<<set _deathYear to 0>>
<<if tags().includes("1665")>><<set _deathYear to 1665>><<elseif tags().includes("1666")>><<set _deathYear to 1666>><</if>>
<<if _deathYear gt 0>>
/* Cause-of-death weights by year */
<<if _deathYear is 1665>>
<<set _causeWeights to {fever: 5257, cough: 68, colic: 134, convulsions: 2036, smallpox: 655, "griping in the guts": 1288, measles: 7, rickets: 557, "spotted fever": 1929, "stopping of the stomach": 332, teeth: 2614, vomiting: 51}>>
<<else>>
<<set _causeWeights to {fever: 741, cough: 32, colic: 40, convulsions: 825, smallpox: 38, "griping in the guts": 676, measles: 3, rickets: 171, "spotted fever": 141, "stopping of the stomach": 107, teeth: 715, vomiting: 18}>><</if>>
/* Collect all dead NPCs for a single funeral choice */
<<set _deadNPCs to []>>
/* Death rolls for each NPC array */
<<npc-death-roll "$NPCs" "your " true>><<set _npcContagion to _ndContagion>>
<<npc-death-roll "$NPCsMaster" "the " true>><<set _masterContagion to _ndContagion>>
<<npc-death-roll "$NPCsExtended" "your " true>><<set _extendedContagion to _ndContagion>>
<<npc-death-roll "$NPCsServants" "your " false>><<set _servantsContagion to _ndContagion>>
/* Contagion spread for each array */
<<npc-contagion-spread "$NPCs" "your " true _npcContagion>>
<<npc-contagion-spread "$NPCsMaster" "the " true _masterContagion>>
<<npc-contagion-spread "$NPCsExtended" "your " true _extendedContagion>>
<<npc-contagion-spread "$NPCsServants" "your " false _servantsContagion>>
<<servant-master-death>>
<<check-widowed>>
<<set-hoh>>
/* Single combined funeral choice for all deaths this month */
<<funeral-choice>>
<</if>> /* end _deathYear gt 0 */
<</if>> /* end plague/quarantine check */
<</nobr>><</widget>>
/* group-mortality-line — outputs one <li> summarizing mortality for a group.
_args[0] = display label (e.g. "Your immediate family")
_args[1] = variable name string for primary array (e.g. "$NPCs")
_args[2] = variable name string for secondary array (optional, e.g. "$FledFamily")
Only renders if the combined array has at least one member.
Non-zero categories are joined with commas. */
<<widget "group-mortality-line">><<nobr>>
<<set _gmlArr to State.getVar(_args[1])>>
<<if _args.length gt 2>><<set _gmlArr to _gmlArr.concat(State.getVar(_args[2]))>><</if>>
<<if _gmlArr.length gt 0>>
<<set _gmlPlague to 0>><<set _gmlOther to 0>><<set _gmlSurv to 0>>
<<for _gi to 0; _gi lt _gmlArr.length; _gi++>>
<<set _gh to _gmlArr[_gi].health>>
<<if _gh is "deceased-pq" or (_gh isnot "deceased" and _gh.indexOf("deceased-pq") is 0)>><<set _gmlPlague += 1>>
<<elseif _gh is "deceased" or _gh.indexOf("deceased") is 0>><<set _gmlOther += 1>>
<<else>><<set _gmlSurv += 1>>
<</if>>
<</for>>
<<set _gmlParts to []>>
<<if _gmlSurv gt 0>><<set _gmlParts.push(_gmlSurv + " survived")>><</if>>
<<if _gmlPlague gt 0>><<set _gmlParts.push(_gmlPlague + " died of plague")>><</if>>
<<if _gmlOther gt 0>><<set _gmlParts.push(_gmlOther + " died of other causes")>><</if>>
<li><<print _args[0]>>: <<print _gmlParts.join(", ")>></li>
<</if>>
<</nobr>><</widget>><<widget "pregnant">><<nobr>>
<<set $pregnant to 4>><<set $pregnancyAnnounced to true>>
You have realized you are pregnant! You look forward to adding a new member to the family<<if $socio is "beggars" or $socio is "day labourers">> even if it means another mouth to feed<</if>>. In a few months you'll have a new baby, but until then life continues as usual.
<<storyline-return "Continue." 0>>
<</nobr>><</widget>>
<<widget "miscarriage">><<nobr>>
<<if not $pregnancyAnnounced>>
<<unset $pregnant>><<unset $miscarriage>><<set $pregnancyAnnounced to false>>
For a few weeks, you thought you might be pregnant, but it is now clear that you are not.
<<else>>
<<unset $pregnant>><<unset $miscarriage>><<set $pregnancyAnnounced to false>>
Unfortunately, you have suffered a miscarriage and are no longer pregnant.
<</if>>
<<storyline-return "Continue." 0>>
<</nobr>><</widget>>
<<widget "birth">><<nobr>>
<<set $pregnancyAnnounced to false>>
<<if random(1,30) is 1>><<set _eventCausedDeath to true>>Send not to know for whom the church bells toll. They toll for you. You died in childbirth.<br><br>At least you didn't die of plague.<br><br>
<<death-announcement>>
<<else>>
<<if random(1,4) is 1>>After a long, hard labor you are devastated to find your baby was stillborn. You bury <<= either("him", "her")>><<set $money -=9>> and attempt to move on.
<<storyline-return "Continue." 0>>
<<else>>
<<addNewbornNPC>>After a long, hard labor you are delighted to add a baby to your family.
Do you <span id="decision">
<<link "host a celebration">>
<<replace "#decision">>
<<plague-risk-check "crowd">>
<<if $socio is "nobles">>
<<set $money -=2400>><<set $decisions.push({text: "Childbirth: Threw a Party", money: -2400, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<<elseif $socio is "merchants">>
<<set $money -=480>><<set $decisions.push({text: "Childbirth: Threw a Party", money: -480, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<<elseif $socio is "artisans">>
<<set $money -=120>><<set $decisions.push({text: "Childbirth: Threw a Party", money: -120, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<<else>>
<<set $money -=6>><<set $decisions.push({text: "Childbirth: Threw a Party", money: -6, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<</if>>
You have your new baby, $NPCs.last().name, baptized then celebrate with all your family, friends, and neighbors. You know such a gathering might be dangerous, in such a time of plague, but there is a good chance that $NPCs.last().name will not be one of the babies who survives their perilous first year of life and you want everyone to meet them.
<<storyline-return "Continue." 0>>
<</replace>>
<</link>> |
<<link "have a quick baptism">>
<<replace "#decision">>
<<set $decisions.push({text: "Childbirth: Had a quick baptism", money: -6, repDelta: 0, repBefore: $reputation, infectPct: null})>>
You quickly baptize them<<set $money -=6>> and pray to God that $NPCs.last().name will be one of the babies who survives their perilous first year of life.
<<storyline-return "Continue." 0>>
<</replace>>
<</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "naval-experience">><<nobr>><<set $death to random(1,10)>><<if $death is 1>>Send not for whom the bell tolls, <<linkappend "it tolls for you.">>it tolls for you. <br><br>Unfortunately, you die in the fighting when <<set _type to random(1,5)>><<if _type is 1>>you are knocked off deck and into the sea where you drown<<elseif _type is 2>>a cannon ball splinters the deck beneath your feet and the shrapnel cuts open your neck<<elseif _type is 3>>your ship is boarded and a Dutch soldier stabs you in the stomach<<elseif _type is 4>>a keg of gunpowder explodes next to you<<else>>a cannon splits the mast of your ship and the falling rigging crushes you<</if>>.
<<if $gender is "female">>At your death, your crewmates discovered that you were a woman.<</if>>
<<if $reputation lte 2>>You died with such a poor reputation that most of your fellow sailors didn't care. The rest of them probably cursed your name and hoped you were suffering in hell.
<<else>>You died with a good enough reputation that your fellow sailors say prayers for your soul.
<</if>>
But regardless, your body meets the same fate of the hundreds of other soldiers who died in this battle. <<linkappend "Your body is wrapped in your hammock and dropped over board.">>Your body is wrapped in your hammock and dropped over board.<br><br>
<<if $religion is "Catholic">>As a God-fearing Catholic, you know you are destined to spend time in purgatory before you can ascend to heaven but you hope that will not take too long<<if $reputation lte 2>>, despite your poor reputation on earth.<</if>><<else>>As a good Protestant, you know that Christ the Redeemer has died for you and your admittance to heaven is guaranteed.<</if>><br><br>
[[At least you didn't die of plague->stats]].<</linkappend>>
<</linkappend>>
<<elseif $death is 2>>
Unfortunately, in the aftermath of a battle you are <<linkappend "taken prisoner.">>taken prisoner. You spend the rest of the war in a Dutch prison. It's not pleasant, but [[at least you didn't die of plague->stats]].<</linkappend>>
<<elseif $death is 3 or $death is 4>>
Unfortunately, you are wounded in battle and in the aftermath you are left <<set _injury to random(1,5)>><<if _injury is 1>><<if $disability is 0>><<set $disability to "disfiguring scar">><<else>><<set $disability to $disability + " and " + "disfiguring scar">><</if>>with a disfiguring scar across your back which pains you occasionally<<elseif _injury is 2>><<if $disability is 0>><<set $disability to "gangrenous leg">><<else>><<set $disability to $disability + " and " + "gangrenous leg">><</if>>with a gangrenous leg that will later need to be amputated<<elseif _injury is 3>><<if $disability is 0>><<set $disability to "lost eye">><<else>><<set $disability to $disability + " and " + "lost eye">><</if>>without the use of your right eye, which was lost to a musket ball<<elseif _injury is 4>><<if $disability is 0>><<set $disability to "lost arm">><<else>><<set $disability to $disability + " and " + "lost arm">><</if>>without your right arm, which was crushed by falling rigging and had to be amputated<<else>><<if $disability is 0>><<set $disability to "lost hand">><<else>><<set $disability to $disability + " and " + "lost hand">><</if>>without your left hand, which was cut off by a Dutch soldier in battle.<</if>><<set $navyDismissed to true>> Your injuries are severe enough that the Navy decides to <<storyline-return "discharge you and send you back to London." 2>>
<<else>>
You serve in the Navy through the war against the Dutch, leaving service in 1667. It was hard work, and not rewarding, but [[at least you didn't die of plague->stats]].
<</if>>
<</nobr>><</widget>>/* removed from stats passage */
<h3>Player Stats</h3>
<ul>
<li>Name: $name</li>
<li>Age: $age</li>
<li>Gender: $gender</li>
<li>Religion: $religion</li>
<li>Social class: $socio</li>
<li>Location: $location</li>
<<if $preFireLocation neq "">><li>Pre-fire location: $preFireLocation</li>
<li>Pre-fire parish: $preFireParish</li><</if>>
<li>Origin: $origin</li>
<li>Reputation: $reputation — <<if $reputation gte 9>>a worthy soul<<elseif $reputation gte 6 and $reputation lte 8>>of good credit and quality<<elseif $reputation gte 3 and $reputation lte 5>>bad credit is better than none<<elseif $reputation lte 2>>a worthless and base rogue<</if>></li>
<li>Wealth: <<conversion>></li>
<<if $role isnot "0">><li>Role: $role</li><</if>>
</ul>
<h3>Household</h3>
<<if $NPCs.length gt 0>>
<ul>
<<for _i to 0; _i lt $NPCs.length; _i++>>
<li>$NPCs[_i].name (<<npc-rel-label $NPCs[_i].relationship>>) - $NPCs[_i].health</li>
<</for>>
</ul>
<<else>>
<p>You have no household members.</p>
<</if>>
<<if $FledFamily.length gt 0>>
<h4>Fled Family</h4>
<ul>
<<for _i to 0; _i lt $FledFamily.length; _i++>>
<li>$FledFamily[_i].name ($FledFamily[_i].relationship) - $FledFamily[_i].health</li>
<</for>>
</ul>
<</if>>
<<if $NPCsServants.length gt 0>>
<h4>Servants</h4>
<ul>
<<for _i to 0; _i lt $NPCsServants.length; _i++>>
<li>$NPCsServants[_i].name - $NPCsServants[_i].health</li>
<</for>>
</ul>
<</if>>
<h3>Fumes and Remedies</h3>
<h4>Fumigants</h4>
<p>Using fumigants during quarantine decreased the chance of plague spreading to each healthy member of your household by 50% (from a 1 in 2 chance to a 1 in 4 chance per person per week).</p>
<table width=90%><th width=70%>Item</th><th width=30%>Remaining</th>
<<for _key range $fumes>>
<tr><td>_key.name</td><td>_key.quantity</td></tr>
<</for>>
</table>
<h4>Remedies</h4>
<table width=90%><th width=35%>Item</th><th width=15%>Remaining</th><th width=50%>Game Effect</th>
<tr><td>$remedies.Plaster.name</td><td>$remedies.Plaster.quantity</td><td>Decreased the chance of death from plague from 1 in 2 (50%) to 1 in 3 (~33%) for you and your infected household members</td></tr>
<tr><td>$remedies.Celestial.name</td><td>$remedies.Celestial.quantity</td><td>Preventative medicine with no direct effect on survival rates</td></tr>
<tr><td>$remedies.Treacle.name</td><td>$remedies.Treacle.quantity</td><td>No mechanical effect on survival rates</td></tr>
<tr><td>$remedies.Cordial.name</td><td>$remedies.Cordial.quantity</td><td>No mechanical effect on survival rates</td></tr>
<tr><td>$remedies.Suppository.name</td><td>$remedies.Suppository.quantity</td><td>No mechanical effect on survival rates</td></tr>
<tr><td>$remedies.Immodium.name</td><td>$remedies.Immodium.quantity</td><td>No mechanical effect on survival rates</td></tr>
</table>
<p>These exposure events included:</p><ul>
<<for _di to 0; _di lt $decisions.length; _di++>>
<<set _d to $decisions[_di]>>
<<if typeof _d is "object" and _d.infectPct neq null and _d.infectPct gt 0>>
<li><<print _d.text>> (<<print _d.infectPct>>% infection chance)</li>
<</if>>
<</for>>
</ul>
<<else>>
<p>None of your decisions directly exposed you to a measurable plague infection risk from decision-based events. Your primary risk came from simply living in your parish (see above).</p>
<p><i>This risk is separate from and in addition to the monthly parish-based infection probability. In the game, your parish’s infection rate was the primary determinant of whether you caught plague, but decisions like attending funerals, doing plague work, or visiting crowded places added to that risk.</i></p>
<p><i>For comparison: St Mary Islington (a suburban parish) had only 58 plague deaths over the whole outbreak, while the deadliest parish was St Dunstan Stepney with 1,392 recorded plague deaths. Parishes inside the City walls were generally safer than the poorer suburbs, where plague arrived earlier and spread faster due to crowded housing.</i></p><<widget "random-events">><<nobr>>
/* Guard: if a header event (debtor/child-service) is active, suppress the
passage body so only the header event content is visible. The header event
uses <<storyline-return 0>> to re-render the passage; on re-render,
visited() > 1 prevents the header widgets from firing and
$randomEventCompleted causes the normal monthly narrative to appear. */
<<if _headerEventActive>>
<<set _randomEventFired to true>>
<<set $churchServiceDecision to false>>
/* Guard: if returning from a random event, skip everything and let
the storyline passage render its normal monthly narrative. */
<<elseif $randomEventCompleted>>
<<set _randomEventFired to false>>
<<set $randomEventCompleted to false>>
<<church-services>>
<<else>>
<<set _randomEventFired to true>>
<<set $churchServiceDecision to false>>
/* _randomEventFired starts true each tick. Events that present
decisions (wedding, birth, funeral, etc.) leave it true and provide
their own <<storyline-return>> navigation. Branches where no event
fires reset it to false so the passage's default monthly narrative
still renders. Multi-month events (plague illness, death sequences)
leave it true to suppress default text and let the event widget own
the output. */
/* Pregnancy tracking for married women of childbearing age */
<<if $gender is "female">>
<<if $agenum gte 16 and $agenum lte 40>>
<<if $relationship is "married">>
<<if $pregnant is 0>>
<<set _tempPregnant to random(1,10)>>
<<if _tempPregnant is 1>>
<<set $pregnant to 1>>
<</if>>
<<else>>
<<set $pregnant +=1>>
<<set $miscarriage to random(1,100)>>
<<if $agenum lte 25>><<set _miscarriageThreshold to 10>>
<<elseif $agenum lte 35>><<set _miscarriageThreshold to 15>>
<<elseif $agenum is 36>><<set _miscarriageThreshold to 20>>
<<elseif $agenum is 37>><<set _miscarriageThreshold to 25>>
<<elseif $agenum is 38>><<set _miscarriageThreshold to 30>>
<<elseif $agenum is 39>><<set _miscarriageThreshold to 35>>
<<elseif $agenum gte 40>><<set _miscarriageThreshold to 40>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
/* NPC death from non-plague causes */
<<set _npcDeathOccurred to false>>
<<NPC-death>>
/* Servant dismissal for bad reputation */
<<dismiss-servant>>
/* Servant promotion for stellar reputation */
<<promote-servant>>
/* Prevent repeat infections */
<<if $plagueInfection is 1 and $playerPlagueStatus is "recovered">>
<<set $plagueInfection to 2>>
<</if>>
/* Priority cascade: first matching event fires */
/* Plague checks */
/* Includes silent miscarriage of unannounced pregnancy but if $pregnant isnot 4 then should pregnancy continue as normal post-quarantine */
<<if $plagueInfection is 1>>
<<if $pregnant is 4>>
<<set $pregnant to 0>><<set $pregnancyAnnounced to false>>
<</if>>
<<if $debtorPrisonInfected is 1>>
<<set $debtorPrisonInfected to 0>>
<<set $plagueRevealed to 1>>
<<set $playerPlagueStatus to "infected">>
<<set $reputation to Math.clamp($reputation - 2, 0, 10)>>
The conditions in debtor's prison are filthy and overcrowded. To your horror, you develop the telltale <<defBuboes "buboes">> of <<defPlague "plague">>. Because you are in prison, you are immediately sent to the [[pesthouse->YouPesthouse]].
<<else>>
<<sickPC>>
<</if>>
<<elseif _infectedFamily.length gte 1>>
<<if $pregnant is 4>>
<<set $pregnant to 0>><<set $pregnancyAnnounced to false>>
<</if>>
<<sickFam>>
<<elseif _infectedMaster.length gte 1 or _infectedExtended.length gte 1>>
<<sickOtherHH>>
<<else>> /* Begin by Initializing Randomizers */
<<set $elderly to random(1,30)>>
<<set $wedding to random(1,10)>>
<<set $apprenticeshipOffer to random(1,10)>>
<<set $prefermentOffer to random(1,10)>>
<<set $fever to random(1,20)>>
<<if $age is "elderly adult" and $elderly is 1>> /* Old Age */
<<elderly>>
<<elseif $seekingApprenticeship is 1 and $apprenticeshipOffer is 1>>
<<apprenticeship-offer>>
<<elseif $seekingPreferment is 1 and $prefermentOffer is 1 and ($fled isnot 6 or $followedCourt is 1 or $monthIndex gte 11)>>
<<preferment-offer>>
<<elseif $seekingMarriage is 1 and $wedding is 1 and $relationship isnot "married">>
<<wedding>>
<<elseif $pregnant is 4>> /* Pregnancy and Marriage */
<<pregnant>>
<<elseif $pregnant isnot 0 and $pregnant isnot 4 and $miscarriage lte _miscarriageThreshold>>
<<miscarriage>>
<<elseif $pregnant is 9>>
<<birth>>
<<elseif $fever is 1>> /* Random Fevers and Socio dependent events */
<<fever>>
<<elseif $socio is "nobles">>
<<set $steward to random(1,40)>>
<<if $ward isnot 0>>
<<set $ward to random(1,10)>>
<</if>>
<<if $steward is 1>>
<<steward>>
<<elseif $ward is 1 and hasVisited("March 1666")>> /* household additions only occur after height of plague */
<<ward>>
<<else>>
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<<elseif $socio is "day labourers" or $socio is "servants">>
<<set $accident to random(1,20)>>
<<if $worker isnot 0>>
<<set $worker to random(1,10)>>
<</if>>
<<if $accident is 1>>
<<accident>>
<<elseif $worker is 1 and hasVisited("March 1666") and ($socio isnot "servants" or $hoh is 1)>>
<<worker-kid>>
<<else>>
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<<elseif $socio is "beggars">>
<<set $runover to random(1,30)>>
<<if $runover is 1>>
<<runover>>
<<else>>
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<<elseif $socio is "merchants" or $socio is "artisans">>
<<hold-office>>
<<if not _officeEventFired>>
<<if $apprentice isnot 0>>
<<set $apprentice to random(1,10)>>
<<if $apprentice is 1 and hasVisited("March 1666")>>
<<apprentice>>
<<else>>
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<<else>>
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<</if>>
<<else>> /* it should not be possible to reach this point but putting in as safeguard */
<<if not _npcDeathOccurred>><<set _randomEventFired to false>><</if>>
<</if>>
<</if>>
<<if not _randomEventFired>>
<<church-services>>
<</if>>
<</if>> /* end $randomEventCompleted guard */
<</nobr>><</widget>>/* all widgets generated via Claude or other AI should be temporarily placed here then manually moved to new locations as needed */
<<widget "june-1665-helper">><<nobr>>
The <<defPlague "plague">> grows worse and the streets are soon filled with coaches and wagons full of people fleeing with their goods to the countryside. The Queen Mother <<defHenriettaMaria "Henrietta Maria">> moves back to France<<if $religion is "Catholic">>, much to your dismay, and that of your fellow Catholics who flock to her chapel each week<<else>>, much to your relief, and that of all your fellow God-fearing <<defProtestants "Protestants">><</if>>. On June 29th, the King packs up his entire <<defHousehold "household">> in 148 carriages and moves 12 miles away, to his palace at <<defHamptonCourt "Hampton Court">>.
<br><br>
<a href="https://upload.wikimedia.org/wikipedia/commons/4/41/Wilson_%22The_plague...%22%3B_people_fleeing_from_plague_Wellcome_L0016623.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/4/41/Wilson_%22The_plague...%22%3B_people_fleeing_from_plague_Wellcome_L0016623.jpg" width="100%" alt="Woodcut of people fleeing from the plague"></a>
//"Runaways Fleeing from the Plague", c. 1630//
<br><br>
<<if $location is "inside the City walls">> There are still no plague cases in your <<defParish "parish">>, but everyone knows that it is only a matter of time
/* Beggars */
<<if $socio is "beggars">> and your neighbors are growing increasingly reluctant to help when you come begging to their doors.<br>
<<beggar-choice>>
/* Day Labourers, Artisans, Merchants */
<<else>>
<<if $socio is "day labourers" or $socio is "artisans" or $socio is "merchants">>. You<<if $agenum lte 15>>r family<</if>> will soon need to decide if you want to flee<<if $gender isnot "female">> or at least send the rest of your household away<</if>> <<storyline-return "before things get worse.">>
/* Servants */
<<elseif $socio is "servants">>. You anxiously await your $masterTitle's decision about whether the <<storyline-return "household will flee or stay.">>
/* Nobles */
<<elseif $socio is "nobles">>. Unfortunately, you are not important enough to merit lodgings at <<defHamptonCourt "Hampton Court">> and the surrounding village is already full to bursting. You<<if $agenum lte 15>>r family<</if>> will soon need to decide if it's worth the risk of staying in London, near enough to visit the Court regularly, or if you <<if $gender isnot "female">>or your household <</if>>should flee <<storyline-return "before things get worse.">>
<</if>><br>
<</if>>
/* If not in city walls or western suburbs */
<<elseif $location isnot "in the western suburbs">><<linkappend "Worse, the first case of plague has appeared in your parish.">><br><br><<include "First Plague Day">><</linkappend>>
<</if>>
/* If location is western suburbs */
<<if $location is "in the western suburbs">>
<<if $socio is "beggars">>
<<if $role is "corpsebearer" or $role is "searcher" or $role is "nurse" or $role is "warder">>
<<plague-work>>
<br><br>Do you:
<ul><li><<storyline-return "swallow your fears and go to do your Christian duty.">></li>
<li>[[refuse to do as you've been tasked.->work-refusal][$reputation to Math.clamp($reputation - 1, 0, 10)]]</li>
</ul>
<<else>>No one has any charity right now for a healthy <<defBeggars "beggar">>, but somehow you manage to scrape together enough food to last you to [[July 1665]].
<</if>>
<<elseif $socio is "day labourers">>
<<if $role is "corpsebearer" or $role is "searcher" or $role is "nurse" or $role is "warder">>
<<plague-work>>
<br><br>Do you:
<ul><li><<storyline-return "swallow your fears and go to do your Christian duty.">></li>
<li><<storyline-return "decide to quit and look for other work." 1 0 -1>></li>
</ul>
<<else>>So many people are fleeing the city, there's plenty of work hauling their belongings to and fro... for now anyway. It's enough to get you through to [[July 1665]].
<</if>>
<<elseif $socio is "servants">><br>
<<flee-choice "late">>
Otherwise, you can <<storyline-return "remain in the city with your entire household.">><br><br>
/* Artisans */
<<elseif $socio is "artisans">><br>
<<flee-choice "late">>
Otherwise, you can <<storyline-return "remain in the city with your entire household.">><br><br>
/* Merchants */
<<elseif $socio is "merchants">>
<<flee-choice "late">>
Otherwise, you can <<storyline-return "remain in the city with your entire household.">><br><br>
/* Nobles */
<<elseif $socio is "nobles">>Do you:
<<flee-choice "late">>
Otherwise, you can <<storyline-return "remain in the city with your entire household.">><br><br>
<</if>>
<</if>>
<</nobr>><</widget>><<nobr>>
<<set _flightSafeKids to []>>
<<for _fsk = 0; _fsk < $NPCs.length; _fsk++>>
<<if $NPCs[_fsk].health is "safe from harm">>
<<set _flightSafeKids.push(_fsk)>>
<</if>>
<</for>>
<<if $fled is 5>>
Your <<defHousehold "household">> is currently safe and sheltering from the plague outbreak in $hhlocation. Do you want to bring them back to London?<br><br>
<<link "Yes, bring them back">>
<<for _f range $FledFamily>><<set _f.location to $location>><<set $NPCs.push(_f)>><</for>>
<<for _fs range $FledServants>><<set _fs.location to $location>><<set $NPCsServants.push(_fs)>><</for>>
<<set $FledFamily to []>>
<<set $FledServants to []>>
<<set $fled to 4>>
<<run Dialog.close()>>
<</link>><br>
<<link "No, not yet">>
<<run Dialog.close()>>
<</link>>
<<if _flightSafeKids.length gt 0>><br><br>
Your <<for _rc, _ri range _flightSafeKids>><<if _flightSafeKids.length eq 1>>$NPCs[_ri].relationship $NPCs[_ri].name is<<elseif _rc < _flightSafeKids.length - 1>>$NPCs[_ri].relationship $NPCs[_ri].name, <<else>>and $NPCs[_ri].relationship $NPCs[_ri].name are<</if>><</for>> still safely sheltering in the countryside.<br><br>
<<link "Bring them home">>
<<for _rk range _flightSafeKids>><<set $NPCs[_rk].health to "healthy">><<set $NPCs[_rk].location to $location>><</for>>
<<set $getaway to []>>
<<run Dialog.close()>>
<</link>><br>
<<link "Leave them there for now">>
<<run Dialog.close()>>
<</link>>
<</if>>
<<elseif _flightSafeKids.length gt 0>>
Your <<for _rc, _ri range _flightSafeKids>><<if _flightSafeKids.length eq 1>>$NPCs[_ri].relationship $NPCs[_ri].name is<<elseif _rc < _flightSafeKids.length - 1>>$NPCs[_ri].relationship $NPCs[_ri].name, <<else>>and $NPCs[_ri].relationship $NPCs[_ri].name are<</if>><</for>> still safely sheltering in the countryside. Do you want to bring <<if _flightSafeKids.length eq 1>>them<<else>>them all<</if>> home?<br><br>
<<link "Bring them home">>
<<for _rk range _flightSafeKids>><<set $NPCs[_rk].health to "healthy">><<set $NPCs[_rk].location to $location>><</for>>
<<set $getaway to []>>
<<run Dialog.close()>>
<</link>><br>
<<link "Leave them there for now">>
<<run Dialog.close()>>
<</link>><br><br>
<<flee-choice "late">>
<<done>><<run $(document).one(':passagestart', function() { Dialog.close(); })>><</done>>
<<else>>
<<flee-choice "late">>
<<done>><<run $(document).one(':passagestart', function() { Dialog.close(); })>><</done>>
<</if>>
<</nobr>><<widget "bill-subscribe">><<nobr>><<if $billSubscribed is 0>><span id="billOffer">With plague cases on the rise, you consider purchasing a subscription to the weekly <<defBillsOfMortality "Bills of Mortality">>. It only costs 4d. per month and you will no longer be reliant upon rumor to know how many people are dying in your parish and in the city—of plague or anything else. Do you wish to subscribe? <<link "Yes">><<replace "#billOffer">><<set $billSubscribed to 1>><<set $decisions.push({text: "Subscribed to the Bills of Mortality", money: -4, repDelta: 0, repBefore: $reputation, infectPct: null})>>Each week you will receive a broadside report of the christenings, burials, and plague burials in $parish and across the city. <<storyline-return "You hope it will help you navigate the risks of the current outbreak." 0>><</replace>><</link>> | <<link "No">><<replace "#billOffer">><<set $billSubscribed to 2>><<set $decisions.push({text: "May 1665: Declined Bills of Mortality subscription", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>Spending that much money doesn't make sense to you, when you can ask your parish clerk for the numbers or simply look around see how many houses have been shut up on your street to <<storyline-return "know the current risks." 0>><</replace>><</link>></span>
<<elseif $billSubscribed is 1 and $money lt 0>><span id="billOffer">You have fallen into debt and must reconsider your regular expenses. Do you wish to continue your subscription to the <<defBillsOfMortality "Bills of Mortality">>? <<link "Yes">><<replace "#billOffer">><<set $billSubscribed to 3>><<set $decisions.push({text: "Continued subscription to the Bills of Mortality despite debts", money: -4, repDelta: 0, repBefore: $reputation, infectPct: null})>><<storyline-return "You consider the Bills of Mortality an essential weekly purchase." 0>><</replace>><</link>> | <<link "No">><<replace "#billOffer">><<set $billSubscribed to 2>><<set $decisions.push({text: "Cancelled Bills of Mortality subscription", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>>As much as the Bills have been helpful, they're an unnecessary expense when you can ask your parish clerk for the numbers or simply look around see how many houses have been shut up on your street to <<storyline-return "know the current risks." 0>><</replace>><</link>></span><</if>>
<</nobr>><</widget>><<widget "smuggle-children">><<nobr>>
<<if $reputation gte 6 and ($hoh is 1 or $hoh is 4)>>
<<set _smuggleEligible = []>>
<<for _e, _household range $NPCs>>
<<if _household.health is "healthy" and (_household.age is "child" or _household.age is "infant")>>
<<set _smuggleEligible.push(_e)>>
<</if>>
<</for>>
<<if _smuggleEligible.length gt 0>><br><br>
<<set _smugIdx to _smuggleEligible[0]>>
<span id="smuggle-choice"><br><br>Under the guise of bringing you food, your neighbors offer to help you evade the quarantine and smuggle <<if _smuggleEligible.length eq 1>>your $NPCs[_smugIdx].relationship $NPCs[_smugIdx].name<<else>>your healthy children<</if>> out of the house. Do you <<if $hoh is 4>>and your husband <</if>>accept their offer?<br><br>
<<link "Yes">><<replace "#smuggle-choice">>
<<set $getaway = []>>
<<for _se range _smuggleEligible>>
<<set $getaway.push(_se)>>
<<set $NPCs[_se].location to "the countryside">><<set $NPCs[_se].health to "safe from harm">>
<</for>>
<<set $reputation to Math.clamp($reputation - 1, 0, 10)>>
Under cover of night, your neighbors manage to smuggle <<for _f, _g range $getaway>><<if $getaway.length eq 1>>your $NPCs[_g].relationship $NPCs[_g].name<<elseif _f < $getaway.length - 1>>your $NPCs[_g].relationship $NPCs[_g].name, <<else>>and your $NPCs[_g].relationship $NPCs[_g].name<</if>><</for>> out of the house. Whether you live or die, you feel better for knowing you have done what you could to protect your child<<if $getaway.length gt 1>>ren<</if>><br><br>.
<</replace>><</link>> | <<link "No">><<replace "#smuggle-choice">>As much as you would love to send your child<<if _smuggleEligible.length gt 1>>ren<</if>> to safety, it's already too late. Your family will live or die together, as God wills.<br><br><</replace>><</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "return-children">><<nobr>>
/* Offer to bring back any children with health "safe from harm" */
<<set _safeKids to []>>
<<for _sk = 0; _sk < $NPCs.length; _sk++>>
<<if $NPCs[_sk].health is "safe from harm">>
<<set _safeKids.push(_sk)>>
<</if>>
<</for>>
<<if _safeKids.length gt 0>>
<br><br><span id="return-children">Your <<for _rc, _ri range _safeKids>><<if _safeKids.length eq 1>>$NPCs[_ri].relationship $NPCs[_ri].name has<<elseif _rc < _safeKids.length - 1>>$NPCs[_ri].relationship $NPCs[_ri].name, <<else>>and $NPCs[_ri].relationship $NPCs[_ri].name have<</if>><</for>> been safe in the countryside but you are now free to open up your house and resume your regular life. Do you <<if $hoh is 4>>and your husband <</if>> want to bring your child<<if _safeKids.length > 1>>ren<</if>> home now?<br><br>
<<link "Yes">><<replace "#return-children">>
<<for _rk range _safeKids>><<set $NPCs[_rk].health to "healthy">><<set $NPCs[_rk].location to $location>><</for>><<set $getaway to []>>
You are ready to reunite your family and hasten to bring your child<<if _safeKids.length > 1>>ren<</if>> home.
<</replace>><</link>> | <<link "No">><<replace "#return-children">>
As much as you miss your child<<if _safeKids.length > 1>>ren<</if>>, it's not safe to reunite your family yet.
<</replace>><</link>>
</span>
<</if>>
<</nobr>><</widget>><<widget "add-lodgers">><<nobr>>
/* Determine lodger capacity by $socio */
<<if $socio is "day labourers">><<set _lodgerCap to 1>>
<<elseif $socio is "servants">><<set _lodgerCap to 1>>
<<elseif $socio is "artisans">><<set _lodgerCap to 3>>
<<elseif $socio is "merchants">><<set _lodgerCap to 5>>
<<else>><<set _lodgerCap to 0>>
<</if>>
<<if _lodgerCap gt 0>>
/* Pick a random lodger type that fits capacity */
<<set _lodgerTypes to []>>
/* Type 1: single male (1 slot) */
<<if _lodgerCap gte 1>><<set _lodgerTypes.push(1)>><</if>>
/* Type 2: single female (1 slot) */
<<if _lodgerCap gte 1>><<set _lodgerTypes.push(2)>><</if>>
/* Type 3: widow/widower + 1-2 children (2-3 slots) */
<<if _lodgerCap gte 2>><<set _lodgerTypes.push(3)>><</if>>
/* Type 4: husband + wife (2 slots) */
<<if _lodgerCap gte 2>><<set _lodgerTypes.push(4)>><</if>>
/* Type 5: husband + wife + 1-3 children (3-5 slots) */
<<if _lodgerCap gte 3>><<set _lodgerTypes.push(5)>><</if>>
<<set _lodgerType to _lodgerTypes.random()>>
<<set _usedLodgerNames to []>>
<<if _lodgerType is 1>>
/* Single adult male */
<<set $NPCs.push({name: weightedEither($mNames), agenum: random(16,50), age: either("young adult", "middle-aged adult"), relationship: "male lodger", health: "healthy", location: $location})>>
<<set _lodgerDesc to "a lodger">>
<<elseif _lodgerType is 2>>
/* Single adult female */
<<set $NPCs.push({name: weightedEither($fNames), agenum: random(16,50), age: either("young adult", "middle-aged adult"), relationship: "female lodger", health: "healthy", location: $location})>>
<<set _lodgerDesc to "a lodger">>
<<elseif _lodgerType is 3>>
/* Widowed adult + 1-2 children */
<<set _numKids to random(1, Math.min(2, _lodgerCap - 1))>>
<<if random(1,2) is 1>>
<<set _wName to weightedEither($mNames)>><<set _usedLodgerNames.push(_wName)>>
<<set $NPCs.push({name: _wName, agenum: random(25,50), age: either("young adult", "middle-aged adult"), relationship: "male lodger", health: "healthy", location: $location})>>
<<else>>
<<set _wName to weightedEither($fNames)>><<set _usedLodgerNames.push(_wName)>>
<<set $NPCs.push({name: _wName, agenum: random(25,50), age: either("young adult", "middle-aged adult"), relationship: "female lodger", health: "healthy", location: $location})>>
<</if>>
<<for _lk to 0; _lk lt _numKids; _lk++>>
<<if random(1,2) is 1>>
<<set _kName to weightedEither($fNames)>><<for ; _usedLodgerNames.includes(_kName); >><<set _kName to weightedEither($fNames)>><</for>><<set _usedLodgerNames.push(_kName)>>
<<set $NPCs.push({name: _kName, agenum: random(1,14), age: either("infant", "child", "adolescent"), relationship: "lodger's daughter", health: "healthy", location: $location})>>
<<else>>
<<set _kName to weightedEither($mNames)>><<for ; _usedLodgerNames.includes(_kName); >><<set _kName to weightedEither($mNames)>><</for>><<set _usedLodgerNames.push(_kName)>>
<<set $NPCs.push({name: _kName, agenum: random(1,14), age: either("infant", "child", "adolescent"), relationship: "lodger's son", health: "healthy", location: $location})>>
<</if>>
<</for>>
<<set _lodgerDesc to "a family of lodgers">>
<<elseif _lodgerType is 4>>
/* Husband + wife */
<<set _hName to weightedEither($mNames)>><<set _usedLodgerNames.push(_hName)>>
<<set $NPCs.push({name: _hName, agenum: random(16,50), age: either("young adult", "middle-aged adult"), relationship: "male lodger", health: "healthy", location: $location})>>
<<set _wfName to weightedEither($fNames)>><<for ; _usedLodgerNames.includes(_wfName); >><<set _wfName to weightedEither($fNames)>><</for>><<set _usedLodgerNames.push(_wfName)>>
<<set $NPCs.push({name: _wfName, agenum: random(16,50), age: either("young adult", "middle-aged adult"), relationship: "lodger's wife", health: "healthy", location: $location})>>
<<set _lodgerDesc to "several lodgers">>
<<elseif _lodgerType is 5>>
/* Husband + wife + 1-3 children */
<<set _numKids to random(1, Math.min(3, _lodgerCap - 2))>>
<<set _hName to weightedEither($mNames)>><<set _usedLodgerNames.push(_hName)>>
<<set $NPCs.push({name: _hName, agenum: random(20,50), age: either("young adult", "middle-aged adult"), relationship: "male lodger", health: "healthy", location: $location})>>
<<set _wfName to weightedEither($fNames)>><<for ; _usedLodgerNames.includes(_wfName); >><<set _wfName to weightedEither($fNames)>><</for>><<set _usedLodgerNames.push(_wfName)>>
<<set $NPCs.push({name: _wfName, agenum: random(20,50), age: either("young adult", "middle-aged adult"), relationship: "lodger's wife", health: "healthy", location: $location})>>
<<for _lk to 0; _lk lt _numKids; _lk++>>
<<if random(1,2) is 1>>
<<set _kName to weightedEither($fNames)>><<for ; _usedLodgerNames.includes(_kName); >><<set _kName to weightedEither($fNames)>><</for>><<set _usedLodgerNames.push(_kName)>>
<<set $NPCs.push({name: _kName, agenum: random(1,14), age: either("infant", "child", "adolescent"), relationship: "lodger's daughter", health: "healthy", location: $location})>>
<<else>>
<<set _kName to weightedEither($mNames)>><<for ; _usedLodgerNames.includes(_kName); >><<set _kName to weightedEither($mNames)>><</for>><<set _usedLodgerNames.push(_kName)>>
<<set $NPCs.push({name: _kName, agenum: random(1,14), age: either("infant", "child", "adolescent"), relationship: "lodger's son", health: "healthy", location: $location})>>
<</if>>
<</for>>
<<set _lodgerDesc to "a family of lodgers">>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "lodger-choice">><<nobr>>
/* Determine monthly rent by $socio */
<<if $socio is "day labourers">><<set _baseRent to 10>>
<<elseif $socio is "servants">><<set _baseRent to 10>>
<<elseif $socio is "artisans">><<set _baseRent to 20>>
<<elseif $socio is "merchants">><<set _baseRent to 40>>
<<else>><<set _baseRent to 0>>
<</if>>
/* Set $hoh-aware decision text */
<<if $hoh is 4>><<set _decide to "You convince your husband to welcome">><<set _decideNot to "You convince your husband not to accept">>
<<elseif $hoh is 3 or ($hoh is 0 and $socio is "servants")>><<set _decide to "You convince your $masterTitle to welcome">><<set _decideNot to "You convince your $masterTitle not to accept">>
<<elseif $hoh isnot 1>><<set _decide to "You convince your family to welcome">><<set _decideNot to "You convince your family not to accept">>
<<else>><<set _decide to "You decide to welcome">><<set _decideNot to "You decide not to accept">>
<</if>>
<span id="lodger">Do you want to accept lodgers into your home?<br><br>
<<link "Yes, and charge extra rent">><<replace "#lodger">><<add-lodgers>><<set $lodger to 1>><<set $lodgerRent to _baseRent * 2>><<set _repBefore to $reputation>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $decisions.push({text: "October 1666: Accepted lodgers at high rent", money: 0, repDelta: $reputation - _repBefore, repBefore: _repBefore, infectPct: null})>><<print _decide>> _lodgerDesc to your household. You welcome their rent money even though your reputation takes a hit for profiting off the disaster.<<storyline-return>><</replace>><</link>> | <<link "Yes, and charge a low rent">><<replace "#lodger">><<add-lodgers>><<set $lodger to 1>><<set $lodgerRent to _baseRent>><<set $decisions.push({text: "October 1666: Accepted lodgers at low rent", money: 0, repDelta: 0, repBefore: $reputation, infectPct: null})>><<print _decide>> _lodgerDesc to your household. You welcome their rent money as even a little bit extra helps.<<storyline-return>><</replace>><</link>> | <<link "No">><<replace "#lodger">><<print _decideNot>> any lodgers. Things are crowded enough without adding strangers to the household.<<storyline-return>><</replace>><</link>></span>
<</nobr>><</widget>>
<<widget "child-service-check">><<nobr>>
/* Voluntary child service: fires when $money lt 0 for beggars/day labourers/artisans. Offers to put eldest child/adolescent into service, or the PC themselves if they are a child/adolescent. Only fires once per month (tracked by $childServiceOffered). */
<<if $money lte 0 and ($socio is "beggars" or $socio is "day labourers" or $socio is "artisans" or ($socio is "servants" and $hoh is 1)) and $childServiceOffered isnot $monthIndex>>
/* Find eligible NPC children/adolescents (not infant, not deceased) */
<<set _csEligible to []>>
<<for _ci = 0; _ci < $NPCs.length; _ci++>>
<<if ($NPCs[_ci].age is "child" or $NPCs[_ci].age is "adolescent") and $NPCs[_ci].health isnot "deceased">>
<<set _csEligible.push(_ci)>>
<</if>>
<</for>>
<<if $agenum lte 15>>
/* PC is a child/adolescent — they may be put into service */
<<set $childServiceOffered to $monthIndex>>
<<set-caretaker>>
<<set _headerEventActive to true>>
<span id="childService">Your family is struggling to bring in enough money to feed everyone and <<if $caretakerLabel isnot "">>your $caretakerLabel suggests sending you to be a servant in a nearby household.<<else>>you wonder if you might be better off finding a position as a servant.<</if>> Would you like to go into service?
<br><br>
<<link "Go into service">><<replace "#childService">><<addMaster>><<set _MasterTrade to either("baker", "chandler", "grocer", "tailor", "weaver")>>
Your <<defParish "Parish">> <<defOverseersOfThePoor "Overseers of the Poor">> have found you a position as a servant in a local _MasterTrade's household. You say a tearful farewell to your family and <<storyline-return "move out." 0>><</replace>><</link>> | <<link "Stay with your family">><<replace "#childService">>Times are hard, but you <<storyline-return "don't want to leave your family." 0>><</replace>><</link>>
</span>
<<elseif _csEligible.length gt 0>>
/* PC is an adult — offer to send eldest child/adolescent into service */
/* Sort eligible indices by NPC agenum descending to find eldest */
<<set _csEligible.sort(function(a, b) { return ($NPCs[b].agenum || 0) - ($NPCs[a].agenum || 0); })>>
<<set _csIdx to _csEligible[0]>>
<<set _csName to $NPCs[_csIdx].name>>
<<set _csRel to $NPCs[_csIdx].relationship>>
<<set $childServiceOffered to $monthIndex>>
<<set _headerEventActive to true>>
<span id="childService">Your family is struggling to bring in enough money to feed everyone and you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> need to decide whether everyone would be better off if you put one of the children into service in a nearby household.<br><br>Do you put your _csRel, _csName, into service?
<br><br>
<<link "Yes">><<replace "#childService">>
<<if $NPCs[_csIdx].health is "safe from harm">><<set $NPCs[_csIdx].health to "healthy">><<set $NPCs[_csIdx].location to $location>><</if>><<set $NPCsExtended.push($NPCs[_csIdx])>><<set $NPCs.splice(_csIdx, 1)>><<NPCpronouns>>
You hate to send any of your family away, but you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> believe that _csRel, _csName, will be well fed and cared for as a servant and that will mean <<storyline-return "one less mouth to feed at home." 0>>
<</replace>><</link>> | <<link "No">><<replace "#childService">>Life is hard, but you <<if $hoh is 4>>and your husband<<elseif $hoh is 2>>and your family<</if>> agree that sending _csRel, _csName, away is not the answer. You will find <<storyline-return "another way to make ends meet." 0>><</replace>><</link>>
</span>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "forced-child-service">><<nobr>>
/* Forced child service: called from the prison widget when debt ceiling is exceeded. For beggars/day labourers/artisans, all children, adolescents, and young adults (agenum lte 21 but NOT married/widowed) are removed from the household and put into service by the parish Overseers of the Poor. Infants always remain with their parents. Sets _forcedServicePC to true if the PC themselves is put into service (skips prison logic). */
<<set _forcedServicePC to false>>
<<if $socio is "beggars" or $socio is "day labourers" or $socio is "artisans" or ($socio is "servants" and $hoh is 1)>>
/* Find eligible NPCs: children, adolescents, young adults lte 21; exclude infants and deceased */
<<set _fsEligible to []>>
<<set _fsInfantNames to []>>
<<for _fi = 0; _fi < $NPCs.length; _fi++>>
<<if $NPCs[_fi].health isnot "deceased">>
<<if ($NPCs[_fi].age is "child" or $NPCs[_fi].age is "adolescent" or ($NPCs[_fi].age is "young adult" and $NPCs[_fi].agenum lte 21)) and $NPCs[_fi].relationship isnot "husband" and $NPCs[_fi].relationship isnot "wife">>
<<set _fsEligible.push(_fi)>>
<<elseif $NPCs[_fi].age is "infant">>
<<set _fsInfantNames.push($NPCs[_fi].relationship + " " + $NPCs[_fi].name)>>
<</if>>
<</if>>
<</for>>
/* Check if PC qualifies */
<<set _fsPCEligible to ($agenum lte 21 and $age isnot "infant" and $relationship isnot "married" and $relationship isnot "widowed")>>
/* Collect names of eligible NPCs before removing */
<<set _fsRemoved to []>>
<<for _fi = 0; _fi < _fsEligible.length; _fi++>>
<<set _fsRemoved.push({name: $NPCs[_fsEligible[_fi]].name, relationship: $NPCs[_fsEligible[_fi]].relationship})>>
<</for>>
/* Move all eligible NPCs to extended — splice in reverse order to preserve indices */
<<set _fsReverse to _fsEligible.slice().sort(function(a, b) { return b - a; })>>
<<for _fi = 0; _fi < _fsReverse.length; _fi++>>
<<if $NPCs[_fsReverse[_fi]].health is "safe from harm">><<set $NPCs[_fsReverse[_fi]].health to "healthy">><<set $NPCs[_fsReverse[_fi]].location to $location>><</if>>
<<set $NPCsExtended.push($NPCs[_fsReverse[_fi]])>>
<<set $NPCs.splice(_fsReverse[_fi], 1)>>
<</for>>
Your household's debts have grown so great that the <<defParish "parish">> <<defOverseersOfThePoor "Overseers of the Poor">> have decided that <<if _fsPCEligible>>you <<if _fsRemoved.length gt 0>>and <</if>><</if>><<if _fsRemoved.length eq 1>> your _fsRemoved[0].relationship, _fsRemoved[0].name, <<else>><<if _fsRemoved.length gt 0>><<for _fn = 0; _fn < _fsRemoved.length; _fn++>><<if _fn < _fsRemoved.length - 1>>_fsRemoved[_fn].relationship _fsRemoved[_fn].name, <<else>>and _fsRemoved[_fn].relationship _fsRemoved[_fn].name<</if>><</for>><</if>><</if>> must be removed from your home. It is in the best interest of the parish rate-payers for pauper children to be bound over in service to a local household.
<<if _fsInfantNames.length gt 0>>Luckily for <<print _fsInfantNames.join(" and ")>>, babies who are too young to be useful, or to survive without their mothers, are exempt.<</if>>
/* PC is put into service by the Overseers */
<<if _fsPCEligible>>
<<set _forcedServicePC to true>>
<<addMaster>>
<<set _MasterTrade to either("baker", "chandler", "grocer", "tailor", "weaver")>>
You are <<storyline-return "bound in service">> to a local _MasterTrade.
<<else>>
You are devastated, but God willing, this will eventually turn out to <<storyline-return "have been a good thing.">>
<</if>>
<</if>>
<</nobr>><</widget>><<widget "apprenticeship-offer">><<nobr>>
<<if $seekingApprenticeship is 1>>
Your family has sent out enquiries to find a master willing to take you on as an apprentice and found several potential candidates. Each one belongs to a different <<defLiveryCompany "livery company">>, requires a different entry fee, and practices a different trade.
<br><br>
<<if $reputation lte 2>>
Unfortunately, your reputation is so poor that none of them is currently willing to take you on. They advise you to amend your behavior and increase your standing within the <<defParish "parish">> after which <<storyline-return "they might reconsider." 0>>
<<elseif $money lt 240>>
Unfortunately, your family can't afford any of the entry fees right now. You hope that someone will still be willing to take you on, after you have <<storyline-return "increased your savings" 0>> to at least £1.
<<else>>
<span id="apprentice-offer">
<<set _repBefore to $reputation>>
Do you wish to apprentice with a
<ul>
<<if $money gte 240 and $reputation gt 2>>
<li><<link "basketmaker (£1 entry fee)">><<replace "#apprentice-offer">><<set $apprenticeship to 1>><<addMaster>><<set $decisions.push({text: $timeline[$monthIndex] + ": Apprenticed in Basketmaker's Company", money: -240, repDelta: 1, repBefore: _repBefore, infectPct: null})>>It may not be the most prestigious work, but it will set you on the path to becoming a full member of a livery company<<if $gender is "male">> and gaining the right to vote in city elections<</if>>. Your family pays the £1 entry fee and you move into your new $masterTitle's household to <<storyline-return "begin learning the trade." 0 -240 1>>
<</replace>><</link>></li>
<<else>><li>basketmaker (£1 entry fee)</li>
<</if>>
<<if $money gte 1200 and $reputation gt 3>>
<li><<link "weaver (£5 entry fee)">><<replace "#apprentice-offer">><<set $apprenticeship to 2>><<addMaster>><<set $decisions.push({text: $timeline[$monthIndex] + ": Apprenticed in the Weaver's Company", money: -1200, repDelta: 1, repBefore: _repBefore, infectPct: null})>>Weavers may not be one of the Great Twelve livery companies, but they are the oldest company in the city. <<if $gender is "male">>Once your apprenticeship is complete, you will become a freeman, have voting rights in city elections, and could be eligible for office yourself. <</if>>Your family pays the £5 entry fee and you move into your new $masterTitle's household to <<storyline-return "begin learning the trade." 0 -1200 1>>
<</replace>><</link>></li>
<<else>>
<li>weaver (£5 entry fee)</li>
<</if>>
<<if $money gte 3600 and $reputation gt 4>>
<li><<link "draper (£15 entry fee)">><<replace "#apprentice-offer">>
<<set $apprenticeship to 3>><<addMaster "merchants">>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Apprenticed as a draper", money: -3600, repDelta: 1, repBefore: _repBefore, infectPct: null})>>The drapers are one of the Great Twelve livery companies and you are eager to be apprenticed in a trade that will set you on a path to success within the city. <<if $gender is "male">>Once your apprenticeship is complete, you will become a freeman, have voting rights in city elections, and could be eligible for office yourself. <</if>>Your family pays the £15 entry fee and you move into your new $masterTitle's household to <<storyline-return "begin learning the trade." 0 -3600 1>>
<</replace>><</link>></li>
<<else>>
<li>draper (£15 entry fee)</li>
<</if>>
<<if $money gte 6000 and $reputation gt 5>>
<li><<link "goldsmith (£25 entry fee)">><<replace "#apprentice-offer">>
<<set $apprenticeship to 4>><<addMaster "merchants">><<set $decisions.push({text: $timeline[$monthIndex] + ": Apprenticed in the Goldsmith's Company", money: -6000, repDelta: 1, repBefore: _repBefore, infectPct: null})>>Although £25 is a substantial investment, the goldsmiths are some of the wealthiest and most powerful people in the city. Not only are you apprenticing to one of the Great Twelve livery companies, but you are guaranteeing yourself a lifetime of elite customers and social connections. <<if $gender is "male">>Once your apprenticeship is complete, you will become a freeman, have voting rights in city elections, and might even hold local office one day. <</if>>You are eager to move into your new $masterTitle's household to <<storyline-return "begin learning the trade." 0 -6000 1>>
<</replace>><</link>></li>
<<else>>
<li>goldsmith (£25 entry fee)</li>
<</if>>
<<if $money gte 12000 and $reputation gt 6>>
<li><<link "mercer (£50 entry fee)">><<replace "#apprentice-offer">>
<<set $apprenticeship to 5>><<addMaster "merchants">><<set $decisions.push({text: $timeline[$monthIndex] + ": Apprenticed in the Mercers Company", money: -12000, repDelta: 1, repBefore: _repBefore, infectPct: null})>>Although £50 is a small fortune, the mercers are the most prestigious and powerful of the Great Twelve livery companies and apprenticing with one is sure to guarantee your future success. <<if $gender is "male">>Once your apprenticeship is complete, you will become a freeman, have voting rights in city elections, and might even be elected Lord Mayor of London one day. <</if>>You are eager to move into your new $masterTitle's household to <<storyline-return "begin learning the trade." 0 -12000 1>>
<</replace>><</link>></li>
<<else>><li>mercer (£50 entry fee)</li>
<</if>>
<li><<link "no one for now">><<replace "#apprentice-offer">>You decide that the moment isn't right to pay for an apprenticeship and move in with a new master, but your <<storyline-return "search will continue." 0>><</replace>><</link>></li>
</ul>
</span>
<</if>>
<</if>>
<</nobr>><</widget>><<widget "generate-landlord-household">><<nobr>>
/* Generate a landlord household for fire-displaced beggars/day labourers.
Creates a middle-aged or elderly adult male head of household ("landlord")
plus additional NPCs using the day labourer household pattern.
Existing $NPCs are concatenated after the landlord's household. */
/* Save existing household members */
<<set _existingNPCs to $NPCs.slice()>>
<<set $NPCs to []>>
/* Generate landlord: middle-aged or elderly adult male */
<<set _landlordAgenum to random(30,76)>>
<<if _landlordAgenum gte 60>><<set _landlordAge to "elderly adult">><<else>><<set _landlordAge to "middle-aged adult">><</if>>
<<set _landlordName to weightedEither($mNames)>>
<<set $NPCs.push({name: _landlordName, agenum: _landlordAgenum, age: _landlordAge, relationship: "landlord", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
/* Determine landlord's marital status */
<<set _landlordRelationship to weightedEither({"married": 32, "widowed": 9, "single": 17})>>
/* Generate landlord's wife if married */
<<set _hasLandlordWife to false>>
<<set _landlordWifeAgenum to 0>>
<<if _landlordRelationship is "married">>
<<set $minAge to _landlordAgenum - 15>>
<<if $minAge lte 16>><<set $minAge to 16>><</if>>
<<set $maxAge to _landlordAgenum + 15>>
<<if $maxAge gte 101>><<set $maxAge to 100>><</if>>
<<setAge>>
<<set _landlordWifeAgenum to $NPCAgeNum>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "landlord's wife", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<set _hasLandlordWife to true>>
<</if>>
/* Generate landlord's children if married or widowed (0-2 children, day labourer pattern) */
<<if _landlordRelationship is "married" or _landlordRelationship is "widowed">>
<<set _usedLandlordChildNames to []>>
<<set _numChildren to random(0,2)>>
<<set _motherAge to _hasLandlordWife ? _landlordWifeAgenum : _landlordAgenum>>
<<for _lc to 0; _lc lt _numChildren; _lc++>>
<<set $minAge to 0>>
<<set $maxAge to _motherAge - 20>>
<<if $maxAge lte 0>><<set $maxAge to 1>><</if>>
<<setAge>>
<<if random(1,2) eq 1>>
<<set _n to weightedEither($fNames)>><<for ; _usedLandlordChildNames.includes(_n); >><<set _n to weightedEither($fNames)>><</for>><<set _usedLandlordChildNames.push(_n)>>
<<set $NPCs.push({name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "landlord's daughter", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set _n to weightedEither($mNames)>><<for ; _usedLandlordChildNames.includes(_n); >><<set _n to weightedEither($mNames)>><</for>><<set _usedLandlordChildNames.push(_n)>>
<<set $NPCs.push({name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "landlord's son", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<</for>>
<</if>>
/* Generate landlord's mother (3 in 4 chance) */
<<if random(1,4) lte 3>>
<<set $minAge to _landlordAgenum + 20>>
<<set $maxAge to _landlordAgenum + 40>>
<<if $maxAge gte 101>><<set $maxAge to 100>><</if>>
<<setAge>>
<<set $NPCs.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "landlord's mother", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<</if>>
/* Concatenate existing household members after landlord's household */
<<set $NPCs to $NPCs.concat(_existingNPCs)>>
/* Sort by household precedence */
<<orderNPCs "$NPCs">>
<</nobr>><</widget>><<widget "set-hoh">><<nobr>>
<<if $agenum lt 16>>
/* Default to child (0), but check for living master/mistress (3) */
<<set $hoh to 0>>
<<for _shi to 0; _shi lt $NPCs.length; _shi++>>
<<if ($NPCs[_shi].relationship is "master" or $NPCs[_shi].relationship is "mistress") and $NPCs[_shi].health isnot "deceased">>
<<set $hoh to 3>>
<</if>>
<</for>>
<<else>>
<<set $hoh to 1>>
/* Check for living with parents (hoh 2) */
<<if $gender is "male">>
<<for _shi to 0; _shi lt $NPCs.length; _shi++>>
<<if ($NPCs[_shi].relationship is "father" or $NPCs[_shi].relationship is "step-father") and $NPCs[_shi].health isnot "deceased">>
<<set $hoh to 2>>
<</if>>
<</for>>
<<else>>
<<for _shi to 0; _shi lt $NPCs.length; _shi++>>
<<if ($NPCs[_shi].relationship is "father" or $NPCs[_shi].relationship is "step-father" or $NPCs[_shi].relationship is "mother" or $NPCs[_shi].relationship is "step-mother") and $NPCs[_shi].health isnot "deceased">>
<<set $hoh to 2>>
<</if>>
<</for>>
<</if>>
/* Check for servant living with master (hoh 3) */
<<for _shi to 0; _shi lt $NPCs.length; _shi++>>
<<if ($NPCs[_shi].relationship is "master" or $NPCs[_shi].relationship is "mistress") and $NPCs[_shi].health isnot "deceased">>
<<set $hoh to 3>>
<</if>>
<</for>>
/* Check for married woman / coverture (hoh 4) */
<<if $gender is "female" and $relationship is "married">>
<<set $hoh to 4>>
<</if>>
<</if>>
<</nobr>><</widget>>
<<widget "set-caretaker">><<nobr>>
/* Sets $caretakerLabel to the relationship string of the authority figure for a non-hoh-1 PC */
<<set $caretakerLabel to "">>
<<if $hoh is 3 or ($hoh is 0 and $socio is "servants")>>
<<set $caretakerLabel to $masterTitle>>
<<elseif $hoh is 4>>
<<set $caretakerLabel to "husband">>
<<elseif $hoh is 0 or $hoh is 2>>
<<find-authority>>
<<if _authorityIdx gte 0>>
<<set $caretakerLabel to $NPCs[_authorityIdx].relationship>>
<</if>>
<</if>>
<</nobr>><</widget>>/* list NPCs in sidebar menu */
<<widget "ListNPCs">><<nobr>><<silently>><<orderNPCs "$NPCs">><<orderNPCs "$NPCsMaster">><<orderNPCs "$NPCsExtended">><<orderNPCs "$NPCsServants">><</silently>><<set _landlordCount to 0>><<for _lci range $NPCs>><<if _lci.relationship.startsWith("landlord")>><<set _landlordCount += 1>><</if>><</for>>Household size: <<if $fled is 5>><<set _hhSize to $FledFamily.length + $FledServants.length + $NPCs.length - _landlordCount + $NPCsServants.length>><<else>><<set _hhSize to $NPCs.length - _landlordCount + $NPCsServants.length + $NPCsMaster.length>><</if>> _hhSize
<br><br>
''Household:''<br>
<<for _i, _idx range $NPCs>>
<<if !$NPCs[_i].relationship.startsWith("landlord")>>$NPCs[_i].name, $NPCs[_i].age <<print ($socio === "servants" && ($NPCs[_i].relationship === "male servant" || $NPCs[_i].relationship === "female servant") ? "fellow servant" : $NPCs[_i].relationship.replace(/^master/, $masterTitle || "master"))>>: <<if $NPCs[_i].health is "infected" and $plagueRevealed is 0>>healthy<<elseif $NPCs[_i].health is "deceased-pq">>deceased<<else>>$NPCs[_i].health<</if>><br><</if>>
<</for>>
<<if $fled is 5 and $FledFamily.length gt 0>>
<br>''Fled to $hhlocation:''<br>
<<for _i, _idx range $FledFamily>>
$FledFamily[_i].name, $FledFamily[_i].age <<print ($socio === "servants" && ($FledFamily[_i].relationship === "male servant" || $FledFamily[_i].relationship === "female servant") ? "fellow servant" : $FledFamily[_i].relationship.replace(/^master/, $masterTitle || "master"))>>: <<if $FledFamily[_i].health is "infected" and $plagueRevealed is 0>>healthy<<elseif $FledFamily[_i].health is "deceased-pq">>deceased<<else>>$FledFamily[_i].health<</if>><br>
<</for>>
<</if>>
<<if _landlordCount gt 0>>
<br>''Landlord's Household:'' <br><<for _li, _idx range $NPCs>><<if $NPCs[_li].relationship.startsWith("landlord")>>
$NPCs[_li].name, $NPCs[_li].age $NPCs[_li].relationship: <<if $NPCs[_li].health is "deceased-pq">>deceased<<else>>$NPCs[_li].health<</if>><br>
<</if>><</for>>
<</if>>
<<if $NPCsExtended.length gt 0>><br>
''Extended family:'' <br><<for _e, _idx range $NPCsExtended>>
$NPCsExtended[_e].name, $NPCsExtended[_e].age $NPCsExtended[_e].relationship: <<if $NPCsExtended[_e].health is "infected" and $plagueRevealed is 0>>healthy<<elseif $NPCsExtended[_e].health is "deceased-pq">>deceased<<else>>$NPCsExtended[_e].health<</if>><br>
<</for>>
<</if>>
<<if $NPCsServants.length gt 0>>
<br>''Household servants:'' <br>/* <<set _svHealthy to 0>><<set _svInfected to 0>><<set _svDeceased to 0>><<set _svRecovered to 0>><<for _sv, _idx range $NPCsServants>><<if $NPCsServants[_sv].health is "healthy" or ($NPCsServants[_sv].health is "infected" and $plagueRevealed is 0)>><<set _svHealthy += 1>><<elseif $NPCsServants[_sv].health is "infected">><<set _svInfected += 1>><<elseif $NPCsServants[_sv].health is "deceased">><<set _svDeceased += 1>><<elseif $NPCsServants[_sv].health is "recovered">><<set _svRecovered += 1>><</if>><</for>><<if _svHealthy gt 0>>_svHealthy healthy<br><</if>><<if _svInfected gt 0>>_svInfected infected<br><</if>><<if _svDeceased gt 0>>_svDeceased deceased<br><</if>><<if _svRecovered gt 0>>_svRecovered recovered<br><</if>> */
<<for _sv, _idx range $NPCsServants>>
$NPCsServants[_sv].name, $NPCsServants[_sv].age $NPCsServants[_sv].relationship: <<if $NPCsServants[_sv].health is "infected" and $plagueRevealed is 0>>healthy<<elseif $NPCsServants[_sv].health is "deceased-pq">>deceased<<else>>$NPCsServants[_sv].health<</if>><br>
<</for>>
<<if $FledServants.length gt 0>>
''Fled servants:'' <br>$FledServants.length fled to $hhlocation<br>
<</if>>
<</if>>
<<if $NPCsMaster.length gt 0>>
<br>''<<if $masterGender is "female">>Mistress's<<else>>Master's<</if>> Household:'' <br><<for _mh, _idx range $NPCsMaster>>
$NPCsMaster[_mh].name, $NPCsMaster[_mh].age <<npc-rel-label $NPCsMaster[_mh].relationship>>: <<if $NPCsMaster[_mh].health is "infected" and $plagueRevealed is 0>>healthy<<elseif $NPCsMaster[_mh].health is "deceased-pq">>deceased<<else>>$NPCsMaster[_mh].health<</if>><br>
<</for>>
<</if>>
<</nobr>><</widget>><<widget "addMaster">><<nobr>>
/* Generalized: used for apprenticeship, forced service, orphan placement, and impressment */
/* Argument 0: Socio of new master (Defaults to "artisans") */
<<set _masterSocio to _args[0] || "artisans">>
/* Move existing family to extended */
<<set _survivingFamily to []>>
<<for _ai = 0; _ai < $NPCs.length; _ai++>>
<<if $NPCs[_ai].health isnot "deceased">>
<<set _survivingFamily.push($NPCs[_ai])>>
<</if>>
<</for>>
<<set $NPCsExtended to $NPCsExtended.concat(_survivingFamily)>>
<<set $NPCs to []>>
<<set $NPCsMaster to []>>
<<addMasterHousehold _masterSocio>>
<<set $NPCs to $NPCsMaster.slice()>>
<<set $NPCsMaster to []>>
<<NPCpronouns>>
<<set $socio to "servants">>
<<set-hoh>>
<<set $seekingApprenticeship to 0>> /* this is okay for regular servants */
<</nobr>><</widget>>
<<widget "addMasterHousehold">><<nobr>>
/* Argument 0: Socio of new master (Defaults to "") */
<<set _masterSocio to _args[0] || "">>
<<if _masterSocio is "">>
<<if $socio is "servants">>
<<set $masterStatus to either("artisans", "merchants", "nobles")>>
<<else>>
<<set $masterStatus to "artisans">>
<</if>>
<<else>>
<<set $masterStatus to _masterSocio>>
<</if>>
<<set _nomasterMother to true>>
<<set _nomasterFather to true>>
<<set _usedMasterChildNames to []>>
/* Roll master gender: ~80% male, ~20% widowed female */
<<set $masterGender to weightedEither({"male": 4, "female": 1})>>
<<set $masterTitle to ($masterGender === "female") ? "mistress" : "master">>
<<if $masterStatus is "artisans">>
<<set _masterHHSize to random(2,4)>>
<<elseif $masterStatus is "merchants">>
<<set _masterHHSize to random(3,6)>>
<<elseif $masterStatus is "nobles">>
<<set _masterHHSize to random(5,10)>>
<</if>>
/* Always generate the master first */
<<set _masterAgenum to random(30,76)>>
<<if _masterAgenum gte 60>><<set _masterAge to "elderly adult">><<else>><<set _masterAge to "middle-aged adult">><</if>>
<<set _masterNamePool to ($masterGender === "female") ? $fNames : $mNames>>
<<set $NPCsMaster.push({name: weightedEither(_masterNamePool), age: _masterAge, agenum: _masterAgenum, relationship: "master", health: "healthy", location: $location, heshe: ($masterGender === "female") ? "she" : "he", hishers: ($masterGender === "female") ? "her" : "his", gender: $masterGender})>>
<<if $masterGender is "male" and random(1,20) lte 11>>
<<set $minAge to _masterAgenum-20>>
<<if $minAge lte 15>>
<<set $minAge to 16>>
<</if>>
<<set $maxAge to _masterAgenum+30>>
<<setAge>>
<<set $NPCsMaster.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "mistress", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<set _mistressAgenum to $NPCAgeNum>>
<<set _mhhInitsize to 2>>
<<else>>
<<set _mistressAgenum to _masterAgenum>>
<<set _mhhInitsize to 1>>
<</if>>
<<for _m to 0; _m lt _masterHHSize-_mhhInitsize; _m++>>
<<if random(1,2) eq 1>>
<<if _nomasterMother>>
<<set _fRel to either("master's daughter", "master's mother", "female servant")>>
<<else>>
<<set _fRel to either("master's daughter", "female servant")>>
<</if>>
<<if _fRel is "master's mother">>
<<set $minAge to _masterAgenum+20>>
<<set $maxAge to _masterAgenum+42>>
<<if $maxAge gte 100>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<set $NPCsMaster.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "master's mother", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<set _nomasterMother to false>>
<<elseif _fRel is "female servant">>
<<set $minAge to 16>>
<<set $maxAge to 76>>
<<setAge>>
<<set $NPCsMaster.push({name: weightedEither($fNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "female servant", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<<else>>
<<set $minAge to 0>>
<<set $maxAge to _mistressAgenum-16>>
<<setAge>>
<<set _n to weightedEither($fNames)>><<for ; _usedMasterChildNames.includes(_n); >><<set _n to weightedEither($fNames)>><</for>><<set _usedMasterChildNames.push(_n)>><<set $NPCsMaster.push({name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "master's daughter", health: "healthy", location: $location, heshe: "she", hishers: "her", gender: "female"})>>
<</if>>
<<else>>
<<if _nomasterFather>>
<<set _fRel to either("master's son", "master's father", "male servant")>>
<<else>>
<<set _fRel to either("master's son", "male servant")>>
<</if>>
<<if _fRel is "master's father">>
<<set $minAge to _masterAgenum+20>>
<<set $maxAge to _masterAgenum+42>>
<<if $maxAge gte 100>>
<<set $maxAge to 100>>
<</if>>
<<setAge>>
<<set $NPCsMaster.push({name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "master's father", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<<set _nomasterFather to false>>
<<elseif _fRel is "male servant">>
<<set $minAge to 16>>
<<set $maxAge to 76>>
<<setAge>>
<<set $NPCsMaster.push({name: weightedEither($mNames), agenum: $NPCAgeNum, age: $NPCAge, relationship: "male servant", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<<else>>
<<set $minAge to 0>>
<<set $maxAge to _mistressAgenum-16>>
<<setAge>>
<<set _n to weightedEither($mNames)>><<for ; _usedMasterChildNames.includes(_n); >><<set _n to weightedEither($mNames)>><</for>><<set _usedMasterChildNames.push(_n)>><<set $NPCsMaster.push({name: _n, agenum: $NPCAgeNum, age: $NPCAge, relationship: "master's son", health: "healthy", location: $location, heshe: "he", hishers: "his", gender: "male"})>>
<</if>>
<</if>>
<</for>><</nobr>><</widget>><<widget "church-services">><<nobr>>
/* If church decision was already made (returning from storyline-return 0), skip */
<<if $churchServiceDecision>>
/* Church of England members always attend services - doubled baseline plague risk */
<<elseif $religion is "member of the Church of England">>
<<if passage() isnot "April 1666">>
<<plague-risk-check>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Attended parish church services", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<</if>>
/* Non-Church of England characters */
<<elseif $religion isnot "member of the Church of England">>
/* Skip for April 1666 - Easter has its own service code */
<<if passage() is "April 1666">>
/* Always-skip: apply penalty silently */
<<elseif $skipServices is 1>>
<<set _repLoss to 0>><<set _repBefore to $reputation>><<if $churchSkipRepPenalty is 0>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $churchSkipRepPenalty to 1>><<set _repLoss to -1>><</if>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Skipped Church of England services (fined 48d.)", money: -48, repDelta: _repLoss, repBefore: _repBefore, infectPct: null})>>
<<set $money to Math.clamp($money - 48, -Infinity, Infinity)>>
/* Forced to attend due to debt - doubled baseline plague risk */
<<elseif $debtForcedAttend is 1 and $money lt 0>>
<<set _randomEventFired to true>>
<<plague-risk-check>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Attended parish church services (debt)", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<<set $churchServiceDecision to true>>
<span id="churchBlock">You return to the Church of England services this month. You cannot afford to pay the fine for skipping while in debt. Your previous commitment to always skip services no longer applies, but once you are no longer in debt, you can re-commit to always <<storyline-return "skipping Church of England services." 0>></span>
/* Offer choice if not in debt */
<<elseif $money gte 0>>
<<set _randomEventFired to true>>
<span id="churchBlock">As a $religion, do you want to attend services at your parish Church of England this month?<br><br>
<<link "Always avoid Church of England services">><<replace "#churchBlock">>
<<set _repLoss to 0>><<set _repBefore to $reputation>><<if $churchSkipRepPenalty is 0>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $churchSkipRepPenalty to 1>><<set _repLoss to -1>><</if>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Skipped Church of England services (fined 48d.)", money: -48, repDelta: _repLoss, repBefore: _repBefore, infectPct: null})>>
<<set $skipServices to 1>>
<<set $money to Math.clamp($money - 48, -Infinity, Infinity)>>
<<set $churchServiceDecision to true>>
You resolve to stop attending services at the Church of England. You are fined 48d. for non-attendance<<if _repLoss is -1>> and your reputation suffers<</if>>.<<if $role is "searcher" or $role is "nurse" or $role is "corpsebearer" or $role is "warder">><<set $role to "0">> As you are no longer attending Church of England services, the parish has removed you from your plague work duties.<</if>><br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>> | <<link "Skip Church of England services this month">><<replace "#churchBlock">>
<<set _repLoss to 0>><<set _repBefore to $reputation>><<if $churchSkipRepPenalty is 0>><<set $reputation to Math.clamp($reputation - 1, 0, 10)>><<set $churchSkipRepPenalty to 1>><<set _repLoss to -1>><</if>>
<<set $decisions.push({text: $timeline[$monthIndex] + ": Skipped Church of England services (fined 48d.)", money: -48, repDelta: _repLoss, repBefore: _repBefore, infectPct: null})>>
<<set $money to Math.clamp($money - 48, -Infinity, Infinity)>>
<<set $churchServiceDecision to true>>
You skip services at your parish church this month and are fined 48d. for non-attendance.<<if _repLoss is -1>> Your reputation suffers.<</if>><br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>> | <<link "Attend services">><<replace "#churchBlock">>
<<plague-risk-check>><<set $decisions.push({text: $timeline[$monthIndex] + ": Attended parish church services", money: 0, repDelta: 0, repBefore: $reputation, infectPct: _riskPct})>>
<<set $churchServiceDecision to true>>
You attend services at your parish church, though it goes against your beliefs as a $religion.<br><br>
<<storyline-return "Continue." 0>>
<</replace>><</link>></span>
<</if>>
<</if>>
<</nobr>><</widget>>/* npc-rel-label — conditionally replaces "male servant" / "female servant"
with "fellow servant" when the player IS a servant ($socio is "servants").
For all other relationships, outputs the relationship string unchanged.
Use this wherever $NPCs[].relationship is displayed in narrative text and
the array may contain master-household servants (unmarried servant players
or quarantine-swap scenarios). */
<<widget "npc-rel-label">><<if $socio is "servants" and (_args[0] is "male servant" or _args[0] is "female servant")>>fellow servant<<else>><<print _args[0]>><</if>><</widget>>