Beispiel #1
0
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
Beispiel #2
0
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