Secure Exit #11286

Parent #3736Owner Flags Source rpg_march_2006/exit.txt

Aliases: Secure Exit

5 verbs · 4 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
is_unlocked_forthis none thisrx#112866
movethis none this#1128653
make_fertilethis none this#1128613
check_movethis none this#1128612
announce_msgthis none this#1128610

Properties

PropertyDefinerFlagsOwnerValue
free_entry#11286rc0
key#11286not readable (E_PERM)
aliases#11286{"Secure Exit"}
object_size#11286{6272, 1141286561}

Ancestry

Ancestors (nearest first): #3736 Defaulting Exit

Children: none

Call graph

calls n11286_1 #11286:move n11286_3 #11286:check_move n11286_1->n11286_3

Source

is_unlocked_for

Spec this none thisFlags rxDefiner #11286

Referenced by

none

Source

1{what} = args;
2c = `$perm_utils:caller() ! E_RANGE => this';
3cannot_walk = ((!is_player(what)) && (what in $local.rpg.pcs)) ? what.doll:cannot_walk() | 0;
4return ((!cannot_walk) && pass(what)) && ((((((this.free_entry || (((typeof(this.dest) == OBJ) && valid(this.dest)) && this.dest:accept(what))) || (((typeof(this.source) == OBJ) && valid(this.source)) && ((this.source == what.location) || this.source:accept(what)))) || (c[1] == this.source)) || (c[3] == this.owner)) || (what.owner in {this.owner, this.source.owner, this.dest.owner})) || what.owner.wizard);
5"Profane (#30788) - Sat May 22, 1999 - trap for E_RANGE";
6"THX (#105941) - Thu Oct 14, 1999 - Put a hack in for monster.doll:cannot_walk() for the AHaBs.";

move

Spec this none thisDefiner #11286

Referenced by

none

Source

1{what} = args;
2rpg = $local.rpg;
3if ((this.owner in rpg.gms) && ((caller == this) || (caller_perms() in rpg.gms)))
4  if (is_player(what))
5    old = what.location;
6    if (valid(doll = rpg:get_doll(what)))
7      "doll:invite(doll.slowness, {7})";
8      doll:check_schedule();
9      if (p = doll:cannot_walk())
10        return rpg:playertell(what, (typeof(p) == STR) ? p | "You're paralyzed and can't possibly go anywhere.");
11      elseif ((doll.last_attack > time()) && (!(rpg.magic_db.rf_combat_effect in doll.combat_effects)))
12        reject_msg = "a recent mental shock";
13        if ((note = doll:read_misc_note("teleport lag")) == E_PROPNF)
14        elseif (note > time())
15          reject_msg = "your recent use of LambdaMOO teleportation";
16        else
17          doll:erase_misc_note("teleport lag");
18        endif
19        return rpg:playertell(what, "You are still disoriented from ", reject_msg, " and cannot negotiate an exit.");
20      endif
21    endif
22    rpg.object_db.wandering_option_monster_heart:heartbeat();
23    if (((what.location == old) && (old == this.source)) && this:check_move(what))
24      pass(what);
25    endif
26  elseif ((what in rpg.pcs) || (caller_perms() in rpg.gms))
27    if (!valid(what.location))
28      what:moveto(rpg.cemetery);
29    elseif (rpg.object_db:is_rpg_room(this.dest))
30      "... ok living critter is heading for another LRPG room ...";
31    else
32      return E_PERM;
33    endif
34    rpg:s_i_n();
35    `what:do_the_move(this) ! ANY => pass(what)';
36    rpg.clock:check_schedule(what);
37  endif
38elseif (what.location == this.source)
39  if ((is_player(what) && (what == player)) || ((what.owner == player) && (!(what.owner in rpg.gms))))
40    pass(what);
41  else
42    return E_PERM;
43  endif
44else
45  return E_PERM;
46endif
47"9/27/95 Quinn -- Rewrote initial perms to disallow movement of RPG objects by untrusted individuals.";
48"Irin Thu Nov 21 15:49:00 1996 PST -- Paralyze check.";
49"Irin Sun Jan 26 14:07:36 1997 PST sub /(caller_perms() != what)/caller != this/3 ";
50"THX 1-Apr-1997 --  added a check for location validity so that monsters go to the cemetery before using the exit if they are in $nowhere ... this avoids a TB from the exit messaging.";
51"Profane (#30788) - Mon Oct  6 18:23:48 1997 PDT - Check for exit ownership";
52"THX (#105941) - Mon Nov 22, 1999 - Allow player-owned secure exits to work, but only on objects in the .source that are owned by player and not non-player gm-owned objects.";
53"THX (#105941) - Sat Apr 21, 2001 - Trigger rpg.clock:check_schedule() when a critter uses the exit.  Trigger the GWOM heart:heartbeat() when a player uses the exit.";

make_fertile

Spec this none thisDefiner #11286

Referenced by

none

Source

1":make_fertile() -- Temporarily toggles the 'f' bit, allowing GMs (and not builders in general) to create a child of adventure gear.  To be used as follows:";
2";;#equipment:make_fertile();return player:_create(#equipment)";
3"Where '#equipment' is the number of the object you're wanting to create.  The blank object returned will be your child.  Congratulations, Mommy.";
4if ($local.rpg:trusted(caller_perms()))
5  if (!this.f)
6    this.f = 1;
7    fork (0)
8      this.f = 0;
9    endfork
10  endif
11  return this.f;
12endif
13"Quinn 09-JUL-93 0343: Changed :trust call to :trusted(caller_perms()); Updated comment lines;  eliminated check for ownership in first 'if'.  Let it crash if a kid not owned by GM uses the parent; Now returns status of f-bit.";

check_move

Spec this none thisDefiner #11286

Referenced by

Source

1"Hook for exit specific stuff.";
2{what} = args;
3rpg = $local.rpg;
4if (((what in rpg.check_player) && (this.owner == rpg.owner)) && (caller_perms() in rpg.gms))
5  oldest = this.dest;
6  this.dest = rpg.player_start;
7  fork (0)
8    this.dest = oldest;
9    (what.location == rpg.player_start) && (rpg.check_player = setremove(rpg.check_player, what));
10  endfork
11endif
12return 1;

announce_msg

Spec this none thisDefiner #11286

Referenced by

none

Source

1":announce_msg(place, what, msg)";
2"  announce msg in place (except to what). Prepend with what:title if it isn't part of the string";
3{place, what, msg} = args;
4rpg = $local.rpg;
5if ((caller == this) || (caller_perms() in rpg.gms))
6  (what in `(dest = this.dest).unannounced ! ANY => {}') && (dest.unannounced = setremove(dest.unannounced, what));
7  title = what:titlec();
8  $string_utils:index_delimited(msg, title) || (msg = tostr(title, " ", msg));
9  rpg:rpg_announce_all_but(place, {what}, msg);
10endif