generic lock #124
Aliases: generic lock, 2lock, lock
16 verbs · 55 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
_start | this none this | rxd | #124 | 8 |
_unlock _do_unlock | this none this | rxd | #124 | 38 |
is_locked locked | this none this | rxd | #124 | 1 |
_permit | this none this | rxd | #124 | 4 |
try_unlock | this none this | rxd | #124 | 8 |
_lock _do_lock | this none this | rxd | #124 | 32 |
try_lock | this none this | rxd | #124 | 10 |
allow_unlock _can_be_unlocked_by | this none this | rxd | #124 | 2 |
hear_close | this none this | rxd | #124 | 4 |
tree_tag | this none this | rxd | #124 | 1 |
_unlock_otherside | this none this | rxd | #124 | 3 |
_lock_otherside | this none this | rxd | #124 | 3 |
tell_additional_appraise | this none this | rxd | #124 | 1 |
become_alock | this none this | rxd | #124 | 0 |
_install | this none this | rxd | #124 | 8 |
action_doing_msg | this none this | rxd | #124 | 13 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
locked | #124 | rc | #361 | 1 |
operational | #124 | rc | #361 | 1 |
lock_msg | #124 | rc | #361 | "%DN locks %dt in %dl." |
lock_self_msg | #124 | rc | #361 | "%DT in %dl clicks shut." |
unlock_msg | #124 | rc | #361 | "%DN unlocks %dt in %dl." |
unlock_self_msg | #124 | rc | #361 | "%DT in %dl clicks open." |
unlock_fail_msg | #124 | rc | #361 | "%DN jiggles uselessly at %dt in %dl." |
installed_msg | #124 | rc | #361 | "%IT is installed in %dl." |
free_to_lock | #124 | rc | #361 | 1 |
lock_fail_msg | #124 | rc | #361 | "%DN jiggles uselessly with %dt in %dl." |
difficulty | #124 | rc | #361 | -3 |
tumblers | #124 | rc | #361 | 5 |
pick_type | #124 | rc | #361 | #-1 |
got_tumbler_msg | #124 | rc | #361 | "You feel a pin set inside %dt." |
lost_tumbler_msg | #124 | rc | #361 | "Dammit! You feel a pin drop inside %dt." |
lost_all_tumblers_msg | #124 | rc | #361 | "SHIT! All the pins fell -- you blew it." |
got_two_tumblers_msg | #124 | rc | #361 | "Ahh. You feel TWO pins set inside %dt!" |
keyed_to | #124 | rc | #361 | 0 |
lock_otherside_msg | #124 | rc | #361 | "You hear a click from %dl." |
unlock_otherside_msg | #124 | rc | #361 | "You hear a soft click from %dl." |
installed_otherside_msg | #124 | rc | #361 | "A lock lever protrudes from under the handle." |
lockable_on_otherside | #124 | rc | #361 | 1 |
use_otherside_msg | #124 | rc | #361 | "%DN flips a lever in %dl." |
openable_on_otherside | #124 | rc | #361 | 1 |
pick_duration | #124 | rc | #361 | 1.0 |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic lock", "2lock", "lock"} |
description | #1 | rc | #361 | "A small brick of machinery, meant for installing into a door or cabinet for security." |
object_size | #1 | r | #29 | {10135, 1298434502} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rwc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #1 root
Children: none
Call graph
Source
_start
Referenced by
none
Source
1who = args[1]; 2action = args[2][1]; 3aargs = {who}; 4if (length(args[2]) > 1) 5aargs = {@aargs, @args[2][2..$]}; 6endif 7this:("_" + action)(@aargs); 8return {2.0, 0};
_unlock _do_unlock
Referenced by
- #124:_permit line 4:
this:_unlock - #124:_unlock_otherside line 3:
this:_unlock
Source
1who = args ? args[1] | #-1; 2queue_open = (length(args) > 1) ? args[2] | 0; 3queue_move = (length(args) > 2) ? args[3] | 0; 4temporary = (length(args) > 3) ? args[4] | 0; 5m = ""; 6if (this:is_locked()) 7if (valid(who)) 8if (who.location != this.location.location) 9return E_INVARG; 10endif 11if (!this:try_unlock(who)) 12return 0; 13endif 14m = this.unlock_msg; 15else 16m = this.unlock_self_msg; 17endif 18endif 19if (is_a(this.location, $door) || is_a(this.location, #3632)) 20if (m) 21this.location:_announce(who, $su:ps(m, who, this, this.location)); 22endif 23if (!temporary) 24this.locked = 0; 25if (valid(this.location.otherside) && valid(this.location.otherside.lock)) 26this.location.otherside.lock.locked = 0; 27endif 28`this.location:hear_lock_change() ! ANY => 0'; 29`this.location.otherside:hear_lock_change() ! ANY => 0'; 30endif 31if (queue_open) 32who:queue_action(this.location, {"open", queue_move, ignore_lock = 1}); 33endif 34else 35m && this:room():announce_all($su:ps(m, who, this, this.location)); 36(!temporary) && (this.locked = 0); 37endif 38return 1;
is_locked locked
Referenced by
- #124:_unlock line 6:
this:is_locked - #124:_lock line 4:
this:is_locked
Source
1return this.locked && this.operational;
_permit
Referenced by
none
Source
1who = args ? args[1] | #-1; 2queue_open = (length(args) > 1) ? args[2] | 0; 3queue_move = (length(args) > 2) ? args[3] | 0; 4return this:_unlock(who, queue_open, queue_move, temporary = 1);
try_unlock
Referenced by
- #124:_unlock line 11:
this:try_unlock
Source
1":try_unlock(OBJ who)"; 2"Do what we must to let who try to unlock us."; 3"Return 1 if who is able to do so."; 4who = args[1]; 5if (this:allow_unlock(who)) 6return 1; 7endif 8who:aat($su:ps(this.unlock_fail_msg, who, this, this.location));
_lock _do_lock
Referenced by
- #124:_lock_otherside line 3:
this:_lock
Source
1who = args ? args[1] | #-1; 2m = ""; 3door = this.location; 4if (!this:is_locked()) 5if (valid(who)) 6if (who.location != door.location) 7return E_INVARG; 8endif 9if (!this:try_lock(who)) 10return 0; 11endif 12m = this.lock_msg; 13else 14m = this.lock_self_msg; 15endif 16if (is_a(door, $door) || is_a(door, #3632)) 17if (valid(door.otherside)) 18door:_announce(who, $su:ps(m, who, this, door), $su:ps(this.lock_otherside_msg, who, this, door.otherside)); 19else 20door:_announce(who, $su:ps(m, who, this, door), $su:ps(this.lock_otherside_msg, who, this, door)); 21endif 22if (valid(door.otherside) && valid(door.otherside.lock)) 23door.otherside.lock.locked = 1; 24endif 25else 26this:room():announce_all($su:ps(m, who, this, door)); 27endif 28this.locked = 1; 29`door:hear_lock_change() ! ANY => 0'; 30`door.otherside:hear_lock_change() ! ANY => 0'; 31return 1; 32endif
try_lock
Referenced by
- #124:_lock line 9:
this:try_lock
Source
1":try_lock(OBJ who)"; 2"Do what we must to let who try to lock us."; 3"Return 1 if who is able to."; 4who = args[1]; 5if (this.free_to_lock) 6return 1; 7elseif (who == this.owner) 8return 1; 9endif 10who:aat($su:ps(this.lock_fail_msg, who, this, this.location));
allow_unlock _can_be_unlocked_by
Referenced by
- #124:try_unlock line 5:
this:allow_unlock
Source
1who = args[1]; 2return who == this.owner;
hear_close
Referenced by
none
Source
1door = args[1]; 2if (this.locked) 3door.location:announce_all($su:ps(this.lock_self_msg, this, this, door)); 4endif
tree_tag
Referenced by
none
Source
1return (((pass(@args) + " ") + tostr(this.difficulty)) + " x") + tostr(this.tumblers);
_unlock_otherside
Referenced by
none
Source
1who = args[1]; 2who:aat($su:ps(this.use_otherside_msg, who, this, this.location.otherside)); 3this:_unlock();
_lock_otherside
Referenced by
none
Source
1who = args[1]; 2who:aat($su:ps(this.use_otherside_msg, who, this, this.location.otherside)); 3this:_lock();
tell_additional_appraise
Referenced by
none
Source
1return 0;
become_alock
Referenced by
none
Source
No program (verb defined but unprogrammed).
_install
Referenced by
none
Source
1who = args[1]; 2door = args[2]; 3if (r = pass(@args)) 4if ($api.lockable:is_on(door)) 5door.lock = this; 6endif 7endif 8return r;
action_doing_msg
Referenced by
none
Source
1action = args[2][1]; 2if (action in {"lock", "lock_otherside"}) 3return "locking " + this:dname(); 4elseif (action in {"unlock", "unlock_otherside"}) 5return "unlocking " + this:dname(); 6elseif (action in {"permit"}) 7return "adjusting " + this:dname(); 8elseif (action == "lock_otherside") 9return "closing " + this:dname(); 10else 11$nets.prognet:announce(#2, (((("unknown lock doing_msg => " + $su:nn(player)) + " used ") + $su:nn(this)) + " args: ") + toliteral(args), 1); 12return ""; 13endif