Advertisement
Guest User

Text adventure Python

a guest
Dec 18th, 2013
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 22.45 KB | None | 0 0
  1. #Text Adventure
  2.  
  3. import shlex
  4.  
  5.  
  6.  
  7. def map():
  8.     print ' _____________________________ '
  9.     print '|         |         |         |'
  10.     print '|         |         |         |'
  11.     print '| Room B  = Room D  =  Room E |'
  12.     print '|   Jack  |  Sword  |   Bear  |'
  13.     print '|         |         |         |'
  14.     print '|____||___|____||___|____\____|'
  15.     print '|         |         |         |'
  16.     print '|         |         |         |'
  17.     print '|  Steve  |  Jesse  |  Room F |'
  18.     print '| Room A  = Room C  =  Chest  |'
  19.     print '|         |         |         |'
  20.     print '|_________|_________|_________|'
  21.  
  22.  
  23.  
  24. #The Room class
  25. class Room(object):
  26.     def __init__(self, location,objectsinRoom, containersinRooom, wallsinRoom,peopleinRoom,hasDoor,\
  27.     description,descriptionpeople,descriptiondirections):
  28.  
  29.         self.location = location
  30.         self.objectsinRoom = objectsinRoom
  31.         self.containersinRooom = containersinRooom
  32.         self.wallsinRoom = wallsinRoom
  33.         self.peopleinRoom = peopleinRoom
  34.         self.hasDoor = hasDoor
  35.         self.description = description
  36.         self.descriptionpeople = descriptionpeople
  37.         self.descriptiondirections = descriptiondirections
  38.  
  39.  
  40. #Returns what will be printed about the Room you're in right meow
  41.     def display_Room(self):
  42.         stri = (' ')
  43.  
  44.         itemprint = []
  45.         contprint = []
  46.         peopprint = []
  47.  
  48.         for item in self.objectsinRoom:
  49.             if item.islocked == True:
  50.                 pass
  51.             else:
  52.                 if item.incontainer == True:
  53.                     itemprint.append('A ' + item.name + ' is in the ' + item.containername + '. ')
  54.                 else:
  55.                     itemprint.append('A ' + item.name + ' is here.')
  56.         stritem = stri.join(itemprint)
  57.  
  58.         for cont in self.containersinRooom:
  59.             contprint.append(cont.text)
  60.         strcont = stri.join(contprint)
  61.  
  62.         for people in self.peopleinRoom:
  63.             if people.state == 'alive':
  64.                 peopprint.append(' ' +  people.name + ' is here. ')
  65.             elif people.state != 'alive':
  66.                 peopprint.append(' ' +  people.name + "'s dead body is here. ")
  67.         strpeop = stri.join(peopprint)
  68.  
  69.         return self.description + strpeop + strcont + stritem
  70.  
  71. #The class for NPCs
  72. class People(object):
  73.     def __init__(self,location,name,text,description,state):
  74.         self.location = location
  75.         self.name = name
  76.         self.text = text
  77.         self.description = description
  78.         self.state = state
  79.  
  80. #Pretty much useless
  81.     def printText(self):
  82.         print self.text
  83.  
  84.  
  85. #Moves the player to another room
  86.     def go(self,location,Decision):
  87.  
  88.         newlocation = list(self.location)
  89.  
  90.  
  91.         if Decision == 'go north' or Decision == 'go n' or Decision == 'n':
  92.             newlocation[1] += 1
  93.             test = world.get(tuple(newlocation))
  94.             if test == None:
  95.                 print 'You cannot go there'
  96.             else:
  97.                 if test.wallsinRoom[2] == False and (test.hasDoor == None or test.hasDoor.islocked == False\
  98.                 or test.hasDoor.dir1 != 'n'):
  99.                     Ply.location = tuple(newlocation)
  100.                 elif test.wallsinRoom[2] == True:
  101.                     print 'There is a wall here. '
  102.                 elif test.hasDoor.islocked == True:
  103.                     print 'There is a door in the way. '
  104.  
  105.         elif Decision == 'go south' or Decision == 'go s' or Decision == 's':
  106.             newlocation[1] -= 1
  107.             test = world.get(tuple(newlocation))
  108.             if test == None:
  109.                 print 'You cannot go there'
  110.             else:
  111.                 if test.wallsinRoom[0] == False and (test.hasDoor == None or test.hasDoor.islocked == False\
  112.                 or test.hasDoor.dir1 != 's'):
  113.  
  114.                     Ply.location = tuple(newlocation)
  115.                 elif test.wallsinRoom[0] == True:
  116.                     print 'There is a wall here. '
  117.                 elif test.hasDoor.islocked == True:
  118.                     print 'There is a door in the way. '
  119.  
  120.  
  121.         elif Decision == 'go east' or Decision == 'go e' or Decision == 'e':
  122.             newlocation[0] += 1
  123.             test = world.get(tuple(newlocation))
  124.             if test == None:
  125.                 print 'You cannot go there'
  126.             else:
  127.                 if test.wallsinRoom[3] == False and (test.hasDoor == None or test.hasDoor.islocked == False\
  128.                 or test.hasDoor.dir1 != 'e'):
  129.                     Ply.location = tuple(newlocation)
  130.                 elif test.wallsinRoom[3] == True:
  131.                     print 'There is a wall here. '
  132.                 elif test.hasDoor.islocked == True:
  133.                     print 'There is a door in the way. '
  134.  
  135.  
  136.         elif Decision == 'go west' or Decision == 'go w' or Decision == 'w':
  137.             newlocation[0] -= 1
  138.             test = world.get(tuple(newlocation))
  139.             if test == None:
  140.                 print 'You cannot go there'
  141.             else:
  142.                 if test.wallsinRoom[1] == False and (test.hasDoor == None or test.hasDoor.islocked == False\
  143.                 or test.hasDoor.dir1 != 'w'):
  144.                     Ply.location = tuple(newlocation)
  145.                 elif test.wallsinRoom[1] == True:
  146.                     print 'There is a wall here. '
  147.                 elif test.hasDoor.islocked == True:
  148.                     print 'There is a door in the way. '
  149.  
  150.  
  151.  
  152. #The Player class!
  153. class Player(People):
  154.     def __init__(self,location,name,text,state):
  155.         self.location = location
  156.         self.name = name
  157.         self.text = text
  158.         self.state = state
  159.  
  160.  
  161. #Actually prints the description of your location
  162.     def printlocation(self,location):
  163.         return world.get(self.location).display_Room()
  164.  
  165. #Adds to inventory n shit
  166.     def take(self,location,Decision):
  167.         tokens = shlex.split(Decision)
  168.         if len(tokens) != 2  or tokens[1] not in objects:
  169.             print "This doesn't exist."
  170.         else:
  171.             if Ply.location == objects[tokens[1]].location:
  172.                 if objects[tokens[1]].ininv == 'no':
  173.                     if objects[tokens[1]].islocked == False:
  174.                         Inventory.append(objects[tokens[1]].name)
  175.                         print 'Taken'
  176.                         objects[tokens[1]].ininv = 'yes'
  177.                         objects[tokens[1]].incontainer = 'yes'
  178.                         objects[tokens[1]].containername = None
  179.                         world.get(self.location).objectsinRoom.remove(objects[tokens[1]])
  180.                     else:
  181.                         print "You don't see that"
  182.                 elif objects[tokens[1]].ininv == 'no':
  183.                     print "You already have that"
  184.  
  185.             else:
  186.                 print "You don't see that"
  187.  
  188. #Removes from inventory n shit
  189.     def drop(self,location,Decision):
  190.         tokens = shlex.split(Decision)
  191.         if len(tokens) != 2 or tokens[1] not in Inventory:
  192.             print "You don't have that"
  193.         else:
  194.             objects[tokens[1]].ininv = 'no'
  195.             Inventory.remove(objects[tokens[1]].name)
  196.             objects[tokens[1]].location = self.location
  197.             world.get(self.location).objectsinRoom.append(objects[tokens[1]])
  198.             print 'Dropped'
  199.  
  200. #Puts something in a container.
  201.     def put(self,location,Decision):
  202.         tokens = shlex.split(Decision)
  203.         if len(tokens) != (4) or tokens[1] not in Inventory:
  204.             print "You don't have that"
  205.         elif tokens[2] != 'in' and tokens[2] != 'on':
  206.             print 'What?'
  207.         elif tokens[2] == 'in':
  208.             if tokens[3] not in containers:
  209.                 print "The thing you want that in doesn't exist"
  210.             else:
  211.                 objects[tokens[1]].ininv = 'no'
  212.                 Inventory.remove(objects[tokens[1]].name)
  213.                 objects[tokens[1]].location = self.location
  214.                 world.get(self.location).objectsinRoom.append(objects[tokens[1]])
  215.                 objects[tokens[1]].incontainer = True
  216.                 objects[tokens[1]].containername = tokens[3]
  217.                 print 'Put.'
  218.         elif tokens[2] == 'on' and tokens[3] == 'floor':
  219.             if tokens[1] not in Inventory:
  220.                 print "You don't have that"
  221.             else:
  222.                 objects[tokens[1]].ininv = 'no'
  223.                 Inventory.remove(objects[tokens[1]].name)
  224.                 objects[tokens[1]].location = self.location
  225.                 world.get(self.location).objectsinRoom.append(objects[tokens[1]])
  226.                 print 'Dropped'
  227.  
  228. #Opens a door or container
  229.     def open(self,location,Decision):
  230.         tokens = shlex.split(Decision)
  231.         if len(tokens) != 2 or tokens[1] not in containers:
  232.             if tokens[1] == 'door':
  233.                 unlock(Decision)
  234.             else:
  235.                 print "This doesn't exist."
  236.         else:
  237.             containers[tokens[1]].isopen = True
  238.             print 'Opened'
  239.             containers[tokens[1]].text = "An open " + containers[tokens[1]].name +" is here. "
  240.             for item in itemsincontainers[containers[tokens[1]]]:
  241.                 item.islocked = False
  242.  
  243. #Closes a container
  244.     def close(self,location,Decision):
  245.         tokens = shlex.split(Decision)
  246.         if len(tokens) != 2 or tokens[1] not in containers:
  247.             print "This doesn't exist."
  248.         else:
  249.             containers[tokens[1]].isopen = False
  250.             print 'Closed'
  251.             containers[tokens[1]].text = "A " + containers[tokens[1]].name +" is here. "
  252.             for item in itemsincontainers[containers[tokens[1]]]:
  253.                 item.islocked = True
  254.  
  255.  
  256. #Talks to a NPC
  257.     def talk(self,location,Decision):
  258.         if Decision == 'talk steve' or Decision == 'talk to steve' or Decision == 'talk with steve':
  259.             if self.location == Steve.location:
  260.                 if Jack.state == 'dead':
  261.                     if gold.ininv == 'no':
  262.                         print 'You killed Jack! Take this is a reward.'
  263.                         print 'Gold added to Inventory'
  264.                         Inventory.append(gold.name)
  265.                     elif gold.ininv == 'yes':
  266.                         print 'Thanks again, man.'
  267.                 elif Steve.state == 'dead':
  268.                     print 'This person is dead.'\
  269.  
  270.                 else:
  271.                     Steve.printText()
  272.             else:
  273.                 print "This person is not here."
  274.  
  275.         elif Decision == 'talk jack' or Decision == 'talk to jack' or Decision == 'talk with jack':
  276.             if self.location == Jack.location:
  277.                 if Jack.state == 'dead':
  278.                     print 'This person is dead.'
  279.                 else:
  280.                     Jack.printText()
  281.             else:
  282.                 print 'This person is not here'
  283.  
  284.         elif Decision == 'talk jesse' or Decision == 'talk to jesse' or Decision == 'talk with jesse':
  285.             if self.location == Jesse.location:
  286.                 if Jesse.state == 'dead':
  287.                     print 'this person is dead'
  288.                 elif 'gold' in Inventory:
  289.                     Drug = raw_input('You wanna buy some drugs?')
  290.                     if Drug == 'no':
  291.                         print 'THEN FUCK OFF'
  292.                     elif Drug == 'yes':
  293.                         Inventory.remove('gold')
  294.                         Inventory.append(meth.name)
  295.                         print 'Gold removed from Inventory'
  296.                         print 'Meth added to Inventory'
  297.                 else:
  298.                     Jesse.printText()
  299.             else:
  300.                 print 'This person is not here'
  301.  
  302.  
  303.         elif Decision == 'talk bear' or Decision == 'talk to bear' or Decision == 'talk with bear':
  304.             if self.location == Bear.location:
  305.                 if Bear.state == 'dead':
  306.                     print 'this monster is dead'
  307.                 else:
  308.                     Bear.printText()
  309.                     print 'The bear killed you'
  310.                     print 'Game over'
  311.                     Ply.state = 'dead'
  312.             else:
  313.                 print 'This thing is not here'
  314.  
  315. #Kills a NPC
  316.     def kill(self,location,Decision):
  317.         tokens = shlex.split(Decision)
  318.         if len(tokens) == 2:
  319.             if tokens[1] in people:
  320.                 if self.location == people[tokens[1]].location:
  321.                     killhelp(tokens[1])
  322.                 else:
  323.                     print 'This person is not here.'
  324.             else:
  325.                 print 'This person does not exist'
  326.         elif len(tokens) == 4:
  327.             if tokens[2] == 'with':
  328.                 if tokens[1] in people:
  329.                     if self.location == people[tokens[1]].location:
  330.                         killhelpwithitem(tokens[3],tokens[1])
  331.                     else:
  332.                         print 'This person is not here.'
  333.                 else:
  334.                     print 'This person does not exist'
  335.             else:
  336.                 print "This won't work"
  337.         else:
  338.             print "This doesn't work"
  339.  
  340. #The item class
  341. class Item(object):
  342.     def __init__(self,name,text,location,cankill,ininv,incontainer,islocked,containername):
  343.         self.name = name
  344.         self.text = text
  345.         self.location = location
  346.         self.cankill = cankill
  347.         self.ininv = ininv
  348.         self.incontainer = incontainer
  349.         self.islocked = islocked
  350.         self.containername = containername
  351.  
  352. #Container Class
  353. class Container(object):
  354.     def __init__(self,name,text,location,isopen,contains):
  355.         self.name = name
  356.         self.text = text
  357.         self.location = location
  358.         self.isopen = isopen
  359.         self.contains = contains
  360.  
  361. #Door class
  362. class Door(object):
  363.     def __init__(self,name,text,location1,location2,dir1,dir2,islocked,needskey,key):
  364.         self.name = name
  365.         self.text = text
  366.         self.location1 = location1
  367.         self.location2 = location2
  368.         self.dir1 = dir1
  369.         self.dir2 = dir2
  370.         self.islocked = islocked
  371.         self.needskey = needskey
  372.         self.key = key
  373.  
  374.  
  375. #helps the killmethod find out, if kill works
  376. def killhelp(victim):
  377.     Dec = raw_input('With what?')
  378.     Dec2 = Dec.lower()
  379.     if Dec2 in objects:
  380.         if Dec2 in Inventory:
  381.             if objects[Dec2].cankill == 'yes':
  382.                 killcons(victim)
  383.             else:
  384.                 print "You can't kill with that!"
  385.         else:
  386.             print "You don't have that."
  387.     else:
  388.         print "This doesn't exist."
  389.  
  390. #helps the killmethod find out, if kill works
  391. def killhelpwithitem(Item,victim):
  392.     if Item in objects:
  393.         if Item in Inventory:
  394.             if objects[Item].cankill == 'yes':
  395.                 killcons(victim)
  396.             else:
  397.                 print "You can't kill with that!"
  398.         else:
  399.             print "You don't have that."
  400.     else:
  401.         print "This doesn't exist."
  402.  
  403. #The consequences of a kill
  404. def killcons(victim):
  405.     genericvictims = ['steve','jack','jesse']
  406.  
  407.     if victim in genericvictims:
  408.         people[victim].state = 'dead'
  409.         print victim + ' died. '
  410.     else:
  411.         if victim == 'myself':
  412.             print 'You killed yourself. Good job, Really. Congratulations.'
  413.             print 'Game over'
  414.             Ply.state = 'dead'
  415.         elif victim == 'bear':
  416.             print 'YOU CANNOT KILL A BEAR GODDAMNIT'
  417.  
  418. #Prints your inventory
  419. def inv():
  420.     stri = ', '
  421.     print 'You have ' + stri.join(Inventory)
  422.  
  423. #also opens stuff
  424. #why is this not in the player class?
  425. def unlock(Decision):
  426.     tokens = shlex.split(Decision)
  427.     otherlocation = list(Ply.location)
  428.     if len(tokens) != 2 or tokens[1] != 'door' or Ply.location not in Doorslocations:
  429.         if tokens[1] in containers:
  430.             Ply.open(Ply.location,Decision)
  431.         else:
  432.             "This not exist, brother. "
  433.     else:
  434.         if Doorsdirection[Ply.location] == 'n':
  435.             otherlocation[1] += 1
  436.             Doorslocations.get(Ply.location).islocked = False
  437.             print 'unlocked'
  438.  
  439.         elif Doorsdirection[Ply.location] == 'e':
  440.             otherlocation[0] += 1
  441.             Doorslocations.get(Ply.location).islocked = False
  442.             print 'unlocked'
  443.  
  444.         elif Doorsdirection[Ply.location] == 's':
  445.             otherlocation[1] -= 1
  446.             Doorslocations.get(Ply.location).islocked = False
  447.             print 'unlocked'
  448.  
  449.         elif Doorsdirection[Ply.location] == 'w':
  450.             otherlocation[0] -= 1
  451.             Doorslocations.get(Ply.location).islocked = False
  452.             print 'unlocked'
  453.  
  454.  
  455. #Examines an item.
  456. def exam(Decision):
  457.     tokens = shlex.split(Decision)
  458.     if len(tokens) != 2 or tokens[0] != 'exam' or tokens[1] not in objects:
  459.         print "This doesn't exist"
  460.     else:
  461.         if Ply.location == objects[tokens[1]].location or tokens[1] in Inventory:
  462.             print objects[tokens[1]].text
  463.         else:
  464.             print "You don't see this"
  465.  
  466. #This doesn't work for some reason
  467. def dodrugs():
  468.     if 'meth' in Inventory:
  469.         print 'YOU ARE HIGH'
  470.         Inventory.remove('meth')
  471.         meth.ininv = 'no'
  472.     else:
  473.         print "You don't have that"
  474.  
  475. #This is supposed to check at the end of turn, if something is supposed to happen
  476. def script():
  477.     pass
  478.  
  479. #prints the help thingy
  480. def helpp():
  481.     print "You can use the following commands:"
  482.     print "go (north,south,west,east)"
  483.     print "talk (person)"
  484.     print "kill (person) with (item)"
  485.     print "take (item)"
  486.     print "drop (item)"
  487.     print "open (door or container)"
  488.     print "inventory"
  489.     print "examine (item)"
  490.     print "quit"
  491.  
  492.  
  493. Inventory = []
  494.  
  495.  
  496. sword = Item('sword','This is a sword',(2,2,1),'yes','no',False,False,None)
  497. pistol = Item('pistol','This is a pistol',(3,1,1),'yes','no',True,True,'chest')
  498. gold = Item('gold','This is gold',(1,1,1),'no','no',False,False,None)
  499. meth = Item('meth','THIS IS SOME REALLY NICE BLUE METH',(1,2,1),'no','no',False,False,None)
  500.  
  501. objects = {
  502. 'sword': sword,
  503. 'gold': gold,
  504. 'meth': meth,
  505. 'pistol': pistol
  506. }
  507.  
  508. objectsinroomA = []
  509. objectsinroomB = []
  510. objectsinroomC = [sword]
  511. objectsinroomD = []
  512. objectsinroomE = []
  513. objectsinroomF = [pistol]
  514.  
  515.  
  516.  
  517. chest = Container('Chest','A chest is here. ',(3,1,1),False,None)
  518.  
  519. containers = {
  520. 'chest': chest
  521.  
  522. }
  523.  
  524. itemsinchest = [pistol]
  525.  
  526. itemsincontainers = {
  527. chest: itemsinchest
  528.  
  529. }
  530.  
  531. containersinRoomA = []
  532. containersinRoomB = []
  533. containersinRoomC = []
  534. containersinRoomD = []
  535. containersinRoomE = []
  536. containersinRoomF = [chest]
  537.  
  538.  
  539.  
  540. Door1 = Door('Door','This is a door. ',(3,1,1),(3,2,1),'n','s',True,False,None)
  541.  
  542. Doorslocations = {
  543. (3,1,1): Door1,
  544. (3,2,1): Door1
  545.  
  546. }
  547.  
  548.  
  549. Doorsdirection = {
  550. (3,1,1): Door1.dir1,
  551. (3,2,1): Door1.dir2
  552.  
  553. }
  554.  
  555.  
  556.  
  557. Ply = Player((1,1,1),'Player','','alive')
  558. Steve = People((1,1,1),'Steve',"Hi, I'm Steve. Dude, can you do me favor? Kill Jack.",'This is Steve','alive')
  559. Jack = People((1,2,1),'Jack',"Don't kill me! ",'This is Jack','alive')
  560. Jesse = People((2,1,1),'Jesse','Piss off, bitch.','This is Jesse','alive')
  561. Bear = People((3,2,1),'Bearbro','RAWWWRRR','THIS IS A FUCKING BEAR','alive')
  562.  
  563.  
  564. people = {
  565. 'steve': Steve,
  566. 'jack': Jack,
  567. 'jesse': Jesse,
  568. 'bear' : Bear,
  569. 'myself': Ply,
  570. }
  571.  
  572.  
  573. peopleinRoomA = [Steve]
  574. peopleinRoomB = [Jack]
  575. peopleinRoomC = []
  576. peopleinRoomD = [Jesse]
  577. peopleinRoomE = [Bear]
  578. peopleinRoomF = []
  579.  
  580.  
  581.  
  582.  
  583. #               North,East,South,West,   Northlo,Eastlo,Southlo,Westlo
  584. wallsinRoomA = [False,False,False,False, False,False,False,False]
  585. wallsinRoomB = [False,False,False,False, False,False,False,False]
  586. wallsinRoomC = [False,False,False,False, False,False,False,False]
  587. wallsinRoomD = [False,False,False,False, False,False,False,False]
  588. wallsinRoomE = [False,False,False,False,  False,False,Door1.islocked,False]
  589. wallsinRoomF = [False,False,False,False,  Door1.islocked,False,False,False]
  590.  
  591.  
  592. RoomA = Room((1,1,1),objectsinroomA,containersinRoomA,wallsinRoomA,peopleinRoomA,None,\
  593. 'You are in Room A.','',' You see a hallway to the north and to the east.')
  594. RoomB = Room((1,2,1),objectsinroomB,containersinRoomB,wallsinRoomB,peopleinRoomB,None,\
  595. 'You are in Room B.','',' You see a hallway to the south and to the east.')
  596. RoomC = Room((2,2,1),objectsinroomC,containersinRoomC,wallsinRoomC,peopleinRoomC,None,\
  597. 'You are in Room C.','',' You see a hallway to the west, to the east and to the south.')
  598. RoomD = Room((2,1,1),objectsinroomD,containersinRoomD,wallsinRoomD,peopleinRoomD,None,\
  599. 'You are in Room D.','',' You see a hallway to the north and to the west.')
  600. RoomE = Room((3,2,1),objectsinroomE,containersinRoomE,wallsinRoomE,peopleinRoomE,Door1,\
  601. 'You are in Room E. A door leading north is here. ',' ',' You see a hallway to the west and south.')
  602. RoomF = Room((3,1,1),objectsinroomF,containersinRoomF,wallsinRoomF,peopleinRoomF,Door1,\
  603. 'You are in Room F. A door leading south is here.','',' You see a hallway to the west and north.')
  604.  
  605. world = {
  606. (1,1,1):RoomA,
  607. (1,2,1):RoomB,
  608. (2,2,1):RoomC,
  609. (2,1,1):RoomD,
  610. (3,2,1):RoomE,
  611. (3,1,1):RoomF
  612. }
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619. emptyline = '\n'
  620.  
  621. #The turn
  622. def main():
  623.     print "Welcome to my Text Adventure!"
  624.     print "Use the 'help' command for help!"
  625.     while Ply.state == 'alive':
  626.         print Ply.printlocation(Ply.location)
  627.         Decisionst = raw_input('>')
  628.         Decisionstr = Decisionst.lower()
  629.         lst = shlex.split(Decisionstr)
  630.         if lst[0] == 'go' or lst[0] in 'nwse':
  631.             Ply.go(Ply.location,Decisionstr)
  632.         elif lst[0] == 'take' or lst[0] == 'get':
  633.             Ply.take(Ply.location, Decisionstr)
  634.         elif lst[0] == 'drop':
  635.             Ply.drop(Ply.location,Decisionstr)
  636.         elif lst[0] == 'quit':
  637.             break
  638.         elif lst[0] == 'talk':
  639.             Ply.talk(Ply.location, Decisionstr)
  640.         elif lst[0] == 'kill':
  641.             Ply.kill(Ply.location,Decisionstr)
  642.         elif lst[0] == 'die':
  643.             killcons('myself')
  644.         elif lst[0] == 'inventory' or lst[0] == 'inv' or lst[0] == 'i':
  645.             inv()
  646.         elif lst[0] == 'help':
  647.             helpp()
  648.         elif lst[0] == 'look':
  649.             Ply.printlocation(Ply.location)
  650.         elif lst[0] == 'open':
  651.             Ply.open(Ply.location,Decisionstr)
  652.         elif lst[0] == 'close':
  653.             Ply.close(Ply.location,Decisionstr)
  654.         elif lst[0] == 'put':
  655.             Ply.put(Ply.location,Decisionstr)
  656.         elif lst[0] == 'unlock':
  657.             unlock(Decisionstr)
  658.         elif lst[0] == 'examine' or 'exam':
  659.             exam(Decisionstr)
  660.         elif Decisionstr == 'do drugs' or 'do meth':
  661.             dodrugs()
  662.         script()
  663.  
  664. map()
  665. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement