Room Class #2

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

8 verbs · 21 properties · 4 children

Verbs

VerbSpecFlagsDefinerLines
will_acceptthis none thisrwxd#234
match_exitthis none thisrwxd#241
enterfuncthis none thisrwxd#27
display_contentsthis none thisrwxd#218
display_exitsthis none thisrwxd#226
describe_tothis none thisrwxd#243
get_animatesthis none thisrwxd#29
exitfuncthis none thisrwxd#21

Properties

PropertyDefinerFlagsOwnerValue
how_full#2rw#100
exits#2rw#10{}
entrances#2rw#10{}
colors#2rw#10{"%W", "%g", "%G", "%C", "%W"}
combatants#2rw#10{}
combat_pid#2rw#100
endurance_cost#2rw#100
description#1rw#10{"This is the beginning of something very special..."}
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): #11 Game Class#1 Root Class

Children: #32 Finder's Test Room, #33 Ixion's Test Room, #58 Editing Room, #60 Character Creation

Call graph

calls n2_2 #2:enterfunc n2_5 #2:describe_to n2_2->n2_5 n3_2 #3:tell n2_5->n3_2 n2_3 #2:display_contents n2_3->n3_2 n2_4 #2:display_exits n2_4->n3_2

Source

will_accept

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1room = this;
2what = args[1];
3do_check = 0;
4" Make sure the recursive location can be referenced (i.e., the object is not ";
5" in #-1). ";
6rec_loc_ok = what.location:has_prop("location");
7"";
8" Just double-checking... ";
9if (what.location == room)
10return 1;
11else
12if (rec_loc_ok)
13if (what.location.location != room)
14" The container holding the target object is NOT in the room. ";
15do_check = 1;
16else
17return 1;
18endif
19else
20" The container holding the target is in #-1. ";
21do_check = 1;
22endif
23endif
24if (do_check)
25combined = room.how_full + what.encumbrance;
26if (combined > room.capacity)
27" The added encumbrance of the target object will exceed ";
28" the room's capacity. ";
29return 0;
30else
31" Ok, the encumbrance check has passed. ";
32return 1;
33endif
34endif

match_exit

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1" #2:match_exit( string ) [ this none this ] ";
2"";
3" string:  a name of an exit typed on the command line ";
4"";
5" Returns:  OBJ ";
6" OBJ: object number of the exit matched or error ";
7"";
8" Modifies:  none ";
9" Owner:  $dm ";
10" Writer:  ixion(#5) from LambdaMOO core";
11" Perms:  don't know ";
12" Called by:  $player:north south east west ";
13" Screen Outputs:  none ";
14"";
15" Description:  <Description> ";
16"               [..more..] ";
17"";
18" NOTE:  <any specific notes or warnings> ";
19" Examples:  <EXAMPLE1> ";
20"            <EXAMPLE2> ";
21"";
22" Error Codes:  ";
23syntax = "SYNTAX:  <verb_name> <proper_args> [optional_syntax]";
24example = "For example:  <verb_name> <example_syntax>";
25alternate_example = "For example:  <verb_name> <alternate_syntax>";
26what = args[1];
27if (what)
28ERR = $failed_match;
29for e in (this.exits)
30if (valid(e) && (what in {e.name, @e.aliases}))
31if (ERR == $failed_match)
32ERR = e;
33elseif (ERR != e)
34return $ambiguous_match;
35endif
36endif
37endfor
38return ERR;
39else
40return $nothing;
41endif

enterfunc

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1"$room:enterfunc this none this";
2"Display room description and contents.";
3who = args[1];
4if (who:is_a($animate))
5this:describe_to(who);
6who:lower_endurance(this.endurance_cost);
7endif

display_contents

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1nonanimate = {};
2outstr = "You see ";
3for xobj in (this.contents)
4if (xobj:is_a($animate))
5player:tell(xobj.name);
6else
7nonanimate = {@nonanimate, xobj};
8endif
9endfor
10if (nonanimate)
11outstr = outstr + nonanimate[1].name;
12if (length(nonanimate) > 1)
13for xobj in (nonanimate[2..length(nonanimate)])
14outstr = (outstr + ", ") + xobj.name;
15endfor
16endif
17player:tell(outstr + ".");
18endif

display_exits

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1" <obj_num>:<verb_name>(<TYPE>, <TYPE>, ...) [<DOBJ> <PREP> <IOBJ>] ";
2"";
3" <ARGS1>:  <Description> ";
4" <ARGS2>:  <Description> ";
5" <...> ";
6"";
7" Returns:  [{]<TYPE>, <TYPE>, ...[}] ";
8" <RETTYPE1>:  <Description> ";
9" <RETTYPE2>:  <Description> ";
10"";
11" Modifies:  <OBJ>.<prop>, <OBJ>.<prop>, ... ";
12" Owner:  <OBJ> ";
13" Writer:  <name>(OBJ#) [source (i.e., LambdaMOO core?)]";
14" Perms:  <OWNER> | <CALLER> | <PLAYER> ";
15" Called by:  <OBJ>:<verb>, <OBJ>:<verb>, [Description] ... ";
16" Screen Outputs:  <Description> ";
17"";
18" Description:  <Description> ";
19"               [..more..] ";
20"";
21" NOTE:  <any specific notes or warnings> ";
22"";
23" Error Codes:  ";
24for xit in (this.exits)
25player:tell(xit.direction, " ==> ", xit.dest.name);
26endfor

describe_to

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

Source

1"$room:describe_to(target) this none this";
2"returns 0 if target isn't a valid animate objidnum";
3{target} = args;
4if (!target:is_a($animate))
5return 0;
6else
7shownum = "";
8if (target:is_a($architect))
9shownum = (" (" + tostr(this)) + ")";
10endif
11colors = this.colors;
12target:sees(3, {(colors[1] + this.name) + shownum});
13for x in (this.description)
14target:sees(3, {colors[2] + x});
15endfor
16nonanimates = {};
17animates = {};
18for xobj in (this.contents)
19if (xobj:is_a($animate))
20animates = {@animates, xobj};
21else
22nonanimates = {@nonanimates, xobj};
23endif
24endfor
25if (nonanimates)
26target:tell("~" + colors[3]);
27for xobj in (nonanimates)
28xobj:describe_to(target);
29endfor
30endif
31animates = setremove(animates, target);
32if (animates)
33target:tell("~" + colors[4]);
34for xobj in (animates)
35xobj:describe_to(target);
36endfor
37endif
38"dont forget the exits!";
39player:tell("~" + colors[5]);
40for xit in (this.exits)
41target:sees(3, {(xit.direction + " ==> ") + xit.dest.name});
42endfor
43endif

get_animates

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1"$room:get_animates() this one this";
2"returns a list of animates that are in this room";
3animates = {};
4for each in (this.contents)
5if (each:is_a($animate))
6animates = {@animates, each};
7endif
8endfor
9return animates;

exitfunc

Spec this none thisFlags rwxdOwner #10Definer #2

Referenced by

none

Source

1"$room:exitfunc this none this";