本文整理汇总了Python中Player.editTime方法的典型用法代码示例。如果您正苦于以下问题:Python Player.editTime方法的具体用法?Python Player.editTime怎么用?Python Player.editTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.editTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: attack
# 需要导入模块: import Player [as 别名]
# 或者: from Player import editTime [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 editTime [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
示例3: move
# 需要导入模块: import Player [as 别名]
# 或者: from Player import editTime [as 别名]
def move(direction): # Deplace le joueur si possible
flee = random.randint(1,6)
if Map.isMonster(Player.getPosition()) == 0 or flee == 6:
answer = Map.check(Player.getPosition(),direction)
if answer == 0:
return 'Il y a un mur dans cette direction'
elif answer == 1 :
Player.move(direction)
Player.editTime(10)
return Map.getDescript(Player.getPosition())
else :
win()
exitGame()
else:
Player.editHealth(-1)
Player.editTime(1)
return "Votre adversaire vous attrappe par le col et frappe a l'estomac. Battez-vous que diable!"
示例4: move
# 需要导入模块: import Player [as 别名]
# 或者: from Player import editTime [as 别名]
def move(direction): # Deplace le joueur si possible
flee = random.randint(1,6)
if Map.isMonster(Player.getPosition()) == 0 or flee == 6:
answer = Map.check(Player.getPosition(),direction)
if answer == 0:
return "You can't go this way. Unless, of course, you can walk through walls!"
elif answer == 1 :
Player.move(direction)
Player.editTime(10)
return Map.getDescript(Player.getPosition())
else :
win()
exitGame()
else:
Player.editHealth(-1)
Player.editTime(1)
return "Votre adversaire vous attrappe par le col et frappe a l'estomac. Battez-vous que diable!"
示例5: move
# 需要导入模块: import Player [as 别名]
# 或者: from Player import editTime [as 别名]
def move(direction): # Deplace le joueur si possible
global visited
flee = random.randint(1,6)
if Map.isMonster(Player.getPosition()) == 0 or flee == 6:
answer = Map.check(Player.getPosition(),direction)
if answer == 0:
return 'There is a wall in this direction.'
elif answer == 1 :
Player.move(direction)
Player.editTime(10)
if Map.getVisited(Player.getPosition()) == 0:
Map.setMonster(Player.getPosition(),Player.getLevel())
Map.setVisited(Player.getPosition())
visited += 1
return Map.getDescript(Player.getPosition())
else :
win()
exitGame()
else:
Player.editHealth(-1)
Player.editTime(1)
return "You opponent pulls you by the collar and punches you in the stomach. Fight for heaven's sake!"