Places Desc Parent

This is designed to enhance a room that already has the standard places code, by adding the place name after the player's name in the desc. Check out the Phoenix Inn on CryptMUX for a working example. [Note it requires that the MU* allows the room owner to execute hasflag(), and that if your MUX or MUSH is set up such that wizards/people who pass ZMO enter locks can see in DARK rooms, it'll be icky for them.]

Category: Dynamic Space

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Places Desc Parent

@create Places Desc Parent=5
@Desc Places Desc Parent=A neato parent for rooms with places. @parent here=[num(me)], and @set here=DARK. Note that the text displayed in the room desc has a prefix based on the last word of the place's PREFIX. So far, the following are supported:%r[iter(lnum(words(v(placetypes))),%r[ljust(extract(v(placetypes),add(##,1),1),10)]-> "[extract(v(placeprefix),add(##,1),1,|)]")]%r%rTo add a new one, add the last word of its PREFIX to &PLACETYPES, and the required text to &PLACEPREFIX.%r%rOriginal Code (c) Mike Whitaker 1996: May be freely distributed provided you take the time to ask my permission first (email mike@altrion.org), and preserve the credits.%r%rIt's in your interests to do so - you don't tell me you have a copy, I don't give you bug fixes.
@Asucc Places Desc Parent=@pemit %#=[u(people)][u(things)][u(exits)]
&EXITS Places Desc Parent=Exits:[setq(0,filter(me/isntdark,lexits(me)))][iter(lnum(words(%q0)),[switch(mod(##,2),0,%r)][ljust(%b%b[name(extract(%q0,add(##,1),1))],30)])]
&THINGS Places Desc Parent=[setq(0,filter(is_thing,lcon(me)))][switch(%q0,,,Objects:[iter(%q0,%r%b%b[name(##)])]%r)]
&IS_THING Places Desc Parent=switch(flags(%0),*P*,0,1)
&PEOPLE Places Desc Parent=[setq(0,filter(is_person,lcon(me)))][switch(%q0,,,People:[iter(%q0,%r%b%b[switch([setq(1,WHICHPLACE(num(me),##))]%q1,0,name(##),u(placename,##,%q1))])]%r)]
&PLACENAME Places Desc Parent=name(%0), [setq(2,PLACEINFO(num(me),%1,NAME))][setq(3,PLACEINFO(num(me),%1,PREFIX))][setq(4,match(v(placetypes),last(%q3)))][switch(%q4,0,%q2,[extract(v(placeprefix),%q4,1,|)] %q2)]
&IS_PERSON Places Desc Parent=and(or(hasflag(%0,connected),hasflag(%0,puppet)),not(hasflag(%0,dark)))
&PLACETYPES Places Desc Parent=table stool bench cot
&PLACEPREFIX Places Desc Parent=at|on one of|on|on the
&ISNTDARK Places Desc Parent=[not(hasflag(%0,DARK))]
@set Places Desc Parent=VISUAL
@set Places Desc Parent=PARENT_OK