View/Edit #2030:exit_list

Switch to edit mode.

Name(s): exit_list
1:  "Prints out a list of exits from the room outside the vehicle."
2:  "Args[1] is 0 for DB entrance search, 1 for DB exit search, and 2 for obvious exits.  Args[2] is where."
3:  {mode, here} = args
4:  if (!valid(here))
5:    return "There are neither entrances nor exits to or from #-1."
6:  elseif (mode == 2 && !here:isa($room))
7:    mode = 1
8:  endif
9:  if (mode == 2)
10:   exits = here:exits()
11: else
12:   player:sub_tell("Scanning database...")
13:   exits = {}
14:   for exit in ($object_utils:descendants_suspended($exit))
15:     if (exit.(mode ? "location" | "dest") == here)
16:       exits = {@exits, exit}
17:     endif
18:     $command_utils:suspend_if_needed()
19:   endfor
20: endif
21: text = {}
22: for exit in (exits)
23:   if (valid(exit.location) && valid(exit.dest))
24:     far_end = mode ? exit.dest | exit.location
25:     text = {@text, "  " + (exit:title() + " (" + tostr(exit) + ") ") + (mode ? "to " | "from ") + (far_end:title() + " (" + tostr(far_end) + ") ")}
26:   endif
27: endfor
28: intro = $string_utils:substitute({{"entrances to *.", "The only entrance to * is:", "The entrances to * are:"}, {"exits from *.", "The only exit from * is:", "The exits from * are:"}, {"obvious exits from *.", "The only obvious exit from * is:", "The obvious exits from * are:"}}[mode + 1][min(length(text), 2) + 1], {{"*", here:title()}})
29: return text ? {intro, @text} | "There are no " + intro
30: "Last modified by Dax (#789) on Mon May 17 04:15:41 1999 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Odo (#987)

You are not logged in.

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