Add hatch retention, automatic breakthroughs and exploration
This commit is contained in:
@@ -19,6 +19,23 @@ def growth_score(catalog, mon):
|
||||
return round(sum(values) / 4, 9) if values is not None else None
|
||||
|
||||
|
||||
def quality_rank(catalog, mon):
|
||||
"""Compare letter grades before using raw growth to break exact-grade ties."""
|
||||
qualities = catalog.quality(mon)
|
||||
if any(value is None for value in qualities):
|
||||
return None
|
||||
# A and B grades are compared per attribute. A raw average must never
|
||||
# make AASA outrank SSAS (or turn an S-grade advantage into a B-grade one).
|
||||
return (sum(value == 4 for value in qualities), sum(value == 3 for value in qualities),
|
||||
sum(value == 2 for value in qualities), growth_score(catalog, mon))
|
||||
|
||||
|
||||
def quality_summary(catalog, mon):
|
||||
qualities = catalog.quality(mon)
|
||||
names = {1: "C", 2: "B", 3: "A", 4: "S"}
|
||||
return "".join(names.get(value, "?") for value in qualities)
|
||||
|
||||
|
||||
class CultivationSelector:
|
||||
def __init__(self, catalog, path=None):
|
||||
self.catalog = catalog
|
||||
|
||||
Reference in New Issue
Block a user