generic lockable container #146

Parent #188Owner #29Flags read, fertileSource hellcore/hellcore.db

Aliases: generic lockable container, container, lockable

39 verbs · 85 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
uninstallany out of/from inside/from thisrxd#14624
_announcethis none thisrxd#1466
open closethis none nonerxd#14611
_openthis none thisrxd#14633
_closeany none nonerxd#14613
_do_openthis none thisrxd#1461
_do_closethis none thisrxd#1461
lock unlockthis none nonerxd#14617
_lock _unlockthis none thisrxd#14611
contentsthis none thisrxd#1466
autoclose_on_lockthis is anyrxd#14616
autoopen_on_unlockthis is anyrxd#14616
_is_lockedany none nonerxd#14611
_can_be_unlocked_byany none nonerxd#14614
location_specifierthis none thisrxd#1461
diethis none thisrxd#14611
_repairthis none thisrxd#1468
_repair_checkthis none thisrxd#1463
is_brokenthis none thisrxd#1467
pickthis none nonerxd#1468
occupantsthis none thisrxd#1461
get_fromthis none thisrxd#14612
bolt_oldthis none thisrxd#14617
unbolt_oldthis none thisrxd#14610
locksthis none thisrxd#1461
clean_locksthis none thisrxd#1461
exitfuncthis none thisrxd#1464
_startthis none thisrxd#14615
may_pickthis none thisrxd#14613
look_selfthis none thisrxd#1468
hear_event_saythis none thisrxd#14610
tell_contentsthis none thisrxd#14642
add_pickerthis none thisrxd#1466
fire_pcmthis none thisrxd#1460
ok_to_pickthis none thisrxd#1461
controlled_bythis none thisrxd#14612
_breakthis none thisrxd#1463
lockedthis none thisrxd#1463
_bolt _unboltthis none thisrxd#1462

Properties

PropertyDefinerFlagsOwnerValue
registered_locks#146rw#29{}
open_success_msg#146rc#29"%DN opens %dt."
open_fail_lock_msg#146rc#29"%DN jiggles at the handle of %dt. Locked."
open_action#146rc#29#357
close_action#146rc#29#358
close_success_msg#146rc#29"%DN closes %dt."
close_fail_msg#146rc#29"%DN tries to close %dt, but just can't seem to do it."
operational#146rc#291
autoclose_on_lock#146r#291
autoopen_on_unlock#146r#290
lock_installable#146rc#291
die_msg#146rc#29"%DT cracks open, unable to take any more abuse."
bolt_msg#146rc#29"%DN presses down on the autosealing bolts on %dt. They spin themselves down into the floor."
unbolt_msg#146rc#29"%DN presses down on the autosealing bolts on %dt. They extract themselves up and out of the floor."
lock#146rc#29#-1
otherside#146rc#29#-1
pickers#146rc#29{}
pick_timeout#146rc#29120
bolted#146r#290
bolted_by#146rc#29#-1
boltable_in_public#146rc#291
boltable_duplicate#146rc#29#-1
glob#188rc#29<clear>
capacity#54rc#29<clear>
weight_reduction#54rc#29<clear>
opaque#54rc#29<clear>
dark#54rc#29<clear>
close_msg#54rc#29<clear>
open_msg#54rc#29<clear>
remove_msg#54rc#29<clear>
put_msg#54rc#29<clear>
empty_msg#54rc#29<clear>
contents_msg#54rc#29<clear>
open_fail_msg#54rc#29"%DN tries to open %dt, but just can't seem to do it."
put_fail_msg#54rc#29<clear>
closed_msg#54rc#29<clear>
closable#54rc#29<clear>
open#54rwc#29<clear>
get_from_msg#54rc#29<clear>
max_objects#54rc#29<clear>
spill_on_break#54rc#290
peek_msg#54rc#29<clear>
clean_start_msg#54rc#29<clear>
oclean_start_msg#54rc#29<clear>
clean_finish_msg#54rc#29<clear>
oclean_finish_msg#54rc#29<clear>
break_msg#255rc#29"%DT breaks violently open."
repair_difficulty#255rc#29<clear>
junk_on_break#255rc#29<clear>
rename_on_break#255rc#29<clear>
smashable#255rc#291
repairable#255rc#29<clear>
armor#255rc#29<clear>
held_break_msg#255rc#29"Your %t breaks violently open."
oheld_break_msg#255rc#29"%DN's %t breaks violently open."
handed#5rc#29<clear>
wield_msg#5rc#29<clear>
unwield_msg#5rc#29<clear>
size#5rc#29<clear>
look_place_msg#5rc#29<clear>
value#5rc#29<clear>
get_msg#5rc#29<clear>
drop_msg#5rc#29<clear>
get_fail_msg#5rc#29<clear>
junk_ok#5rc#29<clear>
floats#5rc#29<clear>
long_name_msg#5rc#29<clear>
article#5rc#29<clear>
setup_list#5rc#29<clear>
health#5rc#29<clear>
health_max#5rc#29<clear>
min_skill#5rc#29<clear>
skill#5rc#29<clear>
recipe_for#5rc#29<clear>
carried_msg#5rc#29<clear>
aliases#1rc#29{"generic lockable container", "container", "lockable"}
description#1rc#29<clear>
object_size#1r#29{24998, 1298433821}
hidden_verbs#1rc#29{"open", "@pass", "_open", "_close", "_is_locked", "_can_be_unlocked_by", "autoclose_on_lock", "autoopen_on_unlock"}
phelp_msg#1rc#29{"A place to hold your stuff. You can install a lock on it just like on a door, to protect your precious loot."}
weight#1rc#291000
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #188 generic globbing container#54 generic container#255 generic smashable thing#5 generic thing#1 root

Children: none

Call graph

calls n146_0 #146:uninstall n107_43 #107:tell n146_0->n107_43 n146_35 #146:controlled_by n146_0->n146_35 n1_39 #1:dnamec n146_0->n1_39 n1_31 #1:dname n146_0->n1_31 n146_1 #146:_announce n20_34 #20:pronoun_sub n146_1->n20_34 n146_2 #146:open n146_2->n107_43 n146_2->n1_31 n146_37 #146:locked n146_2->n146_37 n92_2 #92:queue_action n146_2->n92_2 n146_3 #146:_open n146_3->n146_1 n146_3->n20_34 n146_5 #146:_do_open n146_3->n146_5 n45_5 #45:isa n146_3->n45_5 n146_4 #146:_close n146_4->n146_1 n146_4->n20_34 n146_6 #146:_do_close n146_4->n146_6 n146_7 #146:lock n146_7->n107_43 n146_7->n1_39 n146_7->n146_2 n146_7->n92_2 n20_15 #20:capitalize n146_7->n20_15 n146_8 #146:_lock n146_8->n1_39 n146_25 #146:clean_locks n146_8->n146_25 n146_9 #146:contents n1_23 #1:contents n146_9->n1_23 n146_10 #146:autoclose_on_lock n146_10->n107_43 n146_10->n146_35 n146_10->n1_31 n146_11 #146:autoopen_on_unlock n146_11->n107_43 n146_11->n146_35 n146_11->n1_31 n146_12 #146:_is_locked n146_12->n45_5 n146_20 #146:occupants n146_12->n146_20 n188_2 #188:occupants n146_20->n188_2 n146_13 #146:_can_be_unlocked_by n146_13->n45_5 n146_13->n146_20 n146_14 #146:location_specifier n146_14->n1_31 n146_15 #146:die n146_15->n20_34 n146_15->n146_5 n146_15->n45_5 n146_16 #146:_repair n146_16->n146_6 n255_4 #255:_repair n146_16->n255_4 n146_19 #146:pick n146_19->n107_43 n146_19->n1_31 n146_19->n92_2 n146_21 #146:get_from n47_25 #47:randomly_permute n146_21->n47_25 n146_22 #146:bolt_old n146_22->n107_43 n146_22->n1_31 n146_22->n92_2 n146_23 #146:unbolt_old n146_23->n107_43 n146_23->n1_39 n146_23->n1_31 n146_23->n92_2 n146_28 #146:may_pick n47_16 #47:slice n146_28->n47_16 n146_29 #146:look_self n146_29->n107_43 n146_29->n20_34 n54_2 #54:look_self n146_29->n54_2 n146_30 #146:hear_event_say n45_2 #45:has_verb n146_30->n45_2 n146_31 #146:tell_contents n146_31->n107_43 n48_8 #48:suspend_if_needed n146_31->n48_8 n54_17 #54:tell_contents_sub n146_31->n54_17 n146_36 #146:_break n146_36->n146_15 n54_25 #54:_break n146_36->n54_25

Source

uninstall

Spec any out of/from inside/from thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Uninstall a lock from this container.";
2if (player.location != this.location)
3player:tell("Uninstall from what?");
4return;
5endif
6if (this:controlled_by(player) == 0)
7player:tell("You can't see how to remove a lock from that.");
8return;
9endif
10if (!valid(this.lock))
11player:tell(this:dnamec(), " has no locks to uninstall.");
12return;
13endif
14thelock = this.lock;
15delay = 2.0;
16if (player.location != this.location)
17player:tell("You have to be in the same room as ", this:dname(), " if you want to ", verb, " a lock in it.");
18return;
19endif
20if (this.open == 0)
21player:tell(this:dname(), " must be open for you to be able to ", verb, " a lock from it.");
22return;
23endif
24thelock:("_" + verb)(player, iobj);

_announce

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

Source

1who = args[1];
2if (!valid(who))
3who = this;
4endif
5locmsg = args[2];
6who.location:announce_all($su:ps(locmsg, who, this, this, this));

open close

Spec this none noneFlags rxdOwner #29Definer #146

Referenced by

Source

1if (!this.closable)
2player:tell("You can't ", verb, " ", this:dname(), ".");
3return;
4endif
5if ((this:locked() && is_a(this.lock, $lock)) && (verb == "open"))
6player:queue_action(this.lock, {"unlock"});
7endif
8player:queue_action(this.(verb + "_action"), {this, "_" + verb, player.fighting ? 1.0 | 0.0, 0}, 1, (verb + " ") + dobj.name);
9if (is_a(this.lock, $lock) && (verb == "close"))
10player:queue_action(this.lock, {"lock"});
11endif

_open

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1who = args ? args[1] | #-1;
2ignore_lock = (length(args) > 2) ? args[3] | 0;
3all_locks = {this.lock};
4if (this.open == 1)
5who:tell($su:ps("%DT is already open."));
6return this.open;
7endif
8if (this.operational == 0)
9locmsg = this.open_fail_msg;
10elseif (ignore_lock)
11locmsg = this.open_success_msg;
12this:_do_open();
13elseif (all_locks != {})
14openindex = 0;
15for a in (all_locks)
16if ($ou:isa(a, $lock))
17if (a.locked == 1)
18openindex = openindex + 1;
19endif
20endif
21endfor
22if (openindex != 0)
23locmsg = this.open_fail_lock_msg;
24else
25locmsg = this.open_success_msg;
26this:_do_open();
27endif
28else
29locmsg = this.open_success_msg;
30this:_do_open();
31endif
32this:_announce(who, locmsg);
33return this.open;

_close

Spec any none noneFlags rxdOwner #29Definer #146

Referenced by

none

Source

1who = args ? args[1] | #-1;
2if (this.open == 0)
3who:tell($su:ps("%DT is already closed."));
4return this.open;
5endif
6if (this.operational == 0)
7locmsg = this.close_fail_msg;
8else
9locmsg = this.close_success_msg;
10this:_do_close();
11endif
12this:_announce(who, locmsg);
13return !this.open;

_do_open

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

Source

1this.open = 1;

_do_close

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

Source

1this.open = 0;

lock unlock

Spec this none noneFlags rxdOwner #29Definer #146

Referenced by

none

Source

1if (player.location != this.location)
2player:tell($su:capitalize(verb), " what?");
3return;
4endif
5locked = 0;
6if (!valid(this.lock))
7player:tell(this:dnamec(), " does not have a lock.");
8return;
9endif
10if (((verb == "lock") && (this.lock.locked == 1)) || ((verb == "unlock") && (this.lock.locked == 0)))
11player:tell(this:dnamec(), " is already ", verb, "ed.");
12return;
13endif
14if ((verb == "lock") && this.open)
15this:close();
16endif
17player:queue_action(this.lock, {verb});

_lock _unlock

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1who = args[1];
2actionname = verb[2..$];
3locked = 0;
4this:clean_locks();
5if (!valid(this.lock))
6who:tell(this:dnamec(), " doesn't have any locks.");
7return;
8else
9lock = this.lock;
10who:queue_action(this.lock, {"lock"});
11endif

contents

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1contents = pass(@args);
2if (valid(this.lock))
3return setremove(contents, this.lock);
4else
5return contents;
6endif

autoclose_on_lock

Spec this is anyFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Usage: autoclose_on_lock <door> is <0|1>";
2if (!this:controlled_by(player))
3player:tell("You cannot change the behavior of a door that isn't yours.");
4return E_PERM;
5endif
6if ((args[3] != "1") && (args[3] != "0"))
7player:tell("Usage:  ", verb, " ", this.name, " is <1|0>.");
8return;
9endif
10arg = tonum(args[3]);
11this.autoclose_on_lock = arg;
12if (arg == 1)
13player:tell(this:dname(), " will now automatically close before it is locked.");
14else
15player:tell(this:dname(), " will no longer automatically close before it is locked.");
16endif

autoopen_on_unlock

Spec this is anyFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Usage: autoopen_on_unlock <door> is <0|1>";
2if (!this:controlled_by(player))
3player:tell("You cannot change the behavior of a door that isn't yours.");
4return E_PERM;
5endif
6if ((args[3] != "1") && (args[3] != "0"))
7player:tell("Usage:  ", verb, " ", this.name, " is <1|0>.");
8return;
9endif
10arg = tonum(args[3]);
11this.autoopen_on_unlock = arg;
12if (arg == 1)
13player:tell(this:dname(), " will now automatically open when it is unlocked.");
14else
15player:tell(this:dname(), " will no longer automatically open when it is unlocked.");
16endif

_is_locked

Spec any none noneFlags rxdOwner #29Definer #146

Referenced by

none

Source

1all_locks = this:occupants($alock);
2if (all_locks != {})
3for a in (all_locks)
4if ($ou:isa(a, $lock))
5if (a.locked == 1)
6return 1;
7endif
8endif
9endfor
10endif
11return 0;

_can_be_unlocked_by

Spec any none noneFlags rxdOwner #29Definer #146

Referenced by

none

Source

1who = args[1];
2all_locks = this:occupants($alock);
3lockdata = {};
4if (all_locks != {})
5for a in (all_locks)
6if ($ou:isa(a, $lock))
7can = a:_can_be_unlocked_by(who);
8if (can == 0)
9return 0;
10endif
11endif
12endfor
13endif
14return 1;

location_specifier

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1return this:dname();

die

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

Source

1for a in (this.contents)
2if ($ou:isa(a, $lock))
3a:_do_unlock();
4a.operational = 0;
5endif
6endfor
7this:_do_open();
8if (this.operational)
9this.location:announce_all($su:ps(this.die_msg));
10endif
11this.operational = 0;

_repair

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1pass(@args);
2if (this.health)
3this:_do_close();
4this.operational = 1;
5if (is_a(this.lock, $lock))
6this.lock.operational = 1;
7endif
8endif

_repair_check

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1":_repair_check(OBJ who) => Return a skillcheck of 'who' trying to fix me.";
2check = $skills.repair:check(args[1], 0);
3return check;

is_broken

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1if (!this.operational)
2return 1;
3endif
4if (is_a(this.lock, $lock) && (!this.lock.operational))
5return 1;
6endif
7return this.health != this.health_max;

pick

Spec this none noneFlags rxdOwner #29Definer #146

Referenced by

none

Source

1if (!valid(this.lock))
2player:tell("You can't see any way to pick a lock in ", this:dname(), ".");
3return;
4elseif (!this.lock:is_locked())
5player:tell("It doesn't appear to be locked.");
6return;
7endif
8player:queue_action($actions.apick, {this.lock});

occupants

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

Source

1return valid(this.lock) ? setremove(pass(@args), this.lock) | pass(@args);

get_from

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1who = args[1];
2targets = (typeof(args[2]) == LIST) ? $lu:randomly_permute(args[2]) | {args[2]};
3if (this.open)
4for item in (targets)
5if (item == this.lock)
6targets = setremove(targets, item);
7endif
8endfor
9who:queue_action($actions.get, {targets, this, {}}, 1, "get from " + this.name);
10else
11return E_INVARG;
12endif

bolt_old

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Bolt this sucker down to the floor! (Makes it impossible to lift, regardless of weight.";
2if (player != this.owner)
3player:tell("Only ", this:dname(), "'s owner can bolt it down.");
4return;
5endif
6if (player != this.location.owner)
7player:tell("You can't find a place to bolt this down.");
8return;
9endif
10if (this.weight == -1)
11player:tell("Looking at ", this:dname(), ", you can tell that it's already bolted down.");
12return;
13endif
14if (is_a(this.location, $creature))
15this.location:_drop(this);
16endif
17player:queue_action($actions.verb, {this, "_bolt", {player}, 0.0, 1}, 1, "bolt down " + this.name);

unbolt_old

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Unbolt this from the floor.  Perfect for when you move, and don't want to leave your lockable containers behind.";
2if (player != this.owner)
3player:tell("Only ", this:dname(), "'s owner can bolt it down.");
4return;
5endif
6if (this.weight != -1)
7player:tell(this:dnamec(), " isn't bolted to the floor.");
8return;
9endif
10player:queue_action($actions.verb, {this, "_unbolt", {player}, 0.0, 1}, 1, "bolt down " + this.name);

locks

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1return {this.lock};

clean_locks

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

Source

1return 0;

exitfunc

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1"Copied from generic door (#246837):exitfunc by Gilmore (#98) Tue Oct 16 16:46:29 2007 CDT";
2if (args[1] == this.lock)
3this.lock = #-1;
4endif

_start

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1"Copied from generic door (#246837):_start by Gilmore (#98) Tue Oct 16 17:18:01 2007 CDT";
2who = args[1];
3action = args[2][1];
4aargs = {who};
5if (length(args[2]) > 1)
6aargs = {@aargs, @args[2][2..$]};
7endif
8if (this:("_" + action)(@aargs))
9if (action == "bash")
10return {4.0, 0};
11endif
12return {2.0, 0};
13else
14return E_NONE;
15endif

may_pick

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1"Copied from generic door (#246837):may_pick by Gilmore (#98) Tue Oct 16 18:52:01 2007 CDT";
2who = args[1];
3np = {};
4for x in (this.pickers)
5if ((time() - x[2]) <= this.pick_timeout)
6np = {@np, x};
7endif
8endfor
9this.pickers = np;
10if (who in $lu:slice(this.pickers, 1))
11return 0;
12endif
13return 1;

look_self

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1ret = pass(@args);
2if (valid(this.lock))
3player:tell($su:ps(this.lock.installed_msg, this.lock, this.lock, this));
4endif
5if (!this.operational)
6player:tell("The door hinges are smashed and broken.");
7endif
8return ret;

hear_event_say

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1if (args[4][2] == this)
2for a in (this.contents)
3if ($ou:has_verb(a, verb))
4a:(verb)(@args);
5if (`a.listens == 1 ! ANY => 0')
6return;
7endif
8endif
9endfor
10endif

tell_contents

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

1gn = {"Weapons", "Ammo", "Clothing", "Medical", "Consumables", "Artifacts", "Misc"};
2g = {{}, {}, {}, {}, {}, {}, {}};
3for what in (this.contents)
4if (what == this.lock)
5continue;
6endif
7if (!valid(x = `what:list_as() ! ANY => #-1'))
8x = what;
9endif
10if (is_a(x, $weapon))
11g[1] = setadd(g[1], what);
12elseif (is_a(x, $ammo))
13g[2] = setadd(g[2], what);
14elseif (is_a(x, $clothing))
15g[3] = setadd(g[3], what);
16elseif (is_a(x, #804))
17g[4] = setadd(g[4], what);
18elseif (is_a(x, #723))
19g[4] = setadd(g[4], what);
20elseif (is_a(x, #835))
21g[4] = setadd(g[4], what);
22elseif (is_a(x, $food))
23g[5] = setadd(g[5], what);
24elseif (is_a(x, #868))
25g[5] = setadd(g[5], what);
26elseif (is_a(x, #890))
27g[5] = setadd(g[5], what);
28elseif (is_a(x, #877))
29g[5] = setadd(g[5], what);
30elseif (is_a(x, $treasure))
31g[6] = setadd(g[6], what);
32elseif (!is_a(what, $decal))
33g[7] = setadd(g[7], what);
34endif
35endfor
36for x in [1..length(g)]
37$cu:sin();
38if (g[x])
39player:tell($ansi.bold_on, gn[x], ":", $ansi.reset);
40this:tell_contents_sub(g[x]);
41endif
42endfor

add_picker

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1"Copied from generic door (#246837):add_picker by Gilmore (#98) Sun Nov  4 20:59:47 2007 CST";
2who = args[1];
3this.pickers = {@this.pickers, {who, time()}};
4if (length(this.pickers) > 20)
5this.pickers = this.pickers[$ - 19..$];
6endif

fire_pcm

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

none

Source

No program (verb defined but unprogrammed).

ok_to_pick

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1return 1;

controlled_by

Spec this none thisFlags rxdOwner #29Definer #146

Referenced by

Source

1who = args[1];
2if (who == this.location.owner)
3return 1;
4elseif (who in this.location.residents)
5return 1;
6elseif (is_a(biz = this.location:area().owner.employer, $biz) && biz:permit_control(who, this.location))
7return 1;
8elseif (`who.wizard ! ANY => 0')
9return 1;
10endif
11return 0;
12return (((who == this.location.owner) || (who in this.location.residents)) || this.location:area().owner.employer:permit_control(who, this.location)) || `who.wizard ! ANY => 0';

_break

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1pass(@args);
2this.operational = 0;
3this:die();

locked

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

Source

1if (valid(this.lock))
2return this.lock.locked;
3endif

_bolt _unbolt

Spec this none thisFlags rxdOwner #361Definer #146

Referenced by

none

Source

1"Automatically generated for the boltable API.";
2return $api.boltable.implementation:(verb)(this, @args);