Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #DungeonAdventureWizardLegendQuest v1.0
- #Written February 2011
- # A text based single player adventure game, where the player
- #plays a warrior or wizard fighting their way through a
- #dungeon filled with zombies.
- from random import *
- from time import *
- def characterCreate():
- playerName = input("Enter your name: ")
- playerType = input("Welcome ", playerName, ",\nChoose your character: \n1 - Warrior \n2 - Wizard")
- if playerType == 1:
- mainCharacter = character(warrior)
- print("You have chosen to play a warrior.")
- elif playerType == 2:
- mainCharacter = character(wizard)
- print("You have chosen to play a wizard")
- print("Your adventure has now begun...")
- **************************************************************
- Not sure about the fight sequncing/new room programming. Once character and zombie
- objects are done it can be refined and simplified
- **************************************************************
- def newRoom():
- if roomNumber = 0:
- print("You are inside a room deep within the wizard's dungeon.")
- print("Suddenly, a foul zombie leaps out and attacks!")
- elif :
- print("You go down a passage into the next room.")
- print("Suddenly, a foul zombie leaps out and attacks!")
- fightDecision = input("What do you do? \n1 - Fight! \n2 - Run Away!")
- if fightDecision == 1:
- ****************************************************************
- class zombie():
- zombie.health = 2*randint(1, 6)
- zombie.dexterity = 11
- zombie.attacks():
- dieRoll = 3*randint(1, 6)
- if dieRoll <= dexterity:
- damage = randint(1, 6)
- mainCharacter.health -= (damage - mainCharacter.armor)
- print("The zombie hits for ", damage)
- if dieRoll > dexterity:
- print("The zombie misses!")
- class character():
- def __init__(type):
- if type == warrior:
- character.health = 20
- character.dexterity = 11
- character.attacks():
- dieRoll = 3*randint(1, 6)
- if dieRoll <= dexterity:
- damage = randint(1, 6) + 2
- roomZombie.health -= damage
- print(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement