2323import gui .mainFrame
2424from gui .bitmap_loader import BitmapLoader
2525from gui .statsView import StatsView
26+ from eos .const import FittingModuleState
27+ from service .market import Market
2628
2729_t = wx .GetTranslation
2830
@@ -89,9 +91,30 @@ def refreshPanel(self, fit):
8991 if fit is None :
9092 return
9193
92- bombDamage = 5800
93- bombSigRadius = 400
94- sigRadius = fit .ship .getModifiedItemAttr ('signatureRadius' )
94+ mkt = Market .getInstance ()
95+ emBomb = mkt .getItem (27920 )
96+ thermalBomb = mkt .getItem (27916 )
97+ kineticBomb = mkt .getItem (27912 )
98+ explosiveBomb = mkt .getItem (27918 )
99+ environementBombDamageModifier = 1.0
100+
101+ # list all environmental effects affecting bomb damage
102+ relevantEffects = [
103+ 'Class 6 Red Giant Effects' ,
104+ 'Class 5 Red Giant Effects' ,
105+ 'Class 4 Red Giant Effects' ,
106+ 'Class 3 Red Giant Effects' ,
107+ 'Class 2 Red Giant Effects' ,
108+ 'Class 1 Red Giant Effects' ,
109+ ]
110+ for effect in fit .projectedModules :
111+ if effect .state == FittingModuleState .ONLINE and effect .fullName in relevantEffects :
112+ # note: despite the name, smartbombDamageMultiplier applies to the damage of launched bombs
113+ environementBombDamageModifier = environementBombDamageModifier * \
114+ effect .item .attributes ['smartbombDamageMultiplier' ].value
115+
116+ # signature radius of the current fit to calculate the application of bombs
117+ shipSigRadius = fit .ship .getModifiedItemAttr ('signatureRadius' )
95118
96119 # get the raw values for all hp layers
97120 hullHP = fit .ship .getModifiedItemAttr ('hp' )
@@ -114,18 +137,24 @@ def refreshPanel(self, fit):
114137
115138 # updates the labels for each combination of covert op level and damage type
116139 for covertLevel in ("0" , "1" , "2" , "3" , "4" , "5" ):
117- modBombDamage = bombDamage * (1 + 0.05 * int (covertLevel ))
118- for damageType , ehp , bomber in (("em" , emEhp , "Purifier" ), ("thermal" , thermalEhp , "Nemesis" ),
119- ("kinetic" , kineticEhp , "Manticore" ), ("explosive" , explosiveEhp , "Hound" )):
120- effectiveBombDamage = modBombDamage * min (bombSigRadius , sigRadius ) / bombSigRadius
140+ covertOpsBombDamageModifier = 1 + 0.05 * int (covertLevel )
141+ for damageType , ehp , bomber , bomb in (("em" , emEhp , "Purifier" , emBomb ),
142+ ("thermal" , thermalEhp , "Nemesis" , thermalBomb ),
143+ ("kinetic" , kineticEhp , "Manticore" , kineticBomb ),
144+ ("explosive" , explosiveEhp , "Hound" , explosiveBomb )):
145+ baseBombDamage = (bomb .attributes ['emDamage' ].value + bomb .attributes ['thermalDamage' ].value +
146+ bomb .attributes ['kineticDamage' ].value + bomb .attributes ['explosiveDamage' ].value )
147+ appliedBombDamage = baseBombDamage * covertOpsBombDamageModifier * environementBombDamageModifier * \
148+ (min (bomb .attributes ['signatureRadius' ].value , shipSigRadius ) /
149+ bomb .attributes ['signatureRadius' ].value )
121150 label = getattr (self , "labelDamagetypeCovertlevel%s%s" % (damageType .capitalize (), covertLevel ))
122- label .SetLabel ("{:.1f}" .format (ehp / effectiveBombDamage ))
151+ label .SetLabel ("{:.1f}" .format (ehp / appliedBombDamage ))
123152 if covertLevel is not "0" :
124- label .SetToolTip ("Number of %s bombs to kill a %s using a %s "
125- "with Covert Ops level %s" % (damageType , fit .name , bomber , covertLevel ))
153+ label .SetToolTip ("Number of %s to kill a %s using a %s "
154+ "with Covert Ops level %s" % (bomb . customName , fit .name , bomber , covertLevel ))
126155 else :
127- label .SetToolTip ("Number of %s bombs to kill a %s with Covert Ops level %s" %
128- (damageType , fit .name , covertLevel ))
156+ label .SetToolTip ("Number of %s to kill a %s with Covert Ops level %s" %
157+ (bomb . customName , fit .name , covertLevel ))
129158
130159
131160 self .panel .Layout ()
0 commit comments