Add fighter bomb launcher logic

This commit is contained in:
blitzmann
2016-04-29 19:10:51 -04:00
parent cfd82a6ad4
commit b5420e9c6a
3 changed files with 27 additions and 5 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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):