"Verbs" ;"Syntaxes for regular verbs" ;"Syntaxes for game verbs" ;"Debugging verbs" > > ;"Constants" ;"TODO: these belong in parser.zil?" ;"Object action handlers may get: M-WINNER, or no arg" ;"Room action handlers may get: M-BEG, M-END, M-ENTER, M-LOOK, M-FLASH" ;"Object DESCFCNs may get: M-OBJDESC?, M-OBJDESC" ;"DARKNESS-F may get: M-LOOK, M-SCOPE?, M-LIT-TO-DARK, M-DARK-TO-LIT, M-DARK-TO-DARK, M-DARK-CANT-GO" ;"Intercept action at beginning of turn" ;"React to action at end of turn" ;"Player is entering room" ;"Show room description" ;"Show important descriptions even in BRIEF mode" ;"Choose whether to self-describe" ;"Write a self-description" ;"Decide which scope stages run in darkness" ;"Player moved from light to darkness" ;"Player moved from darkness to light" ;"Player moved from one dark room to another" ;"Player stumbled around in a dark room" ;"Light source is gone" ;"Light source is back" ;"Object is the one performing this action" ;"Helper routines for action handlers" " would appreciate that." CR>> ) (ELSE )> )>)>)> > > > > > > .IF-PL> >> )>> ;"Action handler routines" )>> ;"Prints a room description, handling darkness and briefness. If the room is HERE and the player doesn't have a light source, this prints a generic room name and description. Otherwise, the real name is printed, optionally followed by a description (if MODE is VERBOSE, or if it's BRIEF and this is the first time describing the room, or if LONG is true). Uses: MODE Args: RM: The room to describe. LONG: If true, print the room description even in BRIEF mode. Returns: True if the objects in the room should also be described, otherwise false." > )> ;"Print the room's real name." )> )> ;"If this is an implicit LOOK, check briefness." ) ( >> ;"Call the room's ACTION with M-FLASH even in brief mode." ,M-FLASH> )>)> ;"The room's ACTION can print a description with M-LOOK. Otherwise, print the LDESC if present." ,M-LOOK>) (> )> ;"Call the room's ACTION again with M-FLASH for important descriptions." ,M-FLASH> ;"Mark the room visited." > ) (<=? .ARG ,M-SCOPE?> >) (<=? .ARG ,M-NOW-DARK> ) (<=? .ARG ,M-NOW-LIT> ) (ELSE )>> > ;"Describes the objects in a room. Objects are described in four passes: 1. All non-person objects with DESCFCNs, FDESCS, and LDESCs. 2. All non-person objects not covered by #1. 3. The visible contents of containers and surfaces. 4. All objects with PERSONBIT other than WINNER. Uses: WINNER Args: RM: The room." ) ;"objects with DESCFCNs" (> ;"The DESCFCN is responsible for listing the object's contents" ) ;"objects with applicable FDESCs or LDESCs" (> >> >> ;"Describe contents if applicable" > )>)>> ;"See if there are any non fdesc, ndescbit, personbit objects in room" )>> ;"go through the N objects" )> ;"describe visible contents of generic-desc containers and surfaces" > )>> ;"See if there are any NPCs" > )>> ;"go through the N NPCs" > )>> > > > >>>>> > > > >>>>>> ;"Prints a (short) string with the first letter capitalized." > > > >>>)> >)>> ;"Prints an object name with the first letter capitalized." > > > >>>)> >)>> ;"Implements ." ) (> ) ( ) ( ) (ELSE )> > ;"Implements ." > )> > ;"Implements ." )> > ) ( ) ( ) (ELSE )> > ;"Implements ." ) (ELSE )>> ;"Prints a sentence describing the contents of a surface or container." ) (ELSE )> ,L-ISARE> > ;"Prints a space followed by a parenthetical describing the contents of a surface or container, for use in inventory listings." ) (ELSE )> > )> >> ) (<==? .N 2> >) (ELSE > ) (<==? .N 1> ) (ELSE )>>)> > ;"Prints a list describing a set of objects, usually the contents of a surface or container. No trailing punctuation is printed. If the L-ISARE flag is passed, the list begins with 'is' or 'are' depending on the count and plurality of the child objects. For example: If the container is empty: is nothing If the container has one singular object: is a shirt If the container has one plural object: are some pants If the container has two objects: are a shirt and a hat If the container has three objects: are a shirt, a hat, and a watch Uses: HERE PSEUDO-LOC Args: O: The object whose contents are to be listed, or if L-PRSTABLE is given, the address of a table containing the objects. FILTER: An optional routine to select children to list. If provided, the list will only include objects for which the filter returns true; otherwise it'll list all contents. FLAGS: A combination of option flags: L-ISARE: Print 'is' or 'are'. L-SUFFIX: Print the verb after the list instead of before. (Implies L-ISARE.) L-ISMANY: Use 'is' before a list of objects unless the first one has PLURALBIT. (Implies L-ISARE. Ignored if L-SUFFIX is given.) L-PRSTABLE: List objects from a table instead of the contents of another object. O is the address of the table in P-PRSOS/P-PRSIS format. L-THE: Print the definite article instead of indefinite. L-OR: Print 'or' instead of 'and'. L-CAP: Capitalize the first article printed. (Implies L-SUFFIX.) L-SCENERY: Refer to PSEUDO-OBJECT as 'some scenery [in PSEUDO-LOC]'. Returns: The number of objects listed." >)> > >)> > > > ) (<0? .S> )> >)>>)>) (ELSE > ) (<0? .S> )> >)>>)> ) ( ) ( ) (ELSE )>) (<==? .N 1> >) ( > >) (ELSE >> >)>) (<==? .N 2> >> > > ) (ELSE )>)> > ) (ELSE )> > >) (ELSE >> > > ) (ELSE )>)> > > <=? .I 1>> ) (ELSE >)> > ) (<==? .N 1> ) (ELSE )>) (ELSE )>)>>) (ELSE > <=? .I .F>> ) (ELSE >)> > ) (<==? .N 1> ) (ELSE )>) (ELSE )>)>>)> >)> > > ) (ELSE )> )> ) (.CAP? ) (ELSE )>) (ELSE ) (ELSE )>)>> ;"Direction properties have a different format on V4+, where object numbers are words." ;"size of unconditional exit" ;"size of non-exit" ;"size of function exit" ;"size of conditional exit" ;"size of door exit" ;GET/B ;GET ;GET ;GETB ;GET ;GET/B ;GET) (T )> ;"Checks whether PRSA is a meta-verb that does not cause time to pass." ! !,EXTRA-GAME-VERBS>> > )> ) (<0? >> >> )> ) (<==? > ,UEXIT> >) (<==? .PTS ,NEXIT> CR> ) (<==? .PTS ,FEXIT> >>> )>) (<==? .PTS ,CEXIT> > >) (ELSE > ) ( > ;"DARKNESS-F printed a message") (ELSE )> )>) (<==? .PTS ,DEXIT> > ,OPENBIT> >) (> ) (ELSE )>) (ELSE )> > > ) (ELSE )>> ;"Performs the WALK action with a direction." >> ;"Finds a direction from HERE that leads through the given door. Returns: A direction property, or false if no direction leads through the door." ,DEXIT> <==? .DOOR>> )>> > ;"Finds the room on the other side of a given door from HERE. Returns: A room, or false if no direction leads through the door." > ,EXIT-RM>) (ELSE <>)>> ) (ELSE )>> )) > >> )> ) (ELSE )> )> > )> )>> > ) ( ) (ELSE )>> ) ( ) (> ) ( >> " closed." CR>) (> " empty." CR>) (ELSE )>> > > ) (ELSE )>)> )>)> >) (ELSE )>) (ELSE )>> > ;"Attempts to take an object, implementing all of the default checks, and possibly printing a success or failure message. Args: OBJ: The object to take. SILENT: If true, suppresses any success or failure message. Returns: True if the object was taken." ) (<=? ,P-V-WORD ,W?TAKE ,W?GRAB> ) (<=? ,P-V-WORD ,W?PICK> ) (ELSE )> ) ( > ) (> > ) ( > )> ;"See if picked up object is being taken from a container" > > ) ( > ) (>) ( >> ) (ELSE ) (ELSE )> ) (ELSE )> )> )>)> > ) ( ) (ELSE )> ) (ELSE ) (ELSE )> )>> ;"Locates the container, person, or room that restricts the ability to take a given object. If at least one thing between the taker and the object is a closed container or a person, the closest one to the taker will be returned. Otherwise, the innermost non-surface container or room that encloses the object will be returned. Args: OBJ: The object being taken. TAKER: The object doing the taking. Returns: The closed container or person blocking the take, or the open container or room allowing the take, or ROOMS if the objects have no common parent." > )> ;"Walk up the tree from OBJ to CEIL" <0? .L> >) ) ( ;"Keep the furthest blocker from OBJ" ) ( >> > ;"Keep the closest allower to OBJ" >)>>)> ;"Walk up the tree from TAKER to CEIL, setting variables in reverse" <0? .L> >) ) ( ;"Keep the closest blocker to TAKER" >) ( >> > ;"Keep the furthest blocker from TAKER unless we already found one on the first walk." >)>>)> > >>>>> > > ;"If ROOT is equal to A or B, it's the common parent" )> ;"Look for common parent in each subtree, keeping any matching tree and counting the number found." > > ;"If we found matching parents in two children, ROOT is the common parent." )>)>> ;"One child contained both objects, so the common parent is whatever COMMON-PARENT-R returned for it." .F> ) CWT NWT) )> >> > .CAP> ) (ELSE )> )> > > > )>> ) (ELSE )>> ) ( ) (> )>> ) ( >> ) (> ) ( > ) (ELSE > > 0>) (ELSE ;"set bottomless flag" )> > > )> ;"Determine weight of contents of IO" > > )> )> ) (ELSE )>)>> ) ( ) (> )>> ) (> > ) (> > ) ;"always closed case" (> > ) (> ) ( > ) (ELSE > > 0>) (ELSE ;"set bottomless flag" )> > > )> ;"Determine weight of contents of IO" > ; > )>)> ) (ELSE )>)>> ;"Calculates the weight of all objects in a container, non-recursively." >>> .W> ;"Calculates the weight of an object, including its contents recursively." > ;"add size of objects inside container" > > >) (ELSE >>)>> .W> ) (ELSE )> > > ) (ELSE )>> ) ( ) ( ) (ELSE )>) (ELSE )>> *3777*>> > > ) (ELSE )>> ) (> ) ( ) ( ) (ELSE ) (ELSE >> )>)> )>> ) (> ) ;( ) (> ) (ELSE ) (ELSE )> )>> > > ,M-END>> > > .ENDACT .INTERRUPT> )>>> >>>> ) ( >>>> )> > ;"TODO: The COND below should be factored out (of V-AGAIN and MAIN-LOOP)." > ,M-END>> > )> > ) (ELSE )> > > ) (> ) (> ) (ELSE )>) (ELSE )>> ) (> ) ( ) (ELSE ) (ELSE )>)>> > CR>) (> ) (> ) (ELSE ) (ELSE )>)>> > ) (ELSE )>) ( ) (ELSE )> > ) ( ) (ELSE )> > ) ( ) (ELSE )> > > > > > > > ) ( ) (ELSE )> > " yourself." CR>) ( ) (ELSE T>)> > ) (ELSE " yourself." CR>)>) ( ) ( ) (> ) (ELSE " take " T ,PRSO "." CR>)>> > >> ) (ELSE )> )>> > ;"TELL is a game verb, but it's defined here because it shares PRE-TELL" )>> > > > ) (ELSE )> > > > > > ) ( ) (ELSE )>> ) ( ) (ELSE )>> ) ( ) (ELSE )>> ;"Action handlers for game verbs" )> > )>) (ELSE )>> ) (ELSE )>> > )>> ) (ELSE )>> > > > 1> ) ( 1>> ) (ELSE )>> 1>> ) ( 1>> )>> ;"Debugging verbs" > ) (ELSE )>> > > ,P-NUMBER) (ELSE <>)>) (ELSE .O)>> >> > > > > )> ) (ELSE > )>>)> > > !\`>> )> )> > >> > > >>> ">) (<=? .O ,ROOMS> ) (<=? .O ,GLOBAL-OBJECTS> ) (<=? .O ,LOCAL-GLOBALS> ) (<=? .O ,GENERIC-OBJECTS> ) (ELSE )> ;"Object number" > ) ( ) ( ) (ELSE )> > >> ,KNOWN-FLAGS>>> > .N> > ")"> )>>> > )>> > > >> )>> > )>> ) (ELSE )>> >) (ELSE )> > "> > >) (<=? .S ,NEXIT> "\"">) (<=? .S ,FEXIT> >) (<=? .S ,CEXIT> > > > )>) (<=? .S ,DEXIT> > > > )>) (ELSE >> )> > >> >)> > )> ,PS?ADJECTIVE ,P1?ADJECTIVE>) (ELSE >)>>)> > 2>>> > )> >>)> > > >> >)> > )> >>)> > )> ) )> )>> > >> )> > >