Generic Feature Object (#74)

(an instance of generic thing made by Hacker)

     This is the Generic Feature Object.  It is not meant to be used as a feature object 
itself, but is handy for making new feature objects.


HELP MANUAL:
     The Generic Feature Object--not to be used as a feature object.



VERB SOURCE CODE:

help_msg:
all_help = this.help_msg;
if (typeof(all_help) == STR)
    all_help = {all_help};
endif
helpless = {};
for vrb in (this.feature_verbs)
    if (loc = $object_utils:has_verb(this, vrb))
        loc = loc[1];
        help = $code_utils:verb_documentation(loc, vrb);
        if (help)
            all_help = {@all_help, "", tostr(loc, ":", verb_info(loc, vrb)[3]), @help};
        else
            helpless = {@helpless, vrb};
        endif
    endif
endfor
if (helpless)
    all_help = {@all_help, "", ("No help found on " + $string_utils:english_list(helpless, 
"nothing", " or ")) + "."};
endif
return {@all_help, "----"};
.


look_self:
"Definition from #1";
desc = this:description();
if (desc)
    player:tell_lines(desc);
else
    player:tell("You see nothing special.");
endif
player:tell("Please type \"help ", this, "\" for more information.");
.


using this:
"Proper usage for the Generic Feature Object:";
"";
"First of all, the Generic Feature Object is constructed with the idea";
"that its children will be @moved to #24300, which is kind of a warehouse";
"for feature objects.  If there's enough interest, I'll try to make the";
"stuff that works with that in mind optional.";
"";
"Make a short description.  This is so I can continue to have looking at";
"#24300 give the descriptions of each of the objects in its .contents.";
"The :look_msg automatically includes a pointer to `help ',";
"so you don't have to.";
"";
"Put a list of the commands you want people to use in";
".feature_verbs.  (You need to use the :set_feature_verbs";
"verb to do this.)";
"";
"When someone types `help ', they will be told the comment";
"strings from each of the verbs named in .feature_verbs.";
.


examine_commands_ok:
return this in args[1].features;
.


set_feature_ok:
if ($perm_utils:controls(caller_perms(), this) || (caller == this))
    return this.feature_ok = args[1];
else
    return E_PERM;
endif
.


hidden_verbs:
"Can't see `get' unless it's in the room; can't see `drop' unless it's in the player. 
 Should possibly go on $thing.";
"Should use :contents, but I'm in a hurry.";
hidden = pass(@args);
if (this.location != args[1])
    hidden = setadd(hidden, {$thing, verb_info($thing, "drop")[3], {"this", "none", 
"none"}});
    hidden = setadd(hidden, {$thing, verb_info($thing, "give")[3], {"this", "at/to", 
"any"}});
endif
if (this.location != args[1].location)
    hidden = setadd(hidden, {$thing, verb_info($thing, "get")[3], {"this", "none", 
"none"}});
endif
return hidden;
.


set_feature_verbs:
if ($perm_utils:controls(caller_perms(), this) || (caller == this))
    return this.feature_verbs = args[1];
else
    return E_PERM;
endif
.


initialize:
if ((caller == this) || $perm_utils:controls(caller_perms(), this))
    pass(@args);
    this.feature_verbs = {};
else
    return E_PERM;
endif
.



PROPERTY DATA:
      warehouse
      help_msg
      feature_verbs
      feature_ok

CHILDREN:
Login Watcher Features Feature Object Stage Talk FO Player Information Feature Carrot's Rosette Feature Object Thinking Feature Second Character Registry Social Shortcuts Feature Improved redirected say and whisper Saffrona fo Size-Prospectus FO Lag Feature Pasting Feature Repetitive Stress Injuries feature Random Features Maybe Useful sick features Liquor FO Boot FO Generics Registry FO Suave Delanyesque Pickup FO Info Feature Esperantists' Feature GrrlVerbs