classesentitee.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:AbricotGame 作者: NB0174 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号