def action(self, player, do): if (do[0] in words.take) and ('matches' in do): if transfer('match', self.contents, player.inventory, n=42): print("You pick up the matches.") else: print("You've already taken the matches.") elif (do[0] in words.use or do[0] == 'light') and do[1] == 'torch': if player.has('unlit torch') and player.has('match'): player.take('unlit torch') player.take('match') player.give('flaming torch') print("The torch catches, casting a flickering light on the " "cave walls.") else: print("You'll need a torch and a match.") else: print("Sorry, I don't understand")
def action(self, player, do): if (do[0] in words.take) and ('matches' in do): if transfer('match', self.contents, player.inventory, n=42): print("You pick up the matches.") else: print("You've already taken the matches.") elif (do[0] in words.use or do[0]=='light') and do[1]=='torch': if player.has('unlit torch') and player.has('match'): player.take('unlit torch') player.take('match') player.give('flaming torch') print("The torch catches, casting a flickering light on the " "cave walls.") else: print("You'll need a torch and a match.") else: print("Sorry, I don't understand")
def take_doorknob(self, player): if transfer('doorknob', self.contents, player.inventory): print("You pick up the doorknob.\n") else: print("There is nothing here.\n")
def take_knife(self, player, do): if transfer('knife', self.contents, player.inventory): print("You put the knife in your bag.\n") else: print("There is nothing here.\n")
def take_berries(self, player): if transfer('berries', self.contents, player.inventory): print("Reaching up, you pick the berries.") else: print("There are no berries here.")
def take_mice(self, player): if transfer('mice', self.contents, player.inventory, n=2): print("Ok then. You took the mice.\n") else: print("No more mice for now. Got to leave the traps do their " "job.\n")
def take_berries(self, player): if transfer('berries', self.contents, player.inventory): print("Reaching up, you pick the berries.") else: print("There are no berries here.")
def take_doorknob(self, player): if transfer('doorknob', self.contents, player.inventory): print("You pick up the doorknob.\n") else: print("There is nothing here.\n")
def take_catfood(self, player): if transfer('catfood', self.contents, player.inventory, n=2): print("You did wise. You took the catfood!\n") else: print("There is nothing here.\n")
def take_catfood(self, player): if transfer('catfood', self.contents, player.inventory, n=2): print("You did wise. You took the catfood!\n") else: print("There is nothing here.\n")
def take_knife(self, player, do): if transfer('knife', self.contents, player.inventory): print("You put the knife in your bag.\n") else: print("There is nothing here.\n")