generic openable/closable RPG container #43001
Aliases: generic openable/closable RPG container
14 verbs · 20 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
close_msg oclose_msg oopen_msg open_msg oopen_fail_msg open_fail_msg empty_msg | this none this | rx | #43001 | 1 |
open | this none none | rxd | #43001 | 15 |
close | this none none | rxd | #43001 | 10 |
is_openable_by | this none this | | #43001 | 2 |
look_self | this none this | | #43001 | 4 |
tell_contents | this none this | | #43001 | 9 |
description | this none this | rx | #43001 | 5 |
pu*t ins*ert st*ore ca*che | any in this | rx | #43001 | 6 |
re*move ex*tract rec*over ge*t ta*ke | any from this | rx | #43001 | 6 |
acceptable | this none this | | #43001 | 2 |
@lock_for_open | this with any | | #43001 | 18 |
set_opened | this none this | | #43001 | 5 |
opened | this none this | | #43001 | 1 |
exitfunc | this none this | | #43001 | 12 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
opened | #43001 | r | — | 1 |
close_msg | #43001 | rc | — | "You close %d." |
oclose_msg | #43001 | rc | — | "%n closes %d." |
oopen_msg | #43001 | rc | — | "%n opens %d." |
open_msg | #43001 | rc | — | "You open %d." |
oopen_fail_msg | #43001 | rc | — | "" |
open_fail_msg | #43001 | rc | — | "It is locked." |
empty_msg | #43001 | rc | — | "It is empty." |
open_key | #43001 | | — | not readable (E_PERM) |
trusted | #43001 | rc | — | {} |
store_action | #43001 | | — | "store" |
manufactured | #43001 | | — | 749532345 |
worth | #43001 | | — | -1 |
condition | #43001 | | — | 100 |
odrop_failed_msg | #43001 | | — | "%<tries> to drop %t but fails!" |
odrop_succeeded_msg | #43001 | | — | "%<drops> %t." |
otake_succeeded_msg | #43001 | | — | "%<picks> up %t." |
key | #43001 | | — | not readable (E_PERM) |
aliases | #43001 | | — | {"generic openable/closable RPG container"} |
object_size | #43001 | | — | {8333, 1141286565} |
Ancestry
Ancestors (nearest first): #9338 generic RPG container → #2409 LRPG Adventuring Gear → #112297 Generic Dyable LRPG Thing → #517 Generic LRPG Thing
Children: #59000 generic lockpickable RPG container
Call graph
Source
close_msg oclose_msg oopen_msg open_msg oopen_fail_msg open_fail_msg empty_msg
Referenced by
- #43001:open line 6:
this:open_msg - #43001:open line 7:
this:oopen_msg - #43001:open line 11:
this:open_fail_msg - #43001:open line 12:
this:oopen_fail_msg - #43001:close line 6:
this:close_msg - #43001:close line 7:
this:oclose_msg - #43001:tell_contents line 7:
this:empty_msg
Source
1return (msg = this.(verb)) ? $string_utils:pronoun_sub(msg, @args) | "";
open
Referenced by
none
Source
1"Copied from generic container (#8):open by Nosredna (#2487) Mon Oct 4 00:16:25 1993 PDT"; 2if (this:opened()) 3 player:tell("It's already open."); 4elseif (this:is_openable_by(callers() ? caller_perms() | player)) 5 this:set_opened(1); 6 player:tell(this:open_msg()); 7 if (msg = this:oopen_msg(player, this)) 8 player.location:announce(msg); 9 endif 10else 11 player:tell(this:open_fail_msg()); 12 if (msg = this:oopen_fail_msg(player, this)) 13 player.location:announce(msg); 14 endif 15endif
close
Referenced by
none
Source
1"Copied from generic container (#8):close by Nosredna (#2487) Mon Oct 4 00:17:11 1993 PDT"; 2if (!this:opened()) 3 player:tell("It's already closed."); 4else 5 this:set_opened(0); 6 player:tell(this:close_msg()); 7 if (msg = this:oclose_msg()) 8 player.location:announce(msg); 9 endif 10endif
is_openable_by
Referenced by
- #43001:open line 4:
this:is_openable_by - #43001:exitfunc line 4:
this:is_openable_by
Source
1"Copied from generic container (#8):is_openable_by by Nosredna (#2487) Sat Oct 9 19:20:53 1993 PDT"; 2return (this.open_key == 0) || $lock_utils:eval_key(this.open_key, args[1]);
look_self
Referenced by
none
Source
1player:tell_lines((desc = this:description()) ? desc | "You see nothing special."); 2if (this.opened) 3 this:tell_contents(); 4endif
tell_contents
Referenced by
- #43001:look_self line 3:
this:tell_contents
Source
1"Copied from generic container (#8):tell_contents by Nosredna (#2487) Mon Oct 4 00:32:17 1993 PDT"; 2if (this.contents) 3 player:tell("Contents:"); 4 for thing in (this.contents) 5 player:tell(" ", thing:title()); 6 endfor 7elseif (msg = this:empty_msg()) 8 player:tell(msg); 9endif
description
Referenced by
- #43001:look_self line 1:
this:description
Source
1"Need to know if it is opened or closed."; 2if (msg = this.description) 3 open_msg = this.opened ? "" | " It is closed."; 4 return (typeof(msg) == LIST) ? {@msg, open_msg} | (msg + open_msg); 5endif
pu*t ins*ert st*ore ca*che
Referenced by
- #59000:pu*t line 6:
pass(
Source
1"Prevent transfer if container is not opened"; 2if (!this:opened()) 3 player:tell(this.name, " is closed."); 4 return 0; 5endif 6pass(@args);
re*move ex*tract rec*over ge*t ta*ke
Referenced by
- #59000:re*move line 6:
pass(
Source
1"Prevent transfer if container is not opened"; 2if (!this:opened()) 3 player:tell(this.name, " is closed."); 4 return 0; 5endif 6pass(@args);
acceptable
Referenced by
- #59000:acceptable line 2:
pass(
Source
1"Allow $local.rpg.equipment only if the container is open."; 2return pass(@args) && this:opened();
@lock_for_open
Referenced by
none
Source
1"Copied from generic container (#8):@lock_for_open by Nosredna (#2487) Sun Oct 17 18:32:59 1993 PDT"; 2if (caller != this.owner) 3 player:tell(E_PERM); 4 return; 5endif 6key = $lock_utils:parse_keyexp(iobjstr, player); 7if (typeof(key) == STR) 8 player:tell("That key expression is malformed:"); 9 player:tell(" ", key); 10else 11 res = this.open_key = key; 12 if (typeof(res) == ERR) 13 player:tell(res, "."); 14 else 15 player:tell("Locked opening of ", this.name, " with this key:"); 16 player:tell(" ", $lock_utils:unparse_key(key)); 17 endif 18endif
set_opened
Referenced by
- #43001:open line 5:
this:set_opened - #43001:close line 5:
this:set_opened - #59000:pick_lock line 21:
this:set_opened - #59000:lock line 21:
this:set_opened - #59000:reset_lock line 9:
this:set_opened
Source
1if (!$perm_utils:controls(caller.owner, this)) 2 return E_PERM; 3endif 4this.opened = opened = !(!args[1]); 5return opened;
opened
Referenced by
- #43001:open line 2:
this:opened - #43001:close line 2:
this:opened - #43001:pu*t line 2:
this:opened - #43001:re*move line 2:
this:opened - #43001:acceptable line 2:
this:opened
Source
1return this.(verb);
exitfunc
Referenced by
none
Source
1{thing} = args; 2if (!(rpg = $local.rpg):trusted_efunc()) 3 return E_PERM; 4elseif (this:is_openable_by(caller_perms()) || (thing.owner == caller_perms())) 5 return pass(thing); 6elseif ($recycler:valid(thing)) 7 "thanks to Dred for a patch on some invalid obj problems"; 8 su = $string_utils; 9 rpg:log_error((((((((((((((("Object moved by container: " + su:nn(thing)) + " moved by ") + su:nn(this)) + " Container Location: ") + su:nn(this.location)) + " from: ") + su:nn(thing.location)) + " Player: ") + su:nn(player)) + " Locale: ") + su:nn(player.location)) + " Callers: ") + toliteral(callers(1))) + " ") + ctime()); 10 thing:moveto(this); 11endif 12return 0;