Beispiel #1
0
    def __init__(self,
                 record_id=None,
                 level=None,
                 health=None,
                 abilities=None,
                 is_boss=False,
                 action_type=actions_relations.ACTION_TYPE.BATTLE_PVE_1X1,
                 terrain=map_relations.TERRAIN.PLANE_GRASS):

        self.record_id = record_id
        self.level = level
        self.is_boss = is_boss

        self.abilities = self._produce_abilities(
            self.record, level) if abilities is None else abilities

        self.initiative = self.abilities.modify_attribute(
            heroes_relations.MODIFIERS.INITIATIVE, 1)
        self.health_cooficient = self.abilities.modify_attribute(
            heroes_relations.MODIFIERS.HEALTH, 1)
        self.damage_modifier = self.abilities.modify_attribute(
            heroes_relations.MODIFIERS.DAMAGE, 1)

        if self.is_boss:
            self.max_health = int(
                f.boss_hp_to_lvl(level) * self.health_cooficient)
        else:
            self.max_health = int(
                f.mob_hp_to_lvl(level) * self.health_cooficient)

        self.health = self.max_health if health is None else health

        self.action_type = action_type
        self.terrain = terrain
Beispiel #2
0
    def __init__(self,
                 record_id=None,
                 level=None,
                 health=None,
                 abilities=None,
                 is_boss=False,
                 action_type=actions_relations.ACTION_TYPE.BATTLE_PVE_1X1,
                 terrain=map_relations.TERRAIN.PLANE_GRASS):

        self.record_id = record_id
        self.level = level
        self.is_boss = is_boss

        self.abilities = self._produce_abilities(self.record, level) if abilities is None else abilities

        self.initiative = self.abilities.modify_attribute(HERO_MODIFIERS.INITIATIVE, 1)
        self.health_cooficient = self.abilities.modify_attribute(HERO_MODIFIERS.HEALTH, 1)
        self.damage_modifier = self.abilities.modify_attribute(HERO_MODIFIERS.DAMAGE, 1)

        if self.is_boss:
            self.max_health = int(f.boss_hp_to_lvl(level) * self.health_cooficient)
        else:
            self.max_health = int(f.mob_hp_to_lvl(level) * self.health_cooficient)

        self.health = self.max_health if health is None else health

        self.action_type = action_type
        self.terrain = terrain
Beispiel #3
0
    def __init__(self,
                 record_id=None,
                 level=None,
                 health=None,
                 abilities=None,
                 is_boss=False):

        self.record_id = record_id
        self.level = level
        self.is_boss = is_boss

        self.abilities = self._produce_abilities(
            self.record, level) if abilities is None else abilities

        self.initiative = self.abilities.modify_attribute(
            HERO_MODIFIERS.INITIATIVE, 1)
        self.health_cooficient = self.abilities.modify_attribute(
            HERO_MODIFIERS.HEALTH, 1)
        self.damage_modifier = self.abilities.modify_attribute(
            HERO_MODIFIERS.DAMAGE, 1)

        if self.is_boss:
            self.max_health = int(
                f.boss_hp_to_lvl(level) * self.health_cooficient)
        else:
            self.max_health = int(
                f.mob_hp_to_lvl(level) * self.health_cooficient)

        self.health = self.max_health if health is None else health
Beispiel #4
0
 def use(self, messenger, actor, enemy):  # pylint: disable=W0613
     health_to_regen = f.mob_hp_to_lvl(
         actor.level) * self.restored_percent * (1 + random.uniform(
             -c.DAMAGE_DELTA, c.DAMAGE_DELTA))  # !!!MOB HP, NOT HERO!!!
     applied_health = int(round(actor.change_health(health_to_regen)))
     messenger.add_message('hero_ability_regeneration',
                           actor=actor,
                           health=applied_health)
Beispiel #5
0
    def __init__(self, record_id=None, level=None, health=None, abilities=None, is_boss=False):

        self.record_id = record_id
        self.level = level
        self.is_boss = is_boss

        self.abilities = self._produce_abilities(self.record, level) if abilities is None else abilities

        self.initiative = self.abilities.modify_attribute(HERO_MODIFIERS.INITIATIVE, 1)
        self.health_cooficient = self.abilities.modify_attribute(HERO_MODIFIERS.HEALTH, 1)
        self.damage_modifier = self.abilities.modify_attribute(HERO_MODIFIERS.DAMAGE, 1)

        if self.is_boss:
            self.max_health = int(f.boss_hp_to_lvl(level) * self.health_cooficient)
        else:
            self.max_health = int(f.mob_hp_to_lvl(level) * self.health_cooficient)

        self.health = self.max_health if health is None else health
Beispiel #6
0
 def use(self, messenger, actor, enemy): # pylint: disable=W0613
     health_to_regen = f.mob_hp_to_lvl(actor.level) * self.restored_percent * (1 + random.uniform(-c.DAMAGE_DELTA, c.DAMAGE_DELTA))# !!!MOB HP, NOT HERO!!!
     applied_health = int(round(actor.change_health(health_to_regen)))
     messenger.add_message('hero_ability_regeneration', actor=actor, health=applied_health)