the-infocom-files / hollywoodhijinx

Hollywood Hijinx
3 stars 2 forks source link

Wrong response for "SKI" when not wearing skis #60

Open eriktorbjorn opened 2 years ago

eriktorbjorn commented 2 years ago
>SKI
[Do you have any particular direction in mind?]

Given this syntax definition and implementation:

<SYNTAX SKI = V-WALK-AROUND PRE-SKI>

<ROUTINE PRE-SKI ()
     <COND (<NOT <FSET? ,SKIS ,WORNBIT>>
        <TELL "You're not wearing skis!" CR>)>>

<ROUTINE V-SKI ()
     <COND (<PRSO? ,INTDIR>
        <COND (<EQUAL? ,P-DIRECTION ,P?UP>
               <TELL "There's no tow rope here." CR>)
              (T
               ;<TELL "\"Ski slide shuffle shuffle...\"" CR CR>
               <DO-WALK ,P-DIRECTION>)>)it
           (T
            <TELL "You can't ski down that!" CR>)>>

You'd think that not wearing any skis should print "You're not wearing skis!". But apparently the way syntax tables are generated, there will be no pre-action since the regular WALK-AROUND action doesn't have one.

So it should probably be changed to <SYNTAX SKI = V-SKI PRE-SKI>, and then V-SKI should be modified to handle the case where there is no PRSO.

eriktorbjorn commented 2 years ago

It also doesn't print the expected response for "SKI UP" when you are wearing skis:

>SKI UP
[That sentence didn't make sense. Please reword it or try something else.]

That's probably because "UP" isn't an INTDIR. Perhaps it should be handled (at least partially) in V-WALK instead, since that's where other skiing messages are handled:

<ROUTINE V-WALK ("AUX" PT PTS STR OBJ RM)
     <COND (<AND <FSET? ,SKIS ,WORNBIT>
             <NOT <PRSO? ,P?DOWN>>>
        <TELL
"These are downhill skis, not cross-country skis!" CR>
        <RFATAL>)