Hello helpful internet strangers!
First off, I am very new to writing interactive fiction and thus to inform 7 and I apologize if this has been asked and answered and I just did not know the correct terms to search for… I feel that my issue is something very simple and is covered in great length somewhere and me just not knowing what it is called. I greatly appreciate any and all assistance, even if it is just to point me in the correct direction. (You will also have to excuse my lack of contractions, my apostrophe key is broken!)
Here is my dilemma, I have created a kind of thing that I want to occasionally use in place of a lock to prevent movement in a direction called a doorpanel. But after shorting the first, if i move to the next room and short the second, it tells me it already has.
Here is the code i have:
"Testing Shorted Doors" by SitOnARick
Foyer is a room. "You are in an empty space ready to be painted with your imagination. There is an exit to the north, but the door won't budge."
Lab is north of Foyer. "The research lab where all the fun things happen."
The screwdriver is in the Foyer. The description of the screwdriver is "A discarded screwdriver."
A wrench is in the Foyer. The description of the wrench is "A well-used crescent wrench."
A doorpanel is a kind of thing. A doorpanel is always fixed in place. A doorpanel can be shorted or unshorted. A doorpanel is usually unshorted.
The bunkerpanel is a doorpanel in the Foyer. "Dangling next to the door is an entry keypad that has seen better days. It has clearly been tampered with before and it's a miracle it hasn't fallen off yet." The printed name of the bunkerpanel is "a entry access panel". Understand "keypad" and "panel" and "access" and "pad" as the bunkerpanel. The description is "It's clear this has been fiddled with before.... maybe if you used something metal to try and SHORT the exposed wiring....?"
Shorting is an action applying to two things. Understand "short [something] with [something]" as shorting.
Check shorting:
if the noun is not a doorpanel:
say "I really can't try and short circuit something that doesn't have any circuits, now can I?" instead;
otherwise if the second noun is not the screwdriver:
say "I'm pretty sute that's not gonna work.... If only I had something long thin and metal with a plastic handle that would fit in that little gap there...." instead;
otherwise if the doorpanel is shorted:
say "We did that already!" instead;
Carry out shorting:
now the noun is shorted;
Report shorting:
say "You insert the end of the screwdriver into the gap behind the keypad and wiggle it arounf a bit until you hear a faint sizzle and a tiny wisp of grey smoke drifts out and disapates. Next to you, the lock mechanism clicks loudly, unbarring the way forward."
Instead of going north in the Foyer:
if the bunkerpanel is unshorted:
say "The door is shut tight and appears to be operated by the defunct keypad barely attached to the wall next to it. If we had something to stick in the gap and fiddle with to SHORT it out, we just might be in luck...";
otherwise:
continue the action.
Atrium is east of Lab. "A large atruim with a domed ceiling, open at the center,"
The labpanel is a doorpanel in Lab. "Dangling next to the door is an entry keypad that has seen better days. It has clearly been tampered with before and it's a miracle it hasn't fallen off yet." The printed name of the labpanel is "a entry access panel". Understand "keypad" and "panel" and "access" and "pad" as the labpanel. The description is "It's clear this has been fiddled with before.... maybe if you used something metal to try and SHORT the exposed wiring....?"
Instead of going east in the Lab:
if the labpanel is unshorted:
say "The door is shut tight and appears to be operated by the defunct keypad barely attached to the wall next to it. If we had something to stick in the gap and fiddle with to SHORT it out, we just might be in luck...";
otherwise:
continue the action.
I know I have likely made a ton of rookie mistakes, but it compiles and runs, just does not do what I had intended as far as being able to be used more than once. Many thanks for any insights!