Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Aug 18, 2014
2 parents 84ac71f + 0032163 commit 493bf5c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
8 changes: 6 additions & 2 deletions eos/effects/ewtesteffectjam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions eos/effects/overloadselfecmstrenghtbonus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 10 additions & 3 deletions eos/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def __init__(self):
self.boostsFits = set()
self.gangBoosts = None
self.timestamp = time.time()
self.ecmProjectedStr = 1
self.build()

@reconstructor
Expand Down Expand Up @@ -93,6 +94,7 @@ def build(self):
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
Expand Down Expand Up @@ -226,6 +228,10 @@ def scanType(self):

return type

@property
def jamChance(self):
return (1-self.ecmProjectedStr)*100

@property
def alignTime(self):
agility = self.ship.getModifiedItemAttr("agility")
Expand Down Expand Up @@ -269,6 +275,7 @@ def clear(self):
self.__capState = None
self.__capUsed = None
self.__capRecharge = None
self.ecmProjectedStr = 1
del self.__calculatedTargets[:]
del self.__extraDrains[:]

Expand Down Expand Up @@ -341,7 +348,7 @@ def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyS
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",
Expand All @@ -366,7 +373,7 @@ def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyS
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:
Expand All @@ -375,7 +382,7 @@ def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyS
if forceProjected is True:
targetFit.register(item)
item.calculateModifiedAttributes(targetFit, runTime, True)

for fit in self.projectedFits:
fit.calculateModifiedAttributes(self, withBoosters=withBoosters, dirtyStorage=dirtyStorage)

Expand Down
15 changes: 13 additions & 2 deletions gui/builtinStatsViews/targetingMiscViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,15 @@ def refreshPanel(self, fit):
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":
Expand All @@ -214,6 +217,14 @@ def refreshPanel(self, fit):
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]
Expand Down

0 comments on commit 493bf5c

Please sign in to comment.