repl.it
Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
current_room = "yard"
current_lives = 3
print("Welcome to Zork! A land of adventure, young challenger!")
name = input("In this story you can be a hero or a heroine. Choose one?\n")
print("Welcome", name + "!")
while current_lives == 0:
  print("You died! Play again sometime!")
while current_lives > 0:
  while current_room == "yard":
    print("You wake up seeing youself awake in front of a house. You see a door but it seems to be locked and all of the windows are blocked. To the right of you there is a mailbox.") 
    response1 = input("What will you do?\n")
    if response1 == 'open mailbox' or response1 == 'check mail' or response1 == 'check mailbox':
      print("You find a leaflet and it states: WELCOME TO ZORK", name.strip().upper() + "!", "YOU WILL FIND GREAT ADVENTURE AND NEW ABILITIES YOU NEVER KNEW YOU HAD! BUT ON THE WAY, YOU WILL MEET THE WORST MONSTERS AND WILL HAVE TO DESTROY THEM TO REMEDY YOUR CURSE OF BEING STUCK IN THE HOUSE! HERE ARE THE RULES: YOU WILL HAVE TO PERFORM ACTIONS IN ALMOST EVERY ROOM AND RECIEVE SOME USEFUL ITEMS THAT CAN BE HELPFUL IN ESCAPING THE HOUSE! MOST ROOMS WILL HAVE THESE TYPES OF ITEMS. IN ORDER TO MAKE THE PROCESS EASIER, THE COMPUTER WILL TELL YOU IF THERE IS A HELPFUL ITEM IN THAT ROOM. BEWARE, YOU MAY DIE ON YOUR ESCAPE OUT OF THE HOUSE!\n")
    else: 
      print("I do not understand! Try a different phrase!\n")
    print("Now that you have read the leaflet, the door to the mansion has opened. A goblin approaches you from behind.\n")
    response2 = input("What will you do?\n")
    if response2 == 'go to door' or response2 == 'enter house' or response2 == 'enter door':
      print("You are now in the entrance hallway. To the west of you there seems to be a bathroom. To the east, there seems to be a living room. To the north, there seems to be a chandelier.\n")
      current_room = "hallway"
    else: 
      print("I do not understand! Try a different phrase!\n")
  while current_room == "hallway":
    response3 = input("Pick a direction to go or type in the room you want to go to.\n")
    if response3 == 'north' or response3 == 'chandelier room' or response3 == 'chandelier':
      print("There is one helpful item in this room but it is high up and is unobtainable as of now.\n")
    elif response3 == 'west' or response3 == 'bathroom':
      print("There is one helpful item in this room.")
      current_room = "bathroom"
      while current_room == "bathroom":
        print("You are now in the bathroom! You have a great urge to search the room. In this room there is: a toilet, a shower, a sink, a trash can, and some toilet paper.")
        response4 = input("What will you search?\n") 
        if response4 == 'search toilet' or response4 == 'search shower' or response4 == 'search trash can' or response4 == "search toilet paper" or response4 == "check toilet" or response4 == "check shower" or response4 == "check trash can" or response4 == "check toilet paper" or response4 == 'toilet' or response4 == 'shower' or response4 == 'trash can' or response4 == 'toilet paper':
          print("The helpful item is not here!")
        elif response4 == 'search sink' or response4 == 'check sink' or response4 == 'sink':
          print("Congrats! You found the helpful item! It is a lamp which can help you see in the dark! You are now back in the hallway!")
          current_room = 'hallway'
        else: 
            ("I do not understand! Try a different phrase!\n")
    elif response3 == 'east' or 'living room':
      print("There are no helpful items here, but if you go north there is a bathroom MIGHT just MIGHT be a useful item")
      current_room = "living room"
      while current_room == "living room":
        response5 = input("What will you do?\n")
        if response5 == 'north' or response5 == 'go to bathroom'  or response5 =='enter bathroom':
          print("Oh no! You look in the mirror only to see a Grim Reaper and he comes out and kills you!")
          current_lives -= 1
          current_room = "hallway"
          print("You have", current_lives, "lives!")
        elif response5 == 'leave room' or response5 == 'get out' or response5 == 'get out of room' or response5 == 'leave living room' or response5 == 'get out of living room':
          current_room = "hallway"
        else:
          print("I do not understand! Try a different phrase!\n")
        current_room = "hallway2"
        while current_room == "hallway2":
          print("Now you have checked all rooms surrounding the hallway! There are still 4 more rooms on this floor! They are the kitchen, garage, family room, and library! Right now, you are in another hallway called hallway2!")
          response6 = input("Where would you like to go?")
          if response6 == 'kitchen' or response6 == 'go to kitchen':
            print("There are no helpful items in this room. You are now leaving this room.")
            current_room = "hallway2"
          elif response6 == 'garage' or response6 == 'go to garage':
            print("There is one helpful item in this room. There is a shelf, a rack, a and a trash can.")
            response7 = input("What would you like to search?")
            if response7 == 'rack' or response7 == 'search rack' or response7 == 'check rack' or response7 =='trash can' or response7 == 'search trash can' or response7 == 'check trash can':
              print("The helpful item is not here!")
            if response7 == 'shelf' or response7 == 'search shelf' or response7 == 'check shelf':
              print("Congratulations! You have found the helpful item! It is a ladder which can be used to reach one of the helpful, but not essential item. The one on the chandelier!")
              response8 = input("Would you like to go there? (Yes or No)\n")
            if response8 == 'Yes':
              ("You have found the Old Warrior's Secret! It states: Oh you have found my letter! Just as I was expecting, you are unlike the rest of your kind you actully have the logic read this! The gatekeeper's weekness is that she has an ego and if you can irritate her she will be vulnerable to attacks in the leg. Once you are passed this irrelevant organism, you may move on to your final fight of your journey. The dragon is quite vulnerable to the bow in the throat area. However, you might not be 100% successful in your attacks. Now, my friend, it is time for me to go. Good luck on your journey!")
            if response8 == 'No':
              current_room = "hallway2"
            else:
              print("I do not understand! Try a different word or phrase.")
          elif response6 == 'library' or response6 == 'go to library':
            print("There is no helpful item in this room, but there is a secret entrance behind a shelf which requires a sword to open.")
            current_room = "hallway2"
          else: 
            print("I do not understand! Try a different word or phrase.")
          elif response6 == 'family room' or response6 == 'go to family room':
            print("There is one helpful item in this room. There is a rug, couch, coffee table, and a TV.")
            response9 = input("What would you like to search?\n")
            if response9 == 'couch' or response9 == 'search couch' or response9 == 'check couch' or response9 == 'coffee table' or response9 == 'search coffee table' or respose9 == 'search table' or response9 == 'TV' or response9 == 'search TV' or response9 == 'check TV':
              print("The helpful item is not here!") 
            if response9 == 'rug' or response9 == 'search rug' or response9 == 'check rug':
              print("Congrats! You have found the shield! It will help you in fights! Now you must go upstairs to get more items, before you head to the basement for your final battle.")
              current_room = "staircase"
            else:
              print("I do not understand! Try a different word or phrase.")
        while current_room == "staircase":
          print("You are going up the stairs and are now upstairs.")
          current_room = "upstairs"
        while current_lives == "upstairs":