Root Class #1

Parent #-1Owner #10Flags read, fertileSource MurpgCore-0.4/MurpgCore-0.4.db

17 verbs · 14 properties · 23 children

Verbs

VerbSpecFlagsDefinerLines
treethis none thisrwxd#141
recyclethis none thisrwxd#192
chownthis none thisrwxd#121
_createthis none thisrwxd#125
move_tothis none thisrwxd#141
contained_bythis none thisrwxd#115
descendantsthis none thisrwxd#111
is_athis none thisrwxd#19
ancestorsthis none thisrwxd#17
propertiesthis none thisrwxd#17
has_prop*ertythis none thisrwxd#17
has_verbthis none thisrwxd#19
describe_tothis none thisrwxd#129
encumbrancethis none thisrwxd#110
weightthis none thisrwxd#110
tellthis none thisrwxd#11
known_tothis none thisrwxd#12

Properties

PropertyDefinerFlagsOwnerValue
description#1rw#10{"This object is blank."}
aliases#1rw#10{}
home#1rw#10#-1
short_desc#1rw#10""
core#1rw#101
handedness#1rw#100
base_enc#1rw#100
base_weight#1rw#100
capacity#1rw#100
max_fit#1rw#100
pprep#1rw#10""
gprep#1rw#10""
generic_name#1rw#10""
age#1rw#100

Ancestry

Ancestors (nearest first): none

Children: #0 System Object, #11 Game Class, #12 DM Object Class, #14 Effects Class, #15 Help DB Class, #16 Account Class, #18 General Knowledge Object, #20 Utility Object, #22 Reusable Class, #24 Recycler Object, #42 Combat Manger Object, #43 Log Manager Ojbect, #44 Control Center Object, #45 Mixture Table Object, #46 Effects Table Object, #47 Weather Object, #48 Central Bank Object, #49 Spell Class, #52 Ticker Object, #64 Who List Manager, #68 Channel Manager Object, #85 Magical Path Class, #96 Language Class

Call graph

calls n1_0 #1:tree n3_2 #3:tell n1_0->n3_2 n1_1 #1:recycle n1_1->n3_2 n1_7 #1:is_a n1_1->n1_7 n1_4 #1:move_to n1_1->n1_4 n1_5 #1:contained_by n1_4->n1_5 n1_13 #1:encumbrance n1_4->n1_13 n1_14 #1:weight n1_4->n1_14 n1_3 #1:_create n43_0 #43:add_entry n1_3->n43_0 n1_5->n1_5

Source

tree

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1" #1:tree(INT, INT) this none this";
2"";
3" args[1]:  INT, recursion level ";
4" args[2]:  INT (Boolean), whether or not the 'all' option was used. ";
5"";
6" Returns:  0 ";
7" Modifies:  none ";
8" Owner:  $dm ";
9" Writer:  Ixion(#5) ";
10" Perms:  owner ";
11" Called-by:  #10($dm):tree command-line function ";
12" Screen Outputs:  sends the tree strings to the player ";
13"";
14" Description:  This verb outputs a nice object hierarchy tree for ";
15"               all fertile objects.  Its so simple and elegant;  but ";
16"               then again that is what recursion is about! ";
17"";
18"               Takes as arguments the recursion level which it is at ";
19"               just for formatting purposes, as well as true/false 'all' ";
20"               which, if true, causes the verb to print _all_ children, ";
21"               even those that aren't fertile.  In reality this would mean ";
22"               _every_ object downstream from the object that the verb was ";
23"               called on:  if on #1, then every object in the db. ";
24"";
25" NOTE:  Use with caution!  This function is capable of printing EVERY object ";
26"        in the entire database. ";
27"";
28depth = length(args) ? args[1] | 1;
29all = (length(args) == 2) ? args[2] | 0;
30player:tell(("~" + tostr(depth)) + "-");
31for x in [1..depth]
32player:tell("~  ");
33endfor
34player:tell((tostr(this) + " -- ") + this.name);
35newdepth = depth + 1;
36for y in (children(this))
37if ((y.f == 1) || (all == 1))
38y:tree(newdepth, all);
39endif
40endfor
41return;

recycle

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1" #1:recycle this none this takes no arguments;  this function will change the parent of the object";
2" to #22 -- reusable class and wipe any props, change the name, and fertility stuff.";
3" we don't want to use builtin recycle, because we want a method for recovering object numbers.";
4" after an object is recycled, it will be named to reusable object and put in #-1.  fertile objects ";
5" can not be recycled; wizards cannot be recycled. Recycler, #1 and #0 cannot be recycled.  we will allow ";
6" for a list of non-recyclable objects to be maintained, perhaps on #24 -- recycler. ";
7" player bit should be revoked, prog bit should be revoked.  all verbs on it should be wiped. ";
8for task in ($recycler.recycle_tasks)
9if (task[1] == this)
10player:tell(this.name + " is already queued for recycling.");
11return 0;
12endif
13endfor
14if (((((((this == #1) || (this == #0)) || (this == #24)) || (this.wizard == 1)) || (this.f == 1)) || is_player(this)) || (this in $recycler.non_recyclable))
15player:tell(("You can't recycle " + this.name) + ".");
16return 0;
17else
18if (this:is_a($reusable))
19player:tell("That item is already recyclable material!");
20return;
21elseif (this:is_a($game_object))
22fork get_task_id ($recycler.recycle_time_limit)
23"if it is on a player, remove from held and worn.";
24if ((this.location != #-1) && is_player(this.location))
25this.location.wielded = setremove(this.location.wielded, this);
26this.location.worn = setremove(this.location.worn, this);
27endif
28"if it is an exit, remove it from the appropriate room.exits props";
29if (this:is_a($exit))
30if ((this.source != #-1) && this.source:is_a($room))
31#5:tell(((("removing " + tostr(this)) + " from ") + tostr(this.source)) + " exits.");
32this.source.exits = setremove(this.source.exits, this);
33endif
34endif
35this:move_to(#5);
36"if has kids, chparent on kids to this.parent";
37if (kids = children(this))
38for kid in (kids)
39chparent(kid, parent(this));
40endfor
41endif
42"if has contents, move any that are player to the start room";
43"else move to anonymous";
44if (conts = this.contents)
45for content in (conts)
46if (is_player(content))
47move(content, content.start_location);
48else
49move(content, $anonymous);
50endif
51endfor
52endif
53"if owns any objs, chown to anonymous";
54if (this:is_a($architect))
55for owned in (this.owned_objects)
56result = owned:chown($anonymous);
57endfor
58endif
59"chparent to #22";
60chparent(this, $reusable);
61"set all bits to 0";
62this.programmer = 0;
63this.wizard = 0;
64this.r = 0;
65this.w = 0;
66this.f = 0;
67"clear any verbs";
68for verby in (verbs(this))
69delete_verb(this, verby);
70endfor
71"clear any props";
72for propy in (properties(this))
73delete_property(this, propy);
74endfor
75"rename to Reusable Object";
76this.name = "Reusable Object " + tostr(this);
77this.aliases = {};
78"remove task from recyclers task list";
79for task_item in ($recycler.recycle_tasks)
80if (task_item[1] == this)
81$recycler.recycle_tasks = setremove($recycler.recycle_tasks, task_item);
82endif
83endfor
84player:tell(("Object " + tostr(this)) + " has been recycled.");
85endfork
86$recycler.recycle_tasks = {@$recycler.recycle_tasks, {this, get_task_id}};
87player:tell(((((this.name + " has been queued for recycling in ") + tostr($recycler.recycle_time_limit / 60)) + " minutes with task id ") + tostr(get_task_id)) + ".");
88player:tell("Kill this task id, or use the recycle command to stop this object from being destroyed.");
89else
90player:tell("We do not currently support recycling of this object type.");
91endif
92endif

chown

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1" ok, we will call this instead of the builtin chown, so that we may add objs to our";
2" owned_objects prop.";
3" takes as an argument its new owner.  returns 0 on failure, new parent on success.";
4" will change ownership and ";
5" modify neccessary owned_objects props.";
6if (length(args) != 1)
7return 0;
8elseif (!valid(args[1]))
9return 0;
10else
11new_owner = args[1];
12old_owner = this.owner;
13this.owner = new_owner;
14if (old_owner:has_prop("owned_objects"))
15old_owner.owned_objects = setremove(old_owner.owned_objects, this);
16endif
17if (new_owner:has_prop("owned_objects"))
18new_owner.owned_objects = setadd(new_owner.owned_objects, this);
19endif
20return new_owner;
21endif

_create

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1" #1:create this none this -- #1:create(obj owner) ";
2" returns the object number of the new object owned by owner ";
3{owner} = args;
4if (!valid(owner))
5return 0;
6endif
7new_owner = owner;
8" check for existing reusable objects ";
9kids = children($reusable);
10if (kids != {})
11new_object_num = kids[1];
12chparent(new_object_num, this);
13else
14" assign new obj num, create new obj, owned by $dm ";
15new_object_num = create(this, $dm);
16endif
17" change owner to new owner ";
18"player:tell(new_object_num)";
19testown = new_object_num:chown(new_owner);
20" make sure call to chown did not fail ";
21if (testown != new_owner)
22$log:add_entry("system", "[ERROR]", (((("Call to " + this.name) + ":chown() failed in call to ") + this.name) + ":create().") + "Check your verb logic, its fucked up.");
23endif
24new_object_num.name = "Child of " + this.name;
25return new_object_num;

move_to

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1"#1:move_to(OBJ) this none this ";
2what = this;
3destination = args[1];
4old_loc = this.location;
5if (destination:is_a($animate))
6retval = destination:can_hold(what);
7if (retval[1] == 0)
8return {0, "You cannot hold any more items."};
9"if you are not already carrying the weight and encumbrance check for it";
10elseif (!what:contained_by(destination))
11"check encumbrance";
12if ((destination:encumbrance() + what:encumbrance()) > destination.capacity)
13return {0, "That item is too bulky for you to carry."};
14"check weight limit";
15elseif ((what:weight() + destination:carried_weight()) > (($str_weight_table[destination:str()] * 150) / 100))
16return {0, "That item is too heavy for you to carry."};
17endif
18endif
19elseif (destination:is_a($container))
20"check encumbrance";
21if ((destination:encumbrance() + what:encumbrance()) > destination.capacity)
22return {0, "There is not enough room left to fit that item."};
23"check max_fit size limit";
24elseif (what:encumbrance() > destination.max_fit)
25return {0, "That item is too large to fit."};
26endif
27endif
28try
29move(what, destination);
30if (valid(old_loc))
31if (old_loc:has_property("held"))
32old_loc.held = setremove(old_loc.held, this);
33endif
34endif
35if (destination:has_property("held"))
36destination.held = {@destination.held, this};
37endif
38return {1, ""};
39except (ANY)
40return {0, "That item won't go! (builtin move threw error)"};
41endtry

contained_by

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1"root class:contained_by() this none this";
2"is OBJ contained by this? (recursive)";
3targ = args[1];
4if (this in targ.contents)
5return 1;
6elseif (targ.contents == {})
7return 0;
8else
9for each in (targ.contents)
10if (this:contained_by(each))
11return 1;
12endif
13endfor
14return 0;
15endif

descendants

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1"#1:descendants() this none this";
2target = this;
3r = children(target);
4i = 1;
5while (i <= length(r))
6if (kids = children(r[i]))
7r = {@r, @kids};
8endif
9i = i + 1;
10endwhile
11return r;

is_a

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1{targ} = args;
2what = this;
3while (valid(what))
4if (what == targ)
5return 1;
6endif
7what = parent(what);
8endwhile
9return 0;

ancestors

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1what = this;
2ancestors = {};
3while (valid(parent(what)))
4ancestors = {@ancestors, parent(what)};
5what = parent(what);
6endwhile
7return ancestors;

properties

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1what = this;
2props = properties(what);
3while (valid(parent(what)))
4props = {@props, @properties(parent(what))};
5what = parent(what);
6endwhile
7return props;

has_prop*erty

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1{prop} = args;
2try
3this.(prop);
4return 1;
5except (E_PROPNF, E_INVIND)
6return 0;
7endtry

has_verb

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1":has_verb(STR verbname)";
2"Find out if an object has a verb matching the given verbname.";
3"Returns {location} if so, 0 if not, where location is the object or the ancestor on which the verb is actually defined.";
4{verbname} = args;
5object = this;
6while (E_VERBNF == (vi = `verb_info(object, verbname) ! E_VERBNF, E_INVARG'))
7object = parent(object);
8endwhile
9return vi ? object | 0;

describe_to

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1"#1:describe_to(target) this none this";
2"returns 0 if target isn't a valid animate objidnum";
3"second arg: 0 is for one line desc, e.g. a room look. 1 is for multiline desc, e.g.";
4"look at this, 2 is for very detailed desc, including contents.";
5{target, ?msglen = 0} = args;
6if (!target:is_a($animate))
7return 0;
8else
9shownum = "";
10if (target:is_a($architect))
11shownum = (" (" + tostr(this)) + ")";
12endif
13sees_str = this.short_desc ? (this.short_desc + shownum) + " is lying here." | ((this.name + shownum) + " is lying here.");
14if (msglen == 0)
15target:sees(3, {sees_str});
16elseif (msglen == 1)
17target:sees(3, {sees_str});
18target:sees(3, {this.description});
19elseif (msglen == 2)
20target:sees(3, {sees_str});
21target:sees(3, {this.description});
22target:sees(3, {"%WInside, you see:%w"});
23if (this.contents != {})
24for item in (this.contents)
25item:describe_to(target, 0);
26endfor
27endif
28endif
29endif

encumbrance

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1"root class:encumbrance()";
2if (this.contents == {})
3return this.base_enc;
4else
5enc = 0;
6for each in (this.contents)
7enc = enc + each:encumbrance();
8endfor
9return enc + this.base_enc;
10endif

weight

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

Source

1"root class:weight()";
2if (this.contents == {})
3return this.base_weight;
4else
5weight = 0;
6for each in (this.contents)
7weight = weight + each:weight();
8endfor
9return weight + this.base_weight;
10endif

tell

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1return;

known_to

Spec this none thisFlags rwxdOwner #10Definer #1

Referenced by

none

Source

1"$root:known_to this none this";
2return {1, this.name};