示例#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")
示例#2
0
文件: n2.py 项目: SmartViking/weatbag
 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")
示例#3
0
文件: n3w3.py 项目: ratmonkey/weatbag
 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")
示例#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")
示例#5
0
文件: e1.py 项目: SmartViking/weatbag
 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.")
示例#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")
示例#7
0
文件: e1.py 项目: vishnu-90/weatbag
 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.")
示例#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")
示例#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")
示例#10
0
文件: n2w5.py 项目: ratmonkey/weatbag
 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")
示例#11
0
文件: n3w5.py 项目: vishnu-90/weatbag
 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")