From c64d09ca541618f9b77fdfaad9267b117541f30c Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 8 Jul 2019 08:27:00 +0300 Subject: [PATCH] Get data about webbing/TPing drones --- .../fitDamageStats/projectedCache.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gui/builtinGraphs/fitDamageStats/projectedCache.py b/gui/builtinGraphs/fitDamageStats/projectedCache.py index d54d20db5..195945643 100644 --- a/gui/builtinGraphs/fitDamageStats/projectedCache.py +++ b/gui/builtinGraphs/fitDamageStats/projectedCache.py @@ -46,3 +46,32 @@ class ProjectedDataCache(FitDataCache): maxRange = max(0, (mod.maxRange or 0) + mod.getModifiedItemAttr('doomsdayAOERange') - fit.ship.getModifiedItemAttr('radius')) tpMods.append((mod.getModifiedItemAttr('signatureRadiusBonus'), maxRange, mod.falloff or 0, 'default')) return projectedData + + def getProjDroneData(self, fit): + try: + projectedData = self._data[fit.ID]['drones'] + except KeyError: + # Format of items for both: (boost strength, optimal, falloff, stacking group, speed, radius) + webMods = [] + tpMods = [] + projectedData = self._data.setdefault(fit.ID, {})['drones'] = (webMods, tpMods) + for drone in fit.drones: + if drone.amountActive <= 0: + continue + if 'remoteWebifierEntity' in drone.item.effects: + webMods.extend(drone.amountActive * (( + drone.getModifiedItemAttr('speedFactor'), + drone.maxRange or 0, + drone.falloff or 0, + 'default', + drone.getModifiedItemAttr('maxVelocity'), + drone.getModifiedItemAttr('radius')),)) + if 'remoteTargetPaintEntity' in drone.item.effects: + webMods.extend(drone.amountActive * (( + drone.getModifiedItemAttr('signatureRadiusBonus'), + drone.maxRange or 0, + drone.falloff or 0, + 'default', + drone.getModifiedItemAttr('maxVelocity'), + drone.getModifiedItemAttr('radius')),)) + return projectedData