def shortcut(self): for i in range(0, 2): prompt(messages.shortcut[i] + "\n") import battle_system, monsters boss = monsters.Guillek() battle_system.Battle(self.hero, boss) if self.hero.health: prompt(messages.shortcut[2] + "\n") self.hero.missions[5] = True
def boss2(self): for i in range(0, 8): prompt(messages.boss2[i] + "\n") import battle_system, monsters boss = monsters.Guillek() battle_system.Battle(self.hero, boss) if self.hero.health: for i in range(8, 10): prompt(messages.boss2[i] + "\n") self.hero.missions[5] = True
def go(self, endpoint): print("Your journey beginneth. Press 'I' at any time to use items.") for segment in range(self.distance): if self.hero.health: # Opportunity to use item entry = prompt("").upper() while entry == "I": self.hero.inventory_menu() item = self.hero.item_pick() if item != False: self.hero.use_item(item, self.hero) if entry == "I": print("\nPress 'I' to use another item.") entry = prompt("").upper() # Start message string, get occurence message = "" occurence = random.randint(1, 100) # Determine time and day, add to message if segment in range(0,20,3): message += "On the morning of day " + str(int((segment+3)/3)) elif segment in range(1,21,3): message += "On the afternoon of day " + str(int((segment+2)/3)) else: message += "On the evening of day " + str(int((segment+1)/3)) # If occurence == monster, update message, print message, start battle if occurence < self.fight_chance: monster = self.monster_pick() message += " a monster approaches!" print(message) battle = battle_system.Battle(self.hero, monster) if self.hero.health: print("Your journey continues. Press 'I' at any \ time to use an item.") # Or if occurence != monster, update message, print message else: message += " nothing happens." print(message) # If hero is still alive, return the proper endpoint. if self.hero.health: return endpoint # Otherwise, return None else: return None
def boss1(self): print("You dig where the map directs you to dig.") prompt("And you find:\n\t" + items.kings_loot.name) self.hero.inventory.append(items.kings_loot) self.hero.inventory.remove(items.t_map) prompt("King's First Servant: I see that much of this treasure was made by \ orcs. Perhaps Good King Vinny is trying to make amends by returning goods \ taken during one of the old wars.") prompt("King's Second Servant: I don't believe the orcs would even \ realize.... What ho! Who goes there!?\n") prompt("\nYou turn around to find that a stranger has snuck up on you!") prompt("Prepare for battle!\n") import battle_system, monsters boss = monsters.Simon_Slick() battle = battle_system.Battle(self.hero, boss) if self.hero.health: self.hero.missions[4] = True
def dig(self): import random number = random.randint(1, 5) if number == 1 or number == 2: print("You find nothing.") elif number == 3 or number == 4: print("A monster approaches!") import monsters, battle_system monster_pool = (monsters.Ancient_Technology(), monsters.Goblin(), monsters.Hungry_Spider()) monster = random.choice(monster_pool) battle = battle_system.Battle(self.hero, monster) elif number == 5: item = random.choice(self.inventory) print("You find:\n\t" + item.name) self.hero.inventory.append(item)