#EPIC GAME #this program was made by Andrew Machkasov from 06/02/2014 to ??/??/20?? import random import time class Person: def __init__(self): self.coin = 120 self.health = 20 self.maxhealth = 20 self.attack = 1 self.defence = [2,0,0,0,0,0,1,0,0,0] self.armoring = 0 self.xp = 0 self.level = 1 def get_coin(self): return self.coin def set_coin(self,new): self.coin = new def get_health(self): return self.health def set_health(self,new): self.health = new def get_maxhealth(self): return self.maxhealth def set_maxhealth(self,new): self.maxhealth = new def get_attack(self): return self.attack def set_attack(self,new): self.attack = new def get_defence(self,index): return self.defence[index] def set_defence(self,new,index): self.defence[index] = new def get_armoring(self): return self.armoring def set_armoring(self,new): self.armoring = new def get_xp(self): return self.xp def set_xp(self,new): self.xp = new def get_level(self): return self.level def set_level(self,new): self.level = new class Items: def __init__(self): #RefScript S1 K1 Sp1 Sc1 P1 S2 D1 Si1 M1 C1 O1 K2 S3 F1 Sc2 Sp2 O2 P2 C2 S4 F2 St1 K3 S5 St2 S6 M2 L2 L1 self.itemsname = ["wood sword","shale knife","blunt spear","ghouls scimitar","wood pick","rusty sword","cursed dagger","bronze sickle","wood mace","osmium club","radiant orb","flint knife","worn sword","spiked flail","goblin scimitar","flint spear","scratched orb","rusty pick","burning club","bronze sword","lead flail","oak staff","poisoned knife","iron sword","maple staff","husk sword","frozen mace","trypon sword","aanrok sword"] #RefScript S1, K1,Sp1, Sc1, P1, S2, D1, Si1, M1, C1, O1, K2, S3, F1, Sc2, Sp2, O2, P2, C2, S4, F2, St1, K3, S5, St2, S6, M2, L2 L1 self.weaponhit1 = [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 3, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 3, 3] self.weaponhit2 = [ 3, 2, 4, 3, 2, 3, 3, 5, 5, 5, 3, 3, 4, 4, 4, 5, 4, 3, 4, 5, 6, 4, 4, 5, 5, 6, 6, 6, 5] self.weaponsmash1 = [ 2, 4, 3, 2, 2, 3, 3, 2, 8, 4, 5, 7, 4, 4, 8, 7, 3, 4, 4, 5, 10, 8, 13, 11, 9, 13, 14, 11, 6] self.weaponsmash2 = [ 6, 7, 5, 4, 6, 9, 6, 9, 19, 9, 8, 13, 12, 11, 13, 17, 13, 10, 12, 15, 18, 16, 22, 19, 16, 21, 25, 17, 9] self.itemslevel = [ 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 100, 100] self.itemsdur = [40, 65, 35, 45, 30, 55, 70, 85, 50, 460, 100, 80, 70, 20, 80, 40, 30, 60, 45, 85, 105, 70, 100, 110, 85, 125, 75, 200, 200] self.itemscost = [50, 30, 35, 95, 75, 115, 135, 180, 135, 120, 205, 140, 165, 95, 245, 100, 155, 165, 125, 230, 305, 170, 290, 285, 230, 250, 385, 0, 0] self.items = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] #RefScript S1 K1 Sp1 Sc1 P1 S2 D1 Si1 M1 C1 O1 K2 S3 F1, Sc2 Sp2 O2 P2 C2 S4 F2 St1 K3 S5 St2 S2 M2 L2 L1 self.weapontype = ["normal","normal","normal","fire","normal","normal","death","normal","normal","death","light","normal","normal","venom","normal","normal","light","normal", "fire","normal","normal","normal","venom","normal","normal","death","frost","frost","shock"] self.weaponability =[ "ong-s", "crit", "hcrit","vamp", "inst", "crit", "vamp", "inst", "none", "none","ong-s", "crit", "none","ong-m", "inst", "crit", "vamp", "icrit","ong-s", "inst", "hcrit", "none","ong-s", "none", "none","icrit", "stun","icrit", "stun"] self.typeidentity = ["normal","venom","fire","frost","acid","death","light","shock","sound","cheat"] def get_items(self,index): return self.items[index] def set_items(self,new,index): self.items[index] = new def get_itemsname(self,index): return self.itemsname[index] def get_weaponhit1(self,index): return self.weaponhit1[index] def get_weaponhit2(self,index): return self.weaponhit2[index] def get_weaponsmash1(self,index): return self.weaponsmash1[index] def get_weaponsmash2(self,index): return self.weaponsmash2[index] def get_itemslevel(self,index): return self.itemslevel[index] def get_itemsdur(self,index): return self.itemsdur[index] def get_itemscost(self,index): return self.itemscost[index] def get_weapontype(self,index): return self.weapontype[index] def get_weaponability(self,index): return self.weaponability[index] def get_typeidentity(self,index): return self.typeidentity[index] def get_len_items(self): return len(self.items) class Armor: def __init__(self): self.armorequipped = -1 #RefScript C1 S1 C2 L1 S1 H1 H2 L2 M1 self.armorname = ["cloth armor", "silk armor", "quick cloth armor","leather armor","white salamander armor","deerhide armor","bearhide armor","gnarl leather armor","chainmail armor"] self.armorability = [ "none", "heal-small", "miracle", "high-dur", "heal-small", "none", "ong-reduce", "miracle", "none"] #RefScript C1, S1, C2, L1, S1, H1, H2, L2, M1, self.armordef = [ 2, 1, 3, 5, 0, 7, 8, 10, 14] self.armorlevel = [ 1, 2, 3, 4, 4, 6, 7, 9, 11] self.armordur = [120, 150, 135, 180, 230, 160, 175, 245, 300] self.armorcost = [ 35, 70, 110, 125, 185, 140, 150, 230, 420] self.armor = [ 0, 0, 0, 0, 0, 0, 0, 0, 0] def get_armorequipped(self): return self.armorequipped def set_armorequipped(self,new): self.armorequipped = new def get_armor(self,index): return self.armor[index] def set_armor(self,new,index): self.armor[index] = new def get_armorname(self,index): return self.armorname[index] def get_armordef(self,index): return self.armordef[index] def get_armorlevel(self,index): return self.armorlevel[index] def get_armordur(self,index): return self.armordur[index] def get_armorcost(self,index): return self.armorcost[index] def get_armorability(self,index): return self.armorability[index] def get_len_armor(self): return len(self.armor) class Utility: def __init__(self): self.holding = 0 self.utility = [0,0,0,0] self.utilityname = ["small pouch","average pouch","mediocre pouch","large pouch"] self.utilityhold = [20,50,100,300] self.utilitycost = [25,60,115,220] self.utilitylevel = [1,2,4,9] def get_utility(self,index): return self.utility[index] def set_utility(self,new,index): self.utility[index] = new def get_utilityname(self,index): return self.utilityname[index] def get_utilityhold(self,index): return self.utilityhold[index] def get_utilitycost(self,index): return self.utilitycost[index] def get_utilitylevel(self,index): return self.utilitylevel[index] def get_len_utility(self): return len(self.utility) def get_holding(self): return self.holding def set_holding(self,new): self.holding = new class Berry: def __init__(self): self.berry = [0,0,0,0,0,0,0] self.berryname = ["red berries", "yellow berries", "dotted berries", "green berries","red fungi","glowing fungi","phosphlorecent fungi"] self.berryh = [1 , 5,10,15,20,25,120] self.berrym = [15,20,30,40,45,65,460] def get_berry(self,index): return self.berry[index] def set_berry(self,new,index): self.berry[index] = new def get_berryname(self,index): return self.berryname[index] def get_berryh(self,index): return self.berryh[index] def get_berrym(self,index): return self.berrym[index] def get_len_berry(self): return len(self.berry) class Potion: def __init__(self): self.potionname = ["health","recovery","weak light resistence","weak venom resistence","weak fire resistence"] self.potionsp = [ "heal", "heal", "resist", "resist", "resist"] self.potionscript = [ 0, 0, 6, 1, 2] self.potionval1 = [ 5, 20, 1, 1, 1] self.potionval2 = [ 20, 65, 2, 2, 2] self.potionlevel = [ 2, 8, 8, 8, 8] self.potioncost = [ 40, 120, 145, 145, 145] def get_potionname(self,index): return self.potionname[index] def get_potionsp(self,index): return self.potionsp[index] def get_potionval1(self,index): return self.potionval1[index] def get_potionval2(self,index): return self.potionval2[index] def get_potionlevel(self,index): return self.potionlevel[index] def get_potioncost(self,index): return self.potioncost[index] def get_potionscript(self,index): return self.potionscript[index] def get_len_potion(self): return len(self.potionname) class Boons: def __init__(self): self.Boonname = ["goblins trophy case","goblins golden helm","goblins treasure chest","aanrok sword"] self.Boontype = [ "money", "money", "money", "weapon"] self.Boonval1 = [ 120, 200, 380, 1] self.Boonval2 = [ 350, 465, 1080, 0] def get_Boonname(self,index): return self.Boonname[index] def get_Boonval1(self,index): return self.Boonval1[index] def get_Boonval2(self,index): return self.Boonval2[index] def get_Boontype(self,index): return self.Boontype[index] def get_len_Boon(self): return len(self.Boonname) class LevelUp: def __init__(self): self.LevelUpLevel = [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] self.LevelUpXp = [24, 30, 42, 60, 124, 144, 192, 256, 320, 365, 415, 490, 550, 640, 760, 880, 1000, 1000000] self.LevelUpAttack = [ 1, 0, 1, 0, 2, 0, 1, 0, 1, 2, 1, 0, 0, 1, 0, 1, 1, 0] self.LevelUpDefence = [ 1, 1, 0, 1, 2, 1, 0, 1, 1, 0, 2, 0, 1, 0, 1, 1, 1, 0] self.LevelUpHealth = [ 5, 7, 10, 16, 30, 21, 24, 27, 30, 30, 35, 50, 25, 30, 30, 35, 75, 0] self.LevelUpNotice = 0 def get_LevelUpLevel(self,index): return self.LevelUpLevel[index] def get_LevelUpXp(self,index): return self.LevelUpXp[index] def get_LevelUpAttack(self,index): return self.LevelUpAttack[index] def get_LevelUpDefence(self,index): return self.LevelUpDefence[index] def get_LevelUpHealth(self,index): return self.LevelUpHealth[index] def get_LevelUpNotice(self): return self.LevelUpNotice def get_len_LevelUpLevel(self): return len(self.LevelUpLevel) class Dungeons: def __init__(self): self.DungeoneeringProb1 = [1] self.DungeoneeringProb2 = [2] self.DungeoneeringProb3 = [3] self.DungeoneeringEncounter1 = ["1"] self.DungeoneeringEncounter2 = ["2"] self.DungeoneeringEncounter3 = ["3"] self.DungeoneeringBerries = ["b"] self.DungeoneeringBoon = ["b"] def DungeonDeepTimbercreak(self): self.DungeoneeringProb1 = [6,4,5,6,4,6,5,6,4,4] self.DungeoneeringProb2 = [8,8,8,11,8,10,12,11,10,9] self.DungeoneeringProb3 = [14,14,10,16,15,17,17,16,16,16] self.DungeoneeringEncounter1 = ["goblin warrior","goblin warrior","goblin slinger","goblin thrasher","goblin thrasher","goblin spearman","goblin warchief","goblin warchief","goblin warchief","goblin warchief"] self.DungeoneeringEncounter2 = ["goblin slinger","goblin slinger","goblin thrasher","goblin spearman","goblin spearman","goblin warchief","aakorther wildbeast","aakorther wildbeast","aakorther wildbeast","dire rat swarm"] self.DungeoneeringEncounter3 = ["goblin thrasher","goblin thrasher","goblin spearman","aakorther wildbeast","aakorther wildbeast","aakorther wildbeast","dire rat swarm","dire rat swarm","dire rat swarm","goblin strangler"] self.DungeoneeringBerries = ["red berries","yellow berries","yellow berries","yellow berries","dotted berries","yellow berries","dotted berries","green berries","green berries","green berries"] def DungeonTimbercreakCave(self): self.DungeoneeringProb1 = [6,4,4,6,4,6,7,6,4,4,5,5] self.DungeoneeringProb2 = [8,8,7,11,8,10,12,11,10,10,11,9] self.DungeoneeringProb3 = [14,14,12,16,15,17,17,16,16,16,15,16] self.DungeoneeringEncounter1 = ["goblin strangler","goblin strangler","goblin strangler","goblin swordsman","goblin swordsman","goblin lafar lineman","goblin lafar lineman","goblin lafar lineman","goblin phalanx soldier","goblin phalanx soldier","goblin lafar archerer","goblin lafar archerer"] self.DungeoneeringEncounter2 = ["goblin swordsman","goblin swordsman","goblin swordsman","goblin lafar lineman","goblin lafar lineman","goblin phalanx soldier","goblin phalanx soldier","goblin phalanx soldier","goblin lafar archerer","goblin lafar archerer","goblin lafar commander","goblin lafar commander"] self.DungeoneeringEncounter3 = ["goblin lafar lineman","goblin lafar lineman","goblin lafar lineman","goblin phalanx soldier","goblin phalanx soldier","goblin lafar archerer","goblin lafar archerer","goblin lafar archerer","goblin lafar commander","goblin lafar commander","goblin lafar treasurer","goblin lafar treasurer"] self.DungeoneeringBerries = ["red fungi","red fungi","red fungi","red fungi","red fungi","red fungi","glowing fungi","glowing fungi","glowing fungi","glowing fungi","phosphlorecent fungi","phosphlorecent fungi"] self.DungeoneeringBoon = ["goblins trophy case","goblins trophy case","goblins trophy case","goblins golden helm","aanrok sword","goblins golden helm","goblins golden helm","goblins trophy case","goblins golden helm","aanrok sword","goblins treasure chest","goblins treasure chest"] def get_DungeoneeringProb1(self,index): return self.DungeoneeringProb1[index] def get_DungeoneeringProb2(self,index): return self.DungeoneeringProb2[index] def get_DungeoneeringProb3(self,index): return self.DungeoneeringProb3[index] def get_DungeoneeringEncounter1(self,index): return self.DungeoneeringEncounter1[index] def get_DungeoneeringEncounter2(self,index): return self.DungeoneeringEncounter2[index] def get_DungeoneeringEncounter3(self,index): return self.DungeoneeringEncounter3[index] def get_DungeoneeringBerries(self,index): return self.DungeoneeringBerries[index] def get_DungeoneeringBoon(self,index): return self.DungeoneeringBoon[index] class Enemy: def __init__(self): self.enemyH = 15 self.enemyA = [1,2,1,3,2,4,2,6] self.enemyT = 1 self.enemyD = [2,0,0,0,0,0,0,0,0,0] self.enemyW = [22,28,57,105] self.enemyS = "fire" self.enemyE = "none" self.enemy = "Amburger Ghoul" self.EA = 0 self.hardcore = 0 # level 1, level 1, level 2, level 3, level 4, level 5, level 5, level 5, level 6, level 6, level 7, level 8, level 9, level 9, level 10, level 10, self.enemy_list = [ "goblin slinger", "goblin warrior", "goblin thrasher", "goblin spearman", "aakorther wildbeast", "goblin warchief", "dire rat swarm", "goblin strangler", "goblin swordsman", "goblin lafar lineman", "goblin phalanx soldier", "goblin lafar archerer", "goblin lafar commander", "goblin lafar treasurer", "marlek gaurdian", "marlek"] self.enemyH1_list = [ 12, 10, 15, 26, 31, 36, 35, 38, 42, 45, 47, 63, 63, 71, 72, 256] self.enemyH2_list = [ 18, 15, 25, 42, 45, 46, 62, 57, 64, 54, 71, 74, 75, 86, 95, 295] self.enemyA_list = [ [1,2,1,4,1,3,3,7], [1,2,1,3,1,3,2,5], [1,3,1,4,2,5,3,8], [1,3,2,4,2,7,5,12], [1,3,2,4,2,6,8,13], [2,4,2,5,3,6,4,10], [1,3,2,4,2,7,10,16], [1,3,2,5,2,7,12,18], [1,3,2,5,2,7,12,17], [1,4,2,5,2,8,13,17], [1,3,2,5,3,8,14,18], [1,4,2,5,2,8,16,24], [1,4,2,5,2,8,16,24], [1,4,2,5,3,13,19,29], [1,4,2,5,3,13,25,32], [1,4,2,5,8,17,34,42]] self.enemyT_list = [ 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 6, 6, 7, 7] self.enemyD_list = [ [1,0,2,0,0,0,0,0,0,0], [1,0,2,0,0,0,0,0,0,0], [2,0,2,0,0,0,0,0,0,0], [2,0,2,0,0,0,0,0,0,0], [4,2,0,0,0,1,0,0,0,0], [4,0,2,0,0,0,0,0,0,0], [4,1,0,0,1,2,-4,0,0,0], [2,0,2,0,0,0,0,0,0,0], [4,0,2,0,0,0,0,0,0,0], [5,0,2,0,0,0,0,0,0,0], [5,0,2,0,0,0,0,0,0,0], [5,0,2,0,0,0,0,0,0,0], [5,0,2,0,0,0,0,0,0,0], [6,0,2,0,0,0,0,0,0,0], [7,0,3,0,0,0,0,0,0,0],[12,4,9,4,4,4,4,4,4,0]] self.enemyW_list = [ [7,13,26,40], [4,10,18,36], [10,17,30,53], [13,17,42,59], [15,25,46,57], [28,35,53,178], [16,28,56,75], [20,32,58,93], [22,34,65,103], [25,39,84,110], [27,42,73,119], [28,41,94,135], [29,43,104,138], [32,56,226,450], [32,56,0,0], [107,185,374,804]] self.enemyS_list = [ "normal", "normal", "normal", "normal", "normal", "normal", "death", "normal", "normal", "normal", "normal", "venom", "normal", "normal", "fire", "fire"] self.enemyE_list = [ "none", "none", "none", "crit", "none", "none", "ong-s", "crit", "hcrit", "icrit", "none", "icrit", "ong-s", "ong-s", "hcrit", "ong-m"] def get_enemyH(self): return self.enemyH def set_enemyH(self,new): self.enemyH = new def get_enemyA(self,index): return self.enemyA[index] def get_enemyT(self): return self.enemyT def get_enemyD(self,index): return self.enemyD[index] def get_enemyW(self,index): return self.enemyW[index] def get_enemyS(self): return self.enemyS def get_enemyE(self): return self.enemyE def get_enemy(self): return self.enemy def get_EA(self): return self.EA def set_EA(self,new): self.EA = new def activate_hardcore(self): self.hardcore = 1 def identifygoblin (self,name): self.enemy = name print("you come across a {}!\n\n\n\n").format(self.enemy) #"Hello {}, my name is {}".format('john', 'mike') raw_input("") for enemyname in range(0,len(self.enemy_list)): if self.enemy == self.enemy_list[enemyname]: self.enemyH = random.randint(self.enemyH1_list[enemyname],self.enemyH2_list[enemyname]) self.enemyA = self.enemyA_list[enemyname] self.enemyT = self.enemyT_list[enemyname] self.enemyD = self.enemyD_list[enemyname] self.enemyW = self.enemyW_list[enemyname] self.enemyS = self.enemyS_list[enemyname] self.enemyE = self.enemyE_list[enemyname] """ if self.hardcore > 0: self.enemyH = self.enemyH * 2 self.enemyA[4] = self.enemyA[4] * 2 self.enemyA[5] = self.enemyA[5] * 2 #self.enemyA[6] = self.enemyA[6] * 2 #self.enemyA[7] = self.enemyA[7] * 2 self.enemyT = self.enemyT + 4 self.enemyW[0] = self.enemyW[0] * 3 self.enemyW[1] = self.enemyW[1] * 3 self.enemyW[2] = self.enemyW[2] * 3 self.enemyW[3] = self.enemyW[3] * 3 """ #Constructors user = Person() weapon = Items() protection = Armor() pouch = Utility() heal = Berry() leveling = LevelUp() villain = Enemy() unknown = Dungeons() extra = Potion() gifts = Boons() #stuff hitting = 0 smashing = 0 armordamage = 0 weapondamage = 0 search = 0 twang = 0 boonvalue = 0 LevelUpNotice = 0 questdeeptimbercreak = 0 questtimbercreakcave = 0 DungeoneeringCommand = "" closefar = "" first = 0 depth = 0 x = 1 grandx = 1 #Fight Function def fightgoblin(villain,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal): enemyongoingdamage = 0 enemyhasnowbeenstunned = 0 playerongoingdamage = 0 playerhasnowbeenstunned = 0 while villain.get_enemyH() > 0 and user.get_health() >= 0: #start print "\nyou have", user.get_health(), "health" print "the", villain.get_enemy(), "has", villain.get_enemyH(), "health\n" raw_input("") #your attack if playerhasnowbeenstunned == 1: raw_input("you have been stunned and cannot attack") playerhasnowbeenstunned = 0 else: twang = 0 fighting = raw_input("press help or attack") fighting = fighting.lower() for search in range(0,weapon.get_len_items()): if fighting == weapon.get_itemsname(search): if weapon.get_items(search) >= 1: twang = 2 weaponused = search hitting = random.randint(weapon.get_weaponhit1(search),weapon.get_weaponhit2(search)) smashing = random.randint(weapon.get_weaponsmash1(search),weapon.get_weaponsmash2(search)) weapondamage = random.randint(2,7) weapon.set_items(weapon.get_items(search) - weapondamage,search) if weapon.get_items(search) < 1: print "your", weapon.get_itemsname(search), "was destroyed" else: print "you do not have that weapon" for search in range(0,heal.get_len_berry()): if fighting == heal.get_berryname(search): if heal.get_berry(search) > 0: twang = 1 hitting = 0 smashing = 0 user.set_health(user.get_health() + heal.get_berry(search)) pouch.set_holding(pouch.get_holding() + heal.get_berry(search)) if user.get_health() > user.get_maxhealth(): heal.set_berry(user.get_health() - user.get_maxhealth(),search) pouch.set_holding(pouch.get_holding() - (user.get_health() - user.get_maxhealth())) user.set_health(user.get_maxhealth()) print "you healed to full health" else: print "you gained", heal.get_berry(search), "health" heal.set_berry(0,search) else: print "you do not have that berry" if fighting == "help": print "you have a" print "\tunarmed attack" for search in range(0,weapon.get_len_items()): if weapon.get_items(search) > 0: print "\t", weapon.get_itemsname(search) for search in range(0,heal.get_len_berry()): if heal.get_berry(search) > 0: print "\t", heal.get_berry(search), heal.get_berryname(search) hitting = 0 smashing = 0 elif fighting == "unarmed attack": hitting = random.randint(1,user.get_level() + 1) smashing = random.randint(1,user.get_level() + 2) twang = 3 elif fighting == "cheat number nuke this stuff qwerty": hitting = 9001 smashing = 9001 enemyhasnowbeenstunned = 2 twang = 3 elif fighting == "cheat number what in the name of ?????": user.set_health(user.get_maxhealth() + 10) hitting = 0 smashing = 0 twang = 1 else: if twang == 0: print "\nyou fumbled" hitting = 0 smashing = 0 #damaging enemy if twang == 2: hitting = hitting + user.get_attack() smashing = smashing + user.get_attack() criticalhit = random.randint(1,20) whatdamagetype = 0 for search in range(0,10): if weapon.get_weapontype(weaponused) == weapon.get_typeidentity(search): whatdamagetype = search if hitting > villain.get_enemyD(0): if weapon.get_weaponability(weaponused) == "crit": criticalhit = criticalhit + 2 if weapon.get_weaponability(weaponused) == "icrit": criticalhit = criticalhit + 5 elif weapon.get_weaponability(weaponused) == "inst": if criticalhit == 20: smashing = 9001 raw_input("\n\n\n\n\n\n\n\n\t\tinstiKILL") enemyhasnowbeenstunned = 2 criticalhit = 1 elif weapon.get_weaponability(weaponused) == "ong-s": enemyongoingdamage = random.randint(weapon.get_itemslevel(weaponused),weapon.get_itemslevel(weaponused) + 4) elif weapon.get_weaponability(weaponused) == "ong-m": enemyongoingdamage = random.randint(weapon.get_itemslevel(weaponused) + 3,weapon.get_itemslevel(weaponused) + 10) elif weapon.get_weaponability(weaponused) == "vamp": if user.get_health() != user.get_maxhealth(): user.set_health(user.get_health() + smashing/2) if user.get_health() >= user.get_maxhealth(): user.set_health(user.get_maxhealth()) print "you healed to max health because of your", weapon.get_itemsname(weaponused) else: print "you healed by", smashing/2, "because of your", weapon.get_itemsname(weaponused) elif weapon.get_weaponability(weaponused) == "stun": if criticalhit > 13: print "the enemy was stunned" enemyhasnowbeenstunned = 1 if criticalhit >= 19: print "you scored a critical hit!!!" if weapon.get_weaponability(weaponused) == "hcrit": smashing = smashing + (user.get_level() * 5) else: smashing = smashing + (user.get_level() * 3) if whatdamagetype != 0: smashing = smashing - villain.get_enemyD(whatdamagetype) if smashing < 0: smashing = 0 if villain.get_enemyD(whatdamagetype) > 0: print "the", villain.get_enemy(), "has a resistance to your attack!" print "you delt",villain.get_enemyD(whatdamagetype), "less damage" elif villain.get_enemyD(whatdamagetype) < 0: yo = villain.get_enemyD(whatdamagetype) yo = yo * -1 print "the", villain.get_enemy(), "has a vunerability to your attack!" print "you delt", yo, "more damage" villain.set_enemyH(villain.get_enemyH() - smashing) print "you dealt", smashing, weapon.get_weapontype(weaponused), "damage to the", villain.get_enemy() else: print "you missed!!" elif twang == 3: hitting = hitting + user.get_attack() smashing = smashing + user.get_attack() criticalhit = random.randint(1,20) if criticalhit >= 19: print "you scored a critical hit!!!" smashing = smashing + (user.get_level() * 3) villain.set_enemyH(villain.get_enemyH() - smashing) print "you dealt", smashing, "damage to the", villain.get_enemy() if playerongoingdamage > 0: print "\n" print "you took", playerongoingdamage, "ongoing damage" playerongoingdamage = playerongoingdamage - random.randint(user.get_level()/4,user.get_level()/4 + 3) raw_input("") if playerongoingdamage <= 0: print "you have been saved from the damage" playerongoingdamage = 0 user.set_health(user.get_health() - playerongoingdamage) raw_input("") #enemy attack if enemyhasnowbeenstunned == 1: enemyhasnowbeenstunned = 0 raw_input("the enemy is stunned and cannot attack") elif enemyhasnowbeenstunned == 2: enemyhasnowbeenstunned = 0 else: villain.set_EA(random.randint(1,4)) if villain.get_EA() == 1: hitting = random.randint(villain.get_enemyA(0),villain.get_enemyA(1)) smashing = random.randint(villain.get_enemyA(2),villain.get_enemyA(3)) else: hitting = random.randint(villain.get_enemyA(4),villain.get_enemyA(5)) smashing = random.randint(villain.get_enemyA(6),villain.get_enemyA(7)) hitting = hitting + villain.get_enemyT() smashing = smashing + villain.get_enemyT() criticalhit = random.randint(1,20) whatdamagetype = 0 for search in range(0,10): if villain.get_enemyS() == weapon.get_typeidentity(search): whatdamagetype = search if hitting > user.get_defence(0): if villain.get_enemyE() == "crit": criticalhit = criticalhit + 2 if villain.get_enemyE() == "icrit": criticalhit = criticalhit + 5 elif villain.get_enemyE() == "ong-s": playerongoingdamage = random.randint(villain.get_enemyT(),villain.get_enemyT() + 4) elif villain.get_enemyE() == "ong-m": playerongoingdamage = random.randint(villain.get_enemyT() + 3,villain.get_enemyT() + 10) elif villain.get_enemyE() == "stun": if criticalhit > 13: print "you were stunned" playerhasnowbeenstunned = 1 if criticalhit >= 19: print "the", villain.get_enemy(), "scored a critical hit!!!" if villain.get_enemyE() == "hcrit": smashing = smashing + (villain.get_enemyT() * 4) else: smashing = smashing + (villain.get_enemyT() * 2) if whatdamagetype != 0: smashing = smashing - user.get_defence(whatdamagetype) if smashing < 0: smashing = 0 if user.get_defence(whatdamagetype) > 0: print "You have resistance to the", villain.get_enemy(), "attack!" print "the", villain.get_enemy(), "dealt", user.get_defence(whatdamagetype), "less damage" #armor if protection.get_armorequipped() >= 0: smashing = smashing - protection.get_armordef(protection.get_armorequipped()) if smashing < 0: smashing = 0 if protection.get_armorability(protection.get_armorequipped()) == "high-dur": if hitting > user.get_defence(0): armordamage = random.randint(3,8) else: armordamage = 0 else: armordamage = random.randint(3,8) protection.set_armor(protection.get_armor(protection.get_armorequipped()) - armordamage,protection.get_armorequipped()) if protection.get_armor(protection.get_armorequipped()) < 1: print "your",protection.get_armorname(protection.get_armorequipped()),"was destroyed\n" somethingisequipped = 0 for search in range(0,protection.get_len_armor()): if protection.get_armor(search) > 0: protection.set_armorequipped(search) somethingisequipped = 1 if somethingisequipped == 0: protection.set_armorequipped(-1) else: print "your", protection.get_armorname(protection.get_armorequipped()), "was equipped\n" if protection.get_armorability(protection.get_armorequipped()) == "heal-small": if user.get_health() < user.get_maxhealth(): user.set_health(user.get_health() + protection.get_armorlevel(protection.get_armorequipped())) if user.get_health() < user.get_maxhealth(): print "you were healed", protection.get_armorlevel(protection.get_armorequipped()), "health because of your armor" else: user.set_health(user.get_maxhealth()) print "you where healed to full health beacuase of your armor" if protection.get_armorability(protection.get_armorequipped()) == "miracle": armormiracle = random.randint(1,20) if armormiracle >= 19: raw_input("\n\nyou where miraculously saved by your armor!!!\n") smashing = 0 if hitting > user.get_defence(0): user.set_health(user.get_health() - smashing) print "the", villain.get_enemy(), "dealt", smashing, villain.get_enemyS(), "damage to you" else: print "the", villain.get_enemy(), " missed!!" raw_input("\n") if enemyongoingdamage > 0: print "\n\n" villain.set_enemyH(villain.get_enemyH() - enemyongoingdamage) print "the", villain.get_enemy(), "took", enemyongoingdamage, "ongoing damage" enemyongoingdamage = enemyongoingdamage - random.randint(villain.get_enemyT()/3,villain.get_enemyT()/3 + 2) raw_input("") if enemyongoingdamage <= 0: print "the", villain.get_enemy(), "saved from the damage" enemyongoingdamage = 0 #resolve if villain.get_enemyH() <= 0: print "you killed the", villain.get_enemy() winxp = random.randint(villain.get_enemyW(0),villain.get_enemyW(1)) wincoin = random.randint(villain.get_enemyW(2),villain.get_enemyW(3)) user.set_coin(user.get_coin() + wincoin) user.set_xp(user.get_xp() + winxp) print "you gained", wincoin, "coins and", winxp, "xp" if user.get_health() < 0: print "you died!" user.set_coin(0) user.set_xp(0) user.set_health(user.get_maxhealth()) raw_input("") #end of the fight function #Function of the dungons of awesome def EnterDungeon(depth,unknown,villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,heal,pouch): room = random.randint(1,20) #goblin room if room <= unknown.get_DungeoneeringProb1(depth - 1): villian.identifygoblin(unknown.get_DungeoneeringEncounter1(depth - 1)) fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) elif room <= unknown.get_DungeoneeringProb2(depth - 1): villian.identifygoblin(unknown.get_DungeoneeringEncounter2(depth - 1)) fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) elif room <= unknown.get_DungeoneeringProb3(depth - 1): villian.identifygoblin(unknown.get_DungeoneeringEncounter3(depth - 1)) fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) else: findberries (heal,pouch,unknown.get_DungeoneeringBerries(depth - 1)) return depth #End Function of the dungons of awesome def EffectBoon (user,weapon,gifts,findthingy): for search in range(0,gifts.get_len_Boon()): if findthingy == gifts.get_Boonname(search): if gifts.get_Boontype(search) == "money": boonvalue = random.randint (gifts.get_Boonval1(search),gifts.get_Boonval2(search)) user.set_coin(user.get_coin() + boonvalue) print "you got", boonvalue, "coins from the", findthingy elif gifts.get_Boontype(search) == "weapon": weapon.set_items(weapon.get_itemsdur(weapon.get_len_items() - gifts.get_Boonval1(search)),weapon.get_len_items() - gifts.get_Boonval1(search)) print "you got a", findthingy else: for reallyancutngvariablcutuseiamtocutheck in range(0,1000): print "EXTREME ERROR" def closefardepth(depth,closefar,user,leveling,weapon,protection,pouch,heal,search): closefar = raw_input("\n\n\ndeeper or homeward??\n\n") closefar = closefar.lower() if closefar == "deeper": depth = depth + 1 print "you venture deeper\n\n" elif closefar == "homeward": depth = depth - 1 print "you back away\n\n" elif closefar == "inventory": showinventory(user,weapon,protection,pouch,heal,leveling,search) closefar = raw_input("\n\n\ndeeper or homeward??\n\n") closefar = closefar.lower() if closefar == "deeper": depth = depth + 1 print "you venture deeper\n\n" elif closefar == "homeward": depth = depth - 1 print "you back away\n\n" else: print "you are confused and find yourself where you started" elif closefar == "cheat number mad hacking power of the nth degree": depth = 0 else: print "you are confused and find yourself where you started" return depth #berry function def findberries (heal,pouch,berryness): print "you come across some", berryness raw_input("\n\n") berrysearch = raw_input("you can take them or leave them\n") berrysearch = berrysearch.lower() if berrysearch == "take": if pouch.get_holding() > 0: for search in range(0,heal.get_len_berry()): if berryness == heal.get_berryname(search): berryman = random.randint(heal.get_berryh(search),heal.get_berrym(search)) heal.set_berry(heal.get_berry(search) + berryman,search) pouch.set_holding(pouch.get_holding() - berryman) if pouch.get_holding() < 0: print "you could not take all of the berries because you do not have enough room\n" heal.set_berry(heal.get_berry(search) + pouch.get_holding(),search) pouch.set_holding(0) print "\nusing the small pouch, you have", heal.get_berry(search), heal.get_berryname(search) print "you can use them in a fight to gain health\n\n" else: print "you do not have room\n\n" else: print "you left the berries\n" #end berry def showinventory(user,weapon,protection,pouch,heal,leveling,search): print "" print "\thealth", user.get_health(), "of", user.get_maxhealth() print "\tlevel", user.get_level() print "\tattack bonus", user.get_attack() print "\tdefence bonus", user.get_defence(0) print "" print "\tresistances:" print "\t\tVenom:", user.get_defence(1) print "\t\tFire: ", user.get_defence(2) print "\t\tFrost:", user.get_defence(3) print "\t\tAcid: ", user.get_defence(4) print "\t\tDeath:", user.get_defence(5) print "\t\tLight:", user.get_defence(6) print "\t\tShock:", user.get_defence(7) print "\t\tSound:", user.get_defence(8) print "" print "\txp", user.get_xp() print "\t", leveling.get_LevelUpXp(user.get_level() - 1) - user.get_xp(), "xp to level", user.get_level() + 1 print "\tcoin", user.get_coin() print "\tarmor bonus", protection.get_armordef(protection.get_armorequipped()) print "\n\tweapons:" for search in range(0,weapon.get_len_items()): if weapon.get_items(search) > 0: print "\t\t", weapon.get_itemsname(search), "duribility,", weapon.get_items(search) print "\n\tarmor:" for search in range(0,protection.get_len_armor()): if protection.get_armor(search) > 0: if search == protection.get_armorequipped(): print "\t\t", protection.get_armorname(search), "duribility,", protection.get_armor(search), "<<equipped>>" else: print "\t\t", protection.get_armorname(search), "duribility,", protection.get_armor(search) print "\n\tberries:" for search in range(0,pouch.get_len_utility()): if pouch.get_utility(search) > 0: print "\t\t",pouch.get_utility(search), pouch.get_utilityname(search) print "\t\t\troom left", pouch.get_holding() for search in range(0,heal.get_len_berry()): if heal.get_berry(search) > 0: print "\t\t", heal.get_berry(search), heal.get_berryname(search) x = 0 while x == 0: inventoryequip = raw_input("equip armor or see stat?") inventoryequip = inventoryequip.lower() if inventoryequip == "equip armor": inventoryequip = raw_input("which armor?") inventoryequip = inventoryequip.lower() for search in range(0,protection.get_len_armor()): if protection.get_armor(search) > 0: if inventoryequip == protection.get_armorname(search): protection.set_armorequipped(search) print protection.get_armorname(search), "equipped\n" raw_input("") showinventory(user,weapon,protection,pouch,heal,leveling,search) x = 1 if inventoryequip == "exit": x = 1 #================================================================================================================= # Begin!! #================================================================================================================= hehhehheh = raw_input("\nGreetings!!\n\n") if hehhehheh.lower() == "i want some amburgers": fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) if hehhehheh.lower() == "cheat: (enable) <<hardcore mode>> set.* ": villian.activate_hardcore() print "welcome to my world\n\n" print "in the shop we have \n\twood sword 50c\n\tshale knife 30c\n\tcloth armor 35c\n\tsmall pouch 25c\n\n" while x == 1: print "\nyou have", user.get_coin(), "coins" item = raw_input("what would you like?") item = item.upper() if item == "EXIT": x = 0 elif item == "WOOD SWORD": if user.get_coin() < 50: print "Too Expensive" else: print "You bought a wood sword!\n" weapon.set_items(40,0) user.set_coin(user.get_coin() - 50) elif item == "SHALE KNIFE": if user.get_coin() < 30: print "Too Expensive" else: print "You bought a shale knife!\n" weapon.set_items(65,1) user.set_coin(user.get_coin() - 30) elif item == "CLOTH ARMOR": if user.get_coin() < 35: print "Too Expensive" else: print "You bought some cloth armor!\n" user.set_armoring(2) protection.set_armor(120,0) protection.set_armorequipped(0) user.set_coin(user.get_coin() - 35) elif item == "SMALL POUCH": if user.get_coin < 25: print "Too Expensive" else: print "You bought a small pouch!\n" pouch.set_utility(pouch.get_utility(0) + 1,0) pouch.set_holding(pouch.get_holding() + 20) user.set_coin(user.get_coin() - 25) elif item == "CHEAT NUMBER THISDOESWORK AASSAADD": user.set_coin(user.get_coin() + 100) elif item == "CHEAT NUMBER VIVE L\'EPEE": weapon.set_items(200,weapon.get_len_items() - 1) print "you have the Aanrok sword" elif item == "JOSH PRESET": weapon.set_items(40,0) weapon.set_items(0,1) user.set_armoring(2) protection.set_armor(120,0) protection.set_armorequipped(0) pouch.set_utility(1,0) pouch.set_holding(pouch.get_holding() + 20) user.set_coin(10) x = 0 else: print "that does not work" #end loop print "\n\nwelcome to adventure mode" raw_input("you can fight stuff in this mode") raw_input("remember, if you would like to see what you have \"inventory\"") print "the only place you can go to at the moment is the TimberCreak forest" raw_input("enjoy!!!\n\n\n\n\n") while grandx == 1: place = raw_input("where would you like to go?") first = 1 place = place.upper() #timbercreak forest if place == "TIMBERCREAK FOREST": print "\n\n\n\n\n\n\n\n\nyou venture into the timbercreak forest" room = random.randint(1,20) #goblin room if room <= 8: villian.identifygoblin("goblin warrior") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) elif room <= 12: villian.identifygoblin("goblin slinger") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) elif room <= 15: villian.identifygoblin("goblin thrasher") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) else: findberries (heal,pouch,"red berries") #deep timbercreak elif place == "DEEP TIMBERCREAK": if user.get_level() >= 2: print "\n\n\n\n\n\n\n\n\nyou venture into the deep regions of the timbercreak forest" depth = 1 unknown.DungeonDeepTimbercreak() while depth > 0: if first == 0: depth = closefardepth(depth,closefar,user,leveling,weapon,protection,pouch,heal,search) else: first = 0 #depth deep timbercreak if depth < 11 and depth > 0: depth = EnterDungeon(depth,unknown,villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,heal,pouch) if depth == 11: if questdeeptimbercreak == 0: raw_input("\n\n\n\n\n\n\n\nCongratulations!!!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") raw_input("you have found a teleportation circle\n") raw_input("from the main location, you can type \"Timbercreak Cave\", to go to the cave behind these walls") raw_input("good luck on your journy home!") questdeeptimbercreak = 1 else: print "this is the teleportation circle" if depth > 11: print "no way to go further from here" depth = 11 #deep timbercreak else: print "you are not a high enough level to go in there" #end timbercreak forest elif place == "TIMBERCREAK CAVE": if questdeeptimbercreak == 1: if user.get_level() >= 6: print "\n\n\n\n\n\n\n\n\nyou venture into the teleportation circle of the timbercreak cave" depth = 1 unknown.DungeonTimbercreakCave() while depth > 0: if first == 0: depth = closefardepth(depth,closefar,user,leveling,weapon,protection,pouch,heal,search) else: first = 0 #depth deep timbercreak if depth < 13 and depth > 0: depth = EnterDungeon(depth,unknown,villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,heal,pouch) x = 1 while x == 1: DungeoneeringCommand = raw_input("\n\nsearch room, flee, or continue? ") DungeoneeringCommand = DungeoneeringCommand.lower() if DungeoneeringCommand == "search room": x = 0 room = random.randint(1,20) if room < 3: print "you sprung a trap!!" user.set_health(user.get_health() - random.randint(user.get_level(),user.get_level() * 2)) print "your health was reduced to", user.get_health(), "\n\n\n" elif room < 10: EffectBoon(user,weapon,gifts,unknown.get_DungeoneeringBoon(depth - 1)) elif room < 14: print "there is nothing of value here" else: depth = EnterDungeon(depth,unknown,villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,heal,pouch) elif DungeoneeringCommand == "continue": x = 0 elif DungeoneeringCommand == "flee": depth = depth - 1 x = 0 else: print "\n\ntry again" if depth == 13: if questtimbercreakcave == 0: print "You have found Marlek." time.sleep(2) villian.identifygoblin("marlek guardian") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) villian.identifygoblin("marlek guardian") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) villian.identifygoblin("marlek") fightgoblin(villian,twang,search,hitting,smashing,weapondamage,armordamage,user,weapon,protection,pouch,heal) print "you win!!! not really" questtimbercreakcave = 1 else: print "this is Marlek's place" if depth > 13: print "no way to go further from here" depth = 13 else: print "you are not a high enough level to go in there" else: print "you have not found this location yet" elif place == "POTION SHOP": if user.get_level() >= 8: time.sleep(2) print "..." time.sleep(2) print "you travel south" time.sleep(4) print "..." time.sleep(2) x = 1 print "you can type \"see\" to see the items in the shop" while x == 1: if first == 1: item = "see" first = 0 else: print "\nyou have", user.get_coin(), "coins" twang = 0 item = raw_input("what would you like?") item = item.lower() if item == "exit": x = 0 twang = 1 elif item == "see": print "you have the following items:" for search in range(0,extra.get_len_potion()): if user.get_level() >= extra.get_potionlevel(search): print "\t", extra.get_potionname(search) twang = 1 for search in range(0,extra.get_len_potion()): if item == extra.get_potionname(search): if user.get_level() >= extra.get_potionlevel(search): if user.get_coin() >= extra.get_potioncost(search): if extra.get_potionsp(search) == "heal": potionup = random.randint(extra.get_potionval1(search),extra.get_potionval2(search)) user.set_health(user.get_health() + potionup) if user.get_health() > user.get_maxhealth(): user.set_health(user.get_maxhealth()) print "you healed to max health" else: print "You healed", potionup,"health!\n" user.set_coin(user.get_coin() - extra.get_potioncost(search)) if extra.get_potionsp(search) == "resist": potionup = random.randint(extra.get_potionval1(search),extra.get_potionval2(search)) user.set_defence(user.get_defence(extra.get_potionscript(search)) + potionup,extra.get_potionscript(search)) print "Your", weapon.get_typeidentity(extra.get_potionscript(search)), "resistence increased by", potionup, "\n" user.set_coin(user.get_coin() - extra.get_potioncost(search)) else: print "you do not have enough coins" else: print "you are not a high enough level" if item == "cheat n": user.set_coin(user.get_coin() + 100) else: if twang == 0: print "that does not work" else: print "you cannot enter the shop yet" elif place == "SHOP": if user.get_level() > 1: x = 1 print "you can type \"see\" to see the items in the shop" while x == 1: if first == 1: item = "see" first = 0 else: print "\nyou have", user.get_coin(), "coins" twang = 0 item = raw_input("what would you like?") item = item.lower() if item == "exit": x = 0 twang = 1 elif item == "see": print "you have the following items:" for search in range(0,weapon.get_len_items()): if user.get_level() + 1 > weapon.get_itemslevel(search): print "\t", weapon.get_itemsname(search), weapon.get_itemscost(search), "coins" print "" for search in range(0,protection.get_len_armor()): if user.get_level() + 1 > protection.get_armorlevel(search): print "\t", protection.get_armorname(search), protection.get_armorcost(search), "coins" print "" for search in range(0,pouch.get_len_utility()): if user.get_level() + 1 > pouch.get_utilitylevel(search): print "\t", pouch.get_utilityname(search), pouch.get_utilitycost(search), "coins" print "" if user.get_level() > 2: print "\thealth potion 40c" twang = 1 for search in range(0,weapon.get_len_items()): if item == weapon.get_itemsname(search): if user.get_level() + 1 > weapon.get_itemslevel(search): if user.get_coin() < weapon.get_itemscost(search): print "Too Expensive" else: print "you have bought a", weapon.get_itemsname(search) weapon.set_items(weapon.get_itemsdur(search),search) user.set_coin(user.get_coin() - weapon.get_itemscost(search)) else: print "you are not of a high enough level" twang = 1 for search in range(0,protection.get_len_armor()): if item == protection.get_armorname(search): if user.get_level() + 1 > protection.get_armorlevel(search): if user.get_coin() < protection.get_armorcost(search): print "Too Expensive" else: print "you have bought", protection.get_armorname(search) protection.set_armor(protection.get_armordur(search),search) user.set_coin(user.get_coin() - protection.get_armorcost(search)) user.set_armoring(protection.get_armordef(search)) protection.set_armorequipped(search) else: print "you are not of a high enough level" twang = 1 for search in range(0,pouch.get_len_utility()): if item == pouch.get_utilityname(search): if user.get_level() >= pouch.get_utilitylevel(search): if user.get_coin() <= pouch.get_utilitycost(search): print "Too Expensive" else: print "You bought a", pouch.get_utilityname(search), "\n" pouch.set_utility(pouch.get_utility(search) + 1,search) pouch.set_holding(pouch.get_holding() + pouch.get_utilityhold(search)) user.set_coin(user.get_coin() - pouch.get_utilitycost(search)) else: print "you are not a high enough level" twang = 1 if item == "health potion": if user.get_level() > 2: if user.get_coin() < 40: print "Too Expensive" else: potionup = random.randint(5,20) user.set_health(user.get_health() + potionup) if user.get_health() > user.get_maxhealth(): user.set_health(user.get_maxhealth()) print "you healed to max health" else: print "You bought a health potion and healed", potionup,"health!\n" user.set_coin(user.get_coin() - 40) else: print "you are not a high enough level" elif item == "cheat n": user.set_coin(user.get_coin() + 100) else: if twang == 0: print "that does not work" else: print "you cannot enter the shop yet" #exit shop elif place == "INVENTORY": showinventory(user,weapon,protection,pouch,heal,leveling,search) """ x = 1 while x == 1: infoweapon = raw_input("would you like to see the stats of a weapon?") infoweapon = infoweapon.lower() for search in range(0,len(items)): if infoweapon == itemsname[search]: print "" print "\taccuracy:", weaponhit1[search],"-", weaponhit2[search] print "\tdamage:", weaponsmash1[search], "-", weaponsmash2[search] print "\tduribility:", items[search], "of", itemsdur[search] print "\tcost at shop:", itemscost[search] print "" if infoweapon == "exit": x = 0 elif infoweapon == "cheat number abduct sword loikjuyh": infoweapon = raw_input("You want wizard ... what wizard?") for search in range(0,len(items)): if infoweapon == itemsname[search]: items[search] = itemsdur[search] print "you have wizard" for search in range(0,len(armor)): if infoweapon == armorname[search]: armor[search] = armordur[search] armoring = armoring + armordef[search] print "you have master wizard" if infoweapon == "cheat number i want all the wizards!!!!!!!": for search in range(0,len(items)): items[search] = itemsdur[search] raw_input("pant pant wizard") print "you have wizard" """ elif place == "CHEAT NUMBER DAN\'S CHEAT FOR OREO": reallyannoyinglylongvariablethatihavecreatedfordansothaticouldgetacookie = "" while reallyannoyinglylongvariablethatihavecreatedfordansothaticouldgetacookie == "": reallyannoyinglylongvariablethatihavecreatedfordansothaticouldgetacookie = raw_input("?"*70) user.set_maxhealth(user.get_maxhealth() + 1) user.set_health(user.get_health() + 1) elif place == "CHEAT NUMBER THISISTHEBESTCODEYET AWSEDRFTGYHUJIKOLPMNBVCXZ NO Q": user.set_xp(user.get_xp() * 3 + 1) elif place == "CHEAT NUMBER NOWTHISISPROGRESS BGYUJN": questdeeptimbercreak = 1 elif place == "CHEAT NUMBER BUILD FOR YOUR CONVINIENCE ERTYUJNBGVCD": cheatbuildtype = raw_input("what build?") if cheatbuildtype == "level 4 avenger": user.set_xp(96) user.set_coin(80) protection.set_armor(protection.get_armordur(1),1) protection.set_armorequipped(1) weapon.set_items(weapon.get_itemsdur(3),3) weapon.set_items(weapon.get_itemsdur(5),5) weapon.set_items(weapon.get_itemsdur(7),7) elif cheatbuildtype == "level 6 cave-breaker": user.set_xp(280) user.set_coin(200) questdeeptimbercreak = 1 protection.set_armor(protection.get_armordur(4),4) protection.set_armorequipped(4) weapon.set_items(weapon.get_itemsdur(6),6) weapon.set_items(weapon.get_itemsdur(9),9) weapon.set_items(weapon.get_itemsdur(10),10) elif cheatbuildtype == "level 8 wanderer": user.set_xp(616) user.set_coin(1000) questdeeptimbercreak = 1 elif cheatbuildtype == "level 11 slayer": user.set_xp(1557) user.set_coin(3000) questdeeptimbercreak = 1 else: print "\n\nthat is invalid, try again" #level up for search in range(0,leveling.get_len_LevelUpLevel()): if user.get_xp() >= leveling.get_LevelUpXp(search): if user.get_level() < leveling.get_LevelUpLevel(search): user.set_level(leveling.get_LevelUpLevel(search)) user.set_attack(user.get_attack() + leveling.get_LevelUpAttack(search)) user.set_defence(user.get_defence(0) + leveling.get_LevelUpDefence(search),0) user.set_health(user.get_health() + leveling.get_LevelUpHealth(search)) user.set_maxhealth(user.get_maxhealth() + leveling.get_LevelUpHealth(search)) user.set_xp(user.get_xp() - leveling.get_LevelUpXp(search)) print "you leveled up to level", leveling.get_LevelUpLevel(search) LevelUpNotice = 1 #level up notice if LevelUpNotice == 1: if user.get_level() == 2: LevelUpNotice = 0 raw_input("\nyou can now go into the shop as well as timbercreak forest") raw_input("\nyou also no longer are restrained to the outer edges of the timbercreak that you have been going to") raw_input("\ntype \"deep timbercreak\" if you want to go deeper") raw_input("\nOnce in there you can type \"deeper\" or \"homeward\"") if LevelUpNotice == 1: if user.get_level() == 6: LevelUpNotice = 0 raw_input("\nyou can now go into the teleportation circle for the timbercreak cave") raw_input("\nyou have heard from the village rumors that the goblin chieften \"Maarlek\" has heard of your actions at the timbercreak cave") raw_input("\nMaarlek has started to send his private goblin \"lafar\" or elites after you") raw_input("\nBe warned if you ever enter the timbercreak cave, there are ambushes") raw_input("\nthe timbercreak cave is a dungeon, not a random location like the deep timbercreak") raw_input("\nMarlek make sure that anyone who enters has a hard time getting out") raw_input("\nthere are a few commands you must rember when traveling through dungeons") raw_input("\nthe commands are \n\tdeeper\n\thomeward\n\tflee\n\tsearch room\n\tinventory") if LevelUpNotice == 1: if user.get_level() == 8: LevelUpNotice = 0 raw_input("\nA new shop has opened up just one mile south of here") raw_input("it has a wider selection of potions") raw_input("by wider selection, I mean more than 1") raw_input("\ntype \"Potion Shop\" to go there") #endadventure mode #cheats # CHEAT NUMBER NOWTHISISPROGRESS BGYUJN # CHEAT NUMBER THISISTHEBESTCODEYET AWSEDRFTGYHUJIKOLPMNBVCXZ NO Q # cheat n # CHEAT NUMBER THISDOESWORK AASSAADD # cheat number mad hacking power of the nth degree # cheat number nuke this stuff qwerty # cheat number what in the name of ????? # CHEAT NUMBER VIVE L'EPEE # cheat number abduct sword loikjuyh # cheat number i want allll the wizards!!!!!!! # CHEAT NUMBER DAN'S CHEAT FOR OREO # CHEAT NUMBER BUILD FOR YOUR CONVINIENCE ERTYUJNBGVCD
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question