/*Black Street Market ver 0.55 - IntroComp version*/<a data-passage="intro"><img src=images/screen1.jpg class="center"></a>
<p style="text-align:center"><b>[[CLICK HERE TO START->intro]]</b></p><<nobr>>
<img src=images/screen3.jpg class="center">
<</nobr>>
It's not a big deal. As long as you and the other monsters stay in your part of the city, behind the magic veil, nobody gets upset.
The problem is that more than a few monsters have acquired a taste for goods and products from outside the veil.
[[One of them is talking to you now.]] <<nobr>>
<img @src=$pathImg[$loc.try] class="center">
/* This sets the text descriptions for the route that the player is scouting */
<<if $loc.try==0>><<include pathWest>>
<<elseif $loc.try==1>><<include pathNorth>>
<<else>><<include pathEast>>
<</if>>
/* This establishes the sneakScore, or the player's roll to succeed, and sneakCheck is the score needed to get past the guards.
*/
<<set _sneakScore = random(100)>>
<<set _sneakCheck = $guardLvl[$loc.try]*31>>
<<if _sneakScore > _sneakCheck>><<set $outcome = "sneakPass">><<else>><<set $outcome = "sneakFail">><</if>>
<</nobr>>
The $loc.path leading $loc.dir connect<<if $loc.try==1>>s<</if>> to $loc.neigh part of town. You should be able to acquire $loc.goal there.
<<if $guardLvl[$loc.try]==0>>The $loc.path <<if $loc.try==1>>is<<else>>are<</if>> completely unguarded tonight.<<elseif $guardLvl[$loc.try]==1>>Human patrols are guarding the $loc.path tonight.<<else>>Your senses tell you that monsters are patrolling the $loc.path tonight. It will be difficult to sneak into $loc.neigh part of town.<</if>>
/* warn the player about possible game over and redirect failure state to gameOver passage */<<if $favors < 1 and $guardLvl[$loc.try] > 0>><b>BE CAREFUL:</b> You've called in all your favors already. Getting caught will be the end of the line.<<if _sneakScore < _sneakCheck>><<set $outcome = "gameOver">><</if>>
<</if>><ol>
<li>Continue [[$loc.dir|$outcome]]<<if $guardLvl[$loc.try] > 0>>, and try to sneak past the guards<</if>>.</li>
<li>Turn back and scout paths to the <<if $loc.try==0>>[[north|secondScout][$loc.try=1]]<<else>>[[west|secondScout][$loc.try=0]]<</if>> or <<if $loc.try==2>>[[north|secondScout][$loc.try=1]]<<else>>[[east|secondScout][$loc.try=2]]<</if>>.</li>
</ol><<nobr>>
<img @src=$pathImg[$loc.try] class="center">
/* This sets the text descriptions for the route that the player is scouting */
<<if $loc.try==0>><<include pathWest>>
<<elseif $loc.try==1>><<include pathNorth>>
<<else>><<include pathEast>>
<</if>>
/* This establishes the sneakScore, or the player's roll to succeed, and sneakCheck is the score needed to get past the guards.
*/
<<set _sneakScore = random(100)>>
<<set _sneakCheck = $guardLvl[$loc.try]*31>>
<<if _sneakScore > _sneakCheck>><<set $outcome = "sneakPass">><<else>><<set $outcome = "sneakFail">><</if>>
/*this loop should check for zero inventory*/
<<set _invEmpty = true>>
<<for _i to 0; _i lt $shopInventory.length; _i++>>
<<if $shopInventory[_i][1] > 0>>
<<set _invEmpty = false>>
<</if>>
<</for>>
/*and then zero inventory redirects the player*/
<<if _invEmpty == true and $favors < 1>><<set $retreat = "interruptDay">><<else>><<set $retreat = "dayChoice">><</if>>
<</nobr>>
The $loc.path leading $loc.dir connect<<if $loc.try==1>>s<</if>> to $loc.neigh part of town. You should be able to acquire $loc.goal there.
<<if $guardLvl[$loc.try]==0>>The $loc.path <<if $loc.try==1>>is<<else>>are<</if>> completely unguarded tonight.<<elseif $guardLvl[$loc.try]==1>>Human patrols are guarding the $loc.path tonight.<<else>>Your senses tell you that monsters are patrolling the $loc.path tonight. It will be difficult to sneak into $loc.neigh part of town tonight.<</if>>
/* warn the player about possible game over and redirect failure state to gameOver passage */<<if $favors < 1 and $guardLvl[$loc.try] > 0>><b>BE CAREFUL:</b> You've called in all your favors already. Getting caught will be the end of the line.<<if _sneakScore < _sneakCheck>><<set $outcome = "gameOver">><</if>>
<</if>><ol>
<li>[[Go ahead and run the gauntlet|$outcome]]</li>
<li>It's too risky. You'll have to go home and [[prepare for tomorrow|$retreat]].</li>
</ol>
/*incomplete remove debug text after testing*/
DEBUG SECTION
<<nobr>>
/*supposed to set the approapriate image for security level*/
<<if $guardLvl[$loc.try]==2>>
<img src=images/locations/sneakpass_monster.gif class="center">
<<elseif $guardLvl[$loc.try]==1>>
<img src=images/locations/sneakpass_humans.gif class="center">
<<else>>
<img @src=$pathImg[$loc.try] class="center">
<</if>>
/*This sequence is going to determine which encounter pool to draw from, then it will shuffle the pool and set the first entry as the encounter for this passage*/
<<if $loc.try==0>>
<<set $wesEnc.shuffle()>>
<<set _nightEnc = $wesEnc[0]>>
<<elseif $loc.try==1>>
<<set $norEnc.shuffle()>>
<<set _nightEnc = $norEnc[0]>>
<<else>>
<<set $easEnc.shuffle()>>
<<set _nightEnc = $easEnc[0]>>
<</if>>
<</nobr>><<include _nightEnc>>
After your success, you find yourself [[starting another day|dayChoice]].<<nobr>>
/*supposed to set the approapriate image for security level*/
<<if $guardLvl[$loc.try]==2>>
<img src=images/locations/sneakfail_monster.gif class="center">
<<else>>
<img src=images/locations/sneakfail_human.gif class="center">
<</if>>
<<set $favors = 0>>
<</nobr>>You got caught trying to traverse the $loc.path. You are seized by guards and detained until morning.
You need to call in every favor you have, and all it gets you is an [[audience with the authorities.|sentencing]]<<set $showStuff = true>><img src=monster_request.gif class="center">
"I heard you could hook me up with some shoe polish, you know what I mean?"
The speaker is obviously three kobolds in a trenchcoat, but nobody looks too closely in this part of town.
"I really need some shoe polish. Can you help me out?"
Shoe polish is a controlled substance under the Monster–Human reconciliation act, and you'd get in a lot of trouble for selling it.
That's why you have an opportunity to make a fair amount of money.
It's time to decide whether you're open for business.
<ol>
<li>Yes, [[get shoe polish from the back room.->saleResults][$firstChoice = 1]]</li>
<li>No, [[send them away.->saleResults][$firstChoice = 2]]</li>
<li>Maybe. [[Ask a few questions.->saleResults][$firstChoice = 3]]</li>
</ol><<set $loc= {
try: 0,
path: "path",
dir: "that way",
neigh: "a different",
goal: "more inventory"
}>>
/*
The following $guardLvl and $pathImg arrays determine how heavily a path is guarded and which image to display when the player explores the alleys, bridge, or sewers.
*/
<<set $guardLvl = [0, 1, 2]>>
<<set $pathImg = ["images/locations/alleys.jpg", "images/locations/bridge.jpg", "images/locations/sewer.jpg"]>>
<<set $dayResult = "dayPass">>
<<set $favors = 0>>
<<set $shopInventory = [["shoe polish", 1, "tin"]]>>
<<set $showStuff = false>>
/*These are the encounter pools for evening explorations*/
<<set $wesEnc = ["wes00","wes01"]>>
<<set $norEnc = ["nor00", "nor01"]>>
<<set $easEnc = ["eas00","eas01"]>>
/*Code below this line sets the paramaters for the day's customers*/
<<set $clientName = ["Nadine", "Chester", "Javier", "Justine", "Edgar", "Rudolph", "Wendy", "Francois", "Charlene", "Nicole", "Frank", "Jessica"]>>
<<set $clientType = ["an animated statue", "a banshee", "a beastman", "a brownie", "a cherub", "a chupacabra", "a divine messenger", "a djinn", "a doppleganger", "a dragon", "a fairy", "a flesh-eating automaton", "a goblin", "a golem", "a kobold", "a landshark", "a lizardman", "a manticore", "a mermaid", "a mind ape", "an orc", "an ogre", "a pixie", "a revenant", "a sentient mushroom colony", "a seraph", "a sideways beetle", "a soul stealer", "a talking squid", "a telepath", "a unicorn", "an upright alligator", "a vengeful ghost", "a werewolf", "a wraith", "a wyvern"]>>
<<set $clientMod = ["who has a drinking problem", "who has a button collection", "who has a limp", "who has a speech impediment", "who has a gambling addiction", "who has an aversion to being emotionally vulnerable", "who has a nervous tic", "who has a pet chinchilla", "who has an obsessive attention to detail", "who has a fossilized marmot", "who has a gaudy emerald necklace", "who has a northern accent", "who has a sucking chest wound", "who has barely controlled drug habit", "who has a fondness for taffy", "who has an annoying insistence on mispronouncing your name", "who has a supiciously large umbrella", "who has an unexpectedly small handbag"]>>
<<set $clientAsk = ["pencil shavings", "shoe polish", "floor cleaner", "mustard"]>>
<<set $refuseLoop = false>>
<<set $paranoid = false>><<nobr>>
<<if $firstChoice > 2>>
<img src=monster_request.gif class="center">
<<else>>
<img src=images/storeroom.jpg class="center">
<</if>>
<</nobr>><<if $firstChoice > 2>>Your instincts are solid, but it's tough to get a read on this monster. You'll just have to decide whether it's worth the risk.
<ol>
<li>Yes, [[get shoe polish from the back room.->saleResults][$firstChoice = 1]]</li>
<li>No, [[send them away.->saleResults][$firstChoice = 2]]</li>
</ol>
<<elseif $firstChoice > 1>>Something’s not right about this deal. You try to look offended by the request for illicit goods and [[send the nervous monster on its way.|refuseTheCall]]
<<set $showStuff = true>><<else>><<nobr>>
<<set _passItem = "shoe polish">>
<<set _passQuant = -1>>
<<include "getBot">>
<<set $favors += 1>>
<<set $showStuff = true>>
<</nobr>>They gain a tin of shoe polish, and you gain one satisfied customer.
<b>Somebody owes you a favor that you can collect on later.</b>
However, your supplies of shoe polish are running low.
You'll have to sneak out of the monster quarter and [[acquire more inventory tonight.->nightSetup]]<</if>><<nobr>>
<img src=images/map.jpg class="center">
<<set $guardLvl.shuffle()>>
/* This shuffles the array to set security levels */
<</nobr>>
Night has fallen, and it's time to acquire more inventory.
You can:
<ol><li>Try crossing the bridge to the [[north|firstScout][$loc.try=1]], leading to rich neighborhoods and private residences.</li>
<li>Sneak through sewers to the [[east|firstScout][$loc.try=2]], which lead to the old town, a mix of shops and historic sites.</li>
<li>Venture into the maze of alleways headed [[west|firstScout][$loc.try=0]], and make your way deeper into the industrial district.</li></ol><<nobr>>
<img src=images/customer_1.gif class="center">
/*
This code determines whether the customer is a snitch and how a sale will be resolved by setting the $dayResult variable.
*/
<<set _snitchCheck = random(9)>>
<<if _snitchCheck > 6>>
<<set $dayResult = "dayFail">>
<<else>>
<<set $dayResult = "dayPass">>
<</if>>
/*
This code will set the name, type, and description of the day's client.
Then it will save the details of that client in case it turns out to be a narc.
*/
<<set $clientName.shuffle()>>
<<set $clientType.shuffle()>>
<<set $clientMod.shuffle()>>
<<set $clientAsk.shuffle()>>
<<set _snitch = $clientName[0] + ", " + $clientType[0] + " " + $clientMod[0]>>
<<set $snitch = _snitch>>
/*This code scans $shopInventory to create _custDemand array made out of items in stock. Then _custDemand is shuffled to create $custAsk*/
<<set _custDemand = [""]>>
<<for _i to 0; _i lt $shopInventory.length; _i++>>
<<if $shopInventory[_i][1] gt 0>>
<<run _custDemand.push($shopInventory[_i][0])>>
<</if>>
<</for>>
/*I am modifying this to fix the "" request bug.*/
<<set _custDemand.shuffle()>>
<<if _custDemand[0].length > 0>>
<<set $custAsk = _custDemand[0]>>
<<else>>
<<set $custAsk = _custDemand[1]>>
<</if>>
/*
This phrase can be used for bugtesting:
(length = <<print _custDemand[0].length>>)
I'm wondering if the problem comes from meeting a customer with zero inventory.
*/
<</nobr>>Today, you are approached by $clientName[0], $clientType[0] $clientMod[0].
They are looking for some $custAsk.
<ol>
<li>Yes, [[take their money.|$dayResult][$daySale = 1]]</li>
<li>No, [[they're probably a narc.->dayPass][$daySale = 2]]</li>
<li>Maybe. [[Ask a few questions.->dayPass][$daySale = 3]]</li>
</ol>
<<nobr>>
<img src=images/map.jpg class="center">
<<set $guardLvl.shuffle()>>
/* This shuffles the array to set security levels */
<</nobr>>Night has fallen again. You can sneak into the eastern, western, or northern parts of the city.
Try crossing the bridge to the [[north|firstScout][$loc.try=1]].
Sneak through sewers to the [[east|firstScout][$loc.try=2]].
Venture into the maze of alleways headed [[west|firstScout][$loc.try=0]].<<nobr>>
<<set $loc.path = "bridge">>
<<set $loc.dir = "north">>
<<set $loc.neigh = "the residential">>
<<set $loc.goal = "more inventory">>
<</nobr>><<nobr>>
<<set $loc.path = "sewers">>
<<set $loc.dir = "east">>
<<set $loc.neigh = "the historic">>
<<set $loc.goal = "more inventory">>
<</nobr>><<nobr>>
<<set $loc.path = "alleys">>
<<set $loc.dir = "west">>
<<set $loc.neigh = "the industrial">>
<<set $loc.goal = "more inventory">>
<</nobr>><<nobr>>
<img src=images/customer_1.gif class="center">
<<set _senseTrap = random(1)>>
<</nobr>><<if $daySale > 2>><<if _senseTrap > 0>>This customer smells like a rat. It feels too risky.<<else>>You might be wrong, but this customer seems legit.<</if>>
<ol>
<li>Yes, go ahead and [[sell the goods.|$dayResult][$daySale = 1]]</li>
<li>No, [[this feels too much like a setup.->dayPass][$daySale = 2]]</li>
</ol>
<<else>><<if $daySale > 1>>Something’s not right about this deal. You pretend to be outraged and eject the shifty monster from your store.<<else>><<set $favors += 1>><<nobr>>
/*the code that takes the item from inventory*/
<<set _passItem = $custAsk>>
<<set _passQuant = -1>>
<<include "getBot">>
<</nobr>>You hook the monster up. It's another favor you can call in later.<</if>>
Tonight is going to be another trip to [[acquire more inventory.->nightChoice]]
<</if>>
<<nobr>>
/*this loop should zero out every inventory item*/
<<for _i to 0; _i lt $shopInventory.length; _i++>>
<<set $shopInventory[_i][1] = 0>>
<</for>>
<</nobr>>Your business sense has failed you.
It turns out that the magic authority sent $snitch, to bust you.
You have given them enough evidence for a raid, and they confiscate all your inventory.
Tonight, you'll have to make another trip to [[acquire more inventory.->nightChoice]]
<<nobr>>
<img src=images/screen2.jpg class="center">
<</nobr>>
You run a small grocery store on Black Street, in the industrial part of the city, next to the mechanized bakery.
Most people don’t realize that this is [[the monster quarter]]./*
This space tracks
Favors
Inventory
*/
<<if $favors > 0>>Favors: <<print $favors>><</if>>
<<nobr>>
<<if $showStuff == true>>
<<for _i to 0; _i lt $shopInventory.length; _i++>>
<<if $shopInventory[_i][1] > 0>><<print $shopInventory[_i][1]>> <<print $shopInventory[_i][2]>><<if $shopInventory[_i][1] > 1>>s<</if>> of <<print $shopInventory[_i][0]>><<print "<br>">><</if>>
<</for>>
<</if>>
<</nobr>><<nobr>>
<<set _passItem = "floor cleaner">>
<<set _passQuant = 1>>
<<set _passContain = "bottle">>
<<include "getBot">>
<</nobr>>You’re friends with a sympathetic foreman at one of the factories in the industrial part of town.
He looks the other way while you grab a bottle of floor cleaner from a storeroom.<<nobr>>
<<set _passItem = "shoe polish">>
<<set _passQuant = 1>>
<<set _passContain = "tin">>
<<include "getBot">>
<</nobr>>Some warehouses have better security in the industrial district, but you're interested in the ones that have worse security.
You grab a tin of shoe polish for yourself before anybody else has a chance to steal it.<<nobr>>
<<set _passItem = "pencil shavings">>
<<set _passQuant = 1>>
<<set _passContain = "bag">>
<<include "getBot">>
<</nobr>>Some houses in the rich part of town are so big that their servants need servants.
You’re on good terms a house manager who gives you a bag of pencil shavings.<<nobr>>
<<set _passItem = "toaster pastries">>
<<set _passQuant = 1>>
<<set _passContain = "carton">>
<<include "getBot">>
<</nobr>>It’s your lucky night! One of the houses was receiving a late-night delivery, and you manage to receive a carton of toaster pastries for yourself.<<nobr>>
<<set _passItem = "mustard">>
<<set _passQuant = 1>>
<<set _passContain = "jar">>
<<include "getBot">>
<</nobr>>There are a few late-night emporiums in the historic part of town that don’t ask too many questions.
It’s a quick and easy way to pick up a jar of mustard.<<nobr>>
<<set _passItem = "moustache wax">>
<<set _passQuant = 1>>
<<set _passContain = "tin">>
<<include "getBot">>
<</nobr>>Some people complain about the city’s historic district becoming “too commercialized.”
They’re people, though. As a monster, you love the fact it’s much easier to find a tin of moustache wax that fell off the back of a truck.<<nobr>>
<<set _hasItem = false>>
<<for _i to 0; _i lt $shopInventory.length; _i++>>
<<if $shopInventory[_i][0] eq _passItem>>
<<set $shopInventory[_i][1] += _passQuant>>
<<set _hasItem = true>>
<</if>>
<</for>>
<<if _hasItem == false>>
<<run $shopInventory.push([_passItem, _passQuant, _passContain])>>
<</if>>
<</nobr>><<nobr>>
<img src=images/storeroom.jpg class="center">
<</nobr>>
You’re in a bind — you don’t have any merchandise that you can trade for favors. But you don’t have any favors to call in if you get caught trying to collect more merchandise.
You have two options:
<ol>
<li>Find someone who can [[provide you with contraband.|backChannels]]</li>
<li>Take a big risk by [[trying to sneak out of the monster quarter tonight.|nightChoice]]</li>
</ol>
/*incomplete until the choice text updates to reflect whether or not you have met Wagner, and the update should put the player further along in the Wagner night mssion.*/There is a collection of warehouses on the edge of the monster quarter. They're operated by Sister Wagner's wholesale religious supplies business.
Everyone here is very busy loading and unloading unmarked crates of dubious legal status.
[[Someone here can help you out.|meetWagner]]
<<nobr>>
<img src=images/customer_1.gif class="center">
/*
Setting the name, type, and description of the day's client.
*/
<<set $clientName.shuffle()>>
<<set $clientType.shuffle()>>
<<set $clientMod.shuffle()>>
<<set $clientAsk.shuffle()>>
<</nobr>><<if $refuseLoop == true>>This is obviously not a narc. Go ahead and [[get shoe polish from the back room.->saleResults][$firstChoice = 1]]<<else>>After sending the suspicious monster away, your next customer is a $clientName[0], $clientType[0] $clientMod[0].
They are also looking for some shoe polish. <<if $paranoid == true>>At this point, you're sure it's not a coordinated sting operation. And if you keep turning customers away, it will ruin your reputation.<</if>>
<ol>
<li>Yes, [[get shoe polish from the back room.->saleResults][$firstChoice = 1]]</li>
<li>No, [[send them away.->refuseTheCall][$paranoid = true]]</li>
<<if $refuseLoop == false>><li>Maybe. [[Ask a few questions.->refuseTheCall][$refuseLoop = true]]</li><</if>>
</ol>
<</if>><<nobr>>
<img src=images/char.jpg class="center">
<</nobr>>
Commissioner Char is in charge of security in the monster quarter. Char is a greater fire elemental and the living embodiment of burnout in a civil service career.
The commissioner's wrinkled skin is white and ashy, like a campfire at dawn. Sudden movements and stray drafts occasionally expose glowing embers underneath.
You know for a fact that Char does not need to breathe, but they have accessorized with a cigarette holder clenching a burning stick of chalk.
After hearing your case, the commissioner sentences you to [[community service.|communityService]]
<<nobr>>
<img src=images/cservice.jpg class="center">
<</nobr>>
You spend the rest of the day shepherding lesser air elementals as they try to pick up litter in the streets. They're very unfocused, and it's difficult to keep them on task.
Eventually, night falls and [[you are released.|nightChoice]]<<nobr>>
/*supposed to set the approapriate image for security level*/
<<if $guardLvl[$loc.try]==2>>
<img src=images/locations/sneakfail_monster.gif class="center">
<<else>>
<img src=images/locations/sneakfail_human.gif class="center">
<</if>>
<</nobr>>Ugh, you were warned. But you went ahead and did it anyway.
The guards catch you, lock you up, and throw away the key.
It's the end of the game for you. (Either restart or restore a save from here.)You didn't expect to get help from Wagner herself.
However, her assistance comes at a price.
If you help out her boys this evening, she'll give you [[a reward.|nightDuty]]<<nobr>>
<<set _passItem = "floor cleaner">>
<<set _passQuant = 1>>
<<set _passContain = "bottle">>
<<include "getBot">>
<</nobr>>A ship is arriving at the dockyards tonight, and you're tasked with keeping an eye out for the authorities.
You are accompanied to the docks by an enormous wehrgeist in priestly robes. It is dark and imposing, and it was deliberately chosen to keep you from getting second thoughts.
After the cargo is successfully unloaded, you get a bottle of floor cleaner.
Time to [[prepare for a new day|dayChoice]]