Merge branch 'ammo_graph' into singularity

# Conflicts:
#	gui/targetProfileEditor.py
This commit is contained in:
DarkPhoenix
2020-06-09 19:04:20 +03:00
28 changed files with 582 additions and 232 deletions

View File

@@ -26,6 +26,8 @@ from eos.utils.spoolSupport import SpoolType, SpoolOptions, calculateSpoolup, re
class BaseEffect:
dealsDamage = False
@staticmethod
def handler(fit, module, context, projectionRange, **kwargs):
pass
@@ -62,6 +64,7 @@ class Effect10(BaseEffect):
Modules from group: Energy Weapon (212 of 214)
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -169,6 +172,7 @@ class Effect34(BaseEffect):
Modules from group: Projectile Weapon (165 of 165)
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -189,6 +193,7 @@ class Effect38(BaseEffect):
Modules from group: Smart Bomb (118 of 118)
"""
dealsDamage = True
type = 'active'
@@ -555,6 +560,7 @@ class Effect101(BaseEffect):
Structure Modules named like: Standup Launcher (7 of 7)
"""
dealsDamage = True
type = 'active', 'projected'
@staticmethod
@@ -15124,6 +15130,7 @@ class Effect4489(BaseEffect):
Module: 'Judgment' Electromagnetic Doomsday
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -15140,6 +15147,7 @@ class Effect4490(BaseEffect):
Module: 'Oblivion' Kinetic Doomsday
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -15156,6 +15164,7 @@ class Effect4491(BaseEffect):
Module: 'Aurora Ominae' Thermal Doomsday
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -15172,6 +15181,7 @@ class Effect4492(BaseEffect):
Module: 'Gjallarhorn' Explosive Doomsday
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -27364,6 +27374,7 @@ class Effect6431(BaseEffect):
Fighters from group: Light Fighter (32 of 32)
"""
dealsDamage = True
displayName = 'Missile Attack'
hasCharges = True
prefix = 'fighterAbilityMissiles'
@@ -27644,6 +27655,7 @@ class Effect6465(BaseEffect):
Fighters from group: Heavy Fighter (34 of 34)
"""
dealsDamage = True
displayName = 'Turret Attack'
prefix = 'fighterAbilityAttackMissile'
type = 'active'
@@ -27686,6 +27698,7 @@ class Effect6472(BaseEffect):
Modules named like: Lance (4 of 4)
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -27702,6 +27715,7 @@ class Effect6473(BaseEffect):
Module: Bosonic Field Generator
"""
dealsDamage = True
type = 'active'
@staticmethod
@@ -27912,6 +27926,7 @@ class Effect6485(BaseEffect):
Fighters from group: Heavy Fighter (16 of 34)
"""
dealsDamage = True
displayName = 'Bomb'
hasCharges = True
prefix = 'fighterAbilityLaunchBomb'
@@ -33964,6 +33979,7 @@ class Effect6995(BaseEffect):
Modules from group: Precursor Weapon (19 of 19)
"""
dealsDamage = True
type = 'active'
@staticmethod

View File

@@ -146,6 +146,12 @@ class Effect(EqBase):
return self.__effectDef is not None
@property
def dealsDamage(self):
if not self.__generated:
self.__generateHandler()
return self.__dealsDamage
def isType(self, type):
"""
Check if this effect is of the passed type
@@ -167,6 +173,7 @@ class Effect(EqBase):
self.__handler = getattr(effectDef, "handler", eos.effects.BaseEffect.handler)
self.__runTime = getattr(effectDef, "runTime", "normal")
self.__activeByDefault = getattr(effectDef, "activeByDefault", True)
self.__dealsDamage = effectDef.dealsDamage
effectType = getattr(effectDef, "type", None)
effectType = effectType if isinstance(effectType, tuple) or effectType is None else (effectType,)
self.__type = effectType
@@ -175,6 +182,7 @@ class Effect(EqBase):
self.__handler = eos.effects.DummyEffect.handler
self.__runTime = "normal"
self.__activeByDefault = True
self.__dealsDamage = False
self.__type = None
pyfalog.debug("ImportError generating handler: {0}", e)
except AttributeError as e:
@@ -182,6 +190,7 @@ class Effect(EqBase):
self.__handler = eos.effects.DummyEffect.handler
self.__runTime = "normal"
self.__activeByDefault = True
self.__dealsDamage = False
self.__type = None
pyfalog.error("AttributeError generating handler: {0}", e)
except (KeyboardInterrupt, SystemExit):
@@ -190,6 +199,7 @@ class Effect(EqBase):
self.__handler = eos.effects.DummyEffect.handler
self.__runTime = "normal"
self.__activeByDefault = True
self.__dealsDamage = False
self.__type = None
pyfalog.critical("Exception generating handler:")
pyfalog.critical(e)

View File

@@ -364,3 +364,11 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
if self.item.groupID in fitDroneGroupLimits:
return True
return False
def canDealDamage(self, ignoreState=False):
if self.item is None:
return False
for effect in self.item.effects.values():
if effect.dealsDamage and (ignoreState or self.amountActive > 0):
return True
return False

View File

@@ -441,3 +441,15 @@ class Fighter(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
return False
return True
def canDealDamage(self, ignoreState=False, ignoreAbilityState=False):
if self.item is None:
return False
if not self.active and not ignoreState:
return False
for ability in self.abilities:
if not ability.active and not ignoreAbilityState:
continue
if ability.effect.dealsDamage:
return True
return False

View File

@@ -461,6 +461,20 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
return True
return False
def canDealDamage(self, ignoreState=False):
if self.isEmpty:
return False
for effect in self.item.effects.values():
if effect.dealsDamage and (
ignoreState or
effect.isType('offline') or
(effect.isType('passive') and self.state >= FittingModuleState.ONLINE) or
(effect.isType('active') and self.state >= FittingModuleState.ACTIVE) or
(effect.isType('overheat') and self.state >= FittingModuleState.OVERHEATED)
):
return True
return False
def getVolleyParameters(self, spoolOptions=None, targetProfile=None, ignoreState=False):
if self.isEmpty or (self.state < FittingModuleState.ACTIVE and not ignoreState):
return {0: DmgTypes(0, 0, 0, 0)}