View/Edit #12:@listen @unlisten

Switch to edit mode.

Name(s): @listen @unlisten
1:  if (player != this)
2:    return $msg:mtell("huh")
3:  endif
4:  if (verb == "@listen")
5:    dobj = $su:match_player(dobjstr)
6:    if (!valid(dobj))
7:      return player:tell("Whom?")
8:    elseif (player:isa($mentor) && (parent(dobj) == $player || dobj:isa($guest)))
9:      "Mentor"
10:     $wiz_utils:mentor_alert(tostr($su:nn(player), " has started spying on ", $su:nn(dobj)))
11:   elseif (!this:controls(dobj) && !`dobj.allow_listen[1] ! ANY' && !this:isa($guardian))
12:     return this:sub_tell("You don't control %d and they don't seem to want you to listen.")
13:   elseif (!dobj:connected())
14:     return player:tell(dobj:title(), " isn't connected.")
15:   elseif (dobj == this)
16:     return player:tell("Don't be an idiot and listen to yourself.")
17:   endif
18:   "Wizzen-alert >"
19:   if (this:isa($guardian))
20:     $wiz_utils:guard_alert(tostr($su:nn(player), " has started spying on ", $su:nn(dobj)))
21:   endif
22:   "< Wizzen-alert"
23:   if (dobj:isa($guardian))
24:     dobj:sub_tell("You hear a quiet popping sound as %n starts spying on you.")
25:   elseif (!this:isa($guardian))
26:     dobj:sub_tell("You hear a quiet popping sound as %n (a %1) starts spying on you.", $code_utils:classify_object(this))
27:     dobj:sub_tell("Type @disallow-listen if you don't want this.")
28:     if (!`dobj.allow_listen[1] ! ANY => 1')
29:       dobj.allow_listen = {0, -1}
30:       suspend(8)
31:       if (!dobj.allow_listen[1] && !dobj.allow_listen[2])
32:         return this:tell("Spying rejected!")
33:       endif
34:     endif
35:   endif
36:   this.last_spied = dobj
37:   dobj.spied = listappend(dobj.spied, this)
38:   player:tell("Spying in progress...")
39: else
40:   dobjstr = !dobjstr ? "all" | dobjstr
41:   if (dobjstr == "all")
42:     unlisten = players()
43:   else
44:     if (!valid(dobj = $su:match_player(dobjstr)))
45:       return player:tell("Who is that?")
46:     endif
47:     unlisten = {dobj}
48:   endif
49:   for x in (unlisten)
50:     if (`this in x.spied ! ANY')
51:       x.spied = setremove(x.spied, this)
52:       if (x:isa($guardian) || !this:isa($guardian))
53:         x:sub_tell("You hear a quiet popping sound as %n stops spying on you.")
54:       endif
55:       "Wizzen-alert >"
56:       if (this:isa($guardian))
57:         $wiz_utils:guard_alert(tostr($su:nn(player), " has stopped spying on ", $su:nn(x)))
58:       endif
59:       "< Wizzen-alert"
60:       if (this:isa($mentor))
61:         $wiz_utils:mentor_alert(tostr($su:nn(player), " has stopped spying on ", $su:nn(x)))
62:       endif
63:     endif
64:   endfor
65:   return player:tell(dobjstr == "all" ? "All spying stopped." | "You stop spying on " + unlisten[1].name + ".")
66: endif
67: "Last modified by Dax (#789) on Sun Aug 11 15:18:38 2002 MDT."

Verb arguments: any none none
Verb perms: Readable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]