generic lockable container #146
Aliases: generic lockable container, container, lockable
39 verbs · 85 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
uninstall | any out of/from inside/from this | rxd | #146 | 24 |
_announce | this none this | rxd | #146 | 6 |
open close | this none none | rxd | #146 | 11 |
_open | this none this | rxd | #146 | 33 |
_close | any none none | rxd | #146 | 13 |
_do_open | this none this | rxd | #146 | 1 |
_do_close | this none this | rxd | #146 | 1 |
lock unlock | this none none | rxd | #146 | 17 |
_lock _unlock | this none this | rxd | #146 | 11 |
contents | this none this | rxd | #146 | 6 |
autoclose_on_lock | this is any | rxd | #146 | 16 |
autoopen_on_unlock | this is any | rxd | #146 | 16 |
_is_locked | any none none | rxd | #146 | 11 |
_can_be_unlocked_by | any none none | rxd | #146 | 14 |
location_specifier | this none this | rxd | #146 | 1 |
die | this none this | rxd | #146 | 11 |
_repair | this none this | rxd | #146 | 8 |
_repair_check | this none this | rxd | #146 | 3 |
is_broken | this none this | rxd | #146 | 7 |
pick | this none none | rxd | #146 | 8 |
occupants | this none this | rxd | #146 | 1 |
get_from | this none this | rxd | #146 | 12 |
bolt_old | this none this | rxd | #146 | 17 |
unbolt_old | this none this | rxd | #146 | 10 |
locks | this none this | rxd | #146 | 1 |
clean_locks | this none this | rxd | #146 | 1 |
exitfunc | this none this | rxd | #146 | 4 |
_start | this none this | rxd | #146 | 15 |
may_pick | this none this | rxd | #146 | 13 |
look_self | this none this | rxd | #146 | 8 |
hear_event_say | this none this | rxd | #146 | 10 |
tell_contents | this none this | rxd | #146 | 42 |
add_picker | this none this | rxd | #146 | 6 |
fire_pcm | this none this | rxd | #146 | 0 |
ok_to_pick | this none this | rxd | #146 | 1 |
controlled_by | this none this | rxd | #146 | 12 |
_break | this none this | rxd | #146 | 3 |
locked | this none this | rxd | #146 | 3 |
_bolt _unbolt | this none this | rxd | #146 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
registered_locks | #146 | rw | #29 | {} |
open_success_msg | #146 | rc | #29 | "%DN opens %dt." |
open_fail_lock_msg | #146 | rc | #29 | "%DN jiggles at the handle of %dt. Locked." |
open_action | #146 | rc | #29 | #357 |
close_action | #146 | rc | #29 | #358 |
close_success_msg | #146 | rc | #29 | "%DN closes %dt." |
close_fail_msg | #146 | rc | #29 | "%DN tries to close %dt, but just can't seem to do it." |
operational | #146 | rc | #29 | 1 |
autoclose_on_lock | #146 | r | #29 | 1 |
autoopen_on_unlock | #146 | r | #29 | 0 |
lock_installable | #146 | rc | #29 | 1 |
die_msg | #146 | rc | #29 | "%DT cracks open, unable to take any more abuse." |
bolt_msg | #146 | rc | #29 | "%DN presses down on the autosealing bolts on %dt. They spin themselves down into the floor." |
unbolt_msg | #146 | rc | #29 | "%DN presses down on the autosealing bolts on %dt. They extract themselves up and out of the floor." |
lock | #146 | rc | #29 | #-1 |
otherside | #146 | rc | #29 | #-1 |
pickers | #146 | rc | #29 | {} |
pick_timeout | #146 | rc | #29 | 120 |
bolted | #146 | r | #29 | 0 |
bolted_by | #146 | rc | #29 | #-1 |
boltable_in_public | #146 | rc | #29 | 1 |
boltable_duplicate | #146 | rc | #29 | #-1 |
glob | #188 | rc | #29 | <clear> |
capacity | #54 | rc | #29 | <clear> |
weight_reduction | #54 | rc | #29 | <clear> |
opaque | #54 | rc | #29 | <clear> |
dark | #54 | rc | #29 | <clear> |
close_msg | #54 | rc | #29 | <clear> |
open_msg | #54 | rc | #29 | <clear> |
remove_msg | #54 | rc | #29 | <clear> |
put_msg | #54 | rc | #29 | <clear> |
empty_msg | #54 | rc | #29 | <clear> |
contents_msg | #54 | rc | #29 | <clear> |
open_fail_msg | #54 | rc | #29 | "%DN tries to open %dt, but just can't seem to do it." |
put_fail_msg | #54 | rc | #29 | <clear> |
closed_msg | #54 | rc | #29 | <clear> |
closable | #54 | rc | #29 | <clear> |
open | #54 | rwc | #29 | <clear> |
get_from_msg | #54 | rc | #29 | <clear> |
max_objects | #54 | rc | #29 | <clear> |
spill_on_break | #54 | rc | #29 | 0 |
peek_msg | #54 | rc | #29 | <clear> |
clean_start_msg | #54 | rc | #29 | <clear> |
oclean_start_msg | #54 | rc | #29 | <clear> |
clean_finish_msg | #54 | rc | #29 | <clear> |
oclean_finish_msg | #54 | rc | #29 | <clear> |
break_msg | #255 | rc | #29 | "%DT breaks violently open." |
repair_difficulty | #255 | rc | #29 | <clear> |
junk_on_break | #255 | rc | #29 | <clear> |
rename_on_break | #255 | rc | #29 | <clear> |
smashable | #255 | rc | #29 | 1 |
repairable | #255 | rc | #29 | <clear> |
armor | #255 | rc | #29 | <clear> |
held_break_msg | #255 | rc | #29 | "Your %t breaks violently open." |
oheld_break_msg | #255 | rc | #29 | "%DN's %t breaks violently open." |
handed | #5 | rc | #29 | <clear> |
wield_msg | #5 | rc | #29 | <clear> |
unwield_msg | #5 | rc | #29 | <clear> |
size | #5 | rc | #29 | <clear> |
look_place_msg | #5 | rc | #29 | <clear> |
value | #5 | rc | #29 | <clear> |
get_msg | #5 | rc | #29 | <clear> |
drop_msg | #5 | rc | #29 | <clear> |
get_fail_msg | #5 | rc | #29 | <clear> |
junk_ok | #5 | rc | #29 | <clear> |
floats | #5 | rc | #29 | <clear> |
long_name_msg | #5 | rc | #29 | <clear> |
article | #5 | rc | #29 | <clear> |
setup_list | #5 | rc | #29 | <clear> |
health | #5 | rc | #29 | <clear> |
health_max | #5 | rc | #29 | <clear> |
min_skill | #5 | rc | #29 | <clear> |
skill | #5 | rc | #29 | <clear> |
recipe_for | #5 | rc | #29 | <clear> |
carried_msg | #5 | rc | #29 | <clear> |
aliases | #1 | rc | #29 | {"generic lockable container", "container", "lockable"} |
description | #1 | rc | #29 | <clear> |
object_size | #1 | r | #29 | {24998, 1298433821} |
hidden_verbs | #1 | rc | #29 | {"open", "@pass", "_open", "_close", "_is_locked", "_can_be_unlocked_by", "autoclose_on_lock", "autoopen_on_unlock"} |
phelp_msg | #1 | rc | #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 | #1 | rc | #29 | 1000 |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #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
Source
uninstall
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
Referenced by
- #146:_open line 32:
this:_announce - #146:_close line 12:
this:_announce
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
Referenced by
- #146:lock line 15:
this:close
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
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
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
Referenced by
- #146:_open line 12:
this:_do_open - #146:_open line 26:
this:_do_open - #146:_open line 30:
this:_do_open - #146:die line 7:
this:_do_open
Source
1this.open = 1;
_do_close
Referenced by
- #146:_close line 10:
this:_do_close - #146:_repair line 3:
this:_do_close
Source
1this.open = 0;
lock unlock
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
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
Referenced by
none
Source
1contents = pass(@args); 2if (valid(this.lock)) 3return setremove(contents, this.lock); 4else 5return contents; 6endif
autoclose_on_lock
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
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
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
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
Referenced by
none
Source
1return this:dname();
die
Referenced by
- #146:_break line 3:
this:die
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
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
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
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
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
Referenced by
- #146:_is_locked line 1:
this:occupants - #146:_can_be_unlocked_by line 2:
this:occupants
Source
1return valid(this.lock) ? setremove(pass(@args), this.lock) | pass(@args);
get_from
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
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
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
Referenced by
none
Source
1return {this.lock};
clean_locks
Referenced by
- #146:_lock line 4:
this:clean_locks
Source
1return 0;
exitfunc
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
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
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
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
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
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
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
Referenced by
none
Source
No program (verb defined but unprogrammed).
ok_to_pick
Referenced by
none
Source
1return 1;
controlled_by
Referenced by
- #146:uninstall line 6:
this:controlled_by - #146:autoclose_on_lock line 2:
this:controlled_by - #146:autoopen_on_unlock line 2:
this:controlled_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
Referenced by
none
Source
1pass(@args); 2this.operational = 0; 3this:die();
locked
Referenced by
- #146:open line 5:
this:locked
Source
1if (valid(this.lock)) 2return this.lock.locked; 3endif
_bolt _unbolt
Referenced by
none
Source
1"Automatically generated for the boltable API."; 2return $api.boltable.implementation:(verb)(this, @args);