I’ve released a new version of ZILF, the ZIL compiler + Z-machine assembler + parser and game library, which you can download from Bitbucket.
There are way too many changes to list here, including:
- Doors!
- Loops!
- Scope!
- Time!
- Order!
- Vectors!
- Splices!
- Sections!
- Flags!
- Prepositions!
- Quirks!
- Retro goodness!
Thanks go out to Roody_Yogurt for contributing to the library.
If you’ve never tried ZIL before, here’s a taste of what you’re in for. This snippet from a work in progress demonstrates the use of doors:
[spoiler][code]<ROOM IN-IMMENSE-N/S-PASSAGE
(DESC “Immense N/S Passage”)
(IN ROOMS)
(LDESC “You are at one end of an immense north/south passage.”)
(SOUTH TO IN-GIANT-ROOM)
(NORTH TO IN-CAVERN-WITH-WATERFALL IF RUSTY-DOOR IS OPEN)
(ACTION IN-IMMENSE-N/S-PASSAGE-F)>
<ROUTINE IN-IMMENSE-N/S-PASSAGE-F (RARG)
<COND (<AND <=? .RARG ,M-BEG> <VERB? WALK> <PRSO? ,P?NORTH>>
<COND (<FSET? ,RUSTY-DOOR ,LOCKEDBIT>
<PERFORM ,V?OPEN ,RUSTY-DOOR>
)
(<NOT <FSET? ,RUSTY-DOOR ,OPENBIT>>
<FSET ,RUSTY-DOOR ,OPENBIT>
<TELL “[first wrenching the door open]” CR>
)>)>>
<OBJECT RUSTY-DOOR
(DESC “rusty door”)
(IN IN-IMMENSE-N/S-PASSAGE)
(SYNONYM DOOR HINGE HINGES)
(ADJECTIVE MASSIVE RUSTY IRON)
(TEXT “It’s just a big iron door.”)
(DESCFCN RUSTY-DOOR-DESCFCN)
(ACTION RUSTY-DOOR-F)
(FLAGS DOORBIT LOCKEDBIT)>
<ROUTINE RUSTY-DOOR-DESCFCN (ARG)
<COND (<=? .ARG ,M-OBJDESC?> )>
<TELL “The way north "
<COND (<FSET? ,RUSTY-DOOR ,OPENBIT> “leads through”)
(ELSE “is barred by”)>
" a massive, rusty, iron door.”>>
<CONSTANT HINGES-ARE-RUSTED
“The hinges are quite thoroughly rusted now and won’t budge.”>
<ROUTINE RUSTY-DOOR-F ()
<COND (<VERB? OPEN>
<COND (<FSET? ,PRSO ,LOCKEDBIT>
<TELL ,HINGES-ARE-RUSTED CR>)
(<NOT <FSET? ,PRSO ,OPENBIT>>
<FSET ,PRSO ,OPENBIT>
<TELL “The door heaves open with a shower of rust.” CR>)>)
(<VERB? CLOSE>
<COND (<FSET? ,PRSO ,OPENBIT>
<TELL “With all the effort it took to get the door open,
I wouldn’t suggest closing it again.” CR>)
(ELSE <TELL “No problem there – it already is.” CR>)>)
(<VERB? OIL>
<COND (<AND <HELD? ,BOTTLE> <IN? ,OIL-IN-BOTTLE ,BOTTLE>>
<REMOVE ,OIL-IN-BOTTLE>
<FCLEAR ,PRSO ,LOCKEDBIT>
<FSET ,PRSO ,OPENABLEBIT>
<TELL “The oil has freed up the hinges so that the door will move,
although it requires some effort.” CR>)
(ELSE <TELL “You have nothing to oil it with.” CR>)>)
(<VERB? WATER>
<COND (<AND <HELD? ,BOTTLE> <IN? ,WATER-IN-BOTTLE ,BOTTLE>>
<REMOVE ,WATER-IN-BOTTLE>
<FSET ,PRSO ,LOCKEDBIT>
<FCLEAR ,PRSO ,OPENABLEBIT>
<TELL ,HINGES-ARE-RUSTED CR>)
(ELSE <TELL “You have nothing to water it with.” CR>)>)>>[/code][/spoiler]