generic lockpickable RPG container #59000

Parent #43001Owner Flags Source rpg_march_2006/Misc/lockpickcontainer.txt

Aliases: generic lockpickable RPG container

12 verbs · 14 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
pick_lockthis none this#5900024
pick_msg pick_mod pick_failed lockedthis none this#590002
make_fertilethis none this#5900015
pu*t ins*ert st*ore ca*cheany in thisrx#590006
lock_msg olock_msg unlock_msg ounlock_msg no_key_msgthis none thisrx#590001
lock unlockthis none none#5900025
re*move ex*tract rec*over ge*t ta*keany from thisrx#590006
acceptablethis none this#590003
set_lockedthis none this#590005
holds_keythis none this#590007
is_openable_bythis none this#590001
reset_lockthis none this#5900010

Properties

PropertyDefinerFlagsOwnerValue
oclose_msg#59000"%n %<closes> %d."
oopen_msg#59000"%n %<opens> %d."
open_key#590000
store_action#59000"store"
encumbrance#59000100
manufactured#59000749722886
worth#59000-1
condition#59000100
odrop_failed_msg#59000"%<tries> to drop %t but fails!"
odrop_succeeded_msg#59000"%<drops> %t."
otake_succeeded_msg#59000"%<picks> up %t."
key#59000not readable (E_PERM)
aliases#59000{"generic lockpickable RPG container"}
object_size#59000{9127, 1141286565}

Ancestry

Ancestors (nearest first): #43001 generic openable/closable RPG container#9338 generic RPG container#2409 LRPG Adventuring Gear#112297 Generic Dyable LRPG Thing#517 Generic LRPG Thing

Children: none

Call graph

calls n59000_0 #59000:pick_lock n59000_1 #59000:pick_msg n59000_0->n59000_1 n59000_8 #59000:set_locked n59000_0->n59000_8 n43001_11 #43001:set_opened n59000_0->n43001_11 n59000_3 #59000:pu*t n43001_7 #43001:pu*t n59000_3->n43001_7 n59000_5 #59000:lock n59000_5->n59000_1 n59000_5->n59000_8 n59000_5->n43001_11 n59000_9 #59000:holds_key n59000_5->n59000_9 n59000_4 #59000:lock_msg n59000_5->n59000_4 n59000_6 #59000:re*move n59000_6->n59000_1 n43001_8 #43001:re*move n59000_6->n43001_8 n59000_7 #59000:acceptable n59000_7->n59000_1 n43001_9 #43001:acceptable n59000_7->n43001_9 n59000_10 #59000:is_openable_by n59000_10->n59000_1 n59000_11 #59000:reset_lock n59000_11->n59000_1 n59000_11->n59000_8 n59000_11->n43001_11

Source

pick_lock

Spec this none thisDefiner #59000

Referenced by

none

Source

1":pick_lock(thief, Resolve-result)  -- picked by a lockpick successfully.";
2if (!$object_utils:isa(caller, this.lockpick))
3  return E_PERM;
4endif
5{pc, result, @extra_args} = args;
6if (this:locked())
7  $local.rpg:say_action(this.opick_success_msg, pc, this, this.location);
8  this:set_locked(0);
9else
10  return player:tell("It is already unlocked.");
11endif
12if (!this.reset_time)
13  return;
14endif
15fork (this.reset_time)
16  joe = (pc.location == this.location) ? pc | $no_one;
17  if (!this:locked())
18    $local.rpg:say_action(this.relock_msg, joe, this, this.location);
19    this:set_locked(1);
20  endif
21  this:set_opened(0);
22endfork
23"TM 23-DEC-1995: changed line 6 to use the successful pick msg instead of the picking msg, also added a check to display relocking message only if container is still unlocked, and added check to not print the relock msg to the lockpicker if they're left the room.";
24"THX (#105941) - Thu Feb  3, 2000 - Hannibal added a check to see if the lock was already picked before forking.  THX changed to a scatter assignment and from $you:say_action to $local.rpg:say_action.";

pick_msg pick_mod pick_failed locked

Spec this none thisDefiner #59000

Referenced by

Source

1"You can customize to have :pick_failed fire some nasty traps at the would-be thief, heh, or whatever your cruel imagination can think of.";
2return this.(verb);

make_fertile

Spec this none thisDefiner #59000

Referenced by

none

Source

1"Copied from generic resting/sleeping dungeon (#5804):make_fertile by Quinn (#19845) Sat Sep 18 00:17:46 1993 PDT";
2"If you'd like to make children of this room, I suggest you use the following sequence to create a room which will be the generic for all the rooms in your RPG-area.  Then, just make kids of that object.";
3";foo:make_fertile();bar = create(foo)";
4who = caller_perms();
5if (#46:trust() && (this == #59000))
6  if (this.f)
7    who:tell(this.name, " (", this, ") is already fertile.");
8  else
9    this.f = 1;
10    fork (0)
11      this.f = 0;
12    endfork
13    who:tell(this.name, " (", this, ") is now fertile.");
14  endif
15endif

pu*t ins*ert st*ore ca*che

Spec any in thisFlags rxDefiner #59000

Referenced by

none

Source

1"Prevent transfer if container is locked";
2if (this.locked)
3  player:tell(this.name, " is locked.");
4  return 0;
5endif
6pass(@args);

lock_msg olock_msg unlock_msg ounlock_msg no_key_msg

Spec this none thisFlags rxDefiner #59000

Referenced by

Source

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

lock unlock

Spec this none noneDefiner #59000

Referenced by

none

Source

1":lock/unlock <this> - uses keys if desired; default only lets the owner manipulate.";
2if (!(val = this:holds_key(player)))
3  player:tell(this:no_key_msg());
4  return 0;
5elseif ((val == -1) && (!(player in {this.owner, @this.trusted})))
6  player:tell(tostr("You aren't allowed to ", verb, " ", this.name, "."));
7  return E_PERM;
8elseif (this:locked())
9  if (verb == "lock")
10    player:tell("It is already locked.");
11  else
12    this:set_locked(0);
13    player:tell(this:unlock_msg());
14    player.location:announce_all_but({player}, this:ounlock_msg());
15  endif
16else
17  if (verb == "unlock")
18    player:tell("It is already unlocked.");
19  else
20    this:set_locked(1);
21    this:set_opened(0);
22    player:tell(this:lock_msg());
23    player.location:announce_all_but({player}, this:olock_msg());
24  endif
25endif

re*move ex*tract rec*over ge*t ta*ke

Spec any from thisFlags rxDefiner #59000

Referenced by

none

Source

1"Prevent transfer if container is locked";
2if (this:locked())
3  player:tell(this.name, " is locked.");
4  return 0;
5endif
6pass(@args);

acceptable

Spec this none thisDefiner #59000

Referenced by

none

Source

1"Allow $local.rpg.equipment only if opened and unlocked";
2return ((pass(@args) && (!this:locked())) || (caller_perms() in $local.rpg.grand_masters)) || $perm_utils:controls(caller_perms(), this);
3"TM 23-DEC-1995 14:00 EST:  added $perm_utils check to help GMs teleporting stuff in without unlocking and opening first.";

set_locked

Spec this none thisDefiner #59000

Referenced by

Source

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

holds_key

Spec this none thisDefiner #59000

Referenced by

Source

1":holds_key(pc) ==> 1 if the pc holds a 'key' object for the container. Kudos to Quinn for the wonderful idea";
2if ((typeof(key = this.key_obj) != OBJ) || (!valid(key)))
3  return -1;
4elseif (key.location == (pc = args[1]))
5  return 1;
6endif
7return 0;

is_openable_by

Spec this none thisDefiner #59000

Referenced by

none

Source

1return (!this:locked()) || $perm_utils:controls(caller_perms(), this);

reset_lock

Spec this none thisDefiner #59000

Referenced by

none

Source

1return;
2":reset_lock ([OBJ lockpicking player]) - reset the lock on the container.";
3pc = (length(args) > 1) ? args[1] | $no_one;
4joe = (pc.location == this.location) ? pc | $no_one;
5if (!this:locked())
6  $local.rpg:say_action(this.relock_msg, joe, this, this.location);
7  this:set_locked(1);
8endif
9this:set_opened(0);
10"THX (#105941) - Thu Feb  3, 2000 - subst /$you/$local.rpg/g 1-$";