Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- running = True
- print("\n" * 100)
- Diff = 10
- Skip = input("Skip intro? (Yes/No)")
- Slow = input("Cinematic mode? (Yes/No)")
- if Skip not in ["yes", "Yes", "YES", "y", "Y"]:
- print("Welcome to\n--Escape The Building--\n\nYou robbed the building on 20th floor (for easy), and You have to get to the ground floor.\nThere is guard on the ground floor stopping you from escaping the building.\nThere are also investigators, which are investigating rooms from 1st floor, and then 2nd floor (they can skip rooms on harder modes)...\nThere is inspector following your steps, and he is behind you 2 steps, which means if You go to\nfloor 4 from floor 1 and then to floor 8 he will get to floor 1 because 2 actions before you were there,\nand also he will notice if someone is currently in previous room, so you cant sneek behind him.\nLast problem are dogs, and they jump on higer or lower floors. How much depends on difficulty.\nYou can use elevator and go on whatever floor you want, but if someone is in it then you can only go\n1 floor up or down.\n\nGood luck and escape the building! (1 minute)\n")
- Done = input("Press enter to continue...")
- while running:
- while Diff not in ["1", "2", "3"]:
- Diff = input(
- '\nEasy - 20 floors, 1 dog, dog tires in 5 actions,\ndog and investigators have speed of 1, guard needs 10 actions to move,\nelevator is 20% used\n\nMedium - 15 floors, 2 dogs, dogs tire in 15 actions,\ndogs and investigators have speed of 2, guard needs 10 actions to move,\nelevator is 33.33% used\n\nHard - 10 floors, 3 dogs, dogs tire in 20 actions,\ndogs and investigators have speed of 3, guard needs 20 actions to move,\nelevator is 50% used\n\nDifficulty? Type "1" for easy, "2" for medium, "3" for hard')
- Diff = int(Diff)
- You = 0
- You_Copy1 = 0
- Guard = 0
- Guard_Count = 0
- Investigators = 0
- Inspector = 0
- Inspector_Copy1 = 0
- Dogs = 0
- Dogs2 = 0
- Dogs3 = 0
- Dog_Count = 0
- Action_Count = 0
- Space = "-" * 30
- Walk = "mid"
- Elevator = True
- Player_not_in_range = True
- Dog_Sleep = False
- Guard_Alert = False
- GameRunning = True
- Dog_Diff = Dog_Diff2 = Dog_Diff3 = 0
- if Diff == 1:
- ElevatorDiff = 5
- Dog_Diff = 1
- Floors = 20
- elif Diff == 2:
- ElevatorDiff = 3
- Dog_Diff = Dog_Diff2 = 1
- Floors = 15
- elif Diff == 3:
- ElevatorDiff = 1
- Dog_Diff = Dog_Diff2 = Dog_Diff3 = 1
- Floors = 10
- ADog_Diff = 1
- ADog_Diff2 = 1
- ADog_Diff3 = 1
- if Dog_Diff == 1:
- ADog_Diff = 0
- if Dog_Diff2 == 1:
- ADog_Diff2 = 0
- if Dog_Diff3 == 1:
- ADog_Diff3 = 0
- if Slow in ["Yes", "yes"]:
- SlowTime = 1
- else:
- SlowTime = 0
- while GameRunning:
- Inspector_Copy1 = Inspector
- Inspector = You_Copy1
- You_Copy1 = You
- Elevator_Number = random.randint(0, ElevatorDiff)
- if Elevator_Number == 1:
- Elevator = False
- else:
- Elevator = True
- Guard_Count += 1
- if Guard_Count >= (30 - Floors):
- Elevator = False
- Action_Count += 1
- print("\n--- Action", Action_Count, "---")
- while Player_not_in_range:
- if Elevator == True:
- You = input("\nGo To which floor?")
- You = int(You)
- if 0 <= You <= Floors:
- Player_not_in_range = False
- else:
- while Walk not in ["up", "down"]:
- Walk = input("Someone is in the elevator\nWalk 'up' or 'down'?")
- if Action_Count == 1:
- You = Floors
- if Walk == "up":
- You += 1
- if You > Floors:
- You = Floors
- elif Walk == "down":
- You -= 1
- Player_not_in_range = False
- Investigators += random.randint(1, Diff)
- if Investigators > Floors:
- Investigators = 0
- ADogs = random.randint(-Diff, Diff)
- ADogs2 = random.randint(-Diff, Diff)
- ADogs3 = random.randint(-Diff, Diff)
- Dogs = (Dogs + ADogs) * Dog_Diff - ADog_Diff
- Dogs2 = (Dogs2 + ADogs2) * Dog_Diff2 - ADog_Diff2
- Dogs3 = (Dogs3 + ADogs3) * Dog_Diff3 - ADog_Diff3
- if Dogs > Floors:
- Dogs = Floors
- elif (Dogs < 0) & (Dog_Diff != 0):
- Dogs = -Dogs
- if Dogs2 > Floors:
- Dogs2 = Floors
- elif (Dogs2 < 0) & (Dog_Diff2 != 0):
- Dogs2 = -Dogs2
- if Dogs3 > Floors:
- Dogs3 = Floors
- elif (Dogs3 < 0) & (Dog_Diff3 != 0):
- Dogs3 = -Dogs3
- Dog_Count += 1
- if Dog_Count >= (29 - Floors):
- Dog_Count = -2
- if Dog_Count < 0:
- Dog_Sleep = True
- Dogs = -1
- Dogs2 = -1
- Dogs3 = -1
- else:
- Dog_Sleep = False
- if Guard_Count == 0:
- Guard = 0
- elif Guard_Count >= (30 - Floors):
- Guard = 1
- Guard_Count = -1
- if Guard_Count < 0:
- Guard_Alert = True
- else:
- Guard_Alert = False
- Player_not_in_range = True
- Walk = "mid"
- if You in [Guard, Inspector, Inspector_Copy1, Investigators, Dogs, Dogs2, Dogs3]:
- GameRunning = False
- GG = False
- elif You == 0:
- GameRunning = False
- GG = True
- time.sleep(0.1)
- print("\nYou are on floor", You)
- SlowMo = 1 * SlowTime
- time.sleep(SlowMo)
- if Guard_Alert:
- print("Guard has checked floor 1 and will move back next move")
- else:
- print("Guard is on floor", Guard, "\n", Space, "and he will move in", 30 - Floors - Guard_Count, "actions")
- SlowMo = 3 * SlowTime
- time.sleep(SlowMo)
- print("Investigators are on floor", Investigators)
- SlowMo = 2 * SlowTime
- time.sleep(SlowMo)
- print("Inspector is on floor", Inspector, "\n", Space, "he can see floor", Inspector_Copy1, ", and he will go to floor", You_Copy1)
- SlowMo = 5 * SlowTime
- time.sleep(SlowMo)
- if Dog_Sleep:
- print("Dogs are sleeping and will wake in", -Dog_Count, "actions\n\n")
- SlowMo = 1 * SlowTime
- time.sleep(SlowMo)
- else:
- if Diff > 0:
- print("1st dog is on floor", Dogs)
- if Diff > 1:
- print("2nd dog is on floor", Dogs2)
- if Diff > 2:
- print("3nd dog is on floor", Dogs3)
- print("\n", Space, "and they will be tired in", 28 - Floors - Dog_Count, "actions\n\n")
- SlowMo = 3 * SlowTime
- time.sleep(SlowMo)
- if GG == True:
- print("Congrats, you escaped the building on difficulty", Diff, "!")
- else:
- print("You Got caught :(")
- running = input("Play again?(Yes/No)")
- if running not in ["yes", "Yes", "y", "Y"]:
- running = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement