generic builder (#4)(an instance of Refusals Player Class made by The_Mayor)     You see a player who should type '@describe me as ...'. VERB SOURCE CODE: @quota:
set_task_perms(player);
if (dobjstr == "")
dobj = player;
else
dobj = $string_utils:match_player(dobjstr);
endif
if (!valid(dobj))
player:notify("Show whose quota?");
return;
endif
$quota_utils:display_quota(dobj);
.
@create:
set_task_perms(player);
nargs = length(args);
pos = "named" in args;
if ((pos <= 1) || (pos == nargs))
pos = "called" in args;
endif
if ((pos <= 1) || (pos == nargs))
player:notify("Usage: @create
@recycle:
set_task_perms(player);
dobj = player:my_match_object(dobjstr);
if (dobj == $nothing)
player:notify(tostr("Usage: ", verb, "
@recreate: "@recreate @dig:
set_task_perms(player);
nargs = length(args);
if (nargs == 1)
room = args[1];
exit_spec = "";
elseif ((nargs >= 3) && (args[2] == "to"))
exit_spec = args[1];
room = $string_utils:from_list(args[3..nargs], " ");
elseif (!prepstr)
room = argstr;
exit_spec = "";
else
player:notify(tostr("Usage: ", verb, "
@audit: "Usage: @audit [player] [from @count:
if (!dobjstr)
dobj = player;
elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr),
dobjstr)[1])
return;
endif
set_task_perms(player);
if (typeof(dobj.owned_objects) == LIST)
count = length(dobj.owned_objects);
player:notify(tostr(dobj.name, " currently owns ", count, " object", (count ==
1) ? "." | "s."));
else
player:notify(tostr(dobj.name, " is not enrolled in the object ownership system.
Use @countDB instead."));
endif
.
@countDB:
if (!dobjstr)
dobj = player;
elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr),
dobjstr)[1])
return;
endif
set_task_perms(player);
count = 0;
for i in [1..tonum(max_object())]
if ($command_utils:running_out_of_time())
player:notify("Counting...");
suspend(5);
endif
o = toobj(i);
if (valid(o) && (o.owner == dobj))
count = count + 1;
endif
endfor
player:notify(tostr(dobj.name, " currently owns ", count, " object", (count == 1)
? "." | "s."));
.
@sort-owned*-objects:
"$player:owned_objects -- sorts a players .owned_objects property in ascending";
"order so it looks nice on @audit.";
if (player != this)
return E_PERM;
endif
if (typeof(player.owned_objects) == LIST)
set_task_perms(player);
if ((!dobjstr) || (index("object", dobjstr) == 1))
ret = $list_utils:sort_suspended(0, player.owned_objects);
elseif (index("size", dobjstr) == 1)
ret = $list_utils:reverse_suspended($list_utils:sort_suspended(0, player.owned_objects,
$list_utils:slice($list_utils:map_prop(player.owned_objects, "object_size"))));
endif
if (typeof(ret) == LIST)
player:set_owned_objects(ret);
player:tell("Your .owned_objects list has been sorted.");
return 1;
else
player:tell("Something went wrong. .owned_objects not sorted.");
return 0;
endif
else
player:tell("You are not enrolled in .owned_objects scheme, sorry.");
endif
.
@add-owned:
if (player != this)
player:tell("Permission Denied");
return E_PERM;
endif
if (!valid(dobj))
player:tell("Don't understand `", dobjstr, "' as an object to add.");
elseif (dobj.owner != player)
player:tell("You don't own ", dobj.name, ".");
elseif (dobj in player.owned_objects)
player:tell(dobj.name, " is already recorded in your .owned_objects.");
else
player.owned_objects = setadd(player.owned_objects, dobj);
player:tell("Added ", dobj, " to your .owned_objects.");
endif
.
@verify-owned:
for x in (player.owned_objects)
if ((!valid(x)) || (x.owner != player))
player.owned_objects = setremove(player.owned_objects, x);
if (valid(x))
player:tell("Removing ", x.name, "(", x, "), owned by ", valid(x.owner)
? x.owner.name | "
@unlock:
set_task_perms(player);
dobj = player:my_match_object(dobjstr);
if ($command_utils:object_match_failed(dobj, dobjstr))
return;
endif
res = dobj.key = 0;
if (typeof(res) == ERR)
player:notify(tostr(res, "."));
else
player:notify(tostr("Unlocked ", dobj.name, "."));
endif
.
@lock:
set_task_perms(player);
dobj = player:my_match_object(dobjstr);
if ($command_utils:object_match_failed(dobj, dobjstr))
return;
endif
key = $lock_utils:parse_keyexp(iobjstr, player);
if (typeof(key) == STR)
player:notify("That key expression is malformed:");
player:notify(tostr(" ", key));
else
res = dobj.key = key;
if (typeof(res) == ERR)
player:notify(tostr(res, "."));
else
player:notify(tostr("Locked ", dobj.name, " to this key:"));
player:notify(tostr(" ", $lock_utils:unparse_key(key)));
endif
endif
.
@newmess*age: "Usage: @message @unmess*age: "Usage: @unmessage _messagify:
"Given any of several formats people are likely to use for a @message";
"property, return the canonical form (\"foobar_msg\").";
name = args[1];
if (name[1] == "@")
name = name[2..length(name)];
endif
if ((length(name) < 4) || (name[length(name) - 3..length(name)] != "_msg"))
name = name + "_msg";
endif
return name;
.
@kids: "'@kids @contents: "'@contents @par*ents: "'@parents @location*s: "@locations @cl*asses:
"$class_registry is in the following format:";
" { {name, description, members}, ... }";
"where `name' is the name of a particular class of objects, `description' is a one-sentence
description of the membership of the class, and `members' is a list of object numbers,
the members of the class.";
"";
if (args)
members = {};
for name in (args)
class = $list_utils:assoc_prefix(name, $class_registry);
if (class)
for o in (class[3])
members = setadd(members, o);
endfor
else
player:tell("There is no defined class of objects named `", name, "';
type `@classes' to see a complete list of defined classes.");
return;
endif
endfor
printed = {};
for o in (members)
what = o;
while (valid(what))
printed = setadd(printed, what);
what = parent(what);
endwhile
endfor
player:tell("Members of the class", (length(args) > 1) ? "es" | "", " named ",
$string_utils:english_list(args), ":");
player:tell();
set_task_perms(player);
this:classes_2($root_class, "", members, printed);
player:tell();
else
"List all class names and descriptions";
player:tell("The following classes of objects have been defined:");
for class in ($class_registry)
name = class[1];
description = class[2];
player:tell();
player:tell("-- ", name, ": ", description);
endfor
player:tell();
player:tell("Type `@classes
classes_2:
root = args[1];
indent = args[2];
members = args[3];
printed = args[4];
if (root in members)
player:tell(indent, root.name, " (", root, ")");
else
player:tell(indent, "<", root.name, " (", root, ")>");
endif
indent = indent + " ";
set_task_perms(caller_perms());
for c in (children(root))
$command_utils:suspend_if_needed(10);
if (c in printed)
this:classes_2(c, indent, members, printed);
endif
endfor
.
_create:
set_task_perms(caller_perms());
if (this:build_option("bi_create"))
return $quota_utils:bi_create(@args);
else
return $recycler:(verb)(@args);
endif
.
_recycle:
set_task_perms(caller_perms());
if (this:build_option("bi_create"))
return recycle(@args);
else
return $recycler:(verb)(@args);
endif
.
@chparent:
set_task_perms(player);
if ($command_utils:object_match_failed(object = player:my_match_object(dobjstr),
dobjstr))
"...bogus object...";
elseif ($command_utils:object_match_failed(parent = player:my_match_object(iobjstr),
iobjstr))
"...bogus new parent...";
elseif ((this != player) && (!$object_utils:isa(player, $player)))
"...They chparented to #1 and want to chparent back to $prog. Probably for some
nefarious purpose...";
player:notify("You don't seem to already be a valid player class. Perhaps chparenting
away from the $player hierarchy was not such a good idea. Permission denied.");
elseif (is_player(object) && (!$object_utils:isa(parent, $player)))
player:notify(tostr(object, " is a player and ", parent, " is not a player class."));
player:notify("You really *don't* want to do this. Trust me.");
elseif (typeof(result = player:_chparent(object, parent)) != ERR)
player:notify("Parent changed.");
elseif ((result == E_INVARG) && (valid(object) && valid(parent)))
player:notify(tostr("Some property existing on ", parent, " is defined on ",
object, " or one of its descendants."));
player:notify(tostr("Try @check-chparent ", dobjstr, " to ", iobjstr));
else
player:notify(tostr(result));
endif
.
@check-chp*arent:
"Copied from generic programmer (#217):@check-chparent by ur-Rog (#6349) Sun Nov
8 22:13:53 1992 PST";
"@check-chparent object to newparent";
"checks for property name conflicts that would make @chparent bomb.";
set_task_perms(player);
if (!(dobjstr && iobjstr))
player:notify(tostr("Usage: ", verb, "
@set*prop: "Syntax: @set build_option:
":build_option(name)";
"Returns the value of the specified builder option";
if ((caller == this) || $perm_utils:controls(caller_perms(), this))
return $build_options:get(this.build_options, args[1]);
else
return E_PERM;
endif
.
set_build_option:
":set_build_option(oname,value)";
"Changes the value of the named option.";
"Returns a string error if something goes wrong.";
if (!((caller == this) || $perm_utils:controls(caller_perms(), this)))
return tostr(E_PERM);
endif
"...this is kludgy, but it saves me from writing the same verb n times.";
"...there's got to be a better way to do this...";
verb[1..4] = "";
foo_options = verb + "s";
"...";
if (typeof(s = #0.(foo_options):set(this.(foo_options), @args)) == STR)
return s;
elseif (s == this.(foo_options))
return 0;
else
this.(foo_options) = s;
return 1;
endif
.
@build-o*ptions @buildo*ptions @builder-o*ptions @buildero*ptions: "@ set_owned_objects:
if ((caller == this) || $perm_utils:controls(caller_perms(), this))
this.owned_objects = args[1];
else
return E_PERM;
endif
.
_chparent: set_task_perms(caller_perms()); return chparent(@args); . PROPERTY DATA:       build_options CHILDREN: generic programmer Q2 Frea raspy Horselover Abraxas Marquis Vibeke Wolf Paul Juan Tock_WatchDog spizz Siri Arakasi Akala stitch completemadness Urizen evangeline Bezoar RodRandom Kane Wildfire JayPup Roderick Keats mango Note gonz caulk Dj-CJ Wysperwynde Goliath Strap Heather Larks Cyborg Lar Enigma Mack pulse Flame cubbard Shockwave-Rider Harry Medved Mina Eleni Syr Monday Church_In_Hell Gowan cjp Snark MrW cpj Marney Tremaine tabitha Blackangel tabitha Woodnymph mananda Tigress Alden Rich Violet DNA irena grifter NrrdGrrl hypatiagrrl Exegetical_Hell Lulu Tali Wolverine Wolverine Sheila Bernie Godot Phlod_Firefly moira Raelen java Hank keneto beckit Lestat Arkay Felicia JungleBoy Misery Chameleon letang Klly Kenny beast Goat Captain_Midnite Death's_Dance Scudder Erol Bluerue Nightspore Incubus nemo Nox Tallulah dwarf Rufinnej nextDude SarahBeth Princess_Tinymeat Fasteddie Fate panther mistleford Trib The_Necromancer steven mayan devotee Hunt_Goddess molly Quark Umber Siren Corpse uwiz hydepark Aquitaine Kephren wildthing Moorishmaiden Trent Kalki Hermine % Cire Xorin gromit Pagen Quest Eliud true White-Wolf Tizarin Jason |