Generic Super_Huh Player #26026

Parent #33337Owner Flags Source rpg_march_2006/Dependencies/26026.txt

Aliases: Generic Super_Huh Player

13 verbs · 36 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
@known*_objects @known*-objectsany none nonerxd#260269
@rememberany none none#2602616
@forgetany none none#2602620
set_known_objectsthis none this#260265
my_huhthis none thisrx#2602664
known_objectthis none this#260263
known_objectsthis none this#2602616
@known*_objectsany for anyrxd#260260
match_environmentthis none thisrx#2602623
featuresthis none this#2602616
my_match_objectthis none thisrx#2602622
featurethis none this#260263
find_verbs_onthis none this#260261

Properties

PropertyDefinerFlagsOwnerValue
pets#26026rc{}
puppets#26026rc{}
known_objects#26026r{}
last_read_pc_news#260260
last_player_paged#26026not readable (E_PERM)
idle_watched#26026not readable (E_PERM)
crosspost_list#26026not readable (E_PERM)
spoof_attribution#26026" --"
idle_messages#26026not readable (E_PERM)
respond_to#26026not readable (E_PERM)
moved_by#26026{}
sessile#260260
witnessing#26026not readable (E_PERM)
rooms#26026{{"Living", #17}, {"Dining", #28}, {"Library", #1670}, {"Pool", #1428}}
messages_going#26026not readable (E_PERM)
mail_options#26026{"sticky", {"@mail", "new"}}
current_message#26026not readable (E_PERM)
messages#26026not readable (E_PERM)
features#26026{#55317, #30203, #40842, #26787}
previous_connection#26026not readable (E_PERM)
email_address#26026not readable (E_PERM)
help#26026#55502
linebuffer#26026not readable (E_PERM)
current_folder#26026not readable (E_PERM)
all_connect_places#26026not readable (E_PERM)
last_connect_place#26026not readable (E_PERM)
lines#26026not readable (E_PERM)
ownership_quota#26026not readable (E_PERM)
password#26026not readable (E_PERM)
size_quota#26026not readable (E_PERM)
last_password_time#26026not readable (E_PERM)
last_connect_attempt#26026not readable (E_PERM)
key#26026not readable (E_PERM)
aliases#26026{"Generic Super_Huh Player"}
description#26026
value (372 chars){"This player class essentially extends the parser through clever use of :my_huh. It allows you to @remember and @forget objects so you can refer to them even if they aren't in the room and you've forgotten the number; it also allows you to tell your puppets and pets (as listed in the .puppets and .pets properties) what to do with commands like \"Watson, come here\"."}
object_size#26026{12074, 1141286558}

Ancestry

Ancestors (nearest first): #33337 Politically Correct Featureful Player Class Created Because Nobody Would @Copy Verbs To 8855#8855 Player Class hacked with eval that does substitutions and assorted stuff#5803 Experimental Guinea Pig Class with Even More Features of Dubious Utility#7069 Generic Player Class With Additional Features of Dubious Utility

Children: #1359 Pragmaticter

Call graph

calls n26026_4 #26026:my_huh n7069_29 #7069:my_huh n26026_4->n7069_29 n26026_8 #26026:match_environment n26026_4->n26026_8 n26026_6 #26026:known_objects n26026_4->n26026_6 n26026_5 #26026:known_object n26026_8->n26026_5 n26026_10 #26026:my_match_object n26026_10->n26026_5

Source

@known*_objects @known*-objects

Spec any none noneFlags rxdDefiner #26026

Referenced by

none

Source

1"@known*_objects [<name>] for <player>";
2"List <player>'s known objects matching <name>.";
3who = $string_utils:match_player(iobjstr);
4if ((!$command_utils:player_match_failed(who, iobjstr)) && $Object_utils:has_verb(who, "@known_objects"))
5  player:tell("Checking known objects for ", who:title(), "...");
6  who:("@known_objects")();
7else
8  player:tell(who:titlec(), " doesn't remember things easily.");
9endif

@remember

Spec any none noneDefiner #26026

Referenced by

none

Source

1"Usage: @remember <object>";
2"Add an object to your .known_objects list.";
3if (player != this)
4  player:tell("I'm sorry, your memory isn't that good.");
5elseif (dobjstr)
6  if (!$command_utils:object_match_failed(dobj, dobjstr))
7    if (dobj in player.known_objects)
8      player:tell("You already know ", dobjstr, " (", dobj, ").");
9    else
10      player:set_known_objects(setadd(player.known_objects, dobj));
11      player:tell(dobj, " (", dobj.name, ") remembered.");
12    endif
13  endif
14else
15  player:tell("Usage:  @remember <object>");
16endif

@forget

Spec any none noneDefiner #26026

Referenced by

none

Source

1"Usage: @forget <object>";
2"Remove an object from your .known_objects list.";
3if (player != this)
4  player:tell("How can you forget what you never knew in the first place?");
5elseif (dobjstr)
6  known = player.known_objects;
7  if (!valid(dobj))
8    dobj = $string_utils:match(dobjstr, known, "name", known, "aliases");
9  endif
10  if (!$command_utils:object_match_failed(dobj, dobjstr))
11    if (dobj in player.known_objects)
12      player:set_known_objects(setremove(player.known_objects, dobj));
13      player:tell(dobj, " (", dobj.name, ") forgotten.");
14    else
15      player:tell("You can't forget ", dobjstr, " (", dobj, ") because you don't know it now.");
16    endif
17  endif
18else
19  player:tell("Usage:  @forget <object>");
20endif

set_known_objects

Spec this none thisDefiner #26026

Referenced by

none

Source

1"Set player.known_objects.";
2if (!($perm_utils:controls(caller_perms(), this) || (this == caller)))
3  return E_PERM;
4endif
5this.known_objects = args[1];

my_huh

Spec this none thisFlags rxOwner #24442Definer #26026

Referenced by

none

Source

1permissions = (((caller == this) || $perm_utils:controls(caller_perms(), this)) && $command_utils:validate_feature(@args)) ? this | $no_one;
2if (ret = pass(@args))
3  return ret;
4endif
5verb = args[1];
6pass = args[2];
7if (dobj == $failed_match)
8  dobj = this:match_environment(dobjstr);
9endif
10if (iobj = $failed_match)
11  iobj = this:match_environment(iobjstr);
12endif
13plist = {"any", prepstr ? $code_utils:full_prep(prepstr) | "none"};
14dlist = dobjstr ? {"any"} | {"none", "any"};
15ilist = iobjstr ? {"any"} | {"none", "any"};
16for y in ({@dobjstr ? this:known_objects(dobjstr) | {}, @iobjstr ? this:known_objects(iobjstr) | {}})
17  if (valid(loc = $object_utils:has_callable_verb(y, verb)[1]))
18    template = verb_args(loc, verb);
19    if ("this" in template)
20      dobj_match = 0;
21      if (template[1] == "this")
22        for alias in ({y.name, @y.aliases})
23          dobj_match = dobj_match || (index(alias, dobjstr) == 1);
24        endfor
25      endif
26      iobj_match = 0;
27      if (template[3] == "this")
28        for alias in ({y.name, @y.aliases})
29          iobj_match = iobj_match || (index(alias, iobjstr) == 1);
30        endfor
31      endif
32      if ((((template[1] in dlist) || dobj_match) && (template[2] in plist)) && ((template[3] in ilist) || iobj_match))
33        if (dobj_match)
34          dobj = y;
35        endif
36        if (iobj_match)
37          iobj = y;
38        endif
39        set_task_perms(permissions);
40        y:(verb)(@pass);
41        return 1;
42      endif
43    endif
44  endif
45endfor
46if (verb[length(verb)] == ",")
47  name = verb[1..length(verb) - 1];
48  puppet = $string_utils:match(name, this.puppets, "name", this.puppets, "aliases");
49  pet = $string_utils:match(name, this.pets, "name", this.pets, "aliases");
50  if (($ambiguous_match in {puppet, pet}) || (valid(puppet) && valid(pet)))
51    player:tell("I'm not sure which puppet or pet you're referring to.");
52  elseif (valid(puppet))
53    set_task_perms(permissions);
54    puppet:do(argstr);
55  elseif (valid(pet))
56    set_task_perms(permissions);
57    iobjstr = argstr;
58    argstr = (name + " to ") + iobjstr;
59    pet:ask(@$string_utils:words(argstr));
60  else
61    return 0;
62  endif
63  return 1;
64endif

known_object

Spec this none thisDefiner #26026

Referenced by

Source

1"known_object(name)";
2"Match name against this.known_objects' aliases, return object, $nothing, $ambigous_match, or $failed_match as per $string_utils:match or the parser.";
3return $string_utils:match(args[1], this.known_objects, "aliases");

known_objects

Spec this none thisDefiner #26026

Referenced by

Source

1"known_objects(name)";
2"Match name against this.known_objects aliases; return a list of those objects which match.";
3"If !name, return the whole list.";
4name = args[1];
5if (!name)
6  return this.known_objects;
7endif
8matches = {};
9for object in (this.known_objects)
10  if (!valid(object))
11    this.known_objects = setremove(this.known_objects, object);
12  elseif ((name in object.aliases) || ($string_utils:find_prefix(name, object.aliases) != 0))
13    matches = {@matches, object};
14  endif
15endfor
16return matches;

@known*_objects

Spec any for anyFlags rxdDefiner #26026

Referenced by

none

Source

No program (verb defined but unprogrammed).

match_environment

Spec this none thisFlags rxDefiner #26026

Referenced by

Source

1"Match something around the player.";
2match = args[1];
3mo = valid(this.location) ? this.location:match_object(match) | $string_utils:match_object(match, this.location);
4if (mo != $failed_match)
5  return mo;
6else
7  return this:known_object(match);
8endif
9ko = this:known_object(match);
10if ($ambiguous_match in {mo, ko})
11  return $ambiguous_match;
12endif
13if (valid(mo))
14  if (valid(ko))
15    return $ambiguous_match;
16  else
17    return mo;
18  endif
19endif
20if (valid(ko))
21  return ko;
22endif
23return $failed_match;

features

Spec this none thisDefiner #26026

Referenced by

none

Source

1"features(name)";
2"Match name against this.features aliases; return a list of those objects which match.";
3"If !name, return the whole list.";
4name = args[1];
5if (!name)
6  return this.features;
7endif
8matches = {};
9for object in (this.features)
10  if (!valid(object))
11    this.features = setremove(this.features, object);
12  elseif ((name in object.aliases) || ($string_utils:find_prefix(name, object.aliases) != 0))
13    matches = {@matches, object};
14  endif
15endfor
16return matches;

my_match_object

Spec this none thisFlags rxDefiner #26026

Referenced by

none

Source

1"my_match_object(string[, location])";
2mo = $string_utils:match_object(@{@args, this.location}[1..2], this);
3if (mo != $failed_match)
4  return mo;
5else
6  return this:known_object(args[1]);
7endif
8ko = this:known_object(args[1]);
9if ($ambiguous_match in {mo, ko})
10  return $ambiguous_match;
11endif
12if (valid(mo))
13  if (valid(ko))
14    return $ambiguous_match;
15  else
16    return mo;
17  endif
18endif
19if (valid(ko))
20  return ko;
21endif
22return $failed_match;

feature

Spec this none thisDefiner #26026

Referenced by

none

Source

1"feature(name)";
2"Match name against this.features' aliases, return object, $nothing, $ambigous_match, or $failed_match as per $string_utils:match or the parser.";
3return $string_utils:match(args[1], this.features, "aliases");

find_verbs_on

Spec this none thisDefiner #26026

Referenced by

none

Source

1return {@pass(@args), @this.known_objects};