Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import random
- '''
- print("________________________")
- print("| |")
- print("________________________")
- print("|")
- print("|")
- print("|")
- print("|")
- print("|")
- print("________")
- print("| |")
- print("|______|")
- print("|")
- print("|")
- print(" atherland")
- print("")
- '''
- playername = input("What is your name?")
- zone = 1
- movement = 0
- restcounter = 0
- searchcounter = 0
- class Player:
- def __init__(self, name, hp, mp, atk, xp, dodgerate, atkrate):
- self.name = playername
- self.hp = hp
- self.mp = mp
- self.atk = atk
- self.xp = xp
- self.dodgerate = dodgerate
- self.atkrate = atkrate
- class Enemy(Player):
- def __init__(self, name, gold, maxhp, hp, mp, atk, xp):
- self.name = name
- self.gold = gold
- self.maxhp = maxhp
- self.hp = hp
- self.mp = mp
- self.atk = atk
- self.xp = xp
- class Items:
- def __init__(self, name, quantity, description, price, weight):
- self.name = name
- self.quantity = quantity
- self.description = description
- self.price = price
- self.weight = weight
- Player = Player(playername, 1, 1, 1, 1, 25, 3)
- print(Player.name + " has been created. ")
- time.sleep(1)
- print("You feel weightless and uneasy. \n A windy sensation is going through \n your entire body.")
- time.sleep(1)
- print("Or atleast what you think is your body. You try to look below yourself and you have no feet or arms!")
- time.sleep(1)
- print("You struggle to comprehend what is going on, and \n in search for what your supposed to be you float towards...")
- time.sleep(1)
- '''
- def raceselection():
- raceinput = input("Do you float towards the TEMPLE, CAVE or FOREST?")
- if raceinput == "TEMPLE":
- print("You are now a high elf. High elves utlize a lot of magical power at the cost of being very frail.")
- Player.hp = Player.hp + 24
- Player.mp = Player.mp + 100
- Player.atk = Player.atk + 50
- print("You awaken from your slumber. Your room's walls are gold plated, and you rested on a flat board.")
- print("Out the door, you see many elves with robes praying to some goddess.")
- print("You walk out of your door and into the praying area. You are immediately greeted by a tall man.")
- elif raceinput == "CAVE":
- print("You are now an orc.")
- Player.hp = Player.hp + 1000
- Player.mp = Player.mp + 15
- Player.atk = Player.atk + 50
- print("cave")
- elif raceinput == "FOREST":
- print("You are now a human.")
- Player.hp = Player.hp + 50
- Player.mp = Player.mp + 25
- Player.atk = Player.atk + 25
- else:
- print("You can't float there!")
- raceselection()
- raceselection()
- '''
- def PlayerAttack():
- while(Enemy.hp > 1):
- time.sleep(atkrate)
- Enemy.hp = Enemy.hp - Player.atk
- print("You attacked the enemy for " + Player.atk + " damage (" + atkrate + ")" + "The enemy has " + Enemy.hp + " left!")
- if (Enemy.hp <= 1):
- print("You have defeated " + Enemy + "!")
- Player.xp += Player.xp + Enemy.xp
- Gold = Gold + Enemy.gold
- del Enemy
- movement = movement + 1
- def EnemyAttack():
- while (PlayerAttack is true):
- time.sleep(enemy.atkrate)
- Player.hp = Player.hp - Enemy.atk
- if (Player.hp <= 1):
- print(Enemy + " has defeated you!")
- print("You have lost the game!")
- exit.os()
- inventory = []
- def gameprompt():
- global inventory
- global zone
- global movement
- global restcounter
- global searchcounter
- if (movement == 5):
- movement = movement - movement
- zone = zone + 1
- print("You have advanced to zone",zone,"!!!")
- gameprompt()
- if (zone == 1):
- print("Welcome to the first zone! Easy enemies are here with not very good loot./fix grammar, add description of zone/")
- elif (zone == 2):
- print("Hey, it actually travelled to the second zone, awesome!")
- elif (zone == 3):
- print("Zone 3")
- elif (zone == 4):
- print("You are now in Zone 4")
- prompt = input("Would you like to walk, search or rest?: ")
- if (prompt == "walk"):
- encounterchance = random.randint(1, 3)
- if (encounterchance == 2):
- if (zone == 1):
- mobspawnrate = random.randint(1,3)
- if (mobspawnrate == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 2):
- mobspawnrate2 = random.randint(1,3)
- if (mobspawnrate2 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate2 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate2 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 3):
- mobspawnrate3 = random.randint(1,3)
- if (mobspawnrate3 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate3 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate3 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 4):
- mobspawnrate4 = random.randint(1,3)
- if (mobspawnrate4 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate4 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate4 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 5):
- mobspawnrate3 = random.randint(1,3)
- if (mobspawnrate5 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate5 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate5 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 6):
- mobspawnrate4 = random.randint(1,3)
- if (mobspawnrate6 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate6 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate6 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 7):
- mobspawnrate7 = random.randint(1,3)
- if (mobspawnrate7 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate7 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate7 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 8):
- mobspawnrate8 = random.randint(1,3)
- if (mobspawnrate8 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate8 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate8 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 9):
- mobspawnrate9 = random.randint(1,3)
- if (mobspawnrate9 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate9 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate9 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- if (zone == 10):
- mobspawnrate10 = random.randint(1,3)
- if (mobspawnrate10 == 1):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate10 == 2):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- elif (mobspawnrate10 == 3):
- Enemy = Enemy("Blue SlimeBall", 50, 0, 25, 15, 25, 0.500)
- print("You have encountered a " + Enemy.name + "!!!")
- PlayerAttack()
- EnemyAttack()
- else:
- movement = movement + 1
- print("You have walked a step. You are now at ",movement," steps")
- gameprompt()
- elif (prompt == "search"):
- if (searchcounter == 3):
- print("You cannot search this area anymore! Wait until you reach the next zone!")
- gameprompt()
- else:
- searchchance = random.randint(1, 5)
- if (searchchance == 1 or 2 or 3 or 4):
- searchcounter = searchcounter + 1
- print(searchcounter)
- print("You have found something!")
- searchchance = random.randint(1,4)
- if (searchchance == 1 or 2):
- inventory.append(Items("Old Boot", 1, "An old smelly boot. It's a mystery as to who it belongs to...", 5, 50))
- print("You have found a Boot!")
- print(inventory)
- elif(searchchance == 3):
- inventory.append(Items("Shiny Boot", 1, "Looks like a boot that was lightly worn. You could still wear this.", 5, 50))
- print(inventory)
- print("You have found a Shiny Boot!")
- elif(searchchance == 4):
- inventory.append(Items("Golden Boot", 1, "It's too heavy to wear, but it looks like it could sell for a fortune!", 5, 50))
- print("You have found a Golden Boot?")
- print(inventory)
- else:
- searchcounter = searchcounter + 1
- print(searchcounter)
- print("You did not find anything of value")
- gameprompt()
- elif (prompt == "rest"):
- if (restcounter == 1):
- print("Wait until you reach the next zone to rest again!")
- gameprompt()
- else:
- # Add a MaxHP value to the player later, and the command rest will give 25% of that HP back.
- Player.hp = Player.hp + (Player.hp / 5)
- print("You have restored ",(Player.hp / 5)," hit points!")
- restcounter = restcounter + 1
- gameprompt()
- elif (prompt == "examine"):
- print([item.name for item in inventory])
- gameprompt()
- gameprompt()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement