Skip to content

Instantly share code, notes, and snippets.

@JoshuaGrams
Last active September 20, 2020 09:55
Show Gist options
  • Save JoshuaGrams/bfb7442530b23267fd478f8f230d8627 to your computer and use it in GitHub Desktop.
Save JoshuaGrams/bfb7442530b23267fd478f8f230d8627 to your computer and use it in GitHub Desktop.
Lock and Key: TinyQBN/SugarCube
:: StoryTitle
Lock and Key: Variable in SugarCube
:: Start
<<set $key to false>>
<<include "LocationCheck">>
:: Front-Room [sticky-card req-not-passage-Front-Room]
<<include "LocationCheck">>
::Back-Room [sticky-card req-not-passage-Back-Room]
<<include "LocationCheck">>
<<if $key>>
There is nothing here.
<<else>>
Items:
<<linkreplace "Pick up the key">><<set $key to true>>You have a key.<</linkreplace>>
<</if>>
:: LocationCheck
<<cardrow `QBN.cards().sort(QBN.alphabetically)` "linkbox">>\
:: Exit [sticky-card req-key req-passage-Front-Room]
You found the key and went through the door!
:: Locked-Door [sticky-card req-not-key req-passage-Front-Room]
It won't open.
[[Continue->Front-Room]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment