attack.py 文件源码

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

项目:alpha 作者: ArielHorwitz 项目源码 文件源码
def point_damage(universe,target,dmg,bodypart,damage_type=None):
    bodypart = target.body.get_bodypart(bodypart)
    if bodypart is None:
        Common.debug(8,'No such bodypart! get_bodypart returned None')
        return False
    if bodypart.hp <= 0:
        if bodypart.size != 0:
            truth_about_death = bodypart_death(universe,target,bodypart,damage_type)
            Common.debug(9,'Bodypart found dead. Applying death mechanic')
            return truth_about_death
        else:
            Common.debug(8,'bodypart is a category. randomizing child')
            bodypart = bodypart.get_children()[random.randrange(bodypart.get_children().__len__())]
            if bodypart is None:
                Common.debug(8, 'No bodypart found, point attack missed!')
                return False

    damage_remainder = damage(target,dmg,bodypart,damage_type)
    if damage_remainder <= 0:
        truth_about_death = bodypart_death(universe,target,bodypart,damage_type)
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号