Add hatch retention, automatic breakthroughs and exploration
This commit is contained in:
@@ -4,12 +4,23 @@ from .maps import stages
|
||||
|
||||
|
||||
def monster_rows(catalog, snapshot, managed, room_id=0):
|
||||
planner = None
|
||||
def tp_values(mon):
|
||||
nonlocal planner
|
||||
if planner is None:
|
||||
# Snapshot formatting shares the pure TP calculation with policy planning.
|
||||
from .model import Planner
|
||||
planner = Planner(catalog)
|
||||
thresholds = planner.tp_thresholds(mon)
|
||||
return thresholds[4] if thresholds is not None else None
|
||||
|
||||
return [[m["id"], m.get("nicName") or catalog.monster(m["typeId"]).get("name", "未知"), catalog.monster(m["typeId"]).get("star", "?"),
|
||||
f"{m.get('level', 1)} / {catalog.max_level(m) or '?'}", catalog.quality_text(m),
|
||||
"培育室 · " + snapshot.phase_text(m, catalog) if m.get("process") == 2 else f"牧场 {m.get('roomId', 0)}",
|
||||
"系统锁定" if m.get("sysLock") else "是" if m.get("lock") else "否",
|
||||
"本次培育" if int(m["id"]) in managed else "已有:不自动处理", "", "", m.get("potentialLevel", "?"),
|
||||
*catalog.reference_stats(m), f"{m.get('feel', 0)} / {catalog.max_feel(m)}", catalog.likes_text(m["typeId"]), "", ""] for m in snapshot.raw["monsters"]
|
||||
*catalog.reference_stats(m), f"{m.get('feel', 0)} / {catalog.max_feel(m)}", catalog.likes_text(m["typeId"]), "", "",
|
||||
"", "", f"{m.get('tpLevel', 0)} / 4", f"{m.get('tpExp', 0)} / {tp_values(m) or '?'}"] for m in snapshot.raw["monsters"]
|
||||
if not room_id or m.get("process") == 3 and int(m.get("roomId") or 0) == room_id]
|
||||
|
||||
|
||||
@@ -29,6 +40,7 @@ class Views:
|
||||
statistics_store: object = None
|
||||
drop_statistics: dict = None
|
||||
progression: object = None
|
||||
exploration: object = None
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -43,6 +55,7 @@ def prepare_views(catalog, snapshot, managed, stage_cache=None, statistics=None,
|
||||
"""Omitted monster rows stay dirty; the default preserves the full view API."""
|
||||
source = repr(snapshot.raw["monsters"]) if include_monsters else None
|
||||
monsters = monster_rows(catalog, snapshot, managed) if include_monsters else None
|
||||
return Views(snapshot, source, set(managed), monsters,
|
||||
views = Views(snapshot, source, set(managed), monsters,
|
||||
str(snapshot.raw["master"]["id"]), stage_cache.get(snapshot) if stage_cache else stages(catalog, snapshot), stage_cache,
|
||||
statistics, statistics.snapshot(snapshot.raw["master"]["id"]) if statistics else None)
|
||||
return views
|
||||
|
||||
Reference in New Issue
Block a user