Room Class #2
8 verbs · 21 properties · 4 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
will_accept | this none this | rwxd | #2 | 34 |
match_exit | this none this | rwxd | #2 | 41 |
enterfunc | this none this | rwxd | #2 | 7 |
display_contents | this none this | rwxd | #2 | 18 |
display_exits | this none this | rwxd | #2 | 26 |
describe_to | this none this | rwxd | #2 | 43 |
get_animates | this none this | rwxd | #2 | 9 |
exitfunc | this none this | rwxd | #2 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
how_full | #2 | rw | #10 | 0 |
exits | #2 | rw | #10 | {} |
entrances | #2 | rw | #10 | {} |
colors | #2 | rw | #10 | {"%W", "%g", "%G", "%C", "%W"} |
combatants | #2 | rw | #10 | {} |
combat_pid | #2 | rw | #10 | 0 |
endurance_cost | #2 | rw | #10 | 0 |
description | #1 | rw | #10 | {"This is the beginning of something very special..."} |
aliases | #1 | rw | #10 | <clear> |
home | #1 | rw | #10 | <clear> |
short_desc | #1 | rw | #10 | <clear> |
core | #1 | rw | #10 | 1 |
handedness | #1 | rw | #10 | <clear> |
base_enc | #1 | rw | #10 | <clear> |
base_weight | #1 | rw | #10 | <clear> |
capacity | #1 | rw | #10 | <clear> |
max_fit | #1 | rw | #10 | <clear> |
pprep | #1 | rw | #10 | <clear> |
gprep | #1 | rw | #10 | <clear> |
generic_name | #1 | rw | #10 | <clear> |
age | #1 | rw | #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
Source
will_accept
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
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
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
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
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
Referenced by
- #2:enterfunc line 5:
this:describe_to - #58:describe_to line 3:
pass( - #60:describe_to line 4:
pass(
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
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
Referenced by
none
Source
1"$room:exitfunc this none this";