MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / firepowerSection

Function firepowerSection

service/port/shipstats.py:15–30  ·  view source on GitHub ↗

Returns the text of the firepower section

(fit)

Source from the content-addressed store, hash-verified

13
14
15def firepowerSection(fit):
16 """ Returns the text of the firepower section"""
17 totalDps = fit.getTotalDps().total
18 weaponDps = fit.getWeaponDps().total
19 droneDps = fit.getDroneDps().total
20 totalVolley = fit.getTotalVolley().total
21 firepower = [totalDps, weaponDps, droneDps, totalVolley]
22
23 firepowerStr = [formatAmount(dps, 3, 0, 0) for dps in firepower]
24 # showWeaponAndDroneDps = (weaponDps > 0) and (droneDps > 0)
25 if sum(firepower) == 0:
26 return ""
27
28 return "DPS: {} (".format(firepowerStr[0]) + \
29 ("Weapon: {}, Drone: {}, ".format(*firepowerStr[1:3])) + \
30 ("Volley: {})\n".format(firepowerStr[3]))
31
32
33def tankSection(fit):

Callers 1

exportFitStatsFunction · 0.85

Calls 5

formatAmountFunction · 0.90
getTotalDpsMethod · 0.80
getWeaponDpsMethod · 0.80
getDroneDpsMethod · 0.80
getTotalVolleyMethod · 0.80

Tested by

no test coverage detected