Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import random
- #[ 1, 2, 3,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23]
- maze = [[ 0,18, 1, 1, 7, 1, 1, 1, 1, 1, 1, 6, 7, 6, 2, 2, 6, 2, 2, 2, 2, 2, 2],
- [ 6, 6, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 6, 2, 2, 2, 2, 2, 6, 2, 2, 2],
- [ 1, 1, 1, 1, 1, 1, 7, 6, 1, 6, 9, 1, 6, 6, 2, 2,16,16,16, 6, 2, 2, 2],
- [ 6, 1, 6, 6, 1, 1, 6,14,14, 1, 1, 1, 1, 6, 7, 2,16,16,16, 6, 7, 2, 2],
- [ 9, 1, 1, 1, 1, 1, 1,14,14, 1, 6, 6, 1, 6, 2, 2, 2, 2, 2, 6, 2,11, 2],
- [ 1, 6, 1, 1, 1, 1, 1, 6, 6, 1, 1, 1, 1, 6, 2,11, 6, 2, 2, 6, 2, 2, 2],
- [ 1, 6, 1, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 6, 2, 2, 2, 7, 2, 6, 6, 6, 6],
- [ 1, 1, 1, 6, 6, 6, 1, 8, 1, 1, 6, 1, 1, 6, 6, 6, 6, 6, 2, 2, 6, 8, 6],
- [ 3, 3, 6, 6, 6, 3, 1, 1, 7, 1, 1, 7, 1, 6, 3, 3, 3, 6, 2, 2, 6, 2, 6],
- [ 6, 3, 3, 3, 3, 3, 7, 1, 1, 1, 1, 1, 1, 6, 6, 6, 7, 6, 2, 2, 6, 2, 6],
- [ 3, 6, 6,19, 3, 3, 1, 6, 1, 1,13,12,12, 6, 3, 3, 3, 6, 2, 2,11, 2, 6],
- [ 3, 3, 3, 3, 6, 3, 7, 1, 1, 1,13,13,12, 6, 3, 6, 3, 2,20, 2, 2, 2, 2],
- [ 3, 3, 3, 3, 6, 3, 6, 1, 6, 1, 1, 1, 6, 6, 3, 3, 3, 6, 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5, 5, 5, 5, 5, 5, 5],
- [ 4, 6, 6, 6, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 4, 6, 5, 5, 5, 5, 5, 5, 5],
- [ 4, 4, 4, 4, 4, 4, 4, 7, 6, 4, 4, 4, 4, 6, 4, 6, 5, 5, 5, 5, 5, 5, 5],
- [ 4, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 4, 6, 5, 5, 5, 5, 5, 5, 5],] #size of a maze (0= start, 1=wood, 2= christmas factory, 3= Winterwonderland, 4= Christmasbakery 5=Island)
- dwarfsays = [ "I heard the bad santa is not the best fellow", # possible answers that the dwarf says
- "You really need to find Santa before christmas !!!",
- "Plaese save our christmas",
- "Welcome, traveller! ",
- "Happy Christmas",
- "It is always usefull to have some christmas pouder:)",
- "Angles are really nice creatures and sometimes very usefull aswell"]
- die = [1,0] #random array for 8
- Class vars:
- life = 100 # Life variable
- elf = 0 # Elf variable
- zutaten = 0 # Zutaten variable
- x = 0
- y = 0
- w = 0
- h = 0
- win = 0
- life = 100 # Life variable
- elf = 0 #Elf variable
- zutaten = 0 # Zutaten variable
- def start(x,y): # function finds out where your start point is
- y = 0
- for h in maze:
- x = 0
- for w in h:
- if(w == 0):
- break
- x += 1
- if(w == 0):
- break
- y += 1
- return x,y
- def move(direction, x, y, maze, win,): # move controlls
- mazeSizeX = len(maze[0]) # checks the size of the maze
- mazeSizeY = len(maze)
- if (direction != "u" and direction != "d" and direction != "l" and direction != "r" and direction !="I am lost" and direction != "Coordinates"): #checks if you typed in the right words for directions
- print "Invalid direction. Learn to type, Dummkopf!"
- elif (direction == "u"): #control for going up
- if(y-1 == -1 or maze[y-1][x] == 6): # preserves you from going trhough a wall or out of the maze
- print "Do you like to run into a wall?"
- else:
- y -=1 #changes your coordinates
- elif (direction == "d"): #control for going down
- if(y+1 == mazeSizeY or maze[y+1][x] == 6):
- print "You hit a wall"
- else:
- y +=1
- elif (direction == "l"): #control for going left
- if(x-1 == -1 or maze[y][x-1] == 6):
- print "WAAAALLLL"
- else:
- x -=1
- elif (direction == "r"): #control for going right
- if(x+1 == mazeSizeX or maze[y][x+1] == 6):
- print "Wall infront of you..."
- else:
- x +=1
- elif (direction == "I am lost"):
- (x,y) = start(x,y)
- print "You are at the beginning again"
- elif (direction == "Coordinates"):
- print (x,y)
- #what happens when...
- if (maze[y][x] == 0): # prints you are at start again when you excidentally come back to the start
- print "You are at the start again" # diffrent areas
- if (maze[y][x] == 1):
- print "You are in a wood"
- if (maze[y][x] == 2):
- print "You are in a Christmas Factory"
- if (maze[y][x] == 3):
- print "You are in a Winter Wonderland"
- if (maze[y][x] == 4):
- print "You are in a Christmas bakery"
- if (maze[y][x] == 5):
- print "You are at the island where you can find santa:)"
- if (maze[y][x] == 6):
- print "You can't go this way maybe a tree,wall or iglu is infront of you \nyou need to find an other way.. "
- if(maze[y][x] == 7): #Meeting a Dwarf
- print "You meet a christmas dwarf which says:"
- print dwarfsays[random.randint(0, len(dwarfsays)-1)] # gets a radom answer from array in line 32 to 36 dwarfsays
- # life changing options
- if(maze[y][x] == 8): #christmas pouder
- print "You found christmas pouder :)"
- print" That's kind of awesome cause you get 20 % more life"
- vars.life += 20
- print "Your life level is now:",vars.life, "%"
- if(maze[y][x] == 9): #Grizzly
- print "Wuah there is a GRIZZLY"
- print"He scratches you and you loose 20 % of your life :("
- vars.life -= 20
- print "Your life level is now:",vars.life, "%"
- if(life <= 0 ):
- print "You are dead"
- (x,y) = start(x,y)
- if(maze[y][x] == 11): #Machine
- print "Oh no you run into a machine :o"
- print"Your arm got stack in the maschine that must hurt >.< "
- print"You loose 30 % of your life..."
- vars.life -= 30
- print "Your life level is now:",vars.life, "%"
- if(life <= 0 ):
- print "You are dead"
- (x,y) = start(x,y)
- #Santa deaths
- #you meet the bad santa which kills you
- if(maze[y][x] == 12):
- print "You meet the bad santa..."
- print "He was the original santa from finnland who didn't liked christmas at all.."
- print "He wants to kid nap children to cook and eat them .. "
- print "So bad santa is still bad and not amused that you disturbt him while cooking some sauce for the children.."
- print "He troughs his big cooking spoon in your direction.."
- print "It hits your had and now you are dead .. You should probablly not visit the bad santa again"
- print "You are back at the start"
- (x,y) = start(x,y) #sends you back to the beginning
- if(maze[y][x] == 13): #what happens when you get on 8 (you eather die of not)
- print "You meet one of bad santas elf, a nacked old man.."
- death = die[random.randint(0, len(die)-1)]
- if death == 0:
- print "You give him a gingerbread and he let's you pass but be carefull..."
- elif death == 1:
- print "He hits you with a piece of wood and you are back to the beginning"
- (x,y) = start(x,y)
- # Elfen
- #PROBLEM
- if(maze[y][x] == 14):
- if(vars.elf == 0):
- print "You found the wood elf :)"
- print 'Elf: "Hello :) I am the wood elf, one of Santas 4 best friends. '
- print 'You will need all our help to confince him that christmas needs him..'
- print 'So lets find the other 3 :) We should go to the Winter Wonderland now.."'
- vars.elf += 1
- print vars.elf
- else:
- print "you already found the wood elf"
- if(maze[y][x] == 15):
- if(vars.elf == 1):
- print "Hey that's Rudolf :)"
- print'Rudolf: "Hello christmas good soul.. I heard you want to save christmas?!'
- print 'So i will help you.. Next we should go to the christmas factory.."'
- elf += 1
- elif(vars.elf != 0):
- print "you already found the wood elf"
- print vars.elf
- if(maze[y][x] == 16):
- if(vars.elf == 2):
- if(vars.zutaten == 4):
- print "Finally you found another fellow of Santa the christmas imp"
- print 'Imp: "Good that you found me.. Fast lets go to the Bakery"'
- vars.elf += 1
- else:
- print "You need to find some more things"
- else:
- print "you already found the wood elf"
- print elf
- if(maze[y][x] == 17):
- if(vars.elf == 3):
- print "Congratulations you found Santas wife the last of santas followers"
- print 'Ms Santa: "Argh good lord you want to confince this old stubbon man'
- print 'Okay I will help you.. but just because you seem to be a nice person. Lets find the airport!"'
- vars.elf += 1
- else:
- print "you already found the wood elf"
- print vars.elf
- # Angles
- if(maze[y][x] == 18): # angle 1
- print"Hi I am a christmas angle and me and my friends will give you some advices on your way:)"
- print "Now you are in the forest at the beginning of your journey"
- print"On your way you will need to find some things or people to confince santa that christmas as wonderful"
- print"In the forest you need to find the wood elf but be pationed there are some creature who don't want your best "
- print"GOOD LUCK!"
- if(maze[y][x] == 19): # angle 2
- print"Hello I hear someone tries to save christmas are you this person?"
- print"That is really nice of you :) So i will help you a little bit!"
- print"You are in the winter winderland now the second of four parts.."
- print"You need to find Rudolf in these parts"
- print"Safe travel!"
- if(maze[y][x] == 20): # angle 3
- print"Tralalalalala.. Oh hola !"
- print"You are now in the christmas factory"
- print"Could you please do me a favour and bring my good friend the imp some christmas things, four exacly!?"
- print"Than he will help you to find santa"
- print"Thank you and watch out for the machines!"
- if(maze[y][x] == 21): # angle 4
- print"HOHOHO You are now in the last part of you journey "
- print"This is the christmas Bakery"
- print"You want find any dangerous things here but you will need to solve some riddle"
- print"Are you ready?"
- print"Great:))"
- #Snowballfight
- if(maze[y][x] == 10): #Snowball hits you
- print "Uh a Snowball hit you"
- print"You loose 10 % of your life watch out for them..."
- vars.life -= 10
- print "Your life level is now:",vars.life, "%"
- if(life <= 0 ):
- print "You are dead"
- (x,y) = start(x,y)
- if(maze[y][x] == 22):
- print "You run into a snowball fight be carefull that no snowball hits you"
- if(maze[y][x] == 23):
- print "Snowballs everywhere but you didn't get one ;)"
- #Ice
- if(maze[y][x] == 24):
- print "You are walking on a frozen river. Watch out for holes in the ice"
- if(maze[y][x] == 25):
- print"You fell into a hole in the ice you are dead:("
- (x,y) = start(x,y)
- if(maze[y][x] == 26):
- print"You found one of the things you need for the imp"
- vars.zutaten += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement