diff --git a/src/overwinter/facts.py b/src/overwinter/facts.py index e33c8a5..e89d882 100644 --- a/src/overwinter/facts.py +++ b/src/overwinter/facts.py @@ -160,8 +160,8 @@ "across before the ice went. Her plan for the station's gap was the " "old depot on the headland and the seals off the point, fetched once " "the ice held. The ice held late this year, which left her no time " - "before the storm. She says the sum still closes. She did not mean " - "anyone to have to check it.", + "before the storm. She meant the sum to close without anyone having " + "to check it.", "leads": [ { "to": THE_DEPOT, @@ -227,9 +227,9 @@ }, TEOS_NIGHTS: { "title": "Teo's nights", - "text": "Teo cannot sleep in the dark, so he runs the generator " - "through the night for the lights, and has since the plane left. " - "The fuel margin Marit planned for the storm went on the lights. On " + "text": "Teo cannot sleep in the dark. From the night the plane left " + "he ran the generator through the night for the lights, and the fuel " + "margin Marit planned for the storm went on them. On " "night hours like those, a storm runs the generator dry.", }, THE_PLANE: { diff --git a/src/overwinter/people.py b/src/overwinter/people.py index fdc91dc..c76dfe9 100644 --- a/src/overwinter/people.py +++ b/src/overwinter/people.py @@ -91,15 +91,21 @@ def herArithmetic(): "The station's gap I meant to close myself: the '58 depot on the " "headland, once the ice held, and the seals off the point, which " "Aksel can get and I cannot. The ice held late this year and " - "%s and I have not been across. The sum still closes. I did not " - "mean anyone to have to check it, and I did not tell you because " - "the one person who would have to report it is Dov, and Dov " - "reports things. (A pause.) So. Now you know what I know. What " - "are you going to do with it?" + "%s and I have not been across. %s I did not mean anyone to " + "have to check it, and I did not tell you because the one person " + "who would have to report it is Dov, and Dov reports things. (A " + "pause.) So. Now you know what I know. What are you going to do " + "with it?" % ( "then the storm came" if stormHasCome(state) - else "there is a storm coming" + else "there is a storm coming", + # Once he has walked in, the store has been emptied once and + # the player has watched the sum fail; she does not deny it. + "The sum was meant to close. It did not, and he came in out " + "of the dark on the night it showed." + if state.flags.get(AKSEL_WALKED_IN) + else "The sum still closes.", ) ) @@ -187,7 +193,11 @@ def afterTheDryNight(): and not state.knows(facts.THE_FIFTH), }, { - "question": "I've been across the bay. I've met Aksel.", + "question": ( + "Aksel walked in out of the dark. You knew he was out there." + if state.flags.get(AKSEL_WALKED_IN) + else "I've been across the bay. I've met Aksel." + ), "response": herArithmetic, "condition": lambda: state.knows(facts.THE_FIFTH) and not state.knows(facts.MARITS_ARITHMETIC), @@ -466,6 +476,12 @@ def afterTheDryNight(): "have the lights. I don't know what to do with that. I'd " "have done it for you." ) + if state.knows(facts.TEOS_NIGHTS): + # He has already told you why; he does not pretend otherwise. + return ( + "(Grey.) It ran dry at three. Night tank. You know why; I " + "told you. (He goes back to the engine.)" + ) return ( "(Grey.) It ran dry at three. Night tank. Don't ask me why. " "(You could. You don't.)" diff --git a/src/overwinter/scenes/galley.py b/src/overwinter/scenes/galley.py index 17e48ae..03bbbf9 100644 --- a/src/overwinter/scenes/galley.py +++ b/src/overwinter/scenes/galley.py @@ -10,6 +10,18 @@ STATION_MOUTHS, ) +# The one supper line that is only true while Aksel is across the bay. +NOBODY_TALKS_ABOUT_THE_BAY = ( + "Nobody talks about the far side of the bay. Nobody has, since you came." +) +# What is said instead with him at the table. It replaces the line after the +# draw, so TABLE_TALK keeps its length and order and a reloaded save hears the +# same suppers. +AKSEL_AT_THE_TABLE = ( + "Aksel eats slowly and says the bread is better than his was. Nobody " + "says anything about the hut across the bay." +) + # What gets said at the table, in no order anyone chose. Drawn from the # winter's fixed sequence, so a reloaded save hears the same supper. TABLE_TALK = ( @@ -25,7 +37,7 @@ "nobody stops him.", "Dov says Base asked after the station's stores today, as they do every " "week, and he told them what the manifest says.", - "Nobody talks about the far side of the bay. Nobody has, since you came.", + NOBODY_TALKS_ABOUT_THE_BAY, ) @@ -79,7 +91,7 @@ def run(self): return self.after() elif kind == "cook": self.ui.showDialogue( - "You cook. " + state.draw(TABLE_TALK) + "You cook. " + self.tableTalk() if state.watch == EVENING else "You cook. The others eat where they work, and the " "plates come back." @@ -97,6 +109,14 @@ def run(self): self.ui.showDialogue("Full rations again. Teo says thank you to his plate.") return self.spend(1) + def tableTalk(self): + """One supper's talk, from the fixed sequence, as it is with the + people actually at the table.""" + line = self.state.draw(TABLE_TALK) + if line == NOBODY_TALKS_ABOUT_THE_BAY and self.state.akselAt == AKSEL_STATION: + return AKSEL_AT_THE_TABLE + return line + def count(self): first = self.game.learn(facts.THE_STORE) self.ui.showDialogue(self.firstCount() if first else self.sum()) diff --git a/tests/test_people.py b/tests/test_people.py index 5310253..4effd5d 100644 --- a/tests/test_people.py +++ b/tests/test_people.py @@ -125,6 +125,35 @@ def herSum(day): assert "then the storm came" in answer +def test_after_the_walk_in_marit_is_not_told_you_crossed_the_bay(): + game = FakeGame() + game.learn(facts.THE_FIFTH) + game.state.akselAt = AKSEL_STATION + game.state.flags[flags.AKSEL_WALKED_IN] = True + marit = people.marit(game) + assert "I've been across the bay. I've met Aksel." not in questions(marit) + + answer = ask(marit, "Aksel walked in out of the dark") + assert game.state.knows(facts.MARITS_ARITHMETIC) + # The store has been emptied once; she does not say the sum closes. + assert "The sum still closes" not in answer + assert "It did not, and he came in out of the dark" in answer + + +def test_marit_says_the_sum_closes_while_aksel_is_across_the_bay(): + game = FakeGame() + game.learn(facts.THE_FIFTH) + answer = ask(people.marit(game), "I've been across the bay") + assert "The sum still closes" in answer + + +def test_marits_arithmetic_and_teos_nights_hold_after_the_walk_in_and_the_key(): + # Fixed texts, read on any day: neither claims the sum or the nights + # still stand. + assert "sum still closes" not in facts.FACTS[facts.MARITS_ARITHMETIC]["text"] + assert "has since the plane left" not in facts.FACTS[facts.TEOS_NIGHTS]["text"] + + def test_marit_and_dov_speak_about_the_storm_night_only_if_the_tank_ran_dry(): game = FakeGame() marit, dov = people.marit(game), people.dov(game) @@ -173,6 +202,18 @@ def teoAfterTheStorm(flag=None): assert "Don't ask me why" in teoAfterTheStorm() +def test_teo_does_not_hold_back_why_once_he_has_told_you(): + game = FakeGame() + afterTheStormNight(game) + game.state.flags[flags.MET_TEO] = True + teo = people.teo(game) + ask(teo, "Let's go over the fuel together") + + answer = ask(teo, "About the storm night") + assert "Don't ask me why" not in answer + assert "You know why; I told you" in answer + + def test_teo_warns_of_the_tank_until_the_storm_night_and_owns_it_after(): def theFuel(day): game = FakeGame() diff --git a/tests/test_scenes.py b/tests/test_scenes.py index 235bfda..819b080 100644 --- a/tests/test_scenes.py +++ b/tests/test_scenes.py @@ -7,7 +7,12 @@ from overwinter import facts, flags, premise from overwinter.scenes.bunks import Bunks from overwinter.scenes.epilogue import Epilogue -from overwinter.scenes.galley import Galley +from overwinter.scenes.galley import ( + AKSEL_AT_THE_TABLE, + NOBODY_TALKS_ABOUT_THE_BAY, + TABLE_TALK, + Galley, +) from overwinter.scenes.hut import Hut from overwinter.scenes.shed import Shed from overwinter.state import AKSEL_HUT, AKSEL_STATION, EVENING, MORNING, State @@ -100,6 +105,34 @@ def test_a_first_count_with_aksel_at_the_table_divides_by_five(): assert not game.ui.saw("Fifteen") +def supperWith(akselAt): + game, galley = scene(Galley, ["Cook the meal"], "galley") + game.state.watch = EVENING + game.state.akselAt = akselAt + # Pin the draw to the one line that is only true without him. + drawn = [] + + def draw(choices): + drawn.append(choices) + return NOBODY_TALKS_ABOUT_THE_BAY + + game.state.draw = draw + galley.run() + assert drawn == [TABLE_TALK] + return game.ui + + +def test_nobody_keeps_quiet_about_the_bay_with_aksel_at_the_table(): + ui = supperWith(AKSEL_HUT) + assert ui.saw("Nobody talks about the far side of the bay") + + ui = supperWith(AKSEL_STATION) + assert not ui.saw("Nobody talks about the far side of the bay") + assert ui.saw(AKSEL_AT_THE_TABLE) + # The line is replaced after the draw, so the sequence keeps its shape. + assert NOBODY_TALKS_ABOUT_THE_BAY in TABLE_TALK + + def test_the_stores_journal_line_stays_true_after_the_store_is_eaten_into(): assert "started the winter at fifteen days" in facts.text(facts.THE_STORE) state = State()