Coder Class #9

Parent #8Owner #10Flags fertileSource MurpgCore-0.4/MurpgCore-0.4.db

10 verbs · 72 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
rmp*ropany any anyrwd#989
verbsany none nonerwd#924
addverbany any anyrwd#974
grepany any anyrwd#923
show*verbany any anyrwd#933
treeany any anyrwd#953
evalany any anyrwd#98
who_stringthis none thisrwxd#935
argsany any anyrwd#923
whichany any anyrwd#940

Properties

PropertyDefinerFlagsOwnerValue
owned_objects#8rw#10<clear>
editing_prop#8rw#10<clear>
editing_obj#8rw#10<clear>
editing_loc#8rw#10<clear>
insert_point#8rw#10<clear>
prompt_on#6rw#10<clear>
color#3rw#10<clear>
base_hear#3rw#10<clear>
base_see#3rw#10<clear>
base_smell#3rw#10<clear>
prompt_string#3rw#10<clear>
base_hp#3rw#10<clear>
cur_hp#3rw#10<clear>
password#3rw#10<clear>
messages#3rw#10<clear>
base_feel#3rw#10<clear>
base_taste#3rw#10<clear>
known_languages#3rw#10<clear>
current_language#3rw#10<clear>
gender#3rw#10<clear>
afk#3rw#10<clear>
base_str#3rw#10<clear>
base_int#3rw#10<clear>
base_hea#3rw#10<clear>
base_spd#3rw#10<clear>
base_cnc#3rw#10<clear>
held#3rw#10<clear>
help_db#3rw#10#29
wielded#3rw#10<clear>
worn#3rw#10<clear>
species#3rw#10<clear>
height#3rw#10<clear>
current_channels#3rw#10<clear>
position#3rw#10<clear>
consciousness#3rw#10<clear>
base_ac#3rw#10<clear>
skills#3rw#10<clear>
base_dex#3rw#10<clear>
base_con#3rw#10<clear>
combat_stance#3rw#10<clear>
known_players#3rw#10<clear>
targets#3rw#10<clear>
last_connected#3rw#10<clear>
combat_init#3rw#10<clear>
combat_weapon#3rw#10<clear>
base_endurance#3rw#10<clear>
cur_endurance#3rw#10<clear>
base_focus#3rw#10<clear>
cur_focus#3rw#10<clear>
current_spell#3rw#10<clear>
paths#3rw#10<clear>
prompt_colors#3rw#10<clear>
finished#3rw#10<clear>
full_name#3rw#10<clear>
total_points#3rw#10<clear>
form_members#3rw#10<clear>
leader#3rw#10<clear>
start_location#3rw#10<clear>
description#1rw#10<clear>
aliases#1rw#10<clear>
home#1rw#10<clear>
short_desc#1rw#10<clear>
core#1rw#101
handedness#1rw#10<clear>
base_enc#1rw#10<clear>
base_weight#1rw#10<clear>
capacity#1rw#10<clear>
max_fit#1rw#10<clear>
pprep#1rw#10<clear>
gprep#1rw#10<clear>
generic_name#1rw#10<clear>
age#1rw#10<clear>

Ancestry

Ancestors (nearest first): #8 Architect Class#6 Player Class#3 Animate Class#11 Game Class#1 Root Class

Children: #10 DM Class

Call graph

calls n9_0 #9:rmp*rop n3_2 #3:tell n9_0->n3_2 n20_0 #20:parse_prop_ref n9_0->n20_0 n9_1 #9:verbs n9_1->n3_2 n20_6 #20:sort n9_1->n20_6 n9_2 #9:addverb n9_2->n3_2 n20_5 #20:parse_verb_ref n9_2->n20_5 n9_3 #9:grep n9_3->n20_6 n1_6 #1:descendants n9_3->n1_6 n3_8 #3:tell_raw n9_3->n3_8 n9_4 #9:show*verb n9_4->n3_2 n9_4->n20_5 n9_4->n3_8 n9_5 #9:tree n9_5->n3_2 n9_8 #9:args n9_8->n3_2 n9_8->n20_5 n9_9 #9:which n9_9->n3_2 n9_9->n20_6 n9_9->n1_6

Source

rmp*rop

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1" #9:rmp*rop(STR) any any any";
2"";
3" args[1]:  Only argument this function takes is a string consisting ";
4"           of OBJ.STR which refers to a prop (STR) on the OBJ. ";
5"";
6" Returns:  0 (command-line verb) ";
7"";
8" Modifies:  Removes a property from an object (and all its ";
9"            descendants. ";
10"";
11" Owner:  $dm ";
12" Writer:  Finder(#4) ";
13" Perms:  owner ";
14" Called by:  command-line function usable by DMs and Coders ";
15" Screen Outputs:  message ";
16"";
17" Description:  Performs various permissions checks, then ";
18"               determines whether or not the specified property ";
19"               exists and can be removed (i.e., it exists on the ";
20"               specified OBJ and not on a parent), then removes ";
21"               the property permanently. ";
22"";
23" NOTE:  As of today, string matching has not been completed so ";
24"        the object can only be referenced via its OBJ  number. ";
25"";
26" Examples:  rmprop #4.spoon ";
27"            rmprop me.spoon   <=  Can't be done yet (see NOTE) ";
28"";
29init_string = argstr;
30person = player;
31"";
32syntax = "SYNTAX:  <object_name/object_number>.<new_prop_name>";
33example1 = "For example:  rmprop #233.flight_path";
34example2 = "For example:  rmprop bird.flight_path";
35"";
36" This :tell() is provided for formatting purposes only. :-) ";
37person:tell();
38if (!args)
39person:tell(syntax);
40person:tell(example1);
41" Add this back in once string matching has been coded. ";
42"person:tell(example2);";
43return 0;
44else
45" Ok, going to call $utils:parse_prop_ref here...  If the object ";
46" string it returns can't be changed to an OBJ, just return SYNTAX.  ";
47" String matching has not been coded yet. ";
48if (!(obj_and_prop = $utils:parse_prop_ref(init_string)))
49person:tell(syntax);
50person:tell(example1);
51else
52target = obj_and_prop[1];
53property = obj_and_prop[2];
54if (target[1] != "#")
55" No string matching yet. ";
56person:tell("String matching has not been coded yet.  Please use an object number.");
57person:tell(example1);
58return 0;
59else
60object = toobj(target);
61if (!valid(object))
62" The object is not a valid object number. ";
63person:tell("That is not a valid object.");
64else
65" Make sure the property exists at all. ";
66if (!object:has_prop(property))
67person:tell("There is no '", property, "' property on ", object, ".");
68return 0;
69else
70" Make sure the property is on this specific object and not ";
71" on an ancestor.  Since we already made sure the prop can ";
72" be referenced by the specified OBJ an E_PROPNF must mean ";
73" that the prop is defined above the OBJ.  All other errors ";
74" will be parsed and returned to the player. ";
75try
76delete_property(object, property);
77person:tell("Property removed.");
78except (E_PROPNF)
79person:tell("That property is defined on an ancestor of ", object.name, ".");
80person:tell("At a later date there will be a function designed to test for this.");
81except any_error (ANY)
82person:tell("The built-in function delete_property returned the following error:");
83person:tell(any_error[2]);
84endtry
85endif
86endif
87endif
88endif
89endif

verbs

Spec any none noneFlags rwdOwner #10Definer #9

Referenced by

none

Source

1"#9:verbs any none none";
2{?target = ""} = args;
3targobj = toobj(target);
4if (length(target) == 0)
5player:tell("Display verbs for what object?");
6elseif ((!valid(targobj)) || ((targobj == #0) && ((target != "#0") && (target != "0"))))
7player:tell(("%W" + target) + "%w is not a valid object reference.");
8else
9if (valid(targobj))
10verblist = #20:sort(verbs(targobj));
11player:tell("Verbs defined on ", targobj.name, " (", targobj, ")");
12for verb in (verblist)
13verbinfo = verb_info(targobj, is_member(verb, verbs(targobj)));
14numlines = length(verb_code(targobj, is_member(verb, verbs(targobj))));
15verbargs = verb_args(targobj, is_member(verb, verbs(targobj)));
16player:tell("~  ", verb, " (", verbargs[1], " ", verbargs[2], " ", verbargs[3]);
17player:tell("~", ")  Owned by ", verbinfo[1], ".  (", verbinfo[2]);
18player:tell(")   ", numlines, " lines of code.");
19endfor
20else
21player:tell(targobj, "is not a valid object number");
22return;
23endif
24endif

addverb

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1"#9:addv*erb objnum:verbname arg1 arg2 arg3";
2" Returns:  0 (command-line verb) ";
3" Modifies:  Adds a verb to the specified objnum. ";
4" Owner:  $dm ";
5" Writer:  Ixion (#5) ";
6" Called by:  command-line function usable by DMs and Coders ";
7" Screen outputs:  message ";
8{?init_string, ?value_one = $nothing, ?value_two = $nothing, ?value_three = $nothing} = args;
9person = player;
10target = verb = "";
11"copied from addprop and modified";
12syntax = "SYNTAX:  addverb <object_name/object_number>:<new_verb_name> args1 args2 args3";
13example1 = "For example:  addverb #556:wiggle any none none";
14example2 = "For example:  addverb ferret:wiggle any none none";
15"";
16" The following :tell() is for formatting purposes only. ";
17person:tell();
18if (!args)
19person:tell(syntax);
20person:tell(example1);
21" Add this back in once string matching has been coded. ";
22"person:tell(example2);";
23return 0;
24else
25" Ok, going to call $utils:parse_verb_ref here...  If the object ";
26" string it returns can't be changed to an OBJ, just return SYNTAX.  ";
27" String matching has not been coded yet. ";
28if (!(obj_and_verb = $utils:parse_verb_ref(init_string)))
29person:tell(syntax);
30person:tell(example1);
31else
32target = obj_and_verb[1];
33verb = obj_and_verb[2];
34if (target[1] != "#")
35" No string matching yet. ";
36person:tell();
37person:tell("String matching has not been coded yet.  Please use an object number.");
38person:tell(example1);
39return 0;
40else
41object = toobj(target);
42if (!valid(object))
43" The object is not a valid object number. ";
44person:tell("That is not a valid object.");
45else
46" Make sure the verb does not already exist. ";
47if (object == object:has_verb(verb))
48person:tell("That verb already exists: ", object, ":", verb, ".");
49return 0;
50else
51"add the verb with specified args";
52if ((value_one && value_two) && value_three)
53if (((value_one == "this") && (value_two == "none")) && (value_three == "this"))
54perms = "rwxd";
55else
56perms = "rwd";
57endif
58owner = #10;
59try
60add_verb(object, {owner, perms, verb}, {value_one, value_two, value_three});
61person:tell(tostr("Verb added: ", object, "(", object.name, "):", verb));
62person:tell("Don't forget to change perms on this verb if necessary.");
63except e (ANY)
64" Parse the error and return it. ";
65person:tell("The built-in function add_verb returned the following error: ");
66person:tell(e[2]);
67person:tell("Verb not added");
68endtry
69endif
70endif
71endif
72endif
73endif
74endif

grep

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1"search verb code for occurrences of args[1].  no regexp";
2{pattern} = args;
3searchlist = {};
4allobjs = #20:sort({#1, @#1:descendants()});
5for each in (allobjs)
6if (verbs(each) != {})
7searchlist = {@searchlist, each};
8endif
9endfor
10for each in (searchlist)
11verblist = verbs(each);
12for verbitem in (verblist)
13verbcode = verb_code(each, is_member(verbitem, verblist));
14linenum = 0;
15for line in (verbcode)
16linenum = linenum + 1;
17pos = index(line, pattern);
18if (pos > 0)
19player:tell_raw(tostr(each), ":", verbitem, "() - Line ", tostr(linenum), " - ", line);
20endif
21endfor
22endfor
23endfor

show*verb

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1" #9:show*verb any none none";
2"takes one or two arguments: a verb ref, and optionally the letter 'l' to show linenums";
3{?verb_ref = "", ?showlines = ""} = args;
4if (verb_ref == "")
5player:tell("Show which verb?");
6else
7parsed = $utils:parse_verb_ref(verb_ref);
8if (parsed == 0)
9player:tell(("%W" + verb_ref) + "%w is not a valid verb reference.");
10else
11object = toobj(parsed[1]);
12verb = parsed[2];
13if (!valid(object))
14player:tell(("%W" + tostr(object)) + "%w is not a valid object reference.");
15else
16result = object:has_verb(verb);
17if (result == 0)
18player:tell(((("%W" + verb) + "%w is not defined on %W") + object.name) + "%w.");
19elseif (result != object)
20player:tell(((((("%W" + verb) + "%w is defined on ") + object.name) + "'s ancestor, %W") + result.name) + "%w.");
21elseif (!showlines)
22player:tell_raw(verb_code(object, verb));
23else
24x = 1;
25verbcode = verb_code(object, verb);
26for each in (verbcode)
27player:tell_raw((tostr(x) + ":  ") + each);
28x = x + 1;
29endfor
30endif
31endif
32endif
33endif

tree

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1" #10:tree ([OBJ], [STR all]) ";
2"";
3" args[1]:  Optional.  The OBJ whose descendants you wish to view. ";
4"           Default value is the System Object (#0). ";
5"";
6" args[2]:  The string option 'all' displays every one of the OBJ's ";
7"           descendants whether fertile or not.  Without this option ";
8"           only fertile descendants are displayed. ";
9"";
10" Returns:  0 (command-line verb) ";
11" Modifies:  none ";
12" Owner:  $dm ";
13" Writer:  Ixion(#5) ";
14" Perms:  owner ";
15" Called-by:  Command-line function callable by DMs and Coders. ";
16" Screen Outputs:  A visual tree displaying the OBJ's descendants. ";
17"";
18" Description:  Displays a visual tree that lists out the target OBJ's ";
19"               descendants.  If the 'all' argument is used, every ";
20"               descendant is listed, even those that are not fertile. ";
21"";
22" Examples:  tree          =>  Displays all fertile descendants of #0. ";
23"            tree #18      =>  Displays all fertile descendants of #18. ";
24"            tree #18 all  =>  Displays all fertile and non-fertile ";
25"                              descendants of #18. ";
26"";
27if (length(args) == 0)
28ancestor = #1;
29all = "";
30else
31ancestor = toobj(args[1]);
32all = "";
33endif
34if (length(args) == 2)
35all = args[2];
36elseif (length(args) > 2)
37player:tell("Too many arguments.");
38player:tell("Syntax:  tree object [all]");
39return;
40endif
41if (((ancestor != #0) || (args[1] == "0")) || (args[1] == "#0"))
42if (all == "")
43ancestor:tree(1, 0);
44elseif (all == "all")
45ancestor:tree(1, 1);
46else
47player:tell(("Unknown argument " + all) + ".  Valid second arguments are: [all]");
48player:tell("Syntax:  tree object [all]");
49endif
50else
51player:tell("First argument should be a valid object number.");
52player:tell("Syntax:  tree object [all]");
53endif

eval

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1answer = eval(("return " + argstr) + ";");
2if (answer[1])
3notify(player, tostr("=> ", toliteral(answer[2])));
4else
5for line in (answer[2])
6notify(player, line);
7endfor
8endif

who_string

Spec this none thisFlags rwxdOwner #10Definer #9

Referenced by

none

Source

1"$coder:who_string() this none this";
2viewer = args[1];
3gender = {"N", "B", "F", "M"}[this.gender in {"neither", "both", "female", "male"}];
4"afk";
5if (this.afk)
6afk = $who.afk + "  ";
7else
8afk = "       ";
9endif
10"editing";
11if (this.location:is_a($editor))
12edit = $who.editing + "  ";
13else
14edit = "           ";
15endif
16"idle";
17idle = idle_seconds(this);
18if (idle > 3600)
19idle = $who.dormant + "  ";
20elseif (idle > 1800)
21idle = $who.vegetating + "  ";
22elseif (idle >= 600)
23idle = $who.idle + "  ";
24else
25idle = "        ";
26endif
27"admin";
28if (this in $admins)
29admin = $who.admin;
30else
31admin = "";
32endif
33name_string = $utils:padr(this.name, 16, " ");
34who_string = ((((((("%Y[%yCode " + gender) + "%Y] ") + name_string) + afk) + edit) + idle) + admin) + "%w";
35return who_string;

args

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1"$coder:args any any any";
2"sets the args on obj:verb to specified args";
3if (length(args) == 1)
4{objverb} = args;
5objandverb = $utils:parse_verb_ref(objverb);
6if (objandverb == 0)
7player:tell("syntax: obj:verb [ dobj prep iobj ]");
8else
9objargs = verb_args(toobj(objandverb[1]), objandverb[2]);
10player:tell(objandverb[1], ":", objandverb[2], " ", objargs[1], " ", objargs[2], " ", objargs[3]);
11endif
12elseif (length(args) != 4)
13player:tell("syntax: obj:verb dobj prep iobj");
14else
15{objverb, dobjarg, preparg, iobjarg} = args;
16objandverb = $utils:parse_verb_ref(objverb);
17if (objandverb == 0)
18player:tell("syntax: obj:verb [ dobj prep iobj ]");
19else
20set_verb_args(toobj(objandverb[1]), objandverb[2], {dobjarg, preparg, iobjarg});
21player:tell("Verb arguments changed.");
22endif
23endif

which

Spec any any anyFlags rwdOwner #10Definer #9

Referenced by

none

Source

1"$coder:which any none none";
2"returns a list of objects that have matching verbs and/or props";
3token = argstr;
4if (token == "")
5player:tell("What verb or property would you like to search for?");
6else
7allobjs = $utils:sort({#1, @#1:descendants()});
8"verbs that match";
9for each in (allobjs)
10matched_verbs = {};
11xverbs = verbs(each);
12for xverb in (xverbs)
13if (index(xverb, token) == 1)
14matched_verbs = {@matched_verbs, xverb};
15endif
16endfor
17if (matched_verbs != {})
18player:tell(((each.name + " (") + tostr(each)) + ")");
19for mverb in (matched_verbs)
20player:tell("  :" + mverb);
21endfor
22endif
23endfor
24"props that match";
25for each in (allobjs)
26matched_props = {};
27xprops = properties(each);
28for xprop in (xprops)
29if (index(xprop, token) == 1)
30matched_props = {@matched_props, xprop};
31endif
32endfor
33if (matched_props != {})
34player:tell(((each.name + " (") + tostr(each)) + ")");
35for mprop in (matched_props)
36player:tell("  ." + mprop);
37endfor
38endif
39endfor
40endif