本文整理汇总了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
示例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