import random def castle(): global hall, foyer, artGallery, bedroom, library, diningHall, greatHall, kitchen, garden, cellar, castleNumber hall = 0 foyer = 1 bedroom = 2 artGallery = 3 kitchen = 4 garden = 5 greatHall = 6 diningHall = 7 library = 8 cellar = 9 castleNumber = hall def player(): global plName, plAtt, plDef, plHP plName = input("What is your name?") plAtt = 10 plDef = 13 plHP = 50 def wolf(): global enName, enAtt, enDef, enHP, enDes enName = "Wolf" enAtt = 10 enDef = 4 enHP = 100 enDes = "Tears everything apart, but it defends with nothing but offence. ATTACK: 15 DEFENCE: 4 HEALTH: 100" def Artist(): global enName2, enAtt2, enDef2, enHP2, enDes2 enName2 = "Artist" enAtt2 = 24 enDef2 = 16 enHP2 = 1000 enDes2 = "Nothing comes between an artist and art, INCLUDING YOU, ATTACK: 24, DEFENCE: 16, HEALTH: {HARD TO COMPUTE}... 1000" inCastle = True player() castle() wolf() Artist() while inCastle == True: while castleNumber == hall: print("You can move (from the hall),", plName) moveHall = input("Move [S]outh to leave or [N]orth?") if moveHall == "N": print("It looks to be a cellar") castleNumber = foyer break if moveHall == "S": print("You left, why?") inCastle = False break if moveHall == "L": pass while castleNumber == foyer: encounter = random.randint(1, 2) if encounter == 1: print("A", enName, "attacks!") print(enDes) while enHP >= 0 and plHP >= 0: attack = input("[A]ttack or [D]efend?") enAtt = random.randint(10, 30) if attack == "A": print(plName, "has attacked", enName, "for", plAtt - enDef) enHP -= plAtt - enDef print(enName, "attacked back for", enAtt, plName, "loses", enAtt - plDef, "Health") plHP -= enAtt - plDef print(plName, "has", plHP, "left", enName, "has", enHP, "left") if attack == "D": print(enName, "attacked back for", enAtt, plName, "loses", enAtt - plDef, "Health") plHP = enAtt - plDef if plHP <= 0: print("You have died, to an animal at that.") inCastle = False break if enHP <= 0: print("You cook the wolf meat, make a coat of the fur and sharpen your tool with a tooth... +25 HEALTH, +5 DEFENCE, +1 ATTACK") plHP += 25 plDef += 5 plAtt += 1 encounter = 2 elif encounter == 2: moveHall = input("Move [S]outh to leave, [N]orth, [E]ast, [W]est or [L]ook around?") if moveHall == "L": print("North is the kitchen, East is the art gallery, West is the bedroom") print("You looked around for too long") encounter = 1 if moveHall == "N": print("There's a person audibly moving in that room... WARNING: MINI BOSS AHEAD, PROCEED?") proceed = input("[Y]es? [N]o?") if proceed == "Y": print("Get cookin, your going into a kitchen!") castleNumber = kitchen break elif proceed == "N": print("You step back into the room") castleNumber = foyer break if moveHall == "E": print("You picked up a... paintbrush...") castleNumber = artGallery break if moveHall == "W": print("A blanket lay on the ground, it's messy") castleNumber = bedroom break while castleNumber == artGallery: print(enDes2) while enHP >= 0 and plHP >= 0: attack = input("[A]ttack or [D]efend?") enAtt2 = random.randint(24, 40) if attack == "A": print(plName, "has attacked", enName2, "for", plAtt - enDef2) enHP2 -= plAtt - enDef2 print(enName2, "attacked back for", enAtt2, plName, "loses", enAtt2 - plDef, "Health") plHP -= enAtt2 - plDef print(plName, "has", plHP, "left", enName2, "has", enHP2, "left") if attack == "D": print(enName2, "attacked back for", enAtt2, plName, "loses", enAtt2 - plDef, "Health") plHP = enAtt2 - plDef if plHP <= 0: print("Really? Some paint is what it takes to pull down this 'mighty hero' pathetic.") inCastle = False break if enHP <= 0: print("You found the reason why he had all this health, still dosen't explain the strength... +250 HEALTH, +0 DEFENCE, +0 ATTACK") plHP += 25 plDef += 5 plAtt += 1 encounter = 2 print("This looks cool.")