def startNewGame(self): print("Starting a new game...") print("Creating player...") self.player = player.Player() self.player.equip(generateNextWeapon(self.player.weapon)) file_manager.saveGame(self.player) #self.setDifficulty() self.player.intro() #self.player.difficulty = self.difficulty self.findKitten() self.running = True
def startNewGame(self): print("Starting a new game...") print("Creating player...") self.player = player.Player() self.player.equip(generateNextWeapon(self.player.weapon)) file_manager.saveGame(self.player) # self.setDifficulty() self.player.intro() # self.player.difficulty = self.difficulty self.findKitten() self.running = True
def acquireItem(self, forced_chance=None): item_chance = random.random() if not forced_chance else forced_chance # determine whether a weapon or food was found if item_chance < self.find_food_chance: item = getRandomFood() self.player.inventory.append(item) print("You found a %s" % item.name) else: item = generateNextWeapon(self.player.weapon) if item: print("You found a %s" % item.name) print("You toss your %s to the ground in favor of your new %s!" % (self.player.weapon, item)) self.player.equip(item) else: self.acquireItem(0)
def acquireItem(self, forced_chance=None): item_chance = random.random() if not forced_chance else forced_chance # determine whether a weapon or food was found if item_chance < self.find_food_chance: item = getRandomFood() self.player.inventory.append(item) print("You found a %s" % item.name) else: item = generateNextWeapon(self.player.weapon) if item: print("You found a %s" % item.name) print( "You toss your %s to the ground in favor of your new %s!" % (self.player.weapon, item)) self.player.equip(item) else: self.acquireItem(0)