mechanic: keep at most 100 quests in the log

This commit is contained in:
Dash committed 2026-10-17 15:55:48 +02:00
1 parent fa31045052
commit 48f48aec58
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -162,7 +162,7 @@ class QuestBook(SignalMixin):
def add_quest(self, name: str) -> None: def add_quest(self, name: str) -> None:
logger.info("Commencing quest: %s", name) logger.info("Commencing quest: %s", name)
self._quests = self._quests[-100:] self._quests = self._quests[-99:]
self._quests.append(name) self._quests.append(name)
+8
View File
@@ -146,3 +146,11 @@ def test_cinematic_text_matches_upstream() -> None:
texts = [task.description for task in simulation.player.queue] texts = [task.description for task in simulation.player.queue]
assert any("You've reached the kind protection of " in t for t in texts) assert any("You've reached the kind protection of " in t for t in texts)
assert any(t.endswith("news!? -- Oh yes, of course") for t in texts) assert any(t.endswith("news!? -- Oh yes, of course") for t in texts)
def test_quest_log_keeps_100_quests() -> None:
quest_book = make_simulation().player.quest_book
for i in range(150):
quest_book.add_quest(f"quest {i}")
assert len(quest_book.quests) == 100
assert quest_book.quests[-1] == "quest 149"