Clean up logic and generally make purdier
This commit is contained in:
@@ -459,28 +459,23 @@ class Miscellanea(ViewColumn):
|
|||||||
):
|
):
|
||||||
if "Armor" in itemGroup or "Shield" in itemGroup:
|
if "Armor" in itemGroup or "Shield" in itemGroup:
|
||||||
boosted_attribute = "HP"
|
boosted_attribute = "HP"
|
||||||
|
reload_time = item.getAttribute("reloadTime", 0) / 1000
|
||||||
elif "Capacitor" in itemGroup:
|
elif "Capacitor" in itemGroup:
|
||||||
boosted_attribute = "Cap"
|
boosted_attribute = "Cap"
|
||||||
|
reload_time = 10
|
||||||
else:
|
else:
|
||||||
boosted_attribute = None
|
boosted_attribute = ""
|
||||||
|
reload_time = 0
|
||||||
|
|
||||||
hp = stuff.hpBeforeReload
|
|
||||||
cycles = stuff.numShots
|
cycles = stuff.numShots
|
||||||
cycleTime = stuff.rawCycleTime
|
cycleTime = stuff.rawCycleTime
|
||||||
|
|
||||||
if boosted_attribute == "Cap":
|
# Get HP or boosted amount
|
||||||
if hp is None:
|
stuff_hp = stuff.hpBeforeReload
|
||||||
local_booster = stuff.charge.getAttribute("capacitorBonus", 0)
|
armor_hp = stuff.getModifiedItemAttr("armorDamageAmount", 0)
|
||||||
hp = max(local_booster, 0) * cycles
|
capacitor_hp = stuff.charge.getModifiedChargeAttr("capacitorBonus", 0)
|
||||||
reload_time = 10
|
shield_hp = stuff.getModifiedItemAttr("shieldBonus", 0)
|
||||||
elif boosted_attribute == "HP":
|
hp = max(stuff_hp, armor_hp * cycles, capacitor_hp * cycles, shield_hp * cycles, 0)
|
||||||
if hp is None:
|
|
||||||
armor_repairer = item.getAttribute("armorDamageAmount", None)
|
|
||||||
shield_booster = item.getAttribute("shieldBonus", None)
|
|
||||||
hp = max(armor_repairer, shield_booster, 0)
|
|
||||||
reload_time = item.getAttribute("reloadTime", 0) / 1000
|
|
||||||
else:
|
|
||||||
reload_time = 0
|
|
||||||
|
|
||||||
if not hp or not cycleTime or not cycles:
|
if not hp or not cycleTime or not cycles:
|
||||||
return "", None
|
return "", None
|
||||||
|
|||||||
Reference in New Issue
Block a user