Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #HERO CLASSES
- #character = ''
- class warrior(object):
- name = 'Warrior'
- health = 150
- attack = 50
- defense = 100
- ranged = 10
- magic = 0
- gold = 0
- class archer(object):
- name = 'Archer'
- health = 125
- attack = 40
- defense = 80
- ranged = 50
- magic = 0
- gold = 0
- class wizard(object):
- name = 'Wizard'
- health = 100
- attack = 30
- defense = 70
- ranged = 20
- magic = 100
- gold = 0
- #ENEMY CLASSES
- class golblin(object):
- health = 50
- attack = 5
- defense = 5
- rarity = 0
- class ghost(object):
- health = 60
- attack = 12
- defense = 6
- rarity = 1
- class dragon(object):
- health = 70
- attack = 10
- defense = 15
- rarity = 2
- class demonDog(object):
- health = 30
- attack = 2
- defense = 2
- rarity = 0
- def inventoryWipe():
- file = open("inventory.txt","w")
- file.close()
- def inventoryShow():
- print("You have the following in your Inventory")
- file = open("inventory.txt","r")
- contents = file.read()
- contents = contents.split(",")
- print(contents)
- #global contents
- length = len(contents)-1
- for i in range(length):
- print(contents[i])
- def lootCheck(lootX):
- file = open("inventory.txt","r")
- contents = file.read()
- contents = contents.split(",")
- if lootX in contents:
- print("You already have this item, so you leave it for another adventurer.")
- else:
- inventory(lootX)
- def inventory(lootX):
- file = open("inventory.txt","a")
- file.write(str(lootX + ","))
- file.close()
- def inventoryDelete(decisionX):
- file = open("inventory.txt","r")
- contents = file.read()
- contents = contents.split(",")
- file.close()
- print(contents)
- if decisionX in contents:
- i = contents.index(decisionX)
- del contents[i]
- print(contents)
- print(decisionX)
- contents = contents[:-1]
- print(contents)
- file = open("inventory.txt","w")
- for x in range (0, len(contents)):
- print(contents[x])
- file.write(contents[x]+",")
- file.close()
- #def start():
- print("But first, who are you.....\n")
- choice = int(input("1. Warrior\n2. Archer\n3. Wizard\n"))
- if choice == 1:
- character = (warrior)
- elif choice == 2:
- character = (archer)
- elif choice == 3:
- character = (wizard)
- #return character
- else:
- print("INVALID CHOICE")
- #start()
- #start()
- print("You are a ", character.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement