Beispiel #1
0
	def GO(self, cmd, cmds, msg):
		if ("hole", "room", "301") in msg: setArea("room301")
		elif "ladder" in msg: setArea("hotelground")
		elif ("jump", "bush") in msg:
			raw_input("Alright, you're going to jump...")
			raw_input("You take a deep breath, and run towards the south edge...")
			say("And chicken out; what if the core gets damaged?")
Beispiel #2
0
	def USE(self, cmd, cmds, msg):
		if ("red", "blade", "knife") in msg and "stairs_mattress_cut" not in States and "redblade" in Inventory:
			say("You begin cutting a hole through the mattress.")
			playSound("sounds/mattress.wav")
			for x in range(3): print("..."); time.sleep(1)
			say("It's considerably slower work than you'd prefer, but before long there's enough of a hole for you to squeeze through to the other side. The knife is covered in mattress lint and won't be able to cut much.")
			raw_input("...")
			say("You clean off the knife. Good as new!")
			Inventory["redblade"] += " There are traces of lint stuck to it."
			States["stairs_mattress_cut"] = True
Beispiel #3
0
def main():
	while True:
		msg = SearchableString(raw_input("\n["+Areas[States["area"]].__class__.__name__+"]--> ").lower())
		print("")
		
		with consolelib.listenPrints() as printedString:
			parseCMD(msg)

		if printedString[0]:
			States["time"] += 5 #Successful actions take 5 minutes
		else:
			#Nothing was printed, so the command/args pair wasn't found
			notFound(msg.split())
Beispiel #4
0
	def USE(self, cmd, cmds, msg):
		if "flashlight" in msg:
			if "flashlight" in Inventory:
				if "flashlighton" in States:
					say("You turn off the flashlight, deciding that conserving battery power is likely more important than being able to do anything at all in the Cafe.")
					del States["flashlighton"]
				else:
					say("""You pull the old Lithium Ion flashlight out of your backpack and turn it on.
					The room becomes moderately illuminated, at least enough for a casual look around.
					It's no MF cell, so you should probably keep the idling to a minimum.""")
					States["flashlighton"] = True
			else:
				say("You charade out the actions involved in turning on your hand, but if anything, the room gets darker. You'll probably need an actual flashlight.")
		elif "flashlighton" not in States:
			say("You can't see anything; it's pitch black.")
		elif ("chair", "table") in msg:
			say("You really don't want to sit down in those chairs.")
		elif ("charge", "black", "cable") in msg and "charger" in Inventory:
			if ("computer", "laptop", "terminal") in msg:
				States["laptop_cafe_powered"] = True
				self.USE("","",SearchableString("computer"))
			else: say("Use the cable with what?")
		elif ("computer", "laptop", "terminal") in msg:
			if "laptop_cafe_powered" not in States:
				say("""Glancing over the input device, you recognize the familar power symbol, and try depressing it.
				A red light blinks on a few pulses, then disappears. Either the power symbol had a different etymology than you've been taught,
				or the unit's low on power. Not of much use then.""")
			else:
				say("""The Core can wait. One of the 5 tips of the cable seems to fit into the portable terminal, and when you plug the other end into a socket on the side of the table, the device lights up. A picture of a wheel spins in the center of the display for a few moments, followed by an interface you're actually familiar with. """)
				raw_input("...")
				print("""\
========================================================================
===/      Gmail /=======================================================
==                                                                    ==
= <     Place is Heating Up                                            =
=  From: [email protected]           Oct 11th 2014         =
=---------------------------------------------                         =
=     Okay so you know we got that government contract to redo an      =
= office's sinks? Turns out it was actually the Whitehouse itself, and =
= people are really freaking out around here today. Something about    =
= a navy ship, possibly a submarine, being seized by extremists. I'd   =
= have thought that'd be standard fare for this place, but they've     =
= sent home quite a few of the non-essential staff early, and that     =
= can't be a good sign. My train doesn't leave for another few hours,  =
= so I figured I'd keep working, but the atmosphere was too weird for  =
= me to not send it your way, so let me know if you can find anything  =
= about it in the usual places. I can't imagine what they'd have on    =
= the boat that would threaten us here, I mean we have jets that can   =
= stop nuclear missiles, right? What could be worse than that?         =
=                                        ------------------------------=
==                                       - Reply -   - Fwd-           ==
========================================================================""")
				raw_input("...")
				say("""Amazing! An email from before the Collapse! After copying the contents into your Booker for perpetuity, you hit the keyboard's Back button to return to the list of emails.""")
				raw_input("...")
				say("""Nothing changes. The computer seems to have frozen. A shame, but you don't have time to try fixing it this trip.
				.
				The power cable could be useful for other things, so you take it with you.""")
Beispiel #5
0
	def USE(self, cmd, cmds, msg):
		if "key" in msg:
			if len(cmds) > 2:
				if ("stair", "doorknob") in msg:
					if "stairkey" in Inventory:
						say("""You put the 'S' key into the Stairwell Door.""")
						raw_input("...")
						say("""For awhile, nothing happens. Then suddenly, you realize the architecture of the building precludes 
							automatic doors, and that you'll likely have to turn the key manually to get anywhere with it.""")
						raw_input("...")
						say("""With a turn, the lock clicks open, though the key doesn't want to be removed without locking the door again.""")
						States["stairdoor"] = True
						del Inventory["stairkey"]
					else: say("You don't seem to have a key that matches the stairs door.")
				elif "cafe" in msg:
					say("The cafe door has no lock.")
					if not "flashlight" in Inventory:
						say("it's just creepy in there without a light.")
				elif "washroom" in msg:
					say("The washroom door is already proped open.")
				elif "manage" in msg:
					if "managementkey" in Inventory:
						say("You carefully insert the large key into the lock, and to your delight, it unlocks!")
						States["managedoor"] = True
					else: say("The keyhole for the Management door takes a very large key.")
				elif "suppl" in msg:
					if "suppliesdoorkey" in Inventory:
						say("You unlock the door labeled Supplies. Progress!")
						States["suppliesdoor"] = True
						del Inventory["suppliesdoorkey"]
					else: say("The keyhole for the Supplies door takes a different key.")
				elif "door" in msg:
					print("Which door?")
				else:
					say("Keys are generally used to open locked things. Not much else.")
			else:
				say("Use the key on what?")
Beispiel #6
0
def parseCMD(msg):
	cmds = msg.split(); cmd = SearchableString(len(cmds) > 0 and cmds[0] or "")
	curArea = Areas[States["area"]]
	if cmd == "load":
		SaveName = len(cmds) > 1 and cmds[1] or raw_input("Save name: >")
		if SaveName:
			NewStates, NewInventory = dson.load(open(SaveName+".dson","r"))
			States.clear(); Inventory.clear()
			States.update(NewStates); Inventory.update(NewInventory)
			print("== Progress loaded from '"+SaveName+".dson' ==")
	elif cmd == "save":
		SaveName = len(cmds) > 1 and cmds[1] or raw_input("Save name: >")
		if SaveName:
			dson.dump((States, Inventory), open(SaveName+".dson","w"), indent=2)
			print("== Progress saved to '"+SaveName+".dson' ==")
	elif cmd in ("clear", "cls"):
		consolelib.clear()
		print(" ")
	elif cmd in ("h", "help"):
		print ("You consider for a moment the verbs you've learned:\n"
			"go/enter [room]\n"
			"back/return/last goes to previous room\n"
			"look/examine/view [object]\n"
			"grab/pick/get/take [object]\n"
			"use [object] on [object]\n"
			"lockpick [object]\n"
			"time\n"
			"map\n"
			"i/inventory\n"
			"save [filename]\n"
			"load [filename]")
	elif cmd in ("i", "inventory"):
		if "backpack" in States:
			print("You stop and look at the contents of your leather backpack:")
			for item in Inventory.values():
				print("\t- "+item)
			print("\t- Lockpicking pins: "+str(States["pins"]))
			print("\t- Money: $%.2f" % States["money"])
		else:
			say("There isn't anything in your pockets. You try to start missions light.")
	elif cmd in ("time", "watch"):
		if "watch" in States: say("You glance at your Booker's display of the current local time: "+getTime())
		else: say("Your booker's internal clock hasn't been configured for this locale, and is still displaying your home time: " + str(int(States["time"]/1.44)))
	elif cmd in ("map",):
		say("You review your Booker's spatial layouting program.")
		with consolelib.lineByLine(0.03):
			openMap(curArea.zone)
	elif cmd == "" or (cmd in LOOK and len(cmds) == 1):
		curArea.describe()
	elif cmd in ("back", "return", "last") or "go back" in msg:
		if "lastarea" in States: setArea(States["lastarea"])
		else: say("You just walked into the building, you can't leave yet.")
	elif cmd in GO:
		curArea.GO(cmd, cmds, msg)
	elif cmd in LOOK:
		if ("booker", "arm") in msg:
			say("The Booker on your arm is an advanced Personal Information Processor. The 2000 model premiered in the year 8AA, and is primarily built from salvaged Old world components modified to support an MF power core. Its many features include a watch, 3D scanner, 1w laser pointer (doubles as a microwelder), journal logging, and flying toasters screensaver.")
		elif ("keyhole") in msg: say("You peer through the door's keyhole, but can't see anything, since there's a lock in the way.")
		else:
			curArea.LOOK(cmd, cmds, msg)
	elif cmd in GET:
		curArea.GET(cmd, cmds, msg)
	elif cmd in USE:
		with consolelib.listenPrints() as printedString:
			curArea.USE(cmd, cmds, msg)
		if printedString[0]: pass
		elif "magazines" in Inventory and ("maga", "zine") in msg:
			say("Is now the best time to be doing that?")
		elif "crochetagebook" in Inventory and "crochet" in msg:
			say("You flip through the booklet, but you can't understand the language. The diagrams detail the basics of picking locks.")
		elif ("water", "hydra", "bottle") in msg and "waterbottle" in Inventory:
			say("You're not thirsty at the moment.")
	elif cmd in LOCKPICK:
		if len(cmds) == 1:
			say("What locked object do you want to pick?")
		else:
			curArea.LOCKPICK(cmd, cmds, msg)
	elif "bumbl" in cmd:
		say("Bumbling around into furniture isn't really productive."
			"Besides, you're supposed to follow 'leave no trace' when Seeking.")
	elif ("break", "kick", "smash") in cmd:
		say("Seekers can't just go around breaking things, especially not in old ruins.")
	elif ("hello", "hi", "hey") in cmd: say("Ello.")
	elif ("yes") in cmd: say("Nope.")
	elif ("no") in cmd: say("Yep.")
Beispiel #7
0
	if options.fasttext:
		consolelib.setTextSpeed(True)
	if options.web:
		consolelib.setWebMode(True)
	if options.load:
		parseCMD("load "+options.load.rsplit(".", 1)[0])
		options.showintro = False
	else: raw_input("""\
                  ==========================================

                  `7MMMMMMMM  db      `7MMMMMYb. `7MMMMMMMM  
                    MM    `7 ;MM:       MM    `Yb. MM    `7  
                    MM   d  ,V^MM.      MM     `Mb MM   d    
                    MM""MM ,M  `MM      MM      MM MMmmMM    
                    MM   Y AbmmmqMA     MM     ,MP MM   Y  , 
                    MM    A'     VML    MM    ,dP' MM     ,M 
                  .JMML..AMA.   .AMMA..JMMmmmdP' .JMMmmmmMMM

                  =============== The Search ===============
                  ----- Stumbling through the darkness -----
                  ==========================================

                                [Press Enter]\
""")
	if options.showintro:
		playSound("sounds/ps1start.wav")

		greyscale = [
			".,-",
			"_ivc=!/|\\~",
			"gjez2]/(YL)t[+T7Vf",