the-infocom-files / sorcerer

Sorcerer
3 stars 3 forks source link

MEADOW-F not working as intended? (It's always described as a "barren field") #12

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

MEADOW-F has this code for printing the description:

           (<EQUAL? .RARG ,M-LOOK>
        <TELL "You are in the center of a ">
        <COND (<IN? ,MEADOW-OBJECT ,HERE>
               <TELL "rolling meadow of tall grass">)
              (T
               <TELL "barren field">)>
        <TELL
". To the east is the turret of a ruined castle, and from the northeast
comes the sound of rushing water." CR>)>>

Presumably this is to print different descriptions depending on whether or not you used the MEEF spell on the meadow. See MEADOW-OBJECT-F. But it's not working, because it always prints that it's a "barren field".

That's probably because MEADOW-OBJECT is a local global object. It should probably check <IN? ,MEADOW-OBJECT ,LOCAL-GLOBALS> instead.

eriktorbjorn commented 4 years ago

A related problem is that you can cast MEEF on the meadow multiple times, and get the same response every time. See MEADOW-OBJECT-F.

You'd think that once MEADOW-OBJECT has been removed, you could no longer refer to it. But it seems that local global objects stay local global, even after moving them out of the LOCAL-GLOBAL object. See https://github.com/the-infocom-files/zork2/issues/6 for an example of a bug caused by this behavior.

Though in this case you could argue that the meadow is still there, even if there's no longer any grass growing in it. Maybe it would be more reasonably to set MUNGBIT in the object instead, to mark it as damaged?