fixed detour stacking and improper option gating

This commit is contained in:
2026-08-16 14:50:38 +02:00
parent bea880a999
commit 1ef1720bae
7 changed files with 427 additions and 37 deletions
@@ -1,11 +1,11 @@
// Everything the bartender ever says.
//
// These nodes share a title, which makes them a node group. Callers just
// `<<detour Bartender_Talk>>` and Yarn runs the most specific variation whose
// `when:` conditions pass. Adding a new variation later means adding a node,
// not editing a growing <<if>> chain.
//
// Each variation sets $went_inside so the calling scene knows the verdict.
// Stack discipline (the player comes back to the bar, so it matters):
// `Bartender_Talk` is the node DialogueInteractable starts, so nothing is
// waiting for it to return. Its branches therefore <<jump>> — they are the last
// thing the node does — and each destination hands control back with
// <<enter_environment>> itself. <<detour>> is only for sub-conversations that
// have to resume the caller; a <<jump>> inside one would clear the return stack.
title: Bartender_Talk
position: -121,-60
@@ -17,9 +17,9 @@ position: -121,-60
Bartender: Ah, {$player_alias}. A drink?
<<endif>>
-> Yes, please.
<<detour SC101_Hook_Drink_Bartender_Talk>>
<<jump SC101_Hook_Drink_Bartender_Talk>>
-> No, I have questions.
<<detour SC101_Hook_Questions_Bartender_Talk>>
<<jump SC101_Hook_Questions_Bartender_Talk>>
<<else>>
<<set $spoke_to_bartender = true>>
Bartender: Ah, {$player_alias}, back again?
@@ -41,29 +41,32 @@ position: -121,-60
-> What can you recommend?
Bartender: Last time you tooke the Estate.
Narrator: You ignore the jab.
<<detour SC101_Hook_Drink_Bartender_Talk>>
<<jump SC101_Hook_Drink_Bartender_Talk>>
-> Whatever.
<<detour SC101_Hook_Drink_Bartender_Talk>>
<<jump SC101_Hook_Drink_Bartender_Talk>>
-> Yes. I'll take the usual.
Narrator: The bartender doesn't even flinch, while taking ingredients from the bar.
PROVENANCE: We cannot remember these substances.
AMNESTY: Is this really our favorite drink?
<<set $self_lean_inheritor += 1>>
<<detour SC101_Hook_Drink_Bartender_Talk>>
<<jump SC101_Hook_Drink_Bartender_Talk>>
-> I am, and I have a few questions.
<<detour SC101_Hook_Questions_Bartender_Talk>>
<<jump SC101_Hook_Questions_Bartender_Talk>>
<<endif>>
<<enter_environment>>
===
title: SC101_Hook_Drink_Bartender_Talk
position: 116,222
---
// $had_the_estate_drink is written at the BOTTOM of this node, not here. The whole
// node reads first-glass state — the pour, the taste, and the lean write under the
// answer — and the glass is only recorded once all of it has run. Setting the flag
// up here (as this node used to) leaves the tests below reading a flag this same
// run already flipped, and the lean write can never fire.
Bartender: One Estate coming right up.
<<if $had_the_estate_drink>>
Narrator: He puts another amber drink before you.
<<else>>
<<set $had_the_estate_drink = true>>
Narrator: He puts a deep amber drink before you.
HOUSE POUR: It smells like old wood, oak, which went sour with age, like a library shelf that's been rained on once and dried wrong.
Narrator: You take a sip.
@@ -84,6 +87,8 @@ AMNESTY: Is that the taste of our favorite drink? I cannot remember ...
<<else>>
HOUSE POUR: Still bitter.
<<endif>>
<<set $had_the_estate_drink = true>>
<<enter_environment>>
===
title: SC101_Hook_Questions_Bartender_Talk
@@ -92,10 +97,11 @@ position: -139,224
Bartender: Sure, what do you want to know?
-> Question 1
Bartender: Answer 1
<<detour SC101_Hook_Questions_Bartender_Talk>>
-> Question 2
Bartender: Answer 2
<<detour SC101_Hook_Questions_Bartender_Talk>>
-> Nothing.
Bartender: Alright.
<<enter_environment>>
<<stop>>
<<jump SC101_Hook_Questions_Bartender_Talk>>
===