本文整理汇总了Python中system.makemenus.CraftItemAction.make方法的典型用法代码示例。如果您正苦于以下问题:Python CraftItemAction.make方法的具体用法?Python CraftItemAction.make怎么用?Python CraftItemAction.make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system.makemenus.CraftItemAction
的用法示例。
在下文中一共展示了CraftItemAction.make方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make
# 需要导入模块: from system.makemenus import CraftItemAction [as 别名]
# 或者: from system.makemenus.CraftItemAction import make [as 别名]
def make(self, player, arguments, nodelay=0):
assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')
if not checktool(player, wolfpack.finditem(arguments[0])):
return False
return CraftItemAction.make(self, player, arguments, nodelay)
示例2: make
# 需要导入模块: from system.makemenus import CraftItemAction [as 别名]
# 或者: from system.makemenus.CraftItemAction import make [as 别名]
def make(self, player, arguments, nodelay=0, clothitem = None):
global CLOTH
# We have not been passed a cloth reference.
# Try to statisfy it automatically
if self.cloth > 0:
if not clothitem:
backpack = player.getbackpack()
count = 0 # Valid piles of cloth
for item in backpack.content:
if item.baseid in CLOTH and item.amount >= self.cloth:
clothitem = item
count += 1
# This makes the user select a pile of cloth
if count > 1:
player.socket.clilocmessage(502928) # Which material would you like to work ...
player.socket.attachtarget('skills.tailoring.ClothSelectResponse', [self, arguments])
return
elif count < 1:
player.socket.clilocmessage(1044456) # You don't have any ready cloth
return
# Pass the clothitem on to the next function as an argument
if len(arguments) < 2:
arguments.append(clothitem.serial)
else:
arguments[1] = clothitem.serial
return CraftItemAction.make(self, player, arguments, nodelay)
示例3: make
# 需要导入模块: from system.makemenus import CraftItemAction [as 别名]
# 或者: from system.makemenus.CraftItemAction import make [as 别名]
def make(self, player, arguments, nodelay=0):
if self.useallres:
found = False
for item in player.getbackpack().content:
if item.baseid == self.materials[0][0][0]:
found = True
nodelay = True
# stop if making fails
if not CraftItemAction.make(self, player, arguments, nodelay):
break
if not found:
# we have no material, but call make method do display error message
# and reopen the crafting dialog
return CraftItemAction.make(self, player, arguments, nodelay)
else:
return CraftItemAction.make(self, player, arguments, nodelay)
示例4: make
# 需要导入模块: from system.makemenus import CraftItemAction [as 别名]
# 或者: from system.makemenus.CraftItemAction import make [as 别名]
def make(self, player, arguments, nodelay=0):
assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')
# Look for forge and anvil
if not checkanvilandforge(player):
player.socket.clilocmessage(1044267)
return False
if not checktool(player, wolfpack.finditem(arguments[0])):
return False
return CraftItemAction.make(self, player, arguments, nodelay)
示例5: make
# 需要导入模块: from system.makemenus import CraftItemAction [as 别名]
# 或者: from system.makemenus.CraftItemAction import make [as 别名]
def make(self, player, arguments, nodelay=0):
assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')
return CraftItemAction.make(self, player, arguments, nodelay)