当前位置: 首页>>代码示例>>Python>>正文


Python Player.isItem方法代码示例

本文整理汇总了Python中Player.isItem方法的典型用法代码示例。如果您正苦于以下问题:Python Player.isItem方法的具体用法?Python Player.isItem怎么用?Python Player.isItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.isItem方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: useList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def useList(): #Renvoie la liste des objets utilisables
	global items, use
	items = Player.isItem()
	if items == 0:
	 return "Vous n'avez pas d'objets dans votre inventaire."
	else:
		use = 1
		return "Quel objet voulez-vous utiliser? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Player.getItemList()
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:10,代码来源:GameFR.py

示例2: useList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def useList(): #Renvoie la liste des objets utilisables
	global items, use
	items = Player.isItem()
	if items == 0:
	 return "Your inventory is empty."
	else:
		use = 1
		return "Which item do you want to use? (Type in the corresponding number) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Player.getItemList()
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:10,代码来源:GameEN.py

示例3: throwList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def throwList(): #Renvoie la liste des objets jetables
	global items, throw
	items = Player.isItem()
	if items == 0:
		return "Vous n'avez pas d'objets dans votre inventaire."
	else:
		throw = 1
		return "Quel objet voulez-vous jeter? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Player.getItemList()
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:10,代码来源:GameFR.py

示例4: throwList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def throwList(): #Renvoie la liste des objets jetables
	global items, throw
	items = Player.isItem()
	if items == 0:
		return "Your inventory is empty."
	else:
		throw = 1
		return "Which item do you want to throw away? (Type in the corresponding number) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Player.getItemList()
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:10,代码来源:GameEN.py

示例5: pickList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def pickList(): #Renvoie la liste des objets ramassables
    global items, pick
    items = Map.isItem(Player.getPosition())
    if items == 0:
        return "Il n'y a pas d'objets dans cette zone."
    elif Player.isItem() == 6:
        return "Vous n'avez plus de place dans votre inventaire."
    else:
        pick = 1
        return "Quel objet voulez-vous ramasser? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Map.getItemList(Player.getPosition())
开发者ID:ValentinPearce,项目名称:The-Shades,代码行数:12,代码来源:OriginalGame.py

示例6: pickList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def pickList(): #Renvoie la liste des objets ramassables
	global items, pick
	items = Map.isItem(Player.getPosition())
	if Map.isMonster(Player.getPosition()) == 0 :
		if items == 0:
			return "Il n'y a pas d'objets dans cette zone."
		elif Player.isItem() == 6:
			return "Vous n'avez plus de place dans votre inventaire."
		else:
			pick = 1
			return "Quel objet voulez-vous ramasser? (Tapez le numero correspondant) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Map.getItemList(Player.getPosition())
	else :
		return "Ramasser un objet qu'un adversaire garde n'est jamais une bonne idee. "
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:15,代码来源:GameFR.py

示例7: pickList

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]
def pickList(): #Renvoie la liste des objets ramassables
	global items, pick
	items = Map.isItem(Player.getPosition())
	if Map.isMonster(Player.getPosition()) == 0 :
		if items == 0:
			return "There aren't any items in this area."
		elif Player.isItem() == 6:
			return "Your inventory is already full."
		else:
			pick = 1
			return "Which item do you want to pick up? (Type in the corresponding number) ~~~~~~~~~~~~~~~~~~~~~~~~~~ " + Map.getItemList(Player.getPosition())
	else :
		return "Trying to take an items guarded by an opponent is never a clever idea. "
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:15,代码来源:GameEN.py

示例8: getAction

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]

#.........这里部分代码省略.........
				return throwItem(Player.getPosition(),0)
			elif use == 1:
				return useItem(0)
		elif key == '2' :
			if int(key) > items:
				return "Cet objet n'existe pas!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),1)
			elif throw == 1:
				return throwItem(Player.getPosition(),1)
			elif use == 1:
				return useItem(1)
		elif key == '3' :
			if int(key) > items:
				return "Cet objet n'existe pas!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),2)
			elif throw == 1:
				return throwItem(Player.getPosition(),2)
			elif use == 1:
				return useItem(2)
		elif key == '4' :
			if int(key) > items:
				return "Cet objet n'existe pas!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),3)
			elif throw == 1:
				return throwItem(Player.getPosition(),3)
			elif use == 1:
				return useItem(3)
		elif key == '5' :
			if int(key) > items:
				return "Cet objet n'existe pas!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),4)
			elif throw == 1:
				return throwItem(Player.getPosition(),4)
			elif use == 1:
				return useItem(4)
		elif key == '6' :
			if int(key) > items:
				return "Cet objet n'existe pas!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),5)
			elif throw == 1:
				return throwItem(Player.getPosition(),5)
			elif use == 1:
				return useItem(5)
		elif key == 'z' :
			pick, throw, use = 0,0,0
			return move('north')
		elif key == 'q' :
			pick, throw, use = 0,0,0
			return move('west')
		elif key == 's' :
			pick, throw, use = 0,0,0
			return move('south')
		elif key == 'd' :
			pick, throw, use = 0,0,0
			return move('east')
		elif key == 'o' :
			pick, throw, use = 0,0,0
			return altDescript()
		elif key == 'r' :
			pick, throw, use = 0,0,0
			return pickList()
		elif key == 'j' :
			pick, throw, use = 0,0,0
			return throwList()
		elif key == 'e' :
			pick, throw, use = 0,0,0
			return useList()
		elif key == 'a' :
			pick, throw, use = 0,0,0
			return attack()
		elif key == '\x1b' :
			exitGame()
			time.sleep(0.2)	
		elif key == 'c' :
			termios.tcsetattr(sys.stdin, termios.TCSADRAIN, defaultTerminal)
			cheat = raw_input("Enter cheat code : ")                                                              
			tty.setcbreak(sys.stdin.fileno())
                        if cheat == "doppel":                                                                                 
                                Map.addDoppel(Player.getPosition())                                                           
                                return "Il y a desormais un  Doppelganger devant vous!"
                        elif cheat == "pepperonipizza":
                                Player.addItem({"name" : "une Pizza" , "rate" : 9 , "type" : 0 , "Modifier" : 100 , "liste" : "Une Pizza Pepperoni -- "})
                                return "Une Pizza Pepperoni se materialise dons votre inventaire!"
                        elif cheat == "konami":
                                while Player.getLevel()<10:
                                        Player.setXp(levelUp)
                                        checkXp()
				if Player.isItem() <= 5:
                                        Player.addItem({"name" : "le NES Zapper" , "rate" : 0 , "type" : 1 , "Modifier" : 10 , "liste" : "Le NES Zapper ---+10 "})
					return "KONAMI vous monte au niveau maximal et vous donne un NES Zapper!"
				else :
					return "KONAMI vous monte au niveau maximal!"
					
                        else:
                                return "Ne trichez pas si vous ne savez pas comment le faire !"
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:104,代码来源:GameFR.py

示例9: getAction

# 需要导入模块: import Player [as 别名]
# 或者: from Player import isItem [as 别名]

#.........这里部分代码省略.........
			elif throw == 1:
				return throwItem(Player.getPosition(),0)
			elif use == 1:
				return useItem(0)
		elif key == '2' :
			if int(key) > items:
				return "This item doesn't exist!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),1)
			elif throw == 1:
				return throwItem(Player.getPosition(),1)
			elif use == 1:
				return useItem(1)
		elif key == '3' :
			if int(key) > items:
				return "This item doesn't exist!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),2)
			elif throw == 1:
				return throwItem(Player.getPosition(),2)
			elif use == 1:
				return useItem(2)
		elif key == '4' :
			if int(key) > items:
				return "This item doesn't exist!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),3)
			elif throw == 1:
				return throwItem(Player.getPosition(),3)
			elif use == 1:
				return useItem(3)
		elif key == '5' :
			if int(key) > items:
				return "This item doesn't exist!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),4)
			elif throw == 1:
				return throwItem(Player.getPosition(),4)
			elif use == 1:
				return useItem(4)
		elif key == '6' :
			if int(key) > items:
				return "This item doesn't exist!" 
			elif pick == 1:
				return pickItem(Player.getPosition(),5)
			elif throw == 1:
				return throwItem(Player.getPosition(),5)
			elif use == 1:
				return useItem(5)
		elif key == 'w' :
			pick, throw, use = 0,0,0
			return move('north')
		elif key == 'a' :
			pick, throw, use = 0,0,0
			return move('west')
		elif key == 's' :
			pick, throw, use = 0,0,0
			return move('south')
		elif key == 'd' :
			pick, throw, use = 0,0,0
			return move('east')
		elif key == 'o' :
			pick, throw, use = 0,0,0
			return altDescript()
		elif key == 'p' :
			pick, throw, use = 0,0,0
			return pickList()
		elif key == 't' :
			pick, throw, use = 0,0,0
			return throwList()
		elif key == 'e' :
			pick, throw, use = 0,0,0
			return useList()
		elif key == 'f' :
			pick, throw, use = 0,0,0
			return attack()
		elif key == '\x1b' :
			exitGame()
			time.sleep(0.2)	
		elif key == 'c' :
			termios.tcsetattr(sys.stdin, termios.TCSADRAIN, defaultTerminal)
			cheat = raw_input("Enter cheat code : ")
			tty.setcbreak(sys.stdin.fileno())
			if cheat == "doppel":
				Map.addDoppel(Player.getPosition())
				return "There is now a Doppelganger in front of you!"
			elif cheat == "pepperonipizza":
				Player.addItem({"name" : "a Pizza" , "rate" : 9 , "type" : 0 , "Modifier" : 100 , "liste" : "A Pepperoni Pizza ---- "})
				return "A Pepperoni Pizza materialises in your inventory!"
			elif cheat == "konami":
				while Player.getLevel()<10:
					Player.setXp(levelUp)
                        		checkXp()
				if Player.isItem() <= 5:
					Player.addItem({"name" : "the NES Zapper" , "rate" : 0 , "type" : 1 , "Modifier" : 10 , "liste" : "The NES Zapper --+10 "})
					return "KONAMI Levels you up to the maximum level and gives you NES Zapper!"
				else:
					return "KONAMI Levels you up to the maximum level!"
			else:
				return "Don't cheat if you don't know how to!"
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:104,代码来源:GameEN.py


注:本文中的Player.isItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。