Open eriktorbjorn opened 5 years ago
One thing that should probably be changed is to only call AIRLOCK-LOOK
when you're inside the airlock.
I don't yet understand the other glitches.
I just noticed that DESCRIBE-ROOM
will give the player's location VEHBIT
if the location isn't HERE
. That explains the "(You are in the Red Airlock.)" messages, I guess.
Printing the description of another room is handled by the GO&LOOK
routine. I think the only other game that uses it is Zork II when looking through the window in the door with the key/mat puzzle. If we notice any further problems here, they may also exist there.
I think I see what's causing the double room description, but I can't decide if it's a bug or not:
<ROUTINE DESCRIBE-ROOM ("OPTIONAL" (LOOK? <>) "AUX" V? STR AV)
<SET V? <OR .LOOK? ,VERBOSE>>
<COND (<NOT ,LIT>
<TELL
"It is pitch black. You are likely to be eaten by a grue." CR>
<RETURN <>>)>
<COND (<NOT <FSET? ,HERE ,TOUCHBIT>>
<FSET ,HERE ,TOUCHBIT>
<SET V? T>)>
<COND (<IN? ,HERE ,ROOMS> <TELL D ,HERE CR>)>
<COND (<OR .LOOK? <NOT ,SUPER-BRIEF>>
<SET AV <LOC ,WINNER>>
<COND (<FSET? .AV ,VEHBIT>
<TELL "(You are in the " D .AV ".)" CR>)>
<COND (<AND .V? <APPLY <GETP ,HERE ,P?ACTION> ,M-LOOK>>
<RTRUE>)
(<AND .V? <SET STR <GETP ,HERE ,P?LDESC>>>
<TELL .STR CR>)
(T <APPLY <GETP ,HERE ,P?ACTION> ,M-FLASH>)>
<COND (<AND <NOT <==? ,HERE .AV>> <FSET .AV ,VEHBIT>>
<APPLY <GETP .AV ,P?ACTION> ,M-LOOK>)>)>
<COND (<AND <NOT <FSET? ,HERE ,ONBIT>> ,ALWAYS-LIT>
<TELL
"The room is lit by an emergency lighting system." CR>)>
T>
So if the action routine for HERE
returns true when called with the M-LOOK
parameter, DESCRIBE-ROOM
terminates. RED-DOCK
does have an action routine, so that's what happens when looking through the outer door.
Otherwise, it prints the LDESC
of HERE
. In this case, it does not terminate. RED-THREE
does not have an action routine, so that's what happens when looking through the inner door.
If it didn't terminate, it continues by checking if HERE
and the player's location aren't the same. If so, it sets VEHBIT
on the real location (in this case, RED-LOCK
) and calls the action routine in the vehicle with the M-LOOK
parameter. And since RED-LOCK
does have an action routine, you get the description for the airlock.
The more I look at it, the more convinced I am that
<COND (<AND <NOT <==? ,HERE .AV>> <FSET .AV ,VEHBIT>>
<APPLY <GETP .AV ,P?ACTION> ,M-LOOK>)>)>
was really meant to be
<COND (<AND <NOT <==? ,HERE .AV>> <FSET? .AV ,VEHBIT>>
<APPLY <GETP .AV ,P?ACTION> ,M-LOOK>)>)>
That is, it's supposed to test VEHBIT
, not set it.
I tried to locate the equivalent code in as many games as I could:
Cutthroats, zork-substrate, Zork I (German) and Zork I (Solid Gold) use FSET?
, which I think is correct.
Enchanter, Infidel and Starcross use FSET
, which I think is wrong.
The nice thing about testing games this way is that you find so many "hidden" features. Here's one:
Something's off here. When I look through the inner door, it prints both the description for Red Hall and for Red Airlock, and when I look through the outer door it prints "(You are in the Red Airlock.)" and "(outside the Red Airlock)".
Actually, if I then look through the inner door again, I get "(You are in the Red Airlock.)" for that case too. And when I'm in the Red Airlock, it now tells me that "(You are in the Red Airlock.)" Hmm...
And it's also a bit inconsistent that:
But also:
This is handled in
RED-DOORS-FCN
, which is the action routine for bothRED-INNER
andRED-OUTER
. There's similar code inBLUE-DOORS-FCN
andYELLOW-DOORS-FCN
as well: