def verif_conditions(self, entitee: Entitee, cible: Tuple[int, int]) -> bool:
"""Cette fonction détermine si le sort est valide"""
if entitee.var_attributs.ap >= self.cost:
if entitee.combat_coords[0] == cible[0]:
if not (self.max_range >= abs(entitee.combat_coords[1] - cible[1]) >= self.min_range):
return False
elif entitee.combat_coords[1] == cible[1]:
if not (self.max_range >= abs(entitee.combat_coords[0] - cible[0]) >= self.min_range):
return False
else:
return False
cases_traversee = bresenham(entitee.combat_coords, cible)
for i in cases_traversee:
if i in entitee.combat.map.fullobs:
return False
entitee.var_attributs.ap -= self.cost
return True
return False
评论列表
文章目录