generic container #8
Aliases: generic container
15 verbs · 39 properties · 4 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
p*ut in*sert dr*op | any in/inside/into this | rxd | #8 | 33 |
re*move ta*ke g*et | any out of/from inside/from this | rxd | #8 | 34 |
look_self | this none this | rxd | #8 | 4 |
acceptable | this none this | rxd | #8 | 1 |
open | this none none | rxd | #8 | 16 |
@lock_for_open | this with/using any | rd | #8 | 14 |
is_openable_by | this none this | rxd | #8 | 5 |
close | this none none | rxd | #8 | 9 |
@unlock_for_open | this none none | rd | #8 | 7 |
tell_contents | this none this | rxd | #8 | 8 |
set_opened | this none this | rxd | #8 | 7 |
@opacity | this is any | rd | #8 | 7 |
set_opaque | this none this | rxd | #8 | 9 |
oclose_msg close_msg oopen_msg open_msg oput_fail_msg put_fail_msg oremove_fail_msg oremove_msg remove_fail_msg remove_msg oput_msg put_msg oopen_fail_msg open_fail_msg empty_msg | this none this | rxd | #8 | 1 |
dark | this none this | rxd | #8 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
oclose_msg | #8 | rc | #2 | "closes %d." |
close_msg | #8 | rc | #2 | "You close %d." |
oopen_msg | #8 | rc | #2 | "opens %d." |
open_msg | #8 | rc | #2 | "You open %d." |
oput_fail_msg | #8 | rc | #2 | "" |
put_fail_msg | #8 | rc | #2 | "You can't put %d in that." |
opaque | #8 | r | #2 | 1 |
dark | #8 | r | #2 | 1 |
oremove_fail_msg | #8 | rc | #2 | "" |
oremove_msg | #8 | rc | #2 | "removes %d from %i." |
remove_fail_msg | #8 | rc | #2 | "You can't remove that." |
remove_msg | #8 | rc | #2 | "You remove %d from %i." |
oput_msg | #8 | rc | #2 | "puts %d in %i." |
put_msg | #8 | rc | #2 | "You put %d in %i." |
oopen_fail_msg | #8 | rc | #2 | "" |
open_fail_msg | #8 | rc | #2 | "You can't open that." |
empty_msg | #8 | rc | #2 | "It is empty." |
opened | #8 | r | #2 | 0 |
open_key | #8 | c | #2 | 0 |
drop_failed_msg | #5 | rc | #2 | <clear> |
drop_succeeded_msg | #5 | rc | #2 | <clear> |
odrop_failed_msg | #5 | rc | #2 | <clear> |
odrop_succeeded_msg | #5 | rc | #2 | <clear> |
otake_succeeded_msg | #5 | rc | #2 | <clear> |
otake_failed_msg | #5 | rc | #2 | <clear> |
take_succeeded_msg | #5 | rc | #2 | <clear> |
take_failed_msg | #5 | rc | #2 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #2 | <clear> |
key | #1 | c | #2 | <clear> |
aliases | #1 | rc | #2 | {"generic container"} |
description | #1 | rc | #2 | <clear> |
object_size | #1 | r | #36 | {10791, -1090650497} |
html | #1 | rc | #2 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #102 subthing → #1 Root Class
Children: #84 Generic Warehouse, #128 realm wrapper, #138 Monster Maker, #164 Park City Builder
Call graph
Source
p*ut in*sert dr*op
Referenced by
none
Source
1if ((!prepstr) && (verb in {"drop", "dr"})) 2pass(@args); 3elseif ((this.location != player) && (this.location != player.location)) 4player:tell("You can't get at ", this.name, "."); 5elseif (dobj == $nothing) 6player:tell("What do you want to put ", prepstr, " ", this.name, "?"); 7elseif ($command_utils:object_match_failed(dobj, dobjstr)) 8"nada"; 9elseif ((dobj.location != player) && (dobj.location != player.location)) 10player:tell("You don't have ", dobj.name, "."); 11elseif (!this.opened) 12player:tell(this.name, " is closed."); 13else 14set_task_perms(callers() ? caller_perms() | player); 15dobj:moveto(this); 16if (dobj.location == this) 17player:tell(this:put_msg()); 18if (msg = this:oput_msg()) 19player.location:announce(player.name, " ", msg); 20endif 21else 22player:tell(this:put_fail_msg()); 23if (msg = this:oput_fail_msg()) 24player.location:announce(player.name, " ", msg); 25endif 26endif 27endif 28suspend(1); 29for x in (this:contents()) 30if ($object_utils:has_callable_verb(x, "combine")) 31x:combine(); 32endif 33endfor
re*move ta*ke g*et
Referenced by
none
Source
1if (dobj == this) 2return pass(@args); 3elseif (!this.opened) 4player:tell(this.name, " is not open."); 5elseif (this.dark) 6player:tell("You can't see into ", this.name, " to remove anything."); 7elseif ((dobj = this:match_object(dobjstr)) == $nothing) 8player:tell("What do you want to take from ", this.name, "?"); 9elseif ($command_utils:object_match_failed(dobj, dobjstr)) 10elseif (!(dobj in this:contents())) 11player:tell(dobj.name, " isn't in ", this.name, "."); 12else 13dobj:moveto(player); 14if (dobj.location == player) 15player:tell(this:remove_msg()); 16if (msg = this:oremove_msg()) 17player.location:announce(player.name, " ", msg); 18endif 19else 20dobj:moveto(this.location); 21if (dobj.location == this.location) 22player:tell(this:remove_msg()); 23if (msg = this:oremove_msg()) 24player.location:announce(player.name, " ", msg); 25endif 26player:tell("You can't pick up ", dobj.name, ", so it tumbles onto the floor."); 27else 28player:tell(this:remove_fail_msg()); 29if (msg = this:oremove_fail_msg()) 30player.location:announce(player.name, " ", msg); 31endif 32endif 33endif 34endif
look_self
Referenced by
none
Source
1pass(); 2if (!this.dark) 3this:tell_contents(); 4endif
acceptable
Referenced by
none
Source
1return (!`args[1].alive ! E_PROPNF') && this.opened;
open
Referenced by
none
Source
1perms = (callers() && (caller != this)) ? caller_perms() | player; 2if (this.opened) 3player:tell("It's already open."); 4"elseif (this:is_openable_by(player))"; 5elseif (this:is_openable_by(perms)) 6this:set_opened(1); 7player:tell(this:open_msg()); 8if (msg = this:oopen_msg()) 9player.location:announce(player.name, " ", msg); 10endif 11else 12player:tell(this:open_fail_msg()); 13if (msg = this:oopen_fail_msg()) 14player.location:announce(player.name, " ", msg); 15endif 16endif
@lock_for_open
Referenced by
none
Source
1set_task_perms(player); 2key = $lock_utils:parse_keyexp(iobjstr, player); 3if (typeof(key) == STR) 4player:tell("That key expression is malformed:"); 5player:tell(" ", key); 6else 7try 8this.open_key = key; 9player:tell("Locked opening of ", this.name, " with this key:"); 10player:tell(" ", $lock_utils:unparse_key(key)); 11except error (ANY) 12player:tell(error[2], "."); 13endtry 14endif
is_openable_by
Referenced by
- #8:open line 5:
this:is_openable_by
Source
1holder = args[1]; 2if (this.location in {holder, holder.location}) 3return (this.open_key == 0) || $lock_utils:eval_key(this.open_key, holder); 4endif 5return 0;
close
Referenced by
none
Source
1if (!this.opened) 2player:tell("It's already closed."); 3else 4this:set_opened(0); 5player:tell(this:close_msg()); 6if (msg = this:oclose_msg()) 7player.location:announce(player.name, " ", msg); 8endif 9endif
@unlock_for_open
Referenced by
none
Source
1set_task_perms(player); 2try 3dobj.open_key = 0; 4player:tell("Unlocked ", dobj.name, " for opening."); 5except error (ANY) 6player:tell(error[2], "."); 7endtry
tell_contents
Referenced by
- #8:look_self line 3:
this:tell_contents
Source
1if (this.contents) 2player:tell("Contents:"); 3for thing in (this:contents()) 4player:tell(" ", thing:title()); 5endfor 6elseif (msg = this:empty_msg()) 7player:tell(msg); 8endif
set_opened
Referenced by
Source
1if (!$perm_utils:controls(caller.owner, this)) 2return E_PERM; 3else 4this.opened = opened = !(!args[1]); 5this.dark = this.opaque > opened; 6return opened; 7endif
@opacity
Referenced by
none
Source
1if (!$perm_utils:controls(player, this)) 2player:tell("Can't set opacity of something you don't own."); 3elseif ((iobjstr != "0") && (!toint(iobjstr))) 4player:tell("Opacity must be an integer (0, 1, 2)."); 5else 6player:tell("Opacity changed: Now " + {"transparent.", "opaque.", "a black hole."}[1 + this:set_opaque(toint(iobjstr))]); 7endif
set_opaque
Referenced by
- #8:@opacity line 6:
this:set_opaque
Source
1if (!$perm_utils:controls(caller.owner, this)) 2return E_PERM; 3elseif (typeof(number = args[1]) != INT) 4return E_INVARG; 5else 6number = (number < 0) ? 0 | ((number > 2) ? 2 | number); 7this.dark = number > this.opened; 8return this.opaque = number; 9endif
oclose_msg close_msg oopen_msg open_msg oput_fail_msg put_fail_msg oremove_fail_msg oremove_msg remove_fail_msg remove_msg oput_msg put_msg oopen_fail_msg open_fail_msg empty_msg
Referenced by
- #8:p*ut line 17:
this:put_msg - #8:p*ut line 18:
this:oput_msg - #8:p*ut line 22:
this:put_fail_msg - #8:p*ut line 23:
this:oput_fail_msg - #8:re*move line 15:
this:remove_msg - #8:re*move line 16:
this:oremove_msg - #8:re*move line 22:
this:remove_msg - #8:re*move line 23:
this:oremove_msg - #8:re*move line 28:
this:remove_fail_msg - #8:re*move line 29:
this:oremove_fail_msg - #8:open line 7:
this:open_msg - #8:open line 8:
this:oopen_msg - #8:open line 12:
this:open_fail_msg - #8:open line 13:
this:oopen_fail_msg - #8:close line 5:
this:close_msg - #8:close line 6:
this:oclose_msg - #8:tell_contents line 6:
this:empty_msg
Source
1return (msg = `this.(verb) ! ANY') ? $string_utils:pronoun_sub(msg) | "";
dark
Referenced by
none
Source
1return this.(verb);