Esempio n. 1
0
    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")
Esempio n. 2
0
 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")
Esempio n. 3
0
 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")
Esempio n. 4
0
 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")
Esempio n. 5
0
 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.")
Esempio n. 6
0
 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")
Esempio n. 7
0
 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.")
Esempio n. 8
0
 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")
Esempio n. 9
0
 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")
Esempio n. 10
0
 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")
Esempio n. 11
0
 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")