Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.16 KB | None | 0 0
  1. #DungeonAdventureWizardLegendQuest v1.0
  2. #Written February 2011
  3. #   A text based single player adventure game, where the player
  4. #plays a warrior or wizard fighting their way through a
  5. #dungeon filled with zombies.
  6. from random import *
  7. from time import *
  8.  
  9. def characterCreate():
  10.     playerName = input("Enter your name: ")
  11.     playerType = input("Welcome ", playerName, ",\nChoose your character: \n1 - Warrior \n2 - Wizard")
  12.     if playerType == 1:
  13.         mainCharacter = character(warrior)
  14.         print("You have chosen to play a warrior.")
  15.     elif playerType == 2:
  16.         mainCharacter = character(wizard)
  17.         print("You have chosen to play a wizard")
  18.     print("Your adventure has now begun...")
  19.  
  20. **************************************************************
  21. Not sure about the fight sequncing/new room programming. Once character and zombie
  22. objects are done it can be refined and simplified
  23. **************************************************************
  24. def newRoom():
  25.     if roomNumber = 0:
  26.         print("You are inside a room deep within the wizard's dungeon.")
  27.         print("Suddenly, a foul zombie leaps out and attacks!")
  28.     elif :
  29.         print("You go down a passage into the next room.")
  30.         print("Suddenly, a foul zombie leaps out and attacks!")
  31.     fightDecision = input("What do you do? \n1 - Fight! \n2 - Run Away!")
  32.     if fightDecision == 1:
  33. ****************************************************************
  34. class zombie():
  35.     zombie.health = 2*randint(1, 6)
  36.     zombie.dexterity = 11
  37.     zombie.attacks():
  38.         dieRoll = 3*randint(1, 6)
  39.         if dieRoll <= dexterity:
  40.             damage = randint(1, 6)
  41.             mainCharacter.health -= (damage - mainCharacter.armor)
  42.             print("The zombie hits for ", damage)
  43.         if dieRoll > dexterity:
  44.             print("The zombie misses!")
  45.  
  46. class character():
  47.     def __init__(type):
  48.         if type == warrior:
  49.             character.health = 20
  50.             character.dexterity = 11
  51.             character.attacks():
  52.                 dieRoll = 3*randint(1, 6)
  53.                 if dieRoll <= dexterity:
  54.                     damage = randint(1, 6) + 2
  55.                     roomZombie.health -= damage
  56.                     print(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement