Generic Puppet #7680
Aliases: Generic Puppet
28 verbs · 18 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
com*mand | this to any | rxd | #7680 | 17 |
mon*itor | this none none | rxd | #7680 | 11 |
ign*ore | this none none | rxd | #7680 | 9 |
tell | this none this | | #7680 | 2 |
moveto | this none this | | #7680 | 13 |
wh*isper | any to this | rxd | #7680 | 2 |
acceptable | this none this | | #7680 | 2 |
look_self | this none this | | #7680 | 17 |
sweep_msg | this none this | | #7680 | 3 |
monitor_ok command_ok | this none this | | #7680 | 2 |
idle_time | this none this | | #7680 | 7 |
seek | any none none | rxd | #7680 | 1 |
tell2 | this none this | rx | #7680 | 21 |
is_listening | this none this | rxd | #7680 | 6 |
linelen | this none this | | #7680 | 2 |
i inv*entory | none none none | rxd | #7680 | 21 |
parse_command | this none this | | #7680 | 4 |
call_as_puppet | this none this | rxd | #7680 | 12 |
add_monitor | this none this | | #7680 | 9 |
remove_monitor | this none this | | #7680 | 7 |
my_match_object | this none this | | #7680 | 3 |
my_match_recipient | this none this | | #7680 | 1 |
do | this none this | rxd | #7680 | 44 |
find_verb | this none this | | #7680 | 15 |
initialize | this none this | rxd | #7680 | 13 |
call | this none this | rxd | #7680 | 8 |
is_home | this none this | | #7680 | 7 |
enterfunc exitfunc | this none this | | #7680 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
seek_failed_msg | #7680 | rc | — | "%n bounces off a topographical barrier, and into the room." |
seek_arrive_msg | #7680 | rc | — | "%n arrives, of necessity by an ugly method." |
seek_leave_msg | #7680 | rc | — | "%n leaves, of necessity by an ugly method." |
home2 | #7680 | rc | — | #11 |
home | #7680 | rc | — | #1138 |
brief | #7680 | rc | — | 0 |
debug | #7680 | rc | — | 0 |
simulating | #7680 | rc | — | 1 |
command_ok | #7680 | rc | — | {} |
listen_actions | #7680 | | — | not readable (E_PERM) |
monitor_ok | #7680 | rc | — | {} |
echo_prefix_msg | #7680 | rc | — | " (%n) " |
tell_forward | #7680 | r | — | {} |
linelen | #7680 | rc | — | 79 |
feature_pc | #7680 | rc | — | #7069 |
key | #7680 | | — | not readable (E_PERM) |
aliases | #7680 | | — | {"Generic Puppet"} |
object_size | #7680 | | — | {18040, 1141286558} |
Ancestry
Ancestors (nearest first): none
Children: #259 generic monster
Call graph
Source
com*mand
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
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
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
Referenced by
- #7680:mon*itor line 6:
this:tell - #7680:mon*itor line 9:
this:tell - #7680:ign*ore line 5:
this:tell - #7680:wh*isper line 1:
this:tell - #7680:i line 20:
this:tell - #7680:do line 39:
this:tell
Source
1pass(@args); 2this:tell2(@args);
moveto
Referenced by
- #259:moveto line 7:
pass(
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
Referenced by
none
Source
1this:tell(player.name, " whispers, \"", dobjstr, "\""); 2player:tell("You whisper, \"", dobjstr, "\" to ", this.name, ".");
acceptable
Referenced by
none
Source
1{what} = args; 2return !is_player(what);
look_self
Referenced by
- #259:look_self line 1:
pass(
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
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
Referenced by
- #259:hidden_verbs line 16:
this:command_ok - #259:hidden_verbs line 19:
this:monitor_ok - #7680:com*mand line 6:
this:command_ok - #7680:mon*itor line 4:
this:monitor_ok - #7680:do line 1:
this:command_ok
Source
1{who} = args; 2return who in {this.owner, $code_utils:verb_loc().owner, @this.(verb)};
idle_time
Referenced by
- #7680:look_self line 3:
this:idle_time
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
Referenced by
none
Source
1return this.feature_pc:(verb)(@args);
tell2
Referenced by
- #7680:tell line 2:
this:tell2
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
Referenced by
none
Source
1for x in (this.tell_forward) 2 if (x:is_listening()) 3 return 1; 4 endif 5endfor 6return 0;
linelen
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
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
Referenced by
- #7680:do line 9:
this:parse_command
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
Referenced by
- #7680:moveto line 10:
this:call_as_puppet - #7680:do line 19:
this:call_as_puppet - #7680:do line 22:
this:call_as_puppet - #7680:do line 25:
this:call_as_puppet - #7680:do line 28:
this:call_as_puppet - #7680:do line 35:
this:call_as_puppet
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
Referenced by
- #7680:mon*itor line 5:
this:add_monitor
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
Referenced by
- #7680:ign*ore line 6:
this:remove_monitor
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
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
Referenced by
none
Source
1return $failed_match;
do
Referenced by
- #259:do_follow line 5:
this:do - #259:choose_weaponry line 24:
this:do - #259:choose_weaponry line 27:
this:do - #7680:com*mand line 10:
this:do - #7680:tell2 line 17:
this:do
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
Referenced by
- #7680:do line 17:
this:find_verb - #7680:do line 20:
this:find_verb - #7680:do line 23:
this:find_verb - #7680:do line 26:
this:find_verb
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
Referenced by
- #259:initialize line 13:
pass(
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
Referenced by
- #7680:call_as_puppet line 7:
this:call
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
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
Referenced by
none
Source
1return 1;