I'm using an 'if' condition to control if a link shows up in the list of options. It works fine, up until the link is supposed to disappear again.
Here is my code:
<<if ($inventory.includes("Key") && not $Door.openCondition)>>
<<link "Unlock" "unlockDoor">><</link>> the door<</if>>\
Key is in inventory: <<= $inventory.includes("Key")>>
Door is locked: <<= not $Door.unlockCondition>>
Both: <<= $inventory.includes("Key") && not $Door.openCondition>>
These are the results I get:
Before getting the key:
Open the door
Take the key
Key is in inventory: false
Door is locked: true
Both: false
After getting the key:
Open the door
Unlock the door
Key is in inventory: true
Door is locked: true
Both: true
After the door is unlocked:
Open the door
Unlock the door
Key is in inventory: true
Door is locked: false
Both: true
What's going on? How do I get a conditional to react to one of the conditions turning false?