Generic Puppet #7680

Parent Owner Flags Source rpg_march_2006/Dependencies/7680.txt

Aliases: Generic Puppet

28 verbs · 18 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
com*mandthis to anyrxd#768017
mon*itorthis none nonerxd#768011
ign*orethis none nonerxd#76809
tellthis none this#76802
movetothis none this#768013
wh*isperany to thisrxd#76802
acceptablethis none this#76802
look_selfthis none this#768017
sweep_msgthis none this#76803
monitor_ok command_okthis none this#76802
idle_timethis none this#76807
seekany none nonerxd#76801
tell2this none thisrx#768021
is_listeningthis none thisrxd#76806
linelenthis none this#76802
i inv*entorynone none nonerxd#768021
parse_commandthis none this#76804
call_as_puppetthis none thisrxd#768012
add_monitorthis none this#76809
remove_monitorthis none this#76807
my_match_objectthis none this#76803
my_match_recipientthis none this#76801
dothis none thisrxd#768044
find_verbthis none this#768015
initializethis none thisrxd#768013
callthis none thisrxd#76808
is_homethis none this#76807
enterfunc exitfuncthis none this#76801

Properties

PropertyDefinerFlagsOwnerValue
seek_failed_msg#7680rc"%n bounces off a topographical barrier, and into the room."
seek_arrive_msg#7680rc"%n arrives, of necessity by an ugly method."
seek_leave_msg#7680rc"%n leaves, of necessity by an ugly method."
home2#7680rc#11
home#7680rc#1138
brief#7680rc0
debug#7680rc0
simulating#7680rc1
command_ok#7680rc{}
listen_actions#7680not readable (E_PERM)
monitor_ok#7680rc{}
echo_prefix_msg#7680rc" (%n) "
tell_forward#7680r{}
linelen#7680rc79
feature_pc#7680rc#7069
key#7680not readable (E_PERM)
aliases#7680{"Generic Puppet"}
object_size#7680{18040, 1141286558}

Ancestry

Ancestors (nearest first): none

Children: #259 generic monster

Call graph

calls n7680_0 #7680:com*mand n7680_9 #7680:monitor_ok n7680_0->n7680_9 n7680_22 #7680:do n7680_0->n7680_22 n7680_22->n7680_9 n7680_3 #7680:tell n7680_22->n7680_3 n7680_17 #7680:call_as_puppet n7680_22->n7680_17 n7680_16 #7680:parse_command n7680_22->n7680_16 n7680_23 #7680:find_verb n7680_22->n7680_23 n7680_1 #7680:mon*itor n7680_1->n7680_9 n7680_18 #7680:add_monitor n7680_1->n7680_18 n7680_1->n7680_3 n7680_12 #7680:tell2 n7680_3->n7680_12 n7680_2 #7680:ign*ore n7680_2->n7680_3 n7680_19 #7680:remove_monitor n7680_2->n7680_19 n7680_12->n7680_22 n7680_4 #7680:moveto n7680_4->n7680_17 n7680_25 #7680:call n7680_17->n7680_25 n7680_5 #7680:wh*isper n7680_5->n7680_3 n7680_7 #7680:look_self n7680_10 #7680:idle_time n7680_7->n7680_10 n7680_15 #7680:i n7680_15->n7680_3

Source

com*mand

Spec this to anyFlags rxdOwner #78Definer #7680

Referenced by

none

Source

1"command <puppet> to <cmdline>";
2"Command the puppet to `do' the given command line, processing it as if it were a command issued by a player.";
3"who = (callers() && (caller != this)) ? caller_perms() | player;";
4who = callers() ? caller_perms() | player;
5set_task_perms(who);
6if (this:command_ok(who))
7  text = substitute("%1", $sysobj:match(argstr, ("%<" + prepstr) + "%> *%(.+%)$"));
8  if (text)
9    who:tell("You transmit the command \"", text, "\" to ", this.name, ".");
10    this:do(text);
11  else
12    who:tell("Transmit what to ", this.name, "?");
13  endif
14else
15  who:tell($string_utils:pronoun_sub("%n %<ignores> your command.", this));
16  return E_PERM;
17endif

mon*itor

Spec this none noneFlags rxdDefiner #7680

Referenced by

none

Source

1"mon*itor <puppet>";
2"Have everything heard by the puppet relayed back to you.";
3who = (callers() && (caller != this)) ? caller_perms() | player;
4if (this:monitor_ok(who))
5  this:add_monitor(who);
6  this:tell(who.name, " starts monitoring.");
7else
8  who:tell($string_utils:pronoun_sub("%n %<doesn't> want you monitoring %o.", this));
9  this:tell($string_utils:nn(who), " is refused permission to monitor.");
10  return E_PERM;
11endif

ign*ore

Spec this none noneFlags rxdDefiner #7680

Referenced by

none

Source

1"ignore <puppet>";
2"Stop monitoring the puppet.";
3who = (callers() && (caller != this)) ? caller_perms() | player;
4if (who in this.tell_forward)
5  this:tell(who.name, " stops monitoring.");
6  this:remove_monitor(who);
7else
8  who:tell("You aren't listening to ", this.name, ".");
9endif

tell

Spec this none thisDefiner #7680

Referenced by

Source

1pass(@args);
2this:tell2(@args);

moveto

Spec this none thisDefiner #7680

Referenced by

Source

1"Do a fake :look_self check with the puppet as `player'.";
2{dest} = args;
3old = this.location;
4if ((this == $local.puppet) && ((old == this.home) || (dest != this.home)))
5  return E_PERM;
6endif
7pass(dest);
8where = this.location;
9if ((this.tell_forward && (where != old)) && valid(where))
10  this:call_as_puppet(where, "look_self", {this.brief});
11endif
12"Quinn 09-DEC-93 0223: Added call_as_puppet line to prevent weird spoofs.";
13"THX (#105941) - Thu Dec 14, 2000 - Put in a check for $local.puppet so it doesn't get moved willy-nilly.";

wh*isper

Spec any to thisFlags rxdDefiner #7680

Referenced by

none

Source

1this:tell(player.name, " whispers, \"", dobjstr, "\"");
2player:tell("You whisper, \"", dobjstr, "\" to ", this.name, ".");

acceptable

Spec this none thisDefiner #7680

Referenced by

none

Source

1{what} = args;
2return !is_player(what);

look_self

Spec this none thisDefiner #7680

Referenced by

Source

1pass(@args);
2if (this.simulating)
3  if ((time = this:idle_time()) == 999999999)
4    player:tell($string_utils:pronoun_sub("%S %<is> sleeping.", this));
5  elseif (time < 120)
6    player:tell($string_utils:pronoun_sub("%S %<is> awake and %<looks> alert.", this));
7  else
8    time = $string_utils:from_seconds(time);
9    player:tell($string_utils:pronoun_sub(("%S %<is> awake, but %<has> been %<staring off into space> for " + time) + ".", this));
10  endif
11  if (this.contents)
12    player:tell("Carrying:");
13    for thing in (this.contents)
14      player:tell("  ", thing:title());
15    endfor
16  endif
17endif

sweep_msg

Spec this none thisDefiner #7680

Referenced by

none

Source

1if (y = setremove(this.tell_forward, player))
2  return "is listening for " + $string_utils:nn_list(y);
3endif

monitor_ok command_ok

Spec this none thisDefiner #7680

Referenced by

Source

1{who} = args;
2return who in {this.owner, $code_utils:verb_loc().owner, @this.(verb)};

idle_time

Spec this none thisDefiner #7680

Referenced by

Source

1time = 999999999;
2for who in (setadd((typeof(y = this.command_ok) == LIST) ? y | {}, this.owner))
3  if (((who in connected_players()) && ((who in this.tell_forward) || (who.location == this.location))) && (time > (y = idle_seconds(who))))
4    time = y;
5  endif
6endfor
7return time;

seek

Spec any none noneFlags rxdDefiner #7680

Referenced by

none

Source

1return this.feature_pc:(verb)(@args);

tell2

Spec this none thisFlags rxOwner #49853Definer #7680

Referenced by

Source

1if (typeof(set_task_perms(this.owner)) == ERR)
2  return E_PERM;
3endif
4for q in (this.tell_forward)
5  q:tell($string_utils:pronoun_sub(this.echo_prefix_msg, this), @args);
6endfor
7text = tostr(@args);
8for q in (this.listen_actions)
9  if (y = $string_utils:match_string(text, q[1]))
10    fork (0)
11      comm = q[2][random(length(q[2]))];
12      if (typeof(y) == LIST)
13        for w in (y)
14          comm = strsub(comm, "%" + tostr(w in y), w);
15        endfor
16      endif
17      this:do(comm, @q[3..length(q)]);
18      return;
19    endfork
20  endif
21endfor

is_listening

Spec this none thisFlags rxdOwner #49853Definer #7680

Referenced by

none

Source

1for x in (this.tell_forward)
2  if (x:is_listening())
3    return 1;
4  endif
5endfor
6return 0;

linelen

Spec this none thisDefiner #7680

Referenced by

none

Source

1"Copied from generic player (#6):linelen by Hacker (#18105) Fri Oct 30 15:50:47 1992 PST";
2return abs(this.linelen);

i inv*entory

Spec none none noneFlags rxdDefiner #7680

Referenced by

none

Source

1"originally from $player:inv";
2if (this.contents)
3  c = this.contents;
4  longear = {};
5  gear = {};
6  width = player:linelen();
7  half = width / 2;
8  player:tell("Carrying:");
9  for thing in (c)
10    cx = tostr(" ", thing:title());
11    if (length(cx) > half)
12      longear = {@longear, cx};
13    else
14      gear = {@gear, cx};
15    endif
16  endfor
17  this:tell_lines($string_utils:columnize(gear, 2, width));
18  this:tell_lines(longear);
19else
20  this:tell("You are empty-handed.");
21endif

parse_command

Spec this none thisDefiner #7680

Referenced by

Source

1":parse_command(cmdline-string) Pass to $string_utils by default.";
2$local.rpg:s_i_n(0);
3return $string_utils:parse_command(@args);
4"THX (#105941) - Wed Dec 20, 2000 - Stuffed a suspend check in 'ere.";

call_as_puppet

Spec this none thisFlags rxdOwner #2487Definer #7680

Referenced by

Source

1"-- WIZARDLY --";
2":call_as_puppet(object, verbname, args)";
3"Calls the given verb, after setting 'player' to this 'puppet'.";
4if ((caller == this) || $perm_utils:controls(caller_perms(), this))
5  actual = player;
6  player = this;
7  result = this:call(this, @args);
8  player = actual;
9  return result;
10else
11  return E_PERM;
12endif

add_monitor

Spec this none thisDefiner #7680

Referenced by

Source

1":add_monitor(who)";
2if ((caller == this) || $perm_utils:controls(caller_perms(), this))
3  {who} = args;
4  if (who != this)
5    return this.tell_forward = setadd(this.tell_forward, who);
6  endif
7else
8  return E_PERM;
9endif

remove_monitor

Spec this none thisDefiner #7680

Referenced by

Source

1":remove_monitor(who)";
2if ((caller == this) || $perm_utils:controls(caller_perms(), this))
3  {who} = args;
4  return this.tell_forward = setremove(this.tell_forward, who);
5else
6  return E_PERM;
7endif

my_match_object

Spec this none thisDefiner #7680

Referenced by

none

Source

1"Copied from generic player (#6):my_match_object by ur-Rog (#6349) Mon May  5 16:29:14 1997 PDT";
2":my_match_object(string [,location])";
3return $string_utils:match_object(@{@args, this.location}[1..2], this);

my_match_recipient

Spec this none thisDefiner #7680

Referenced by

none

Source

1return $failed_match;

do

Spec this none thisFlags rxdOwner #49853Definer #7680

Referenced by

Source

1if (this:command_ok(cp = caller_perms()) || (caller == this))
2  who = cp.wizard ? player | cp;
3  {text, @now} = args;
4  brev = {"\"", ":", ";", "?"};
5  rep = {"say ", "emote ", "eval", "help"};
6  if (indx = `text[1] ! E_RANGE => " "' in brev)
7    text = rep[indx] + text[2..$];
8  endif
9  if ((y = this:parse_command(text, this)) && valid(this.location))
10    player = this;
11    {verb, d, p, i, a, s} = y;
12    {dobj, dobjstr} = d;
13    {prep, prepstr} = p;
14    {iobj, iobjstr} = i;
15    {args, argstr} = a;
16    verbargs = {s, {dobj, prep, iobj}};
17    if (this:find_verb(player, verb, @verbargs))
18      "this:call(who, player, verb, args, @now);";
19      this:call_as_puppet(player, verb, args, @now);
20    elseif (this:find_verb(player.location, verb, @verbargs))
21      "this:call(who, player.location, verb, args, @now);";
22      this:call_as_puppet(player.location, verb, args, @now);
23    elseif (this:find_verb(dobj, verb, @verbargs))
24      "this:call(who, dobj, verb, args, @now);";
25      this:call_as_puppet(dobj, verb, args, @now);
26    elseif (this:find_verb(iobj, verb, @verbargs))
27      "this:call(who, iobj, verb, args, @now);";
28      this:call_as_puppet(iobj, verb, args, @now);
29    else
30      "Comment out for now; should replace with correct huh sequence.";
31      "this:call_as_puppet(who, player.location, \"huh2\", {verb, args}, @now)";
32      "... Rog suggests:";
33      "this:call(who, $command_utils, \"do_huh\", {verb, args}, @now);";
34      "Recent change as per 6178-6182 on *wiz Ho_Yan 8/23/99. And above lines too.";
35      this:call_as_puppet($command_utils, "do_huh", {verb, args}, @now);
36    endif
37  else
38    "1/15/96, Heathcliff";
39    this:tell("I don't understand that.");
40  endif
41else
42  return E_PERM;
43endif
44"Mooshie (#106469) - Sat Dec 27, 1997 - Sped up, 1.8.0 conventions, etc.";

find_verb

Spec this none thisDefiner #7680

Referenced by

Source

1{where, vrb, match, split, @rest} = args;
2if (valid(where) && (def = $object_utils:has_verb(where, vrb)))
3  {def} = def;
4  if (`{first, second, third} = `verb_args(def, vrb) ! E_PERM' ! E_TYPE' in {{"this", "none", "this"}, E_TYPE})
5    return 0;
6    "make sure to exclude this none this verbs";
7  endif
8  {ds, ps, is} = match;
9  {do, pn, io} = split;
10  {owner, perms, name} = verb_info(def, vrb);
11  return index(perms, "x") && (((((first == "this") && (where == do)) || (first in ds)) || (second in ps)) && (((third == "this") && (where == io)) || (third in is)));
12endif
13return 0;
14"Mooshie (#106469) - Wed Jan 21, 1998 - Complete overhaul. That was a bit too much indexing for my liking.";
15"Profane (#30788) - Fri Oct 19, 2001 - Trap for !r verbs";

initialize

Spec this none thisFlags rxdOwner #49853Definer #7680

Referenced by

Source

1if ((caller == this) || $perm_utils:controls(caller_perms(), this))
2  "Grump 6/22/93: took out #24222.puppets initialization -- what was it here for?";
3  this.home = this.owner.home;
4  this.debug = 0;
5  this.command_ok = {};
6  this.listen_actions = {};
7  this.monitor_ok = {};
8  this.tell_forward = {};
9  pass(@args);
10else
11  return E_PERM;
12endif
13"Mooshie (#106469) - Thu Jan 22, 1998 - Updated the security a bit and moved the pass() call *inside* the security, where we want it.";

call

Spec this none thisFlags rxdOwner #49853Definer #7680

Referenced by

Source

1if (caller_perms().wizard)
2  {who, what, vrb, pass, @rest} = args;
3  set_task_perms(who.wizard ? $no_one | who);
4  return what:(vrb)(@pass);
5else
6  return E_PERM;
7endif
8"Mooshie (#106469) - Thu Jan 22, 1998 - New version.";

is_home

Spec this none thisDefiner #7680

Referenced by

none

Source

1":is_home() => 1 or 0";
2{home, loc} = {this.home, this.location};
3home = (typeof(home) == OBJ) ? home | loc;
4if ((loc == home) || (loc == `home.dest ! E_PROPNF, E_INVIND => loc'))
5  return 1;
6endif
7return 0;

enterfunc exitfunc

Spec this none thisDefiner #7680

Referenced by

none

Source

1return 1;