def make_tool(self, tool): if self.flag == False and self.newtool == tool.newtool: print "%s 和 没有手柄的%s 组成成了 %s" % \ (name(tool.__doc__), name(self.__doc__), name(self.__doc__)) self.flag = True else: print "%s 和 %s 不能组合" % (name(self.__doc__), name(tool.__doc__))
def make_tool(self, tool): if self.flag == True and self.newtool == tool.newtool: print "%s 和 没有手柄的%s 组成成了 %s" % \ (name(self.__doc__), name(tool.__doc__), name(tool.__doc__)) tool.flag = True else: print "%s 和 %s 不能组合" % (name(self.__doc__), name(tool.__doc__))
def examine(self): if self.flag == False: print "柜子好像少了手柄,打不开" elif self.value == None: print "柜子里什么也没有" else: self.value.flag = True print "柜子里发现了一个%s" % name(self.value.__doc__)
def use_tool(self, obj): if self.flag == True: if obj == None: print "长木干用来做什么?" else: obj.flag = True print "你拿到了%s" % name(obj.__doc__) else: print "由于一些原因,你还不能使用这个长木干"
def make_tool(self, tool): if self.flag == False: print "由于一些原因,你还不能使用这个长木干" else: print "%s 和 %s 不能组合" % (name(self.__doc__), name(tool.__doc__))
def make_tool(self, tool): tool = name(tool.__doc__) n = name(self.__doc__) print "%s 和 %s 不能组合" % (n, tool) return 'no_make'
def make_tool(self, tool): print "密码门不能和%s组合" % name(tool.__doc__)