本文整理汇总了Python中Player.getItem方法的典型用法代码示例。如果您正苦于以下问题:Python Player.getItem方法的具体用法?Python Player.getItem怎么用?Python Player.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.getItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: throwItem
# 需要导入模块: import Player [as 别名]
# 或者: from Player import getItem [as 别名]
def throwItem(position,index): #Jette un objet
global throw
throw = 0
Map.addItem(position,Player.getItem(index))
descript = "Vous jetez " + Player.getItemName(index)
Player.removeItem(index)
return descript
示例2: throwItem
# 需要导入模块: import Player [as 别名]
# 或者: from Player import getItem [as 别名]
def throwItem(position,index): #Jette un objet
global throw
throw = 0
Map.addItem(position,Player.getItem(index))
descript = "You throw " + Player.getItemName(index) + " away."
Player.removeItem(index)
return descript
示例3: useItem
# 需要导入模块: import Player [as 别名]
# 或者: from Player import getItem [as 别名]
def useItem(index): #Utilise un objet
global use
use = 0
item = Player.getItem(index)
if item["type"] == 1:
Player.equip(item)
descript = "Vous equipez " + Player.getItemName(index)
else:
Player.editHealth(item["Modifier"])
descript = "Vous mangez " + Player.getItemName(index)
Player.removeItem(index)
return descript
示例4: useItem
# 需要导入模块: import Player [as 别名]
# 或者: from Player import getItem [as 别名]
def useItem(index): #Utilise un objet
global use, levelUp
use = 0
item = Player.getItem(index)
if item["type"] == 0 :
Player.editHealth(item["Modifier"])
descript = "Vous mangez " + Player.getItemName(index)
Player.removeItem(index)
elif item["type"] == 1 :
Player.equip(item)
descript = "Vous equipez " + Player.getItemName(index)
elif item['type'] == 2 :
for i in range (item['Modifier']):
Player.setXp(levelUp)
checkXp()
descript = "Vous mangez " + Player.getItemName(index)
Player.removeItem(index)
return descript