Nastie's Redescer

A description storage/changing device.

Category: Other

Instructions

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

MUSHCode for Nastie's Redescer

@create redescer
@lock/Basic redescer==me
@set redescer = !NO_COMMAND
&DELETE redescer=$delete *:@switch %#= [owner(me)], {&%0 me= ;@pemit %#="%0" deleted.}
@DESCRIBE redescer=%b %b %b This object stores descriptions and allows you to "wear" a list of them. It's secondary function is to teach MUSHcode. You can copy the basic commands here to your object and modify them as you wish. Feel free to ask me for help.%r%rPlease @create an object with the name of your choice. Then:%r@lock <object>==me%r@lock/use <object>==me%r@set <object>=command%r@set <object>=inherit%r%r%b %b %b Then type 'redhelp' to get started. (I call mine "redescer" and set it Dark, so it doesn't get lost. You might want to name it something you'd carry ICly, and give it an IC @desc.)%r%r...by Akiko
@set redescer/DESCRIBE=no_command visual
&HAIRPIN redescer=Kryana has long strait red hair that curls at the bottom and bright red fur. Her eyes are auburn and caring. She is 4"3" tall and weighs 74 lbs. She wears a pale pink spidersilk shirt and carries around a long white marble quarterstaff which is practiclly as tall as she is. She's usually very nice but when she's grumpy you can tell by the look on her face! :)
&HELP redescer=$redhelp:@pemit %#=[center(>> DESC-NAMES *MUST* BE ONLY ONE WORD! <<,78)]%r[ljust(Commands,40)]Results%r%r[ljust(store <desc-name>,40)]To STORE your @desc as <desc-name>.%r[ljust(&<desc-name> chest=<text>,40)]To write a desc or shortdesc directly%r[space(40)]to the chest.%r[ljust(delete <desc-name>,40)]To DELETE a desc from the chest.%r[ljust(ldesc,40)]To see a List of your DESCs.%r[ljust(try <desc-name> \[<desc-name>\] \[etc.\],40)]See what your @desc or shortdesc%r[space(40)]would look like before you "wear" it%r[space(40)](or to see a desc you've forgotton).%r[ljust(wear <desc-name> \[<desc-name>\] \[etc.\],40)]Make a change to your @desc. %r[ljust(makesht <sht-name>,40)]Make a change to your SHORTDESC.%r[ljust(rewear,40)]RE-WEARs your @desc. Use after edits.%r[ljust(worn,40)]Shows last list used by 'wear'.%r%r[center(* text and code copyright 1997 by Nastie of Tara'Nae *,78)]%b %b %b (Remember, don't type in the < >'s, and DON'T call a desc "desc" or%r%b %b %b "describe". That will make your redescer look like you! <grin>)%rSee <redhelp2> for hints.
&HELP2 redescer=$redhelp2:@pemit %#=The "desc-name" is the name of the desc in the redescer.%rExample: <store first>%b , will store your @desc as FIRST.%r%rYou can edit the desc by typing:%r<@edit chest/<desc-name>=\{old\},\{new\}> %b (See < help @edit > ).%r%rThe first desc might be a general description of your character, the second a description of what you are wearing, the third could be your current mood... but you could put the mood first, just by changing the order of the desc-names in the command.%rYou might want to make an @desc of smaller parts, say, a list like: %rHAIR3 GEN1 DRS_BLUE SMILE%rthen store this combined desc as "STD1", so you could 'wear' it easily.%r"STD2" might be:%rHAIR3 GEN1 DRS_BLUE FROWN%rso, if you're caught in the rain wearing STD1, you could quickly type:%rwear STD2 UMBRELLA[space(6)](Assuming you have an "umbrella" desc! :)
&LIST redescer=$ldesc:@pemit %#=Your descs are: [setdiff(lattr(me), DELETE Desc STORE HELP HELP2 LIST MAKESHT REWEAR TRY WEAR WORN )]
&MAKESHT redescer=$makesht *:setq(0,%0);setq(1,setdiff(ucstr(%q0),lattr(me)));@switch [words(%q1)]=0,{&short-desc %#=[iter(%q0, v(##))];@fo %#=+look},{@pemit %#=Sorry,"%q1" is(are) not a desc(s). Please try <ldesc>.}
&NECKLACE redescer=Kryana has long strait red hair that curls at the bottom and bright red fur. Her eyes are auburn and caring. She is 4"3" tall and weighs 74 lbs. She wears a pale pink spidersilk shirt and carries around a long white marble quarterstaff which is practiclly as tall as she is. She's usually very nice but when she's grumpy you can tell by the look on her face! :)
&REWEAR redescer=$rewear:@desc %#=[iter(%vc, v(##))];@fo %#=l me
&STORE redescer=$store *:@switch [hasattr(me,%0)]= 1, {@pemit %#=You already have a desc by that name. You must delete it first.}, {@switch [words(%0)]= 1,{&%0 me=[get(%#/describe)];@pemit %#=Your current @desc has been stored as "%0".}, {@pemit %#-You must use one-word names for your descs.}}
&TALISMAN redescer=Kryana has long strait red hair that curls at the bottom and bright red fur. Her eyes are auburn and caring. She is 4"3" tall and weighs 74 lbs. She wears a pale pink spidersilk shirt and carries around a long white marble quarterstaff which is practiclly as tall as she is. She's usually very nice but when she's grumpy you can tell by the look on her face! :)
&TRY redescer=$try *:setq(0,setdiff(ucstr(%0),lattr(me)));@pemit %#=[switch(words(%q0),0,{[iter(%0, get_eval(me/##))]},{Sorry, "%q0" is(are) not a desc(s). Please try <ldesc>.})]
&WEAR redescer=$wear *:setq(0,%0);setq(1,setdiff(ucstr(%q0),lattr(me)));@switch [words(%q1)]=0,{@desc %#=[iter(%q0, v(##))]%r;@vc me=%q0;@pemit %#=Your @desc is changed to:%r[get_eval(%#/desc)]},{@pemit %#=Sorry,"%q1" is(are) not a desc(s). Please try <ldesc>.}
&WORN redescer=$worn:@pemit %#=You are wearing: %vc