Generic Player Class With Additional Features of Dubious Utility #7069

Parent Owner Flags Source rpg_march_2006/Dependencies/7069.txt

Aliases: generic, programmer

40 verbs · 36 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
seekany none noner#706955
titlethis none this#70695
@cor*rectionthis none thisrd#706954
gear @gearany none nonerxd#706914
page_echo_msgthis none thisrxd#70691
idle_suffixthis none this#706913
tellthis none thisrx#706915
idle_msgthis none this#70691
@que*ued_tasksnone none nonerxd#706916
alt_examineany any anyrxd#706983
@destroyany any anyrd#706942
@rescueany any anyrd#706922
@purgeany any anyrd#706921
look_selfthis none this#706919
okthis none this#706914
descriptionthis none this#706917
kill_exitthis none thisrxd#706931
@fillany any anyrd#706921
move_okthis none thisrxd#706922
movetothis none thisrxd#70694
@whom*ovedmenone none nonerxd#706912
res*pond =*any any anyrxd#706920
wh*isperany to thisrxd#70692
@rel*inkany any anyrxd#706950
set_respond_tothis none thisrxd#70698
pose-oldany any anyrxd#706944
verb_sub(old)this none thisrxd#70692
sub_tellthis none thisrxd#70698
@abortany any anyrxd#706927
my_huhthis none thisrx#706930
receive_pagethis none thisrxd#706914
move_ok(old)this none thisrxd#706922
seek_arrive_msg seek_leave_msg seek_failed_msgthis none this#70691
tell(expensive)this none thisrx#706923
title(old)this none this#70699
my_huh(old)this none thisrd#706954
my_huh(oldold)this none thisrd#706954
respond_tothis none thisrx#706917
@db*sizenone none nonerd#70692
receive_page(old)this none thisrxd#706910

Properties

PropertyDefinerFlagsOwnerValue
notify_huh#7069rc1
contents_huh#7069rc0
inward_xmit#7069rc0
respond_to#7069not readable (E_PERM)
move_passers#7069rc{}
moved_by#7069rc{{{#102181, "shove", #117379, #102181, #117379}}, #117379, 1094697581}
sessile#7069rc-1
look_sep_msg#7069rc" "
twitch_delay#7069rc3
last_twitch#7069r#780
idle_msg#7069rc" stares off into the middle distance."
twitch_threshold#7069rc120
page_notify#7069rc0
witnessing#7069not readable (E_PERM)
rooms#7069{{"Living", #17}, {"Dining", #28}, {"Library", #1670}, {"Pool", #1428}}
messages_going#7069not readable (E_PERM)
current_message#7069not readable (E_PERM)
messages#7069not readable (E_PERM)
features#7069{#55317, #30203, #40842, #26787}
previous_connection#7069not readable (E_PERM)
email_address#7069not readable (E_PERM)
help#70690
linebuffer#7069not readable (E_PERM)
current_folder#7069not readable (E_PERM)
all_connect_places#7069not readable (E_PERM)
last_connect_place#7069not readable (E_PERM)
lines#7069not readable (E_PERM)
ownership_quota#7069not readable (E_PERM)
password#7069not readable (E_PERM)
size_quota#7069not readable (E_PERM)
last_password_time#7069not readable (E_PERM)
last_connect_attempt#7069not readable (E_PERM)
key#7069not readable (E_PERM)
aliases#7069{"generic", "programmer"}
description#7069"You see a player who is probably remaining undescribed as a political statement. It has to be something like that."
object_size#7069{36961, 1141286549}

Ancestry

Ancestors (nearest first): none

Children: #5803 Experimental Guinea Pig Class with Even More Features of Dubious Utility

Call graph

calls n7069_0 #7069:seek n7069_1 #7069:title n7069_0->n7069_1 n7069_5 #7069:idle_suffix n7069_1->n7069_5 n7069_3 #7069:gear n7069_3->n7069_3 n7069_4 #7069:page_echo_msg n7069_4->n7069_5 n7069_6 #7069:tell n7069_7 #7069:idle_msg n7069_6->n7069_7 n7069_8 #7069:@que*ued_tasks n7069_8->n7069_6 n7069_10 #7069:@destroy n7069_10->n7069_6 n7069_11 #7069:@rescue n7069_11->n7069_6 n7069_12 #7069:@purge n7069_12->n7069_6 n7069_13 #7069:look_self n7069_14 #7069:ok n7069_13->n7069_14 n7069_15 #7069:description n7069_13->n7069_15 n7069_17 #7069:@fill n7069_17->n7069_6 n7069_16 #7069:kill_exit n7069_17->n7069_16 n7069_19 #7069:moveto n7069_18 #7069:move_ok n7069_19->n7069_18 n7069_20 #7069:@whom*ovedme n7069_20->n7069_6 n7069_21 #7069:res*pond n7069_21->n7069_6 n7069_37 #7069:respond_to n7069_21->n7069_37 n7069_22 #7069:wh*isper n7069_24 #7069:set_respond_to n7069_22->n7069_24 n7069_27 #7069:sub_tell n7069_27->n7069_6 n7069_28 #7069:@abort n7069_28->n7069_6 n7069_30 #7069:receive_page n7069_30->n7069_24 n7069_33 #7069:tell(expensive) n7069_33->n7069_7 n7069_34 #7069:title(old) n7069_34->n7069_5 n7069_39 #7069:receive_page(old) n7069_39->n7069_24

Source

seek

Spec any none noneFlags rOwner #78Definer #7069

Referenced by

none

Source

1"seek <player>   --  tries to enter <player>.location via an exit.";
2set_task_perms(player);
3if (valid(dobj))
4  who = dobj;
5else
6  who = $string_utils:match_player(args[1]);
7  if (length($command_utils:player_match_result(who, args[1])) == 1)
8    return;
9  endif
10endif
11from = player.location;
12to = who.location;
13if (!valid(to))
14  player:tell(who.name, " is nowhere.");
15  return;
16elseif ($object_utils:isa(to, $generic_editor))
17  player:tell(who.name, " is in ", to.name, ". You don't want to visit ", who.po, " there.");
18  if (z = who in to.active)
19    player:tell($string_utils:pronoun_sub(("%S should reappear in " + (to = to.original[z]).name) + " when %s %<has> finished editing. I'll send you there.", who));
20  else
21    player:tell($string_utils:pronoun_sub("Damned if I know what %s %<is> doing there, though. I give up.", who));
22    return;
23  endif
24endif
25obvious = {"n", "ne", "e", "se", "s", "sw", "w", "nw", "north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "u", "d", "up", "down"};
26reverse = {"s", "sw", "w", "nw", "n", "ne", "e", "se", "south", "southwest", "west", "northwest", "north", "northeast", "east", "southeast", "d", "u", "down", "up"};
27out = en = $nothing;
28for dir in (obvious)
29  if ((!valid(out)) && (valid(y = from:match_exit(dir)) && y:is_unlocked_for(player)))
30    out = y;
31  endif
32endfor
33for d in [1..length(obvious)]
34  if ((!valid(en)) && (valid(ex = to:match_exit(obvious[d])) && ($object_utils:isa(ex, $exit) && ((typeof(ex.dest) == OBJ) && ($object_utils:isa(ex.dest, $room) && (valid(y = ex.dest:match_exit(reverse[d])) && y:is_unlocked_for(player)))))))
35    en = y;
36  endif
37endfor
38if (valid(out))
39  out:move(player);
40endif
41if (player.location != to)
42  player.location:announce(this:title(), " leaves, of necessity by an ugly method.");
43  if (valid(en))
44    en:move(player);
45  endif
46  if (player.location != to)
47    player:moveto(to);
48    if (player.location != to)
49      player:tell("You failed to seek out ", who.name, ".");
50      player.location:announce(this:title(), " bounces off a topographic barrier, and into the room.");
51    else
52      to:announce(this:title(), " arrives, of necessity by an ugly method.");
53    endif
54  endif
55endif

title

Spec this none thisDefiner #7069

Referenced by

Source

1if ($list_utils:assoc("tell_contents", callers(), 2) && (msg = this:idle_suffix()))
2  return tostr(pass(@args), " (", msg, ")");
3else
4  return pass(@args);
5endif

@cor*rection

Spec this none thisFlags rdOwner #78Definer #7069

Referenced by

none

Source

1p = index(dobjstr, "+");
2m = index(dobjstr, "/");
3if ((p && m) || ((!p) && (!m)))
4  player:tell("Usage: @correct <object>:<verb>/<line> to <code>");
5  player:tell("   or: @correct <object>:<verb>+<line> to <code>");
6  return;
7elseif (p)
8  k = p - 1;
9else
10  k = m - 1;
11endif
12vs = dobjstr[1..k];
13line = tonum(dobjstr[k + 2..length(dobjstr)]);
14if ((line < 0) || ((line == 0) && m))
15  player:tell("Illegal line number");
16endif
17vl = $code_utils:parse_verbref(vs);
18if (vl)
19  OBJ = this.location:match_object(vl[1]);
20  verb = vl[2];
21else
22  player:tell("Usage: @correct <object>:<verb>/<line> to <code>");
23  player:tell("   or: @correct <object>:<verb>+<line> to <code>");
24  return;
25endif
26code = verb_code(OBJ, verb);
27text = "";
28for foo in (args[3..length(args)])
29  text = (text + " ") + foo;
30endfor
31if (p)
32  code = {@code[1..line], text, @code[line + 1..length(code)]};
33else
34  code = {@code[1..line - 1], text, @code[line + 1..length(code)]};
35endif
36if (set_verb_code(OBJ, verb, code) == {})
37  player:tell("Line corrected.");
38else
39  player:tell("Correction failed.");
40endif
41code = verb_code(OBJ, verb);
42if (line < 5)
43  s1 = 1;
44else
45  s1 = line - 3;
46endif
47if (line > (length(code) - 4))
48  s2 = length(code);
49else
50  s2 = line + 3;
51endif
52for k in [s1..s2]
53  player:tell($string_utils:right(tostr(k), 4), " : ", code[k]);
54endfor

gear @gear

Spec any none noneFlags rxdDefiner #7069

Referenced by

Source

1if (!args)
2  sp = "";
3  who = player;
4elseif (length(args) == 1)
5  sp = "";
6  who = dobj;
7else
8  sp = args[2];
9  who = args[1];
10endif
11player:tell((sp + $string_utils:left(who, length(tostr(max_object())) + 1)) + who.name);
12for k in (who.contents)
13  this:gear(k, "  " + sp);
14endfor

page_echo_msg

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1return pass(@args) + ((s = this:idle_suffix()) ? tostr("  ", this.name, " seems to be ", s, ", though.") | "");

idle_suffix

Spec this none thisDefiner #7069

Referenced by

Source

1if (!(this in connected_players()))
2  return "asleep";
3elseif ((z = idle_seconds(this)) > 3600)
4  return ("out on " + this.pp) + " feet";
5elseif (z > 600)
6  return "dozing";
7elseif (z > 180)
8  return "daydreaming";
9elseif (z > 60)
10  return "distracted";
11else
12  return "";
13endif

tell

Spec this none thisFlags rxOwner #67Definer #7069

Referenced by

Source

1pass(@args);
2if (((!$login:is_lagging()) && (player != this)) && ((caller in {this.location, this}) && ((this.twitch_delay >= 0) && ((this.twitch_threshold > 0) && ((this in connected_players()) && (((idle = idle_seconds(this)) > this.twitch_threshold) && ((time() - idle) > this.last_twitch)))))))
3  text = tostr(@args);
4  for y in (listinsert(this.aliases, this.name))
5    if ($string_utils:index_delimited(text, y))
6      this.last_twitch = time();
7      fork (this.twitch_delay)
8        if ((idle_seconds(this) > this.twitch_threshold) && (msg = this:idle_msg()))
9          this.location:announce_all(this.name, msg);
10        endif
11      endfork
12      return;
13    endif
14  endfor
15endif

idle_msg

Spec this none thisDefiner #7069

Referenced by

Source

1return this.(verb);

@que*ued_tasks

Spec none none noneFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1set_task_perms(this);
2tasks = queued_tasks();
3if (tasks == {})
4  this:tell("You have no queued tasks.");
5else
6  t = time();
7  player:tell("----------------------------------------------------------------------------");
8  for job in (tasks)
9    name = strsub(job[7], "*", "");
10    if (y = index(name, " "))
11      name = name[1..y - 1];
12    endif
13    this:tell($string_utils:left(job[1], 10), $string_utils:right($time_utils:dhms(job[2] - time()), 12), "  ", $string_utils:left(valid(what = job[9]) ? what.name | "** recycled **", -19 + length(tostr(what))), " (", what, ")", $string_utils:right(job[6], 9), ":", name, " (", job[8], ")");
14  endfor
15  player:tell("----------------------------------------------------------------------------");
16endif

alt_examine

Spec any any anyFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1if (dobjstr == "")
2  player:tell("Usage:  @examine <object>");
3  return;
4endif
5what = player.location:match_object(dobjstr);
6if (!$command_utils:object_match_failed(what, dobjstr))
7  player:tell(what.name, " (", what, ") is owned by ", what.owner.name, " (", what.owner, ").");
8  player:tell("Aliases:  ", $string_utils:english_list(what.aliases));
9  desc = what:description();
10  if (desc)
11    player:tell_lines(what:description());
12  else
13    player:tell("(No description set.)");
14  endif
15  if ($perm_utils:controls(player, what))
16    player:tell("Key:  ", $lock_utils:unparse_key(what.key));
17  endif
18  contents = what.contents;
19  if (contents)
20    player:tell("Contents:");
21    for item in (contents)
22      player:tell("  ", item.name, " (", item, ")");
23    endfor
24  endif
25  name = what.name;
26  if ((typeof(what.aliases) == LIST) && (what.aliases != {}))
27    for alias in (what.aliases)
28      if (length(alias) <= length(name))
29        name = alias;
30      endif
31    endfor
32  endif
33  vrbs = {};
34  commands_ok = what in {player, player.location};
35  dull_classes = {$root_class, $room, $player, $prog};
36  what = what;
37  while (what != $nothing)
38    if (!(what in dull_classes))
39      for i in [0..length(verbs(what)) - 1]
40        info = verb_info(what, tostr(i));
41        syntax = verb_args(what, tostr(i));
42        if (index(info[2], "r") && ((syntax[2..3] != {"none", "this"}) && (commands_ok || ("this" in syntax))))
43          dobj = syntax[1];
44          prep = syntax[2];
45          iobj = syntax[3];
46          if (syntax == {"any", "any", "any"})
47            prep = "none";
48          endif
49          if (prep != "none")
50            for x in ($string_utils:explode(prep, "/"))
51              if (length(x) <= length(prep))
52                prep = x;
53              endif
54            endfor
55          endif
56          "NOTE: Is this the correct way to handle verbs named *?";
57          names = $string_utils:explode(info[3], " ");
58          if ("*" in names)
59            vname = "<anything>";
60          else
61            vname = $string_utils:from_list(names, "/");
62          endif
63          rest = "";
64          if (prep != "none")
65            rest = " " + ((prep == "any") ? "<anything>" | prep);
66            if (iobj != "none")
67              rest = (rest + " ") + ((iobj == "this") ? name | "<anything>");
68            endif
69          endif
70          if (dobj != "none")
71            rest = (" " + ((dobj == "this") ? name | "<anything>")) + rest;
72          endif
73          vrbs = setadd(vrbs, ("  " + vname) + rest);
74        endif
75      endfor
76    endif
77    what = parent(what);
78  endwhile
79  if (vrbs)
80    player:tell("Obvious Verbs:");
81    player:tell_lines(vrbs);
82  endif
83endif

@destroy

Spec any any anyFlags rdOwner #78Definer #7069

Referenced by

none

Source

1dobj = player:my_match_object(dobjstr);
2if (player != this)
3  player:tell("Sorry, that @destroy command is off limits for you.");
4  #15.destroy_abusers = listappend(#15.destroy_abusers, {player, this});
5elseif (dobj == $nothing)
6  player:notify(tostr("Usage:  ", verb, " <object>"));
7elseif ($command_utils:object_match_failed(dobj, dobjstr))
8  "...bogus object...";
9elseif (player == dobj)
10  player:notify("You don't *really* want to commit suicide, do you?");
11else
12  name = dobj.name;
13  if (!$perm_utils:controls(this, dobj))
14    this:tell(name, " (", dobj, ") belongs to ", dobj.owner.name, " (", dobj.owner, "), only they or a wizard can recycle it.");
15    return;
16  endif
17  this:tell(name, " (", dobj, ") scheduled for recycling in sixty seconds. Type \"@rescue\" to save it.");
18  #5586.going = setadd(#5586.going, dobj);
19  set_task_perms(this);
20  dobj:moveto(#5586);
21  fork (60)
22    if (valid(dobj))
23      if (dobj in #5586.going)
24        result = #4455:_recycle(dobj);
25        if (typeof(result) == ERR)
26          this:tell("Couldn't recycle ", name, ": ", result);
27        else
28          this:tell(name, " (", dobj, ") recycled.");
29        endif
30      elseif (dobj.location == #5586)
31        dobj:moveto(this);
32        if (dobj.location == this)
33          s = "You now have";
34        else
35          s = ((dobj.location.name + " (") + tostr(dobj.location)) + ") now has";
36        endif
37        this:tell(s, " the rescued ", dobj.name, " (", dobj, ")");
38      endif
39      #5586:sweep();
40    endif
41  endfork
42endif

@rescue

Spec any any anyFlags rdOwner #78Definer #7069

Referenced by

none

Source

1c = 0;
2objs = {};
3for q in (args)
4  if (valid(w = $string_utils:match(q, #5586.contents, "name", #5586.contents, "aliases")) || valid(this.location:match_object(q)))
5    objs = setadd(objs, w);
6  endif
7endfor
8for q in (#5586.going)
9  if (this.wizard || (this == q.owner))
10    if ((objs == {}) || (q in objs))
11      c = c + 1;
12      #5586.going = setremove(#5586.going, q);
13      this:tell(q.name, " (", q, ") rescued.");
14      if (this != q.owner)
15        q.owner:tell(q.name, " (", q, ") rescued by ", this.name, ".");
16      endif
17    else
18      this:tell(q.name, " (", q, ") left to its fate.");
19    endif
20  endif
21endfor
22this:tell(c, " objects rescued.");

@purge

Spec any any anyFlags rdOwner #78Definer #7069

Referenced by

none

Source

1c = 0;
2objs = {};
3for q in (args)
4  if (valid(w = $string_utils:match(q, #5586.contents, "name", #5586.contents, "aliases")) || valid(this.location:match_object(q)))
5    objs = setadd(objs, w);
6  endif
7endfor
8for q in (#5586.going)
9  if (this.wizard || (this == q.owner))
10    if ((objs == {}) || (q in objs))
11      c = c + 1;
12      #5586.going = setremove(#5586.going, q);
13      this:tell(q.name, " (", q, ") purged.");
14      if (this != q.owner)
15        q.owner:tell(q.name, " (", q, ") purged.");
16      endif
17      #4455:_recycle(q);
18    endif
19  endif
20endfor
21this:tell(c, " objects purged.");

look_self

Spec this none thisDefiner #7069

Referenced by

none

Source

1player:tell(this:titlec());
2c = i = {};
3for k in (setremove(this:contents(), player))
4  if ((y = this:ok(k)) > 0)
5    i = {@i, k};
6  elseif (!y)
7    c = {@c, k};
8  endif
9endfor
10player:tell_lines(this:description(@i));
11if (!(this in connected_players()))
12  player:tell($string_utils:alt_pronoun_sub("%S %<is> sleeping.", this));
13elseif ((idle = idle_seconds(this)) < 60)
14  player:tell($string_utils:alt_pronoun_sub("%S %<is> awake and %<looks> alert.", this));
15else
16  time = $string_utils:from_seconds(idle);
17  player:tell($string_utils:alt_pronoun_sub(("%S %<is> awake, but %<has> been staring off into space for " + time) + ".", this));
18endif
19this:tell_contents(c);

ok

Spec this none thisDefiner #7069

Referenced by

Source

1"Stolen from #6792:ok()";
2k = args[1];
3if (y = $code_utils:verb_or_property(k, "carried_msg"))
4  if (k.owner == this.owner)
5    return (typeof(y) == STR) ? 1 | -1;
6  elseif (typeof(y) != STR)
7    return;
8  endif
9  for a in ({"%n", k.name, @k.aliases})
10    if (index(y, a))
11      return 1;
12    endif
13  endfor
14endif

description

Spec this none thisDefiner #7069

Referenced by

Source

1d = pass();
2if (args == {})
3  return d;
4else
5  s = ex = "";
6  for k in (args)
7    s = (s + ex) + $string_utils:pronoun_sub($object_utils:has_verb(k, "carried_msg") ? k:carried_msg() | k.carried_msg, this, k);
8    ex = this.look_sep_msg;
9  endfor
10endif
11if (typeof(d) == LIST)
12  return listappend(d, s);
13elseif (typeof(d) == STR)
14  return (d + this.look_sep_msg) + s;
15else
16  return s;
17endif

kill_exit

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

Source

1"if this is a legit call, then player==cp. So the messages should go to the right place.";
2set_task_perms(cp = caller_perms());
3"if (length(callers()) != 1 || callers()[1][1] != this)";
4"player:tell(\"Security violation.\");";
5"else";
6exit = args[1];
7from = args[2];
8to = args[3];
9if (exit in from.exits)
10  if ((from.owner != cp) && (!cp.wizard))
11    player:tell("Can't remove ", exit.name, " (", exit, ") from exit list of ", from.name, " (", from, "). Ask ", from.owner.name, " (", from.owner, ")");
12  else
13    player:tell("Removed ", exit.name, " (", exit, ") from exit list of ", from.name, " (", from, "). Ask ", from.owner.name, " (", from.owner, ").");
14    from.exits = setremove(from.exits, exit);
15  endif
16endif
17if (exit in to.entrances)
18  if ((to.owner != cp) && (!cp.wizard))
19    player:tell("Can't remove ", exit.name, " (", exit, ") from entrance list of ", to.name, " (", to, "). Ask ", to.owner.name, " (", to.owner, ").");
20  else
21    player:tell("Removed ", exit.name, " (", exit, ") from entrance list of ", to.name, " (", to, ").");
22    to.entrances = setremove(to.entrances, exit);
23  endif
24endif
25if ((exit.owner != cp) && (!cp.wizard))
26  player:tell("Can't recycle ", exit.name, " (", exit, "). Ask ", exit.owner.name, " (", exit.owner, ")");
27else
28  player:tell(exit.name + " (", exit, ") recycled.");
29  cp:_recycle(exit);
30endif
31"endif";

@fill

Spec any any anyFlags rdOwner #78Definer #7069

Referenced by

none

Source

1if (valid(dobj))
2  exit = dobj;
3elseif (argstr)
4  exit = this.location:match_exit(argstr);
5else
6  this:tell("Usage: @fill <exit-name>");
7  this:tell("  recycles the exit named and eliminates it from the relevant lists in the rooms, and does the same for the reverse exit(s), if any.");
8endif
9if (!valid(exit))
10  player:tell("I don't see that exit.");
11  return;
12endif
13to = exit.dest;
14back = {};
15set_task_perms(player);
16this:kill_exit(exit, this.location, to);
17for foo in (to.exits)
18  if (foo.dest == this.location)
19    this:kill_exit(foo, to, this.location);
20  endif
21endfor

move_ok

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

Source

1if ((!valid(args[1])) && (args[1] != $nothing))
2  return 0;
3elseif (this.sessile <= 0)
4  return 1;
5else
6  "We want to include the owner, but if we're in #-1, we want nothing.  So, we abuse list splicing.";
7  ok = {this, @valid(this.location) ? {this.location.owner} | {}};
8  by = listappend(callers(), {player, "", player});
9  n = 1;
10  exits = $object_utils:has_property(this.location, "exits") ? this.location.exits | {};
11  while (((y = by[n])[1] == this) && (y[2] == "moveto"))
12    n = n + 1;
13  endwhile
14  for k in (by[n..length(by)])
15    if (k[3] in ok)
16      return 1;
17    elseif (!((k[3].wizard || (k[1] in exits)) || (k[3] in this.move_passers)))
18      return 0;
19    endif
20  endfor
21  return k[3].wizard || (player == this);
22endif

moveto

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

Source

1this.moved_by = this.sessile ? {callers(), player, time()} | {};
2if (this:move_ok(@args))
3  return pass(@args);
4endif

@whom*ovedme

Spec none none noneFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1if (w = this.moved_by)
2  who = w[2];
3  this:tell("Task of ", $string_utils:from_seconds(time() - w[3]), " ago was initiated by ", valid(who) ? who.name | "(recycled)", " (", who, "), your moveto was");
4  for k in (w[1])
5    vrb = (z = index(k[2], " ")) ? k[2][1..z - 1] | k[2];
6    vrb = strsub(vrb, "*", "");
7    this:tell("called from: ", $string_utils:right(k[1], 6), ":", $string_utils:left(vrb, -15), " programmed by ", valid(who = k[3]) ? who.name | "(recycled)", " (", who, ")");
8  endfor
9  this:tell("(End of responsibility traceback.)");
10else
11  this:tell("I'm sorry, I didn't notice.");
12endif

res*pond =*

Spec any any anyFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1if (typeof(r = this:respond_to()) == LIST)
2  this:tell("Do you mean ", r[1].name, " or ", r[2].name, "?");
3elseif (!valid(r))
4  this:tell("Nobody to respond to.");
5elseif (!(r in connected_players()))
6  this:tell("Don't respond to ", r.name, " now, ", r.ps, "'s asleep.");
7else
8  text = ((length(verb) > 1) && (verb[1] == "=")) ? verb[2..length(verb)] + (argstr ? " " + argstr | "") | argstr;
9  if (text)
10    if (r:receive_page(tostr(this.name, " responds, \"", text, "\"")))
11      this:tell("You respond to ", r.name, ".");
12    else
13      this:tell("Your response to ", r.name, " was refused.");
14    endif
15  elseif (r in connected_players())
16    this:tell("You are ready to respond to ", r.name, ".");
17  else
18    this:tell("You would like to respond to ", r.name, ", but ", r.ps, "'s asleep.");
19  endif
20endif

wh*isper

Spec any to thisFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1this:set_respond_to(player);
2pass(@args);

@rel*ink

Spec any any anyFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1if ((iobj != $nothing) && (!valid(iobj)))
2  player:tell("Relink to where?");
3elseif (!valid(out = player.location:match_exit(dobjstr)))
4  player:tell("I don't understand \"", dobjstr, "\"");
5elseif (!$object_utils:isa(out, $exit))
6  player:tell(out.name, " (", out, ") isn't an exit. I think you better do this.");
7elseif (out.owner != player)
8  player:tell("You don't own ", out.name, " (", out, ").");
9elseif (from.owner != player)
10  player:tell("You don't own this room.");
11elseif (!$object_utils:isa(iobj, $room))
12  player:tell(iobj.name, " (", iobj, ") isn't a room.");
13elseif (iobj.owner != player)
14  player:tell("You don't own ", iobj.name, " (", iobj, ").");
15else
16  from = player.location;
17  to = out.dest;
18  if (out.source != from)
19    player:tell(out.name, " (", out, ") doesn't have it's source here.");
20  elseif (!(out in from.exits))
21    player:tell(out.name, " (", out, ") isn't an exit from here.");
22  elseif (!valid(to = out.dest))
23    player:tell(out.name, " (", out, ") doesn't have a destination.");
24  elseif (to.owner != player)
25    player:tell("You don't own ", out.name, " (", out, ")'s destination, ", to.name, " (", to, ")");
26  else
27    back = {};
28    for k in (to.exits)
29      if ((valid(k) && $object_utils:isa(k, $exit)) && (k.dest == from))
30        if (k.source != to)
31          player:tell(k.name, " (", k, ") doesn't seem to come from ", to.name, " (", to, ").");
32        elseif (k.owner != player)
33          player:tell(k.name, "( ", k, ") is owned by ", valid(k.owner) ? k.owner.name | "** recycled ** ", " (", k.owner, ").");
34        else
35          back = listappend(back, k);
36        endif
37      endif
38    endfor
39    out.dest = iobj;
40    iobj.entrances = setadd(iobj.entrances, out);
41    to.entrances = setremove(to.entrances, out);
42    player:tell("Redirected ", out.name, " (", out, ") to go to ", iobj.name, " (", iobj, ").");
43    for k in (back)
44      k.source = iobj;
45      iobj.exits = setadd(iobj.exits, k);
46      to.exits = setremove(to.exits, k);
47      player:tell("Redirected ", k.name, " (", k, ") to come from ", iobj.name, " (", iobj, ").");
48    endfor
49  endif
50endif

set_respond_to

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

Source

1who = args[1];
2if ((typeof(this.respond_to) != LIST) || (length(this.respond_to) < 2))
3  this.respond_to = {{$nothing, 0}, {who, time()}};
4elseif (this.respond_to[2][1] == who)
5  this.respond_to = {this.respond_to[1], {who, time()}};
6else
7  this.respond_to = {this.respond_to[2], {who, time()}};
8endif

pose-old

Spec any any anyFlags rxdDefiner #7069

Referenced by

none

Source

1if (index(verb, ".") == 1)
2  text = (verb[2..length(verb)] + " ") + argstr;
3else
4  text = argstr;
5endif
6genders = {};
7people = setremove(this.location.contents, player);
8them = {this};
9c = 0;
10for k in ({"ps", "psc", "po", "poc", "pp", "ppc", "pr", "prc", "pq", "pqc"})
11  for z in (people)
12    if (index(text, this.(k)))
13      genders = listappend(genders, {z, k, length(z.(k))});
14    endif
15  endfor
16endfor
17for z in (people)
18  if (index(text, z.name))
19    them = listappend(them, z);
20    for k in (genders)
21      if (this.(k) == z.(k))
22        player:tell("Ambiguity: \"", this.(k), "\" refers to you or ", z.name, "?");
23      endif
24    endfor
25  endif
26endfor
27genders = $list_utils:sort_alist(genders, 3);
28for z in (people)
29  out = text;
30  if (z in them)
31    sub = {{(". " + z.name) + "'s", ". Your"}, {(".  " + z.name) + "'s", ".  Your"}, {("\"" + z.name) + "'s", "\"Your"}, {z.name + "'s", "your"}, {". " + z.name, ". You"}, {".  " + z.name, ".  You"}, {"\"" + z.name, "\" You"}, {z.name, "you"}};
32    for k in (genders)
33      if (z == k[1])
34        sub = listappend(sub, {z.k[2], $you.(k[2])});
35      endif
36    endfor
37    out = $string_utils:substitute(text, sub);
38    player:tell(z.name, " sees \"", player.name, " ", out, "\"");
39  else
40    out = text;
41  endif
42  z:tell(player.name, " ", out);
43endfor
44player:tell("You ", text);

verb_sub(old)

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1text = args[1];
2return $string_utils:alt_pronoun_sub($string_utils:substitute_delimited(text, this.verb_subs, 1), this);

sub_tell

Spec this none thisFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1";who:sub_tell([object,] args); where args are like those to tell()";
2if (!args)
3  this:tell();
4elseif (typeof(args[1]) == OBJ)
5  this:tell($string_utils:pronoun_sub(tostr(@listdelete(args, 1)), args[1]));
6else
7  this:tell($string_utils:pronoun_sub(tostr(@args), player));
8endif

@abort

Spec any any anyFlags rxdOwner #78Definer #7069

Referenced by

none

Source

1set_task_perms(valid(c = caller_perms()) ? c | player);
2if (argstr == "")
3  player:tell("Usage: @abort [<object>][:<verb>]  (aborts queued tasks.)");
4  return;
5elseif (y = index(argstr, ":"))
6  what = argstr[1..y - 1];
7  vrb = argstr[y + 1..length(argstr)];
8else
9  what = argstr;
10  vrb = "";
11endif
12n = (argstr == tostr(n = tonum(argstr))) ? n | -1;
13it = toobj(what);
14if (tostr(it) != what)
15  it = $nothing;
16endif
17c = 1;
18for y in (queued_tasks())
19  if (((((((what == "") || (valid(y[6]) && (index(y[6].name, what) == 1))) || (valid(y[9]) && (index(y[9].name, what) == 1))) || (y[9] == it)) || (y[6] == it)) && ((vrb == "") || (index(" " + strsub(y[7], "*", ""), " " + vrb) == 1))) || (y[1] == n))
20    player:tell("Killed ", y[1], "  (", y[9], ":", y[7], ")");
21    kill_task(y[1]);
22    c = 0;
23  endif
24endfor
25if (c)
26  this:tell("No such tasks in the queue.");
27endif

my_huh

Spec this none thisFlags rxOwner #78Definer #7069

Referenced by

Source

1permissions = (((caller == this) || $perm_utils:controls(caller_perms(), this)) && $command_utils:validate_feature(@args)) ? this | $no_one;
2if (ret = pass(@args))
3  return ret;
4elseif (!this.contents_huh)
5  return 0;
6endif
7verb = args[1];
8pass = args[2];
9what = $nothing;
10plist = {"any", prepstr ? $code_utils:full_prep(prepstr) | "none"};
11dlist = dobjstr ? {"any"} | {"none", "any"};
12ilist = iobjstr ? {"any"} | {"none", "any"};
13for fobj in (this.contents)
14  if (valid(loc = $object_utils:has_callable_verb(fobj, verb)[1]))
15    vargs = verb_args(loc, verb);
16    if ((vargs[2] in plist) && ((vargs[1] in dlist) && (vargs[3] in ilist)))
17      "if (this.notify_huh)";
18      "player:notify(tostr(\"Using \", what.name, \" (\", what, \")\"));";
19      "endif";
20      set_task_perms(permissions);
21      fobj:(verb)(@pass);
22      "Problem with verbs of the same name. If we use which=vrb in the loop instead, we have a problem with verbs that use the variable verb.";
23      return 1;
24    endif
25  endif
26  if ($command_utils:running_out_of_time())
27    player:tell("You're carrying too much stuff.  Parsing your command runs out of time at about ", fobj.name, " (", fobj, ").");
28    return 1;
29  endif
30endfor

receive_page

Spec this none thisFlags rxdOwner #2487Definer #7069

Referenced by

Source

1val = pass(@args);
2if (val)
3  "Page received if returned 1, refused if 0.";
4  this:set_respond_to(player);
5  notifies = (typeof(this.page_notify) == LIST) ? this.page_notify | setremove(setremove({@this:mail_notify(), @(typeof(this.mail_forward) == LIST) ? this.mail_forward | {}}, this), player);
6  if (length(notifies) > $mail_agent.max_mail_notify)
7    notifies = {};
8  endif
9  for who in (notifies)
10    is = $gender_utils:get_conj("is", player);
11    who:tell(player.name, " ", is, " paging ", this.name, ".");
12  endfor
13endif
14return val;

move_ok(old)

Spec this none thisFlags rxdOwner #2487Definer #7069

Referenced by

none

Source

1if ((!valid(args[1])) && (args[1] != $nothing))
2  return 0;
3elseif (this.sessile <= 0)
4  return 1;
5else
6  "We want to include the owner, but if we're in #-1, we want nothing.  So, we abuse list splicing.";
7  ok = {this, @valid(this.location) ? {this.location.owner} | {}, @this.move_ok};
8  by = listappend(callers(), {player, "", player});
9  n = 1;
10  exits = $object_utils:has_property(this.location, "exits") ? this.location.exits | {};
11  while (((y = by[n])[1] == this) && (y[2] == "moveto"))
12    n = n + 1;
13  endwhile
14  for k in (by[n + 1..length(by)])
15    if (k[3] in ok)
16      return 1;
17    elseif (!((k[3].wizard || (k[1] in exits)) || (k[3] in this.move_passers)))
18      return 0;
19    endif
20  endfor
21  return k[3].wizard || (player == this);
22endif

seek_arrive_msg seek_leave_msg seek_failed_msg

Spec this none thisDefiner #7069

Referenced by

none

Source

1return $string_utils:pronoun_sub((index(l = player.(verb), "%n") ? "" | "%n ") + l);

tell(expensive)

Spec this none thisFlags rxOwner #24442Definer #7069

Referenced by

none

Source

1pass(@args);
2if (this.inward_xmit && (((z = typeof(this.inward_xmit) == LIST) || (this.inward_xmit > 0)) || ($perm_utils:caller()[1] == this.location)))
3  callers = $list_utils:slice(callers());
4  for what in (this.contents)
5    if ((!(what in callers)) && ((!z) || (what in this.inward_xmit)))
6      what:tell(@args);
7    endif
8  endfor
9endif
10if (((((((player != this) && (caller in {this.location, this})) && (this.twitch_delay >= 0)) && (this.twitch_threshold > 0)) && (this in connected_players())) && ((idle = idle_seconds(this)) > this.twitch_threshold)) && ((time() - idle) > this.last_twitch))
11  text = tostr(@args);
12  for y in (listinsert(this.aliases, this.name))
13    if ($string_utils:index_delimited(text, y))
14      this.last_twitch = time();
15      fork (this.twitch_delay)
16        if (idle_seconds(this) > this.twitch_threshold)
17          this.location:announce_all(this.name, this:idle_msg());
18        endif
19      endfork
20      return;
21    endif
22  endfor
23endif

title(old)

Spec this none thisDefiner #7069

Referenced by

none

Source

1c = callers();
2while ((c != {}) && (c[1][1] in {this, $list_utils}))
3  c = listdelete(c, 1);
4endwhile
5if (((c == {}) || (c[1][2] != "tell_contents")) || ((msg = this:idle_suffix()) == ""))
6  return pass(@args);
7else
8  return ((pass(@args) + " (") + msg) + ")";
9endif

my_huh(old)

Spec this none thisFlags rdOwner #6349Definer #7069

Referenced by

none

Source

1if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
2  return E_PERM;
3endif
4verb = args[1];
5pass = args[2];
6what = $nothing;
7for y in (this.contents_huh ? $list_utils:remove_duplicates({@this.features, @this.contents}) | this.features)
8  "for y in ({@this.features, @this.contents_huh ? this.contents | {}})";
9  for v in [0..length(verbs(y)) - 1]
10    info = verb_info(y, vrb = tostr(v));
11    if (index(info[2], "x"))
12      s = info[3];
13      while (s)
14        if (nspace = index(s, " "))
15          ss = s[1..nspace - 1];
16          s = s[nspace + 1..length(s)];
17        else
18          nspace = 1 + length(s);
19          ss = s;
20          s = "";
21        endif
22        nast = index(ss, "*");
23        if (nast == (nspace - 1))
24          q = index(verb, ss[1..nast - 1]) == 1;
25        elseif (nast)
26          q = (index(verb, ss[1..nast - 1]) == 1) && (index(ss[1..nast - 1] + ss[nast + 1..nspace - 1], verb) == 1);
27        else
28          q = verb == ss;
29        endif
30        if (q)
31          template = verb_args(y, vrb);
32          if (((((template[2] == "any") || ((prepstr == "") && (template[2] == "none"))) || index(("/" + template[2]) + "/", ("/" + prepstr) + "/")) && ((template[1] == "any") || ((template[1] == "none") && (dobjstr == "")))) && ((template[3] == "any") || ((template[3] == "none") && (iobjstr == ""))))
33            if (valid(what))
34              player:tell("I'm sorry, that's ambiguous. That command might be executable by either ", what.name, " (", what, ") or ", y.name, " (", y, ").");
35              return 1;
36            else
37              s = "";
38              what = y;
39            endif
40          endif
41        endif
42      endwhile
43    endif
44  endfor
45endfor
46if (valid(what))
47  if (this.notify_huh)
48    player:tell("Using ", what.name, " (", what, ")");
49  endif
50  set_task_perms(this);
51  what:(verb)(@pass);
52  "Problem with verbs of the same name. If we use which=vrb in the loop instead, we have a problem with verbs that use the variable verb.";
53  return 1;
54endif

my_huh(oldold)

Spec this none thisFlags rdOwner #24442Definer #7069

Referenced by

none

Source

1if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
2  return E_PERM;
3endif
4verb = args[1];
5pass = args[2];
6what = $nothing;
7for y in (this.contents_huh ? $list_utils:remove_duplicates({@this.features, @this.contents}) | this.features)
8  "for y in ({@this.features, @this.contents_huh ? this.contents | {}})";
9  for v in [0..length(verbs(y)) - 1]
10    info = verb_info(y, vrb = tostr(v));
11    if (index(info[2], "x"))
12      s = info[3];
13      while (s)
14        if (nspace = index(s, " "))
15          ss = s[1..nspace - 1];
16          s = s[nspace + 1..length(s)];
17        else
18          nspace = 1 + length(s);
19          ss = s;
20          s = "";
21        endif
22        nast = index(ss, "*");
23        if (nast == (nspace - 1))
24          q = index(verb, ss[1..nast - 1]) == 1;
25        elseif (nast)
26          q = (index(verb, ss[1..nast - 1]) == 1) && (index(ss[1..nast - 1] + ss[nast + 1..nspace - 1], verb) == 1);
27        else
28          q = verb == ss;
29        endif
30        if (q)
31          template = verb_args(y, vrb);
32          if (((((template[2] == "any") || ((prepstr == "") && (template[2] == "none"))) || index(("/" + template[2]) + "/", ("/" + prepstr) + "/")) && ((template[1] == "any") || ((template[1] == "none") && (dobjstr == "")))) && ((template[3] == "any") || ((template[3] == "none") && (iobjstr == ""))))
33            if (valid(what))
34              player:tell("I'm sorry, that's ambiguous. That command might be executable by either ", what.name, " (", what, ") or ", y.name, " (", y, ").");
35              return 1;
36            else
37              s = "";
38              what = y;
39            endif
40          endif
41        endif
42      endwhile
43    endif
44  endfor
45endfor
46if (valid(what))
47  if (this.notify_huh)
48    player:tell("Using ", what.name, " (", what, ")");
49  endif
50  set_task_perms(this);
51  what:(verb)(@pass);
52  "Problem with verbs of the same name. If we use which=vrb in the loop instead, we have a problem with verbs that use the variable verb.";
53  return 1;
54endif

respond_to

Spec this none thisFlags rxOwner #78Definer #7069

Referenced by

Source

1"Who to respond to.";
2"Return:";
3"#-1 if no one to respond to.";
4"{OBJ, OBJ} if someone different has paged within the last 30 seconds.";
5"OBJ if unambiguous.";
6who = args[1];
7if ((caller == this) || $perm_utils:controls(caller_perms(), this))
8  if (!valid(r = this.respond_to[2][1]))
9    return #-1;
10  elseif ((time() - this.respond_to[1][2]) < 30)
11    return {r, this.respond_to[1][1]};
12  else
13    return r;
14  endif
15else
16  return E_PERM;
17endif

@db*size

Spec none none noneFlags rdOwner #2487Definer #7069

Referenced by

none

Source

1at_big_FO = #174;
2player:tell("You really didn't want to use the @dbsize command.  It would go through all the possible object numbers, from #0 to ", max_object(), ", taking about ", at_big_FO.last_run_time, " minutes, and calculate how many valid and invalid numbers there are.  Let's just say there are about 20,000 invalid numbers.  Now you know, and we didn't lag telling you.  :-)");

receive_page(old)

Spec this none thisFlags rxdOwner #2487Definer #7069

Referenced by

none

Source

1"Copied from Generic Player Class With Additional Features of Dubious Utility (#7069):receive_page by Nosredna (#2487) Tue Jun  6 22:46:39 1995 PDT";
2val = pass(@args);
3if (val)
4  "Page received if returned 1, refused if 0.";
5  this:set_respond_to(player);
6  for who in ((typeof(this.page_notify) == LIST) ? this.page_notify | setremove(setremove({@this.mail_notify, @this.mail_forward}, this), player))
7    who:tell(player.name, " is paging ", this.name, ".");
8  endfor
9endif
10return val;