Skip to content

Commit c6f2089

Browse files
committed
Updated Navy Ammo meta filter to be cumulative instead of exclusive buckets to fix bug related to Exotic plasma not having navy variants.
1 parent 11ac35c commit c6f2089

1 file changed

Lines changed: 30 additions & 26 deletions

File tree

graphs/data/fitApplicationProfile/calc/charges.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
'Republic Fleet ',
2828
'Caldari Navy ',
2929
'Federation Navy ',
30-
'Plasma '
3130
)
3231

3332
# Capital (XL) "navy-tier" faction ammo prefixes
@@ -36,7 +35,6 @@
3635
'Sansha ',
3736
'Arch Angel ',
3837
'Shadow ',
39-
'Plasma'
4038
)
4139

4240

@@ -55,13 +53,16 @@ def filterChargesByQuality(charges, qualityTier):
5553
Returns:
5654
Filtered list of charges
5755
58-
Tiers are cumulative:
59-
- 't1': Tech I (metaGroup 1) + Tech II (metaGroup 2)
60-
- 'navy': t1 + Navy faction ammo (Imperial Navy, Republic Fleet, Caldari Navy, Federation Navy)
56+
Tiers are cumulative (each tier includes everything below it):
57+
- 't1': Tech I only (metaGroup 1)
58+
- 'navy': t1 + Tech II (metaGroup 2) + Navy faction ammo (Imperial Navy,
59+
Republic Fleet, Caldari Navy, Federation Navy)
6160
For XL (capital) ammo: includes pirate faction (Sansha, Arch Angel, Shadow)
6261
- 'all': Everything including high-tier faction (Blood, Dark Blood, True Sansha, etc.)
6362
64-
Tech II ammo is always included as it's a distinct ammo type, not a "better" variant.
63+
Charges with no meta group in the game data (metaGroupID is NULL - e.g. all
64+
Baryon Exotic Plasma and every XL Triglavian charge) are treated as Tech I.
65+
Otherwise they would be filtered out of every tier despite being basic ammo.
6566
"""
6667
if qualityTier == 'all':
6768
return charges
@@ -74,29 +75,32 @@ def filterChargesByQuality(charges, qualityTier):
7475
if mgId is not None:
7576
classifiable = True
7677

77-
# Tech I (metaGroup 1) - always included
78-
if mgId == 1:
78+
# Tech I (metaGroup 1), or unclassified ammo (NULL metaGroup) treated as
79+
# Tech I - always included in every tier.
80+
if mgId == 1 or mgId is None:
7981
filtered.append(charge)
8082
continue
8183

82-
# Tech II (metaGroup 2) - always included (distinct ammo type like Conflagration, Void, etc.)
83-
if mgId == 2:
84-
filtered.append(charge)
85-
continue
86-
87-
# For 'navy' tier, include Navy faction ammo
88-
if qualityTier == 'navy' and mgId == 4: # Faction
89-
# Check if it's XL (capital) ammo by name suffix
90-
isCapital = charge.name.endswith(' XL')
91-
92-
if isCapital:
93-
# For capital ammo, use pirate faction prefixes as "navy" tier
94-
if any(charge.name.startswith(prefix) for prefix in CAPITAL_NAVY_PREFIXES):
95-
filtered.append(charge)
96-
else:
97-
# For subcap ammo, use empire Navy prefixes
98-
if any(charge.name.startswith(prefix) for prefix in NAVY_PREFIXES):
99-
filtered.append(charge)
84+
# 'navy' tier additionally includes Tech II and Navy faction ammo.
85+
if qualityTier == 'navy':
86+
# Tech II (metaGroup 2) - distinct ammo type like Conflagration, Void, etc.
87+
if mgId == 2:
88+
filtered.append(charge)
89+
continue
90+
91+
# Navy faction ammo (metaGroup 4)
92+
if mgId == 4:
93+
# Check if it's XL (capital) ammo by name suffix
94+
isCapital = charge.name.endswith(' XL')
95+
96+
if isCapital:
97+
# For capital ammo, use pirate faction prefixes as "navy" tier
98+
if any(charge.name.startswith(prefix) for prefix in CAPITAL_NAVY_PREFIXES):
99+
filtered.append(charge)
100+
else:
101+
# For subcap ammo, use empire Navy prefixes
102+
if any(charge.name.startswith(prefix) for prefix in NAVY_PREFIXES):
103+
filtered.append(charge)
100104

101105
# Honor the user's tier selection even when it excludes every charge (the
102106
# weapon simply has no ammo in this tier). Only fall back to the full list

0 commit comments

Comments
 (0)