diff --git a/eos/effects/fighterabilitylaunchbomb.py b/eos/effects/fighterabilitylaunchbomb.py new file mode 100644 index 000000000..55e5eca15 --- /dev/null +++ b/eos/effects/fighterabilitylaunchbomb.py @@ -0,0 +1,14 @@ +""" +Since fighter abilities do not have any sort of item entity in the EVE database, we must derive the abilities from the +effects, and thus this effect file contains some custom information useful only to fighters. +""" +# User-friendly name for the ability +displayName = "Bomb" + +# Attribute prefix that this ability targets +prefix = "fighterAbilityLaunchBomb" + +type = "active" + +def handler(fit, src, context): + pass \ No newline at end of file diff --git a/eos/saveddata/fighter.py b/eos/saveddata/fighter.py index 6f779ac80..0791d3397 100644 --- a/eos/saveddata/fighter.py +++ b/eos/saveddata/fighter.py @@ -87,8 +87,7 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): self.__itemModifiedAttributes.overrides = self.__item.overrides self.__slot = self.__calculateSlot(self.__item) - # chargeID = self.getModifiedItemAttr("fighterAbilityLaunchBombType") - chargeID = None + chargeID = self.getModifiedItemAttr("fighterAbilityLaunchBombType") if chargeID is not None: charge = eos.db.getItem(int(chargeID)) self.__charge = charge @@ -124,6 +123,10 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): def abilities(self): return self.__abilities or [] + @property + def charge(self): + return self.__charge + @property def itemModifiedAttributes(self): return self.__itemModifiedAttributes @@ -159,9 +162,14 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): if self.active: for ability in self.abilities: if ability.dealsDamage and ability.active and self.amountActive > 0: - cycleTime = self.getModifiedItemAttr("{}Duration".format(ability.attrPrefix)) - volley = sum(map(lambda d2, d: + cycleTime = self.getModifiedItemAttr("{}Duration".format(ability.attrPrefix)) + if ability.attrPrefix == "fighterAbilityLaunchBomb": + # bomb calcs + volley = sum(map(lambda attr: (self.getModifiedChargeAttr("%sDamage" % attr) or 0) * (1 - getattr(targetResists, "%sAmount" % attr, 0)), self.DAMAGE_TYPES)) + print volley + else: + volley = sum(map(lambda d2, d: (self.getModifiedItemAttr("{}Damage{}".format(ability.attrPrefix, d2)) or 0) * (1-getattr(targetResists, "{}Amount".format(d), 0)), self.DAMAGE_TYPES2, self.DAMAGE_TYPES)) diff --git a/eos/saveddata/fighterAbility.py b/eos/saveddata/fighterAbility.py index 0397e3215..3956a2e4d 100644 --- a/eos/saveddata/fighterAbility.py +++ b/eos/saveddata/fighterAbility.py @@ -62,7 +62,7 @@ class FighterAbility(object): @property def dealsDamage(self): attr = "{}DamageMultiplier".format(self.attrPrefix) - return attr in self.fighter.itemModifiedAttributes + return attr in self.fighter.itemModifiedAttributes or self.fighter.charge is not None @property def grouped(self):