generic openable/closable RPG container #43001

Parent #9338Owner Flags Source rpg_march_2006/Dependencies/43001.txt

Aliases: generic openable/closable RPG container

14 verbs · 20 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
close_msg oclose_msg oopen_msg open_msg oopen_fail_msg open_fail_msg empty_msgthis none thisrx#430011
openthis none nonerxd#4300115
closethis none nonerxd#4300110
is_openable_bythis none this#430012
look_selfthis none this#430014
tell_contentsthis none this#430019
descriptionthis none thisrx#430015
pu*t ins*ert st*ore ca*cheany in thisrx#430016
re*move ex*tract rec*over ge*t ta*keany from thisrx#430016
acceptablethis none this#430012
@lock_for_openthis with any#4300118
set_openedthis none this#430015
openedthis none this#430011
exitfuncthis none this#4300112

Properties

PropertyDefinerFlagsOwnerValue
opened#43001r1
close_msg#43001rc"You close %d."
oclose_msg#43001rc"%n closes %d."
oopen_msg#43001rc"%n opens %d."
open_msg#43001rc"You open %d."
oopen_fail_msg#43001rc""
open_fail_msg#43001rc"It is locked."
empty_msg#43001rc"It is empty."
open_key#43001not readable (E_PERM)
trusted#43001rc{}
store_action#43001"store"
manufactured#43001749532345
worth#43001-1
condition#43001100
odrop_failed_msg#43001"%<tries> to drop %t but fails!"
odrop_succeeded_msg#43001"%<drops> %t."
otake_succeeded_msg#43001"%<picks> up %t."
key#43001not 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

calls n43001_1 #43001:open n43001_12 #43001:opened n43001_1->n43001_12 n43001_3 #43001:is_openable_by n43001_1->n43001_3 n43001_11 #43001:set_opened n43001_1->n43001_11 n43001_0 #43001:close_msg n43001_1->n43001_0 n43001_2 #43001:close n43001_2->n43001_12 n43001_2->n43001_11 n43001_2->n43001_0 n43001_4 #43001:look_self n43001_6 #43001:description n43001_4->n43001_6 n43001_5 #43001:tell_contents n43001_4->n43001_5 n43001_5->n43001_0 n43001_7 #43001:pu*t n43001_7->n43001_12 n9338_12 #9338:pu*t n43001_7->n9338_12 n43001_8 #43001:re*move n43001_8->n43001_12 n9338_2 #9338:re*move n43001_8->n9338_2 n43001_9 #43001:acceptable n43001_9->n43001_12 n9338_1 #9338:acceptable n43001_9->n9338_1 n43001_13 #43001:exitfunc n43001_13->n43001_3

Source

close_msg oclose_msg oopen_msg open_msg oopen_fail_msg open_fail_msg empty_msg

Spec this none thisFlags rxDefiner #43001

Referenced by

Source

1return (msg = this.(verb)) ? $string_utils:pronoun_sub(msg, @args) | "";

open

Spec this none noneFlags rxdDefiner #43001

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

Spec this none noneFlags rxdDefiner #43001

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

Spec this none thisDefiner #43001

Referenced 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

Spec this none thisDefiner #43001

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

Spec this none thisDefiner #43001

Referenced by

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

Spec this none thisFlags rxDefiner #43001

Referenced by

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

Spec any in thisFlags rxDefiner #43001

Referenced by

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

Spec any from thisFlags rxDefiner #43001

Referenced by

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

Spec this none thisDefiner #43001

Referenced by

Source

1"Allow $local.rpg.equipment only if the container is open.";
2return pass(@args) && this:opened();

@lock_for_open

Spec this with anyDefiner #43001

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

Spec this none thisDefiner #43001

Referenced by

Source

1if (!$perm_utils:controls(caller.owner, this))
2  return E_PERM;
3endif
4this.opened = opened = !(!args[1]);
5return opened;

opened

Spec this none thisDefiner #43001

Referenced by

Source

1return this.(verb);

exitfunc

Spec this none thisDefiner #43001

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;