repl.it
@MatthewWellingt/

adventure 3

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
answer="N"
while answer=="N":
  class Character(object):
    name=""
    HP=100
    build=""
    weapon=""
    def __init__(self,name,HP,build,weapon):
      self.name=name
      self.HP=HP
      self.build=build
      self.weapon=weapon
  def make_character(name,HP,build,weapon):
    character=Character(name,HP,build,weapon)
    return character 
  mcname=input("what is your name?")
  mcbuild=input("What character do you want to play as?")
  mcweapon=input("What weapon do you want to use?")
  mcHP=100
  MC=make_character(mcname,mcHP,mcbuild,mcHP)
  print("you are",mcname,"your character is",mcbuild,"you will use a/an",mcweapon,)
  answer=input("are you happy with your character? Y/N ")

choiceCAVE=input("You are travelling along a dark and scary road. You see a cave. Go in cave Y/N?")
if choiceCAVE=="Y":
  choiceCHEST=input("you went into the cave and saw a chest. Open chest Y/N?")
  if choiceCHEST=="Y":
    choiceSKELETON=input("you opened the chest and a skeleton jumped out. You can either choose to fight the skeleton, and risk harm for some loot, or ignore it and leave the cave. Do you fight skeleton Y/N")
    if choiceSKELETON=="Y":
      gold=100
      print("You fight him. He is a weak fighter, because he doesn't have any guts. You get 100 gold from his pile of bones. For your bravery you receive",gold,"gold")
    if choiceSKELETON=="N":
      gold=0
      print(". You leave the cave and continue on your path. For your cowardice, you recieve",gold,"gold")
  if choiceCHEST=="N":
    print("You ignored the chest continue on your along the road.")
    
choiceWITCH=input("You continue on your journey on the dark and scary path. You come across a witch under a tree. Do you talk to the witch Y/N?")
if choiceWITCH=="Y":
  choiceSCROLL=input("The witch is impressed with your humble nature. She offers you a scroll of magic. Do you accept Y/N?")
  if choiceSCROLL=="Y":
    choiceRIDDLE=input("You accept the scroll. As soon as you touch it, you turn into a frog. She tells you the only way to escape a lifetime as a frog slave is to answer a riddle. However, if you answer this riddle wrong, you will perish. Do you wish to hear it? Y/N")
    if choiceRIDDLE=="Y":
      choiceRIDDLEANSWER=input("What do you call a witch at a beach? Be warned, I do not accept answers beginning with capital letters.")
      if choiceRIDDLEANSWER=="sandwitch":
        print("you are saved.")
      else:
        print("You die GAME OVER!!!")
        exit()
    if choiceRIDDLE=="N":
      print("the witch was lying to you. The frog was only a temporary state. You die anyway. GAME OVER!!!")
      exit()
  print("the witch wishes you farewell")
print("You nod and continue on your path.")

class enemy(object):
  name="skeleton"
  HP=100
  build="skeleton"
  weapon="build"
  def __init__(self,name,HP,build,weapon):
    self.name=name
    self.HP=HP
    self.build=build
    self.weapon=weapon
def make_enemy(name,HP,build,weapon):
  character=enemy(name,HP,build,weapon)
  return character 
?