Merge remote-tracking branch 'origin/master'

This commit is contained in:
blitzmann
2014-08-18 01:24:04 -04:00
4 changed files with 34 additions and 11 deletions

View File

@@ -2,5 +2,9 @@
# Modules from group: ECM (44 of 44)
# Drones named like: EC (3 of 3)
type = "projected", "active"
def handler(fit, container, context):
pass
def handler(fit, module, context):
if "projected" in context:
# jam formula: 1 - (1- (jammer str/ship str))^(# of jam mods with same str))
strModifier = 1 - module.getModifiedItemAttr("scan{0}StrengthBonus".format(fit.scanType))/fit.scanStrength
fit.ecmProjectedStr *= strModifier

View File

@@ -3,7 +3,8 @@
# Modules from group: ECM Burst (7 of 7)
type = "overheat"
def handler(fit, module, context):
for scanType in ("Gravimetric", "Magnetometric", "Radar", "Ladar"):
module.boostItemAttr("scan{0}StrengthBonus".format(scanType),
module.getModifiedItemAttr("overloadECMStrengthBonus"),
stackingPenalties = True)
if "projected" not in context:
for scanType in ("Gravimetric", "Magnetometric", "Radar", "Ladar"):
module.boostItemAttr("scan{0}StrengthBonus".format(scanType),
module.getModifiedItemAttr("overloadECMStrengthBonus"),
stackingPenalties = True)

View File

@@ -65,6 +65,7 @@ class Fit(object):
self.boostsFits = set()
self.gangBoosts = None
self.timestamp = time.time()
self.ecmProjectedStr = 1
self.build()
@reconstructor
@@ -93,6 +94,7 @@ class Fit(object):
self.fleet = None
self.boostsFits = set()
self.gangBoosts = None
self.ecmProjectedStr = 1
self.extraAttributes = ModifiedAttributeDict(self)
self.extraAttributes.original = self.EXTRA_ATTRIBUTES
self.ship = Ship(db.getItem(self.shipID)) if self.shipID is not None else None
@@ -226,6 +228,10 @@ class Fit(object):
return type
@property
def jamChance(self):
return (1-self.ecmProjectedStr)*100
@property
def alignTime(self):
agility = self.ship.getModifiedItemAttr("agility")
@@ -269,6 +275,7 @@ class Fit(object):
self.__capState = None
self.__capUsed = None
self.__capRecharge = None
self.ecmProjectedStr = 1
del self.__calculatedTargets[:]
del self.__extraDrains[:]
@@ -341,7 +348,7 @@ class Fit(object):
else:
c = chain((self.character, self.ship), self.drones, self.boosters, self.appliedImplants, self.modules,
self.projectedDrones, self.projectedModules)
if self.gangBoosts is not None:
contextMap = {Skill: "skill",
Ship: "ship",
@@ -366,7 +373,7 @@ class Fit(object):
effect.handler(self, thing, context)
except:
pass
for item in c:
# Registering the item about to affect the fit allows us to track "Affected By" relations correctly
if item is not None:
@@ -375,7 +382,7 @@ class Fit(object):
if forceProjected is True:
targetFit.register(item)
item.calculateModifiedAttributes(targetFit, runTime, True)
for fit in self.projectedFits:
fit.calculateModifiedAttributes(self, withBoosters=withBoosters, dirtyStorage=dirtyStorage)

View File

@@ -189,12 +189,15 @@ class TargetingMiscViewFull(StatsView):
right = "%s [%d]" % (size, radius)
lockTime += "%5s\t%s\n" % (left,right)
label.SetToolTip(wx.ToolTip(lockTime))
elif labelName == "labelSensorStr":
label.SetToolTip(wx.ToolTip("Type: %s - %.1f" % (fit.scanType, mainValue)))
elif labelName == "labelFullSigRadius":
label.SetToolTip(wx.ToolTip("Probe Size: %.3f" % (fit.probeSize or 0) ))
elif labelName == "labelFullWarpSpeed":
label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance))
elif labelName == "labelSensorStr":
if fit.jamChance > 0:
label.SetToolTip(wx.ToolTip("Type: %s\n%.1f%% Chance of Jam" % (fit.scanType, fit.jamChance)))
else:
label.SetToolTip(wx.ToolTip("Type: %s" % (fit.scanType)))
elif labelName == "labelFullAlignTime":
label.SetToolTip(wx.ToolTip("%.3f" % mainValue))
elif labelName == "labelFullCargo":
@@ -214,6 +217,14 @@ class TargetingMiscViewFull(StatsView):
label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance))
else:
label.SetToolTip(wx.ToolTip(""))
elif labelName == "labelSensorStr":
if fit:
if fit.jamChance > 0:
label.SetToolTip(wx.ToolTip("Type: %s\n%.1f%% Chance of Jam" % (fit.scanType, fit.jamChance)))
else:
label.SetToolTip(wx.ToolTip("Type: %s" % (fit.scanType)))
else:
label.SetToolTip(wx.ToolTip(""))
elif labelName == "labelFullCargo":
if fit:
cachedCargo = self._cachedValues[counter]