View/Edit #12:@features

Switch to edit mode.

Name(s): @features
1:  "Usage:  @features [<name>] for <player>"
2:  "List the feature objects matching <name> used by <player>."
3:  if (!iobjstr)
4:    player:tell("Usage: @features [&lt;name&gt;] for &lt;player&gt;")
5:    return
6:  elseif ($command_utils:player_match_failed(whose = $string_utils:match_player(iobjstr), iobjstr))
7:    return
8:  endif
9:  features = {}
10: for feature in (whose.features)
11:   if (!valid(feature))
12:     `this:remove_feature(feature) ! ANY'
13:   elseif (!dobjstr || (dobjstr in feature.aliases || ((pref = $string_utils:find_prefix(dobjstr, feature.aliases)) || pref == $ambiguous_match)))
14:     features = listappend(features, feature)
15:   endif
16: endfor
17: if (features)
18:   len = max(length("Feature"), length(tostr(max_object()))) + 1
19:   player:tell($string_utils:left("Feature", len), "Name")
20:   player:tell($string_utils:left("-------", len), "----")
21:   for feature in (features)
22:     player:tell($string_utils:left(tostr(feature), len), feature.name)
23:   endfor
24:   player:tell($string_utils:left("-------", len), "----")
25:   cstr = tostr(length(features)) + " feature" + (length(features) > 1 ? "s" | "") + " found"
26:   if (whose != this)
27:     cstr = cstr + " on " + whose.name + " (" + tostr(whose) + ")"
28:   endif
29:   if (dobjstr)
30:     cstr = cstr + " matching \"" + dobjstr + "\""
31:   endif
32:   cstr = cstr + "."
33:   player:tell(cstr)
34: elseif (dobjstr)
35:   player:tell("No features found on ", whose.name, " (", whose, ") matching \"", dobjstr, "\".")
36: else
37:   player:tell("No features found on ", whose.name, " (", whose, ").")
38: endif
39: "Last modified by whiz (#3135) on Wed Feb  6 23:36:06 2002 MST."

Verb arguments: any for/about any
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

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