generic lock #124

Parent #5Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic lock, 2lock, lock

16 verbs · 55 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
_startthis none thisrxd#1248
_unlock _do_unlockthis none thisrxd#12438
is_locked lockedthis none thisrxd#1241
_permitthis none thisrxd#1244
try_unlockthis none thisrxd#1248
_lock _do_lockthis none thisrxd#12432
try_lockthis none thisrxd#12410
allow_unlock _can_be_unlocked_bythis none thisrxd#1242
hear_closethis none thisrxd#1244
tree_tagthis none thisrxd#1241
_unlock_othersidethis none thisrxd#1243
_lock_othersidethis none thisrxd#1243
tell_additional_appraisethis none thisrxd#1241
become_alockthis none thisrxd#1240
_installthis none thisrxd#1248
action_doing_msgthis none thisrxd#12413

Properties

PropertyDefinerFlagsOwnerValue
locked#124rc#3611
operational#124rc#3611
lock_msg#124rc#361"%DN locks %dt in %dl."
lock_self_msg#124rc#361"%DT in %dl clicks shut."
unlock_msg#124rc#361"%DN unlocks %dt in %dl."
unlock_self_msg#124rc#361"%DT in %dl clicks open."
unlock_fail_msg#124rc#361"%DN jiggles uselessly at %dt in %dl."
installed_msg#124rc#361"%IT is installed in %dl."
free_to_lock#124rc#3611
lock_fail_msg#124rc#361"%DN jiggles uselessly with %dt in %dl."
difficulty#124rc#361-3
tumblers#124rc#3615
pick_type#124rc#361#-1
got_tumbler_msg#124rc#361"You feel a pin set inside %dt."
lost_tumbler_msg#124rc#361"Dammit! You feel a pin drop inside %dt."
lost_all_tumblers_msg#124rc#361"SHIT! All the pins fell -- you blew it."
got_two_tumblers_msg#124rc#361"Ahh. You feel TWO pins set inside %dt!"
keyed_to#124rc#3610
lock_otherside_msg#124rc#361"You hear a click from %dl."
unlock_otherside_msg#124rc#361"You hear a soft click from %dl."
installed_otherside_msg#124rc#361"A lock lever protrudes from under the handle."
lockable_on_otherside#124rc#3611
use_otherside_msg#124rc#361"%DN flips a lever in %dl."
openable_on_otherside#124rc#3611
pick_duration#124rc#3611.0
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic lock", "2lock", "lock"}
description#1rc#361"A small brick of machinery, meant for installing into a door or cabinet for security."
object_size#1r#29{10135, 1298434502}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rwc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n124_1 #124:_unlock n124_2 #124:is_locked n124_1->n124_2 n124_4 #124:try_unlock n124_1->n124_4 n20_34 #20:pronoun_sub n124_1->n20_34 n1_46 #1:room n124_1->n1_46 n124_4->n20_34 n124_7 #124:allow_unlock n124_4->n124_7 n124_3 #124:_permit n124_3->n124_1 n124_5 #124:_lock n124_5->n124_2 n124_5->n20_34 n124_5->n1_46 n124_6 #124:try_lock n124_5->n124_6 n124_6->n20_34 n124_8 #124:hear_close n124_8->n20_34 n124_9 #124:tree_tag n5_18 #5:tree_tag n124_9->n5_18 n124_10 #124:_unlock_otherside n124_10->n124_1 n124_10->n20_34 n124_11 #124:_lock_otherside n124_11->n20_34 n124_11->n124_5 n124_15 #124:action_doing_msg n1_31 #1:dname n124_15->n1_31 n20_59 #20:name_and_number n124_15->n20_59

Source

_start

Spec this none thisFlags rxdOwner #361Definer #124

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

Source

1return this.locked && this.operational;

_permit

Spec this none thisFlags rxdOwner #361Definer #124

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

Source

1who = args[1];
2return who == this.owner;

hear_close

Spec this none thisFlags rxdOwner #361Definer #124

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

none

Source

1return (((pass(@args) + " ") + tostr(this.difficulty)) + " x") + tostr(this.tumblers);

_unlock_otherside

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

none

Source

1who = args[1];
2who:aat($su:ps(this.use_otherside_msg, who, this, this.location.otherside));
3this:_unlock();

_lock_otherside

Spec this none thisFlags rxdOwner #361Definer #124

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

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

none

Source

1return 0;

become_alock

Spec this none thisFlags rxdOwner #361Definer #124

Referenced by

none

Source

No program (verb defined but unprogrammed).

_install

Spec this none thisFlags rxdOwner #361Definer #124

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

Spec this none thisFlags rxdOwner #361Definer #124

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