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


Python Player.editXp方法代码示例

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


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

示例1: attack

# 需要导入模块: import Player [as 别名]
# 或者: from Player import editXp [as 别名]
def attack(): #Gestion du combat
	if Map.isMonster(Player.getPosition()) == 0:
		descript = "Qui voulez-vous attaquer dites-moi? Les murs?"
	else :
		playerPow = Player.getPower()
		monsterPow = Map.getMonsterPower(Player.getPosition())
		player1, player2, monster1, monster2 = random.randint(1,6),random.randint(1,6),random.randint(1,6),random.randint(1,6)
		if Player.isEquip() == 1:
			equipPow = Player.getEquipModifier()
		else:
			equipPow = 0
		descript = "Vous chargez tous les deux."
		if playerPow+player1+player2+equipPow >= monsterPow+monster1+monster2:
			Map.editMonsterHealth(Player.getPosition(),-2)
			descript += "Vous blessez votre adversaire."
		else:
			if random.randint(1,6) == 6:
				Player.editHealth(-2)
			else:
				Player.editHealth(-1)
			descript += "Votre adversaire vous blesse. "
		if Map.getMonsterHealth(Player.getPosition()) <= 0:
			descript += "CE coup lui est fatal. Son corps tombe tel un pantin desarticule et, quelques secondes plus tard, il se desintegre." 
			Player.editXp(Map.getMonsterXp(Player.getPosition()))
			Map.removeMonster(Player.getPosition())
	Player.editTime(1)
	return descript
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:29,代码来源:GameFR.py

示例2: attack

# 需要导入模块: import Player [as 别名]
# 或者: from Player import editXp [as 别名]
def attack(): #Gestion du combat
	if Map.isMonster(Player.getPosition()) == 0:
		descript = "Tell me, who are you trying to fight? The walls perhaps?"
	else :
		playerPow = Player.getPower()
		monsterPow = Map.getMonsterPower(Player.getPosition())
		player1, player2, monster1, monster2 = random.randint(1,6),random.randint(1,6),random.randint(1,6),random.randint(1,6)
		if Player.isEquip() == 1:
			equipPow = Player.getEquipModifier()
		else:
			equipPow = 0
		descript = "You both charge at the other."
		if playerPow+player1+player2+equipPow >= monsterPow+monster1+monster2:
			Map.editMonsterHealth(Player.getPosition(),-2)
			descript += "You hit your opponent."
		else:
			if random.randint(1,6) == 6:
				Player.editHealth(-2)
			else :
				Player.editHealth(-1)
			descript += "Your opponent hits you. "
		if Map.getMonsterHealth(Player.getPosition()) <= 0:
			descript += "THIS blow is deadly. It's body falls like a ragdoll and, a few seconds later, it disintegrates." 
			Player.editXp(Map.getMonsterXp(Player.getPosition()))
			Map.removeMonster(Player.getPosition())
	Player.editTime(1)
	return descript
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:29,代码来源:GameEN.py


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