Exemplo n.º 1
0
    def hp(self):
        """Fetch HP stats of the item.

        Returns:
            TankingLayersTotal helper container instance.
        """
        hull = self.attrs.get(AttrId.hp, 0)
        armor = self.attrs.get(AttrId.armor_hp, 0)
        shield = self.attrs.get(AttrId.shield_capacity, 0)
        return ItemHP(hull, armor, shield)
Exemplo n.º 2
0
    def hp(self):
        """Fetch ship HP stats.

        Returns:
            TankingLayersTotal helper container instance. If ship data cannot be
            fetched, HP values will be None.
        """
        try:
            return self.__fit.ship.hp
        except AttributeError:
            return ItemHP(0, 0, 0)
Exemplo n.º 3
0
    def get_ehp(self, dmg_profile=None):
        """Get effective HP of an item against passed damage profile.

        Args:
            dmg_profile (optional): DmgProfile helper container instance. If not
                specified, default on-fit damage profile is used.

        Returns:
            TankingLayersTotal helper container instance.
        """
        if dmg_profile is None:
            dmg_profile = self._fit.default_incoming_dmg
        # If damage profile is not specified anywhere, return Nones
        if dmg_profile is None:
            return ItemHP(0, 0, 0)
        hull_ehp = self.__get_layer_ehp(self.hp.hull, self.resists.hull,
                                        dmg_profile)
        armor_ehp = self.__get_layer_ehp(self.hp.armor, self.resists.armor,
                                         dmg_profile)
        shield_ehp = self.__get_layer_ehp(self.hp.shield, self.resists.shield,
                                          dmg_profile)
        return ItemHP(hull_ehp, armor_ehp, shield_ehp)
Exemplo n.º 4
0
    def worst_case_ehp(self):
        """Get eve-style effective HP for the item.

        Eve takes the worst resistance and calculates EHP against it, on a per-
        layer basis.

        Returns:
            TankingLayersTotal helper container instance. If ship data cannot be
            fetched, EHP values will be None.
        """
        try:
            return self.__fit.ship.worst_case_ehp
        except AttributeError:
            return ItemHP(0, 0, 0)
Exemplo n.º 5
0
    def get_ehp(self, dmg_profile=None):
        """Get effective HP of an item against passed damage profile.

        Args:
            dmg_profile (optional): DmgProfile helper container instance. If
                not specified, default on-fit damage profile is used.

        Returns:
            TankingLayersTotal helper container instance. If ship data cannot be
            fetched, EHP values will be None.
        """
        try:
            return self.__fit.ship.get_ehp(dmg_profile)
        except AttributeError:
            return ItemHP(0, 0, 0)
Exemplo n.º 6
0
    def worst_case_ehp(self):
        """Get eve-style effective HP for the item.

        Eve takes the worst resistance and calculates EHP against it, on a per-
        layer basis.

        Returns:
            TankingLayersTotal helper container instance.
        """
        hull_ehp = self.__get_layer_worst_case_ehp(self.hp.hull,
                                                   self.resists.hull)
        armor_ehp = self.__get_layer_worst_case_ehp(self.hp.armor,
                                                    self.resists.armor)
        shield_ehp = self.__get_layer_worst_case_ehp(self.hp.shield,
                                                     self.resists.shield)
        return ItemHP(hull_ehp, armor_ehp, shield_ehp)