Second Character Registry (#319)(an instance of Generic Feature Object made by Dredful)     The repository of all second character information for Dhalgren. Usable only by wizards and trusted players. Go to location of this object, Features Feature Object. VERB SOURCE CODE: is_second_char:
if (!this:trust(caller_perms()))
return E_PERM;
endif
who = args[1];
for set in (this.seconds)
if (who in set)
return 1;
endif
endfor
return 0;
.
all_second_chars other_chars:
if (!this:trust(caller_perms()))
return E_PERM;
endif
who = args[1];
for set in (this.seconds)
if (who in set)
return (verb == "other_chars") ? setremove(set, who) | set;
endif
endfor
return {};
.
trust: return (player.wizard || (player in this.trust)) || (args[1] in this.trust); . feature_ok: return args[1].wizard || (args[1] in this.trust); . @second: "Usage: @second char_index:
if (!this:trust(player))
return E_PERM;
endif
who = args[1];
for ind in [1..length(this.seconds)]
if (who in this.seconds[ind])
return ind;
endif
endfor
return 0;
.
@unsecond: "Usage: @unsecond @seconds:
"Usage: @seconds [player]";
"";
"Usable only by wizards or trusted players. If [player] is given, then returns all
second characters, if player has any, of that player. If no argument is given, lists
all groups of second characters.";
if (!this:trust(player))
return E_PERM;
endif
if (dobjstr)
who = $string_utils:match_player(dobjstr);
if (!$command_utils:player_match_failed(who, dobjstr))
if (set = this:all_second_chars(who))
player:tell("Registered: ", $string_utils:nanl(set));
else
player:tell($string_utils:nn(who), " has no other characters according
to this object.");
endif
endif
else
player:tell("Full registrations:");
for set in (this.seconds)
player:tell($string_utils:nanl(set));
endfor
player:tell("-- Finished");
endif
.
unsecond_char:
if (!this:trust(caller_perms()))
return E_PERM;
endif
one = args[1];
two = args[2];
if (!(one in this.seconds[ind = this:char_index(two)]))
player:tell($string_utils:nn(one), " is not registered to ", $string_utils:nn(two));
else
if (length(this.seconds[ind]) == 2)
this.seconds = listdelete(this.seconds, ind);
player:tell("Removed ", $string_utils:nn(one), " from the association. Full
registration is now: ", $string_utils:nanl(this.seconds[ind]));
else
this.seconds[ind] = setremove(this.seconds[ind], one);
player:tell("Removed association involving ", $string_utils:nanl({one, two}),
".");
endif
endif
.
PROPERTY DATA:       trust       seconds |