Frand's administrator class #90
Aliases: Frand's administrator class, Frand's player class, player class
74 verbs · 118 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
@rooms | none none none | rxd | #90 | 6 |
names_of | this none this | rxd | #90 | 2 |
@go | any none none | rxd | #90 | 10 |
lookup_room | this none this | rxd | #90 | 23 |
teleport | this none this | rxd | #90 | 37 |
teleport_messages | this none this | rxd | #90 | 18 |
@move | any any any | rxd | #90 | 27 |
index_room | this none this | rxd | #90 | 15 |
@addr*oom | any none none | rxd | #90 | 23 |
@rmr*oom | any none none | rxd | #90 | 14 |
@join | any none none | rxd | #90 | 36 |
@find | any none none | rxd | #90 | 25 |
find_verb | this none this | rxd | #90 | 18 |
@ways | any none none | rxd | #90 | 17 |
findexits | this none this | rxd | #90 | 10 |
checkexits | this none this | rxd | #90 | 9 |
self_port_msg player_port_msg thing_port_msg join_msg | this none this | rxd | #90 | 6 |
oself_port_msg self_arrive_msg oplayer_port_msg player_arrive_msg victim_port_msg othing_port_msg thing_arrive_msg object_port_msg | this none this | rxd | #90 | 9 |
msg_sub | this none this | rxd | #90 | 5 |
obvious_exits | this none this | rxd | #90 | 2 |
tell_ways | this none this | rxd | #90 | 7 |
tell_obj | this none this | rxd | #90 | 3 |
parse_out_object | this none this | rxd | #90 | 35 |
enlist | this none this | rxd | #90 | 9 |
@at | any any any | rxd | #90 | 2 |
at_players | this none this | rxd | #90 | 2 |
do_at_all | this none this | rxd | #90 | 18 |
do_at | this none this | rxd | #90 | 9 |
print_at_items | this none this | rxd | #90 | 6 |
at_item | this none this | rxd | #90 | 31 |
internal_at | this none this | rxd | #90 | 26 |
confunc | this none this | rxd | #90 | 15 |
disfunc | this none this | rxd | #90 | 16 |
find_property | this none this | rxd | #90 | 22 |
find_verbs_on | this none this | rxd | #90 | 2 |
find_properties_on | this none this | rxd | #90 | 2 |
property_inherited_from | this none this | rxd | #90 | 12 |
@ref*use | any any any | rd | #90 | 15 |
@unref*use @allow | any any any | rd | #90 | 30 |
@refusals | none any any | rd | #90 | 15 |
@refusal-r*eporting | any any any | rd | #90 | 14 |
parse_refuse_arguments | this none this | rxd | #90 | 45 |
time_word_to_seconds | this none this | rxd | #90 | 2 |
parse_time_length | this none this | rxd | #90 | 10 |
parse_time | this none this | rxd | #90 | 14 |
clear_refusals | this none this | rxd | #90 | 8 |
set_default_refusal_time | this none this | rxd | #90 | 5 |
refusable_actions | this none this | rxd | #90 | 2 |
translate_refusal_synonym | this none this | rxd | #90 | 6 |
default_refusals_text_filter | this none this | rxd | #90 | 2 |
refusals_text | this none this | rxd | #90 | 20 |
player_to_refusal_origin | this none this | rxd | #90 | 7 |
refusal_origin_to_name | this none this | rxd | #90 | 11 |
check_refusal_actions | this none this | rxd | #90 | 9 |
add_refusal | this none this | rxd | #90 | 34 |
remove_refusal | this none this | rxd | #90 | 26 |
remove_expired_refusals | this none this | rxd | #90 | 11 |
refuses_action | this none this | rxd | #90 | 15 |
refuses_action_* | this none this | rxd | #90 | 11 |
report_refusal | this none this | rxd | #90 | 4 |
wh*isper | any at/to this | rxd | #90 | 7 |
receive_page | this none this | rxd | #90 | 7 |
page_echo_msg | this none this | rxd | #90 | 7 |
moveto acceptable | this none this | rxd | #90 | 25 |
receive_message | this none this | rxd | #90 | 8 |
whisper_refused_msg page_refused_msg mail_refused_msg | this none this | rxd | #90 | 2 |
last_huh | this none this | rxd | #90 | 12 |
ping_features | this none this | rxd | #90 | 10 |
set_owned_objects | this none this | rxd | #90 | 21 |
init_for_core | this none this | rxd | #90 | 8 |
@stats @score @points @status | any none none | rd | #90 | 16 |
@award | any at/to any | rd | #90 | 28 |
@sanctuaries | none none none | rd | #90 | 10 |
whois | any any any | rd | #90 | 75 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
at_room_width | #90 | rc | #36 | 30 |
at_number | #90 | rc | #36 | 0 |
join_msg | #90 | rc | #36 | "You join %n." |
object_port_msg | #90 | rc | #36 | "teleports you." |
victim_port_msg | #90 | rc | #36 | "teleports you." |
thing_arrive_msg | #90 | rc | #36 | "%T teleports %n in." |
othing_port_msg | #90 | rc | #36 | "%T teleports %n out." |
thing_port_msg | #90 | rc | #36 | "You teleport %n." |
player_arrive_msg | #90 | rc | #36 | "%T teleports %n in." |
oplayer_port_msg | #90 | rc | #36 | "%T teleports %n out." |
player_port_msg | #90 | rc | #36 | "You teleport %n." |
self_arrive_msg | #90 | rc | #36 | "%<teleports> in." |
oself_port_msg | #90 | rc | #36 | "%<teleports> out." |
self_port_msg | #90 | rc | #36 | "" |
rooms | #90 | r | #36 | {} |
refused_origins | #90 | r | #36 | {} |
refused_extra | #90 | r | #36 | {} |
default_refusal_time | #90 | r | #36 | 604800 |
report_refusal | #90 | r | #36 | 0 |
refused_actions | #90 | r | #36 | {} |
refused_until | #90 | r | #36 | {} |
page_refused | #90 | r | #36 | 0 |
page_refused_msg | #90 | rc | #36 | "%N refuses your page." |
whisper_refused_msg | #90 | rc | #36 | "%N refuses your whisper." |
mail_refused_msg | #90 | rc | #36 | "%N refuses your mail." |
death_msg | #91 | rc | #36 | <clear> |
alive | #91 | r | #36 | <clear> |
alert | #91 | r | #36 | <clear> |
mobile | #91 | r | #36 | <clear> |
wielded | #91 | r | #36 | <clear> |
last_paged | #91 | r | #36 | <clear> |
last_healed | #91 | r | #36 | <clear> |
followed_by | #91 | r | #36 | <clear> |
following | #91 | r | #36 | <clear> |
free_points | #91 | r | #36 | 1.35999999999999 |
stats | #91 | r | #36 | <clear> |
stats_current | #91 | r | #36 | <clear> |
skills | #91 | r | #36 | <clear> |
race | #91 | r | #36 | <clear> |
org | #91 | r | #36 | <clear> |
money | #91 | r | #36 | <clear> |
follow_msg | #91 | rc | #36 | <clear> |
stopfollow_msg | #91 | rc | #36 | <clear> |
searching | #91 | r | #36 | <clear> |
languages | #91 | r | #36 | {{#142}, {2.0}} |
speaking | #91 | r | #36 | <clear> |
remembered_names | #91 | r | #36 | {} |
short_desc_msg | #91 | r | #36 | "" |
_mail_task | #40 | rc | #36 | <clear> |
messages_going | #40 | c | #36 | <clear> |
mail_lists | #40 | rc | #36 | <clear> |
mail_notify | #40 | rc | #36 | <clear> |
mail_forward | #40 | rc | #36 | <clear> |
mail_options | #40 | rc | #36 | {} |
message_keep_date | #40 | rc | #36 | <clear> |
messages_kept | #40 | rc | #36 | <clear> |
current_message | #40 | c | #36 | {0, -1300000000} |
messages | #40 | c | #36 | <clear> |
ansi_options | #95 | r | #36 | <clear> |
replace_codes | #95 | r | #36 | <clear> |
features | #6 | r | #36 | <clear> |
previous_connection | #6 | | #2 | <clear> |
email_address | #6 | | #2 | <clear> |
last_disconnect_time | #6 | r | #2 | <clear> |
help | #6 | rc | #36 | #139 |
more_msg | #6 | rc | #36 | <clear> |
linetask | #6 | r | #36 | <clear> |
linesleft | #6 | r | #36 | <clear> |
linebuffer | #6 | | #36 | <clear> |
pagelen | #6 | r | #36 | <clear> |
owned_objects | #6 | r | #2 | <clear> |
linelen | #6 | r | #36 | <clear> |
current_folder | #6 | c | #36 | <clear> |
all_connect_places | #6 | | #2 | <clear> |
last_connect_place | #6 | | #2 | <clear> |
brief | #6 | rc | #36 | <clear> |
lines | #6 | c | #36 | <clear> |
page_absent_msg | #6 | rc | #36 | <clear> |
pq | #6 | rc | #36 | <clear> |
pqc | #6 | rc | #36 | <clear> |
page_origin_msg | #6 | rc | #36 | <clear> |
page_echo_msg | #6 | rc | #36 | <clear> |
edit_options | #6 | rc | #36 | <clear> |
last_connect_time | #6 | r | #2 | <clear> |
ownership_quota | #6 | | #36 | <clear> |
gender | #6 | rc | #36 | <clear> |
prc | #6 | rc | #36 | <clear> |
ppc | #6 | rc | #36 | <clear> |
poc | #6 | rc | #36 | <clear> |
psc | #6 | rc | #36 | <clear> |
pr | #6 | rc | #36 | <clear> |
pp | #6 | rc | #36 | <clear> |
po | #6 | rc | #36 | <clear> |
ps | #6 | rc | #36 | <clear> |
home | #6 | rc | #36 | #62 |
password | #6 | | #2 | <clear> |
gaglist | #6 | rc | #36 | <clear> |
paranoid | #6 | rc | #36 | <clear> |
display_options | #6 | rc | #36 | <clear> |
verb_subs | #6 | rc | #36 | <clear> |
first_connect_time | #6 | r | #2 | <clear> |
size_quota | #6 | | #36 | {50000, 0, 0, 1} |
last_password_time | #6 | | #2 | <clear> |
last_connect_attempt | #6 | | #2 | <clear> |
page_count_start_time | #6 | r | #2 | <clear> |
ping_task | #6 | r | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | <clear> |
key | #1 | c | #36 | <clear> |
aliases | #1 | r | #2 | {"Frand's administrator class", "Frand's player class", "player class"} |
description | #1 | rc | #36 | "You see a player who should type '@describe me as ...'." |
object_size | #1 | r | #36 | {68919, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #91 generic gamer → #40 Generic Mail Receiving Player → #95 ANSI PC → #6 generic player → #102 subthing → #1 Root Class
Children: #4 generic builder
Call graph
Showing 48 of 129 verbs; 81 not shown.
Source
@rooms
Referenced by
none
Source
1"'@rooms' - List the rooms which are known by name."; 2line = ""; 3for item in (this.rooms) 4line = (((line + item[1]) + "(") + tostr(item[2])) + ") "; 5endfor 6player:tell(line);
names_of
Referenced by
none
Source
1"Return a string giving the names of the objects in a list. Now on $string_utils"; 2return $string_utils:names_of(@args);
@go
Referenced by
none
Source
1"'@go <place>' - Teleport yourself somewhere. Example: '@go liv' to go to the living room."; 2dest = this:lookup_room(dobjstr); 3if (dest == $failed_match) 4player:tell("There's no such place known."); 5else 6this:teleport(player, dest); 7endif 8if (`dest.room_type == 2 ! E_PROPNF => 0') 9dest:random_exit(this); 10endif
lookup_room
Referenced by
- #90:@go line 2:
this:lookup_room - #90:@move line 24:
this:lookup_room - #90:internal_at line 11:
this:lookup_room
Source
1"Look up a room in your personal database of room names, returning its object number. If it's not in your database, it checks to see if it's a number or a nearby object."; 2room = args[1]; 3if (room == "home") 4return player.home; 5elseif (room == "me") 6return player; 7elseif (room == "here") 8return player.location; 9elseif (!room) 10return $failed_match; 11endif 12index = this:index_room(room); 13if (index) 14return this.rooms[index][2]; 15else 16return this:my_match_object(room); 17"old code no longer used, 2/11/96 Heathcliff"; 18source = player.location; 19if (!(valid(source) && ($room in $object_utils:ancestors(source)))) 20source = $room; 21endif 22return source:match_object(room); 23endif
teleport
Referenced by
Source
1"Teleport a player or object. For printing messages, there are three cases: (1) teleport self (2) teleport other player (3) teleport object. There's a spot of complexity for handling the invalid location #-1."; 2{thing, dest} = args; 3source = thing.location; 4if (valid(dest)) 5dest_name = dest.name; 6else 7dest_name = tostr(dest); 8endif 9if (source == dest) 10player:tell(thing.name, " is already at ", dest_name, "."); 11return; 12endif 13thing:moveto(dest); 14if (thing.location == dest) 15tsd = {thing, source, dest}; 16if (thing == player) 17this:teleport_messages(@tsd, this:self_port_msg(@tsd), this:oself_port_msg(@tsd), this:self_arrive_msg(@tsd), ""); 18elseif (is_player(thing)) 19this:teleport_messages(@tsd, this:player_port_msg(@tsd), this:oplayer_port_msg(@tsd), this:player_arrive_msg(@tsd), this:victim_port_msg(@tsd)); 20else 21this:teleport_messages(@tsd, this:thing_port_msg(@tsd), this:othing_port_msg(@tsd), this:thing_arrive_msg(@tsd), this:object_port_msg(@tsd)); 22endif 23elseif (thing.location == source) 24if ($object_utils:contains(thing, dest)) 25player:tell("Ooh, it's all twisty. ", dest_name, " is inside ", thing.name, "."); 26else 27if ($object_utils:has_property(thing, "po")) 28pronoun = thing.po; 29else 30pronoun = "it"; 31endif 32player:tell("Either ", thing.name, " doesn't want to go, or ", dest_name, " didn't accept ", pronoun, "."); 33endif 34else 35thing_name = (thing == player) ? "you" | thing.name; 36player:tell("A strange force deflects ", thing_name, " from the destination."); 37endif
teleport_messages
Referenced by
- #90:teleport line 17:
this:teleport_messages - #90:teleport line 19:
this:teleport_messages - #90:teleport line 21:
this:teleport_messages
Source
1"Send teleport messages. There's a slight complication in that the source and dest need not be valid objects."; 2{thing, source, dest, pmsg, smsg, dmsg, tmsg} = args; 3if (pmsg) 4"The player's own message."; 5player:tell(pmsg); 6endif 7if (smsg && valid(source)) 8"A message to the victim's original location, if it is a room."; 9`source:announce_all_but({thing, player}, smsg) ! E_VERBNF => ""'; 10endif 11if (dmsg && valid(dest)) 12"A message to the destination, if it is a room."; 13`dest:announce_all_but({thing, player}, dmsg) ! E_VERBNF => ""'; 14endif 15if (tmsg) 16"A message to the victim being teleported."; 17thing:tell(tmsg); 18endif
@move
Referenced by
none
Source
1"'@move <object> to <place>' - Teleport an object. Example: '@move trash to #11' to move trash to the closet."; 2here = player.location; 3if ((prepstr != "to") || (!iobjstr)) 4player:tell("Usage: @move <object> to <location>"); 5return; 6endif 7if ((!dobjstr) || (dobjstr == "me")) 8thing = this; 9else 10if (valid(here) && $object_utils:has_callable_verb(here, "match_object")) 11thing = here:match_object(dobjstr); 12endif 13if (thing == $failed_match) 14thing = player:my_match_object(dobjstr); 15endif 16endif 17if ($command_utils:object_match_failed(thing, dobjstr)) 18return; 19endif 20if ((!player.programmer) && ((thing.owner != player) && (thing != player))) 21player:tell("You can only move your own objects."); 22return; 23endif 24dest = this:lookup_room(iobjstr); 25if ((dest == #-1) || (!$command_utils:object_match_failed(dest, iobjstr))) 26this:teleport(thing, dest); 27endif
index_room
Referenced by
- #90:lookup_room line 12:
this:index_room - #90:@rmr*oom line 8:
this:index_room
Source
1"'index_room (<room name>)' - Look up a room in your personal database of room names, returning its index in the list. Return 0 if it is not in the list. If the room name is the empty string, then only exact matches are considered; otherwise, a leading match is good enough."; 2room = tostr(args[1]); 3size = length(room); 4index = 1; 5match = 0; 6for item in (this.rooms) 7item_name = item[1]; 8if (room == item_name) 9return index; 10elseif ((size && (length(item_name) >= size)) && (room == item_name[1..size])) 11match = index; 12endif 13index = index + 1; 14endfor 15return match;
@addr*oom
Referenced by
none
Source
1"'@addroom <name> <object>', '@addroom <object> <name>', '@addroom <name>', '@addroom <object>', '@addroom' - Add a room to your personal database of teleport destinations. Example: '@addroom Kitchen #24'. Reasonable <object>s are numbers (#17) and 'here'. If you leave out <object>, the object is the current room. If you leave out <name>, the name is the specified room's name. If you leave out both, you get the current room and its name."; 2if (((!caller) && (player != this)) || (caller && (callers()[1][3] != this))) 3if (!caller) 4player:tell(E_PERM); 5endif 6return E_PERM; 7endif 8if (!dobjstr) 9object = this.location; 10name = valid(object) ? object.name | "Nowhere"; 11elseif (command = this:parse_out_object(dobjstr)) 12name = command[1]; 13object = command[2]; 14else 15name = dobjstr; 16object = this.location; 17endif 18if (!valid(object)) 19player:tell("This is not a valid location."); 20return E_INVARG; 21endif 22player:tell("Adding ", name, "(", tostr(object), ") to your database of rooms."); 23this.rooms = {@this.rooms, {name, object}};
@rmr*oom
Referenced by
none
Source
1"'@rmroom <roomname>' - Remove a room from your personal database of teleport destinations. Example: '@rmroom library'."; 2if (((!caller) && (player != this)) || (caller && (callers()[1][3] != this))) 3if (!caller) 4player:tell(E_PERM); 5endif 6return E_PERM; 7endif 8index = this:index_room(dobjstr); 9if (index) 10player:tell("Removing ", this.rooms[index][1], "(", this.rooms[index][2], ")."); 11this.rooms = listdelete(this.rooms, index); 12else 13player:tell("That room is not in your database of rooms. Check '@rooms'."); 14endif
@join
Referenced by
none
Source
1"'@join <player>' - Teleport yourself to the location of any player, whether connected or not."; 2if (dobjstr == "") 3player:tell("Usage: @join <player>. For example, '@join frand'."); 4return; 5endif 6target = $string_utils:match_player(dobjstr); 7$command_utils:player_match_result(target, dobjstr); 8if (valid(target)) 9if (target == this) 10if (player == this) 11player:tell("There is little need to join yourself, unless you are split up."); 12else 13player:tell("No thank you. Please get your own join verb."); 14endif 15return; 16endif 17dest = target.location; 18msg = this:enlist(this:join_msg()); 19editing = $object_utils:isa(dest, $generic_editor); 20if (editing) 21dest = dest.original[target in dest.active]; 22editing_msg = "%N is editing at the moment. You can wait here until %s is done."; 23if (player.location == dest) 24msg = {editing_msg}; 25else 26msg = {@msg, editing_msg}; 27endif 28endif 29if (msg && ((player.location != dest) || editing)) 30player:tell_lines($string_utils:pronoun_sub(msg, target)); 31elseif ((`this.x_loc = target.x_loc ! ANY => 1' && `this.y_loc = target.y_loc ! ANY => 1') && (player.location == dest)) 32player:tell("OK, you're there."); 33return; 34endif 35this:teleport(player, dest); 36endif
@find
Referenced by
none
Source
1"'@find #<object>', '@find <player>', '@find :<verb>' '@find .<property>' - Attempt to locate things. Verbs and properties are found on any object in the player's vicinity, and some other places."; 2if (!dobjstr) 3player:tell("Usage: '@find #<object>' or '@find <player>' or '@find :<verb>' or '@find .<property>'."); 4return; 5endif 6if (dobjstr[1] == ":") 7name = dobjstr[2..$]; 8this:find_verb(name); 9return; 10elseif (dobjstr[1] == ".") 11name = dobjstr[2..$]; 12this:find_property(name); 13return; 14elseif (dobjstr[1] == "#") 15target = toobj(dobjstr); 16if (!valid(target)) 17player:tell(target, " does not exist."); 18endif 19else 20target = $string_utils:match_player(dobjstr); 21$command_utils:player_match_result(target, dobjstr); 22endif 23if (valid(target)) 24player:tell(target.name, " (", target, ") is at ", valid(target.location) ? target.location.name | "Nowhere", " (", target.location, ")."); 25endif
find_verb
Referenced by
- #90:@find line 8:
this:find_verb
Source
1"'find_verb (<name>)' - Search for a verb with the given name. The objects searched are those returned by this:find_verbs_on(). The printing order relies on $list_utils:remove_duplicates to leave the *first* copy of each duplicated element in a list; for example, {1, 2, 1} -> {1, 2}, not to {2, 1}."; 2name = args[1]; 3results = ""; 4objects = $list_utils:remove_duplicates(this:find_verbs_on()); 5for thing in (objects) 6if (valid(thing) && (mom = $object_utils:has_verb(thing, name))) 7results = ((((results + " ") + thing.name) + "(") + tostr(thing)) + ")"; 8mom = mom[1]; 9if (thing != mom) 10results = ((((results + "--") + mom.name) + "(") + tostr(mom)) + ")"; 11endif 12endif 13endfor 14if (results) 15this:tell("The verb :", name, " is on", results); 16else 17this:tell("The verb :", name, " is nowhere to be found."); 18endif
@ways
Referenced by
none
Source
1"'@ways', '@ways <room>' - List any obvious exits from the given room (or this room, if none is given)."; 2if (dobjstr) 3room = dobj; 4else 5room = this.location; 6endif 7if ((!valid(room)) || (!($room in $object_utils:ancestors(room)))) 8player:tell("You can only pry into the exits of a room."); 9return; 10endif 11exits = {}; 12if ($object_utils:has_verb(room, "obvious_exits")) 13exits = room:obvious_exits(); 14endif 15exits = this:checkexits(this:obvious_exits(), room, exits); 16exits = this:findexits(room, exits); 17this:tell_ways(exits, room);
findexits
Referenced by
- #90:@ways line 16:
this:findexits
Source
1"Add to the 'exits' list any exits in the room which have a single-letter alias."; 2{room, exits} = args; 3alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; 4for i in [1..length(alphabet)] 5found = room:match_exit(alphabet[i]); 6if (valid(found) && (!(found in exits))) 7exits = {@exits, found}; 8endif 9endfor 10return exits;
checkexits
Referenced by
- #90:@ways line 15:
this:checkexits
Source
1"Check a list of exits to see if any of them are in the given room."; 2{to_check, room, exits} = args; 3for word in (to_check) 4found = room:match_exit(word); 5if (valid(found) && (!(found in exits))) 6exits = {@exits, found}; 7endif 8endfor 9return exits;
self_port_msg player_port_msg thing_port_msg join_msg
Referenced by
- #90:teleport line 17:
this:self_port_msg - #90:teleport line 19:
this:player_port_msg - #90:teleport line 21:
this:thing_port_msg - #90:@join line 18:
this:join_msg
Source
1"This verb returns messages that go only to you. You don't need to have your name tacked on to the beginning of these. Heh."; 2msg = this.(verb); 3if (msg && (length(args) >= 3)) 4msg = this:msg_sub(msg, @args); 5endif 6return msg;
oself_port_msg self_arrive_msg oplayer_port_msg player_arrive_msg victim_port_msg othing_port_msg thing_arrive_msg object_port_msg
Referenced by
- #90:teleport line 17:
this:oself_port_msg - #90:teleport line 17:
this:self_arrive_msg - #90:teleport line 19:
this:oplayer_port_msg - #90:teleport line 19:
this:player_arrive_msg - #90:teleport line 19:
this:victim_port_msg - #90:teleport line 21:
this:othing_port_msg - #90:teleport line 21:
this:thing_arrive_msg - #90:teleport line 21:
this:object_port_msg
Source
1"This verb returns messages that go to other players. It does pronoun substitutions; if your name is not included in the final string, it adds the name in front."; 2msg = this.(verb); 3if (msg && (length(args) >= 3)) 4msg = this:msg_sub(msg, @args); 5endif 6if (msg && (!$string_utils:index_delimited(msg, player.name))) 7msg = (player.name + " ") + msg; 8endif 9return msg;
msg_sub
Referenced by
- #90:self_port_msg line 4:
this:msg_sub - #90:oself_port_msg line 4:
this:msg_sub
Source
1"Do pronoun and other substitutions on the teleport messages. The arguments are: 1. The original message, before any substitutions; 2. object being teleported; 3. from location; 4. to location. The return value is the final message."; 2{msg, thing, from, to} = args; 3msg = $string_utils:substitute(msg, $string_utils:pronoun_quote({{"%<from room>", valid(from) ? from.name | "Nowhere"}, {"%<to room>", valid(to) ? to.name | "Nowhere"}})); 4msg = $string_utils:pronoun_sub(msg, thing); 5return msg;
obvious_exits
Referenced by
- #90:@ways line 15:
this:obvious_exits
Source
1"'obvious_exits()' - Return a list of common exit names which are obviously worth looking for in a room."; 2return {"n", "ne", "e", "se", "s", "sw", "w", "nw", "north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "u", "d", "up", "down", "out", "exit", "leave", "enter"};
tell_ways
Referenced by
- #90:@ways line 17:
this:tell_ways
Source
1":tell_ways (<list of exits>)' - Tell yourself a list of exits, for @ways. You can override it to print the exits in any format."; 2exits = args[1]; 3answer = {}; 4for e in (exits) 5answer = {@answer, ((e.name + " (") + $string_utils:english_list(e.aliases)) + ")"}; 6endfor 7player:tell("Obvious exits: ", $string_utils:english_list(answer), ".");
tell_obj
Referenced by
none
Source
1"Return the name and number of an object, e.g. 'Root Class (#1)'."; 2o = args[1]; 3return (((valid(o) ? o.name | "Nothing") + " (") + tostr(o)) + ")";
parse_out_object
Referenced by
- #90:@addr*oom line 11:
this:parse_out_object
Source
1"'parse_out_object (<string>)' -> {<name>, <object>}, or 0. Given a string, attempt to find an object at its beginning or its end. An object can be either an object number, or 'here'. If this succeeds, return a list of the object and the unmatched part of the string, called the name. If it fails, return 0."; 2words = $string_utils:words(args[1]); 3if (!length(words)) 4return 0; 5endif 6word1 = words[1]; 7wordN = words[$]; 8if (length(word1) && (word1[1] == "#")) 9start = 2; 10finish = length(words); 11what = toobj(word1); 12elseif (word1 == "here") 13start = 2; 14finish = length(words); 15what = this.location; 16elseif (length(wordN) && (wordN[1] == "#")) 17start = 1; 18finish = length(words) - 1; 19what = toobj(wordN); 20elseif (wordN == "here") 21start = 1; 22finish = length(words) - 1; 23what = this.location; 24else 25return 0; 26endif 27"toobj() has the nasty property that invalid strings get turned into #0. Here we just pretend that all references to #0 are actually meant for #-1."; 28if (what == #0) 29what = $nothing; 30endif 31name = $string_utils:from_list(words[start..finish], " "); 32if (!name) 33name = valid(what) ? what.name | "Nowhere"; 34endif 35return {name, what};
enlist
Referenced by
- #90:@join line 18:
this:enlist
Source
1"'enlist (<x>)' - If x is a list, just return it; otherwise, return {x}. The purpose here is to turn message strings into lists, so that lines can be added. It is not guaranteed to work for non-string non-lists."; 2x = args[1]; 3if (!x) 4return {}; 5elseif (typeof(x) == LIST) 6return x; 7else 8return {x}; 9endif
@at
Referenced by
none
Source
1"'@at' - Find out where everyone is. '@at <player>' - Find out where <player> is, and who else is there. '@at <obj>' - Find out who else is at the same place as <obj>. '@at <place>' - Find out who is at the place. The place can be given by number, or it can be a name from your @rooms list. '@at #-1' - Find out who is at #-1. '@at me' - Find out who is in the room with you. '@at home' - Find out who is at your home."; 2this:internal_at(argstr);
at_players
Referenced by
- #90:do_at_all line 5:
this:at_players - #90:do_at line 4:
this:at_players
Source
1"'at_players ()' - Return a list of players to be displayed by @at."; 2return connected_players();
do_at_all
Referenced by
- #90:internal_at line 25:
this:do_at_all
Source
1"'do_at_all ()' - List where everyone is, sorted by popularity of location. This is called when you type '@at'."; 2locations = {}; 3parties = {}; 4counts = {}; 5for who in (this:at_players()) 6loc = who.location; 7if (i = loc in locations) 8parties[i] = setadd(parties[i], who); 9counts[i] = counts[i] - 1; 10else 11locations = {@locations, loc}; 12parties = {@parties, {who}}; 13counts = {@counts, 0}; 14endif 15endfor 16locations = $list_utils:sort(locations, counts); 17parties = $list_utils:sort(parties, counts); 18this:print_at_items(locations, parties);
do_at
Referenced by
- #90:internal_at line 23:
this:do_at
Source
1"'do_at (<location>)' - List the players at a given location."; 2loc = args[1]; 3party = {}; 4for who in (this:at_players()) 5if (who.location == loc) 6party = setadd(party, who); 7endif 8endfor 9this:print_at_items({loc}, {party});
print_at_items
Referenced by
- #90:do_at_all line 18:
this:print_at_items - #90:do_at line 9:
this:print_at_items
Source
1"'print_at_items (<locations>, <parties>)' - Print a list of locations and people, for @at. Override this if you want to make a change to @at's output that you can't make in :at_item."; 2{locations, parties} = args; 3for i in [1..length(locations)] 4(ticks_left() < 4000) && suspend(0); 5player:tell_lines(this:at_item(locations[i], parties[i])); 6endfor
at_item
Referenced by
- #90:print_at_items line 5:
this:at_item
Source
1"'at_item (<location>, <party>)' - Given a location and a list of the people there, return a string displaying the information. Override this if you want to change the format of each line of @at's output."; 2{loc, party} = args; 3su = $string_utils; 4if (this.at_number) 5number = su:right(tostr(loc), 7) + " "; 6else 7number = ""; 8endif 9room = su:left(valid(loc) ? loc.name | "[Nowhere]", this.at_room_width); 10if (length(room) > this.at_room_width) 11room = room[1..this.at_room_width]; 12endif 13text = (number + room) + " "; 14if (party) 15filler = su:space(length(text) - 2); 16line = text; 17text = {}; 18for who in (party) 19name = " " + (valid(who) ? who.name | "[Nobody]"); 20if ((length(line) + length(name)) > this:linelen()) 21text = {@text, line}; 22line = filler + name; 23else 24line = line + name; 25endif 26endfor 27text = {@text, line}; 28else 29text = text + " [deserted]"; 30endif 31return text;
internal_at
Referenced by
- #90:@at line 2:
this:internal_at
Source
1"'internal_at (<argument string>)' - Perform the function of @at. The argument string is whatever the user typed after @at. This is factored out so that other verbs can call it."; 2where = $string_utils:trim(args[1]); 3if (where) 4if (where[1] == "#") 5result = toobj(where); 6if ((!valid(result)) && (result != #-1)) 7player:tell("That object does not exist."); 8return; 9endif 10else 11result = this:lookup_room(where); 12if (!valid(result)) 13result = $string_utils:match_player(where); 14if (!valid(result)) 15player:tell("That is neither a player nor a room name."); 16return; 17endif 18endif 19endif 20if (valid(result) && (!$object_utils:isa(result, $room))) 21result = result.location; 22endif 23this:do_at(result); 24else 25this:do_at_all(); 26endif
confunc
Referenced by
none
Source
1"'confunc ()' - Besides the inherited behavior, notify the player's feature objects that the player has connected."; 2if ((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) 3return E_PERM; 4endif 5pass(@args); 6set_task_perms(this); 7for feature in (this.features) 8try 9feature:player_connected(player, @args); 10except (E_VERBNF) 11continue feature; 12except id (ANY) 13player:tell("Feature initialization failure for ", feature, ": ", id[2], "."); 14endtry 15endfor
disfunc
Referenced by
none
Source
1"'disfunc ()' - Besides the inherited behavior, notify the player's feature objects that the player has disconnected."; 2if ((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) 3return E_PERM; 4endif 5pass(@args); 6"This is forked off to protect :disfunc from buggy :player_disconnected verbs."; 7set_task_perms(this); 8fork (max(0, $login:current_lag())) 9for feature in (this.features) 10try 11feature:player_disconnected(player, @args); 12except (ANY) 13continue feature; 14endtry 15endfor 16endfork
find_property
Referenced by
- #90:@find line 12:
this:find_property
Source
1"'find_property (<name>)' - Search for a property with the given name. The objects searched are those returned by this:find_properties_on(). The printing order relies on $list_utils:remove_duplicates to leave the *first* copy of each duplicated element in a list; for example, {1, 2, 1} -> {1, 2}, not to {2, 1}."; 2name = args[1]; 3results = ""; 4objects = $list_utils:remove_duplicates(this:find_properties_on()); 5for thing in (objects) 6if (valid(thing) && (mom = $object_utils:has_property(thing, name))) 7results = ((((results + " ") + thing.name) + "(") + tostr(thing)) + ")"; 8mom = this:property_inherited_from(thing, name); 9if (thing != mom) 10if (valid(mom)) 11results = ((((results + "--") + mom.name) + "(") + tostr(mom)) + ")"; 12else 13results = results + "--built-in"; 14endif 15endif 16endif 17endfor 18if (results) 19this:tell("The property .", name, " is on", results); 20else 21this:tell("The property .", name, " is nowhere to be found."); 22endif
find_verbs_on
Referenced by
- #90:find_verb line 4:
this:find_verbs_on
Source
1"'find_verbs_on ()' -> list of objects - Return the objects that @find searches when looking for a verb. The objects are searched (and the results printed) in the order returned. Feature objects are included in the search. Duplicate entries are removed by the caller."; 2return {this, this.location, @valid(this.location) ? this.location:contents() | {}, @this:contents(), @this.features};
find_properties_on
Referenced by
- #90:find_property line 4:
this:find_properties_on
Source
1"'find_properties_on ()' -> list of objects - Return the objects that @find searches when looking for a property. The objects are searched (and the results printed) in the order returned. Feature objects are *not* included in the search. Duplicate entries are removed by the caller."; 2return {this, this.location, @valid(this.location) ? this.location:contents() | {}, @this:contents()};
property_inherited_from
Referenced by
- #90:find_property line 8:
this:property_inherited_from
Source
1"'property_inherited_from (<object>, <property name>)' -> object - Return the ancestor of <object> on which <object>.<property> is originally defined. If <object>.<property> is not actually defined, return 0. The property is taken as originally defined on the earliest ancestor of <object> which has it. If the property is built-in, return $nothing."; 2{what, prop} = args; 3if (!$object_utils:has_property(what, prop)) 4return 0; 5elseif (prop in $code_utils.builtin_props) 6return $nothing; 7endif 8ancestor = what; 9while ($object_utils:has_property(parent(ancestor), prop)) 10ancestor = parent(ancestor); 11endwhile 12return ancestor;
@ref*use
Referenced by
none
Source
1"'@refuse <action(s)> [ from <player> ] [ for <time> ]' - Refuse all of a list of one or more actions. If a player is given, refuse actions from the player; otherwise, refuse all actions. If a time is specified, refuse the actions for the given amount of time; otherwise, refuse them for a week. If the actions are already refused, then the only their times are adjusted."; 2if (!argstr) 3player:tell("@refuse <action(s)> [ from <player> ] [ for <time> ]"); 4return; 5endif 6stuff = this:parse_refuse_arguments(argstr); 7if (stuff) 8if (((typeof(who = stuff[1]) == OBJ) && (who != $nothing)) && (!is_player(who))) 9player:tell("You must give the name of some player."); 10else 11"'stuff' is now in the form {<origin>, <actions>, <duration>}."; 12this:add_refusal(@stuff); 13player:tell("Refusal of ", this:refusal_origin_to_name(stuff[1]), " for ", $time_utils:english_time(stuff[3]), " added."); 14endif 15endif
@unref*use @allow
Referenced by
none
Source
1"'@unrefuse <action(s)> [ from <player> ]' - Stop refusing all of a list of actions. If a player is given, stop refusing actions by the player; otherwise, stop refusing all actions of the given kinds. '@unrefuse everything' - Remove all refusals."; 2if (argstr == "everything") 3if ($command_utils:yes_or_no("Do you really want to erase all your refusals?")) 4this:clear_refusals(); 5player:tell("OK, they are gone."); 6else 7player:tell("OK, no harm done."); 8endif 9return; 10endif 11stuff = this:parse_refuse_arguments(argstr); 12if (!stuff) 13return; 14endif 15"'stuff' is now in the form {<origin>, <actions>, <duration>}."; 16origins = stuff[1]; 17actions = stuff[2]; 18if (typeof(origins) != LIST) 19origins = {origins}; 20endif 21n = 0; 22for origin in (origins) 23n = n + this:remove_refusal(origin, actions); 24endfor 25plural = ((n == 1) && (length(origins) == 1)) ? "" | "s"; 26if (n) 27player:tell("Refusal", plural, " removed."); 28else 29player:tell("You have no such refusal", plural, "."); 30endif
@refusals
Referenced by
none
Source
1"'@refusals' - List your refusals. '@refusals for <player>' - List the given player's refusals."; 2if (iobjstr) 3who = $string_utils:match_player(iobjstr); 4if ($command_utils:player_match_failed(who, iobjstr)) 5return; 6endif 7if (!$object_utils:has_verb(who, "refusals_text")) 8player:tell("That player does not have the refusal facility."); 9return; 10endif 11else 12who = player; 13endif 14who:remove_expired_refusals(); 15player:tell_lines(this:refusals_text(who));
@refusal-r*eporting
Referenced by
none
Source
1"'@refusal-reporting' - See if refusal reporting is on. '@refusal-reporting on', '@refusal-reporting off' - Turn it on or off.."; 2if (!argstr) 3player:tell("Refusal reporting is ", this.report_refusal ? "on" | "off", "."); 4elseif (argstr in {"on", "yes", "y", "1"}) 5this.report_refusal = 1; 6player:tell("Refusals will be reported to you as they happen."); 7elseif (argstr in {"off", "no", "n", "0"}) 8this.report_refusal = 0; 9player:tell("Refusals will happen silently."); 10else 11player:tell("@refusal-reporting on - turn on refusal reporting"); 12player:tell("@refusal-reporting off - turn it off"); 13player:tell("@refusal-reporting - see if it's on or off"); 14endif
parse_refuse_arguments
Referenced by
- #90:@ref*use line 6:
this:parse_refuse_arguments - #90:@unref*use line 11:
this:parse_refuse_arguments
Source
1"'parse_refuse_arguments (<string>)' -> {<who>, <actions>, <duration>} - Parse the arguments of a @refuse or @unrefuse command. <who> is the player requested, or $nothing if none was. <actions> is a list of the actions asked for. <duration> is how long the refusal should last, or 0 if no expiration is given. <errors> is a list of actions (or other words) which are wrong. If there are any errors, this prints an error message and returns 0."; 2words = $string_utils:explode(args[1]); 3possible_actions = this:refusable_actions(); 4who = $nothing; 5actions = {}; 6until = this.default_refusal_time; 7errors = {}; 8skip_to = 0; 9for i in [1..length(words)] 10word = words[i]; 11if (i <= skip_to) 12elseif (which = $string_utils:find_prefix(word, possible_actions)) 13actions = setadd(actions, possible_actions[which]); 14elseif ((word[$] == "s") && (which = $string_utils:find_prefix(word[1..$ - 1], possible_actions))) 15"The word seems to be the plural of an action."; 16actions = setadd(actions, possible_actions[which]); 17elseif (results = this:translate_refusal_synonym(word)) 18actions = $set_utils:union(actions, results); 19elseif ((word == "from") && (i < length(words))) 20"Modified to allow refusals from all guests at once. 5-27-94, Gelfin"; 21if (words[i + 1] == "guests") 22who = "all guests"; 23elseif (!(typeof(who = $code_utils:toobj(words[i + 1])) == OBJ)) 24who = $string_utils:match_player(words[i + 1]); 25if ($command_utils:player_match_failed(who, words[i + 1])) 26return 0; 27endif 28endif 29skip_to = i + 1; 30elseif ((word == "for") && (i < length(words))) 31n_words = this:parse_time_length(words[i + 1..$]); 32until = this:parse_time(words[i + 1..i + n_words]); 33if (!until) 34return 0; 35endif 36skip_to = i + n_words; 37else 38errors = {@errors, word}; 39endif 40endfor 41if (errors) 42player:tell((length(errors) > 1) ? "These parts of the command were not understood: " | "This part of the command was not understood: ", $string_utils:english_list(errors, 0, " ", " ", " ")); 43return 0; 44endif 45return {this:player_to_refusal_origin(who), actions, until};
time_word_to_seconds
Referenced by
- #90:parse_time_length line 4:
this:time_word_to_seconds - #90:parse_time_length line 7:
this:time_word_to_seconds - #90:parse_time line 11:
this:time_word_to_seconds - #90:parse_time line 11:
this:time_word_to_seconds - #90:parse_time line 14:
this:time_word_to_seconds
Source
1"'time_word_to_seconds (<string>)' - The <string> is expected to be a time word, 'second', 'minute', 'hour', 'day', 'week', or 'month'. Return the number of seconds in that amount of time (a month is taken to be 30 days). If <string> is not a time word, return 0. This is used both as a test of whether a word is a time word and as a converter."; 2return $time_utils:parse_english_time_interval("1", args[1]);
parse_time_length
Referenced by
- #90:parse_refuse_arguments line 31:
this:parse_time_length
Source
1"'parse_time_length (<words>)' -> n - Given a list of words which is expected to begin with a time expression, return how many of them belong to the time expression. A time expression can be a positive integer, a time word, or a positive integer followed by a time word. A time word is anything that this:time_word_to_seconds this is one. The return value is 0, 1, or 2."; 2words = {@args[1], "dummy"}; 3n = 0; 4if (toint(words[1]) || this:time_word_to_seconds(words[1])) 5n = 1; 6endif 7if (this:time_word_to_seconds(words[n + 1])) 8n = n + 1; 9endif 10return n;
parse_time
Referenced by
- #90:parse_refuse_arguments line 32:
this:parse_time
Source
1"'parse_time (<words>)' -> <seconds> - Given a list of zero or more words, either empty or a valid time expression, return the number of seconds that the time expression refers to. This is a duration, not an absolute time."; 2words = args[1]; 3"If the list is empty, return the default refusal time."; 4if (!words) 5return this.default_refusal_time; 6endif 7"If the list has one word, either <units> or <n>."; 8"If it is a unit, like 'hour', return the time for 1 <unit>."; 9"If it is a number, return the time for <n> days."; 10if (length(words) == 1) 11return this:time_word_to_seconds(words[1]) || (toint(words[1]) * this:time_word_to_seconds("days")); 12endif 13"The list must contain two words, <n> <units>."; 14return toint(words[1]) * this:time_word_to_seconds(words[2]);
clear_refusals
Referenced by
- #90:@unref*use line 4:
this:clear_refusals
Source
1"'clear_refusals ()' - Erase all of this player's refusals."; 2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 3return E_PERM; 4endif 5this.refused_origins = {}; 6this.refused_actions = {}; 7this.refused_until = {}; 8this.refused_extra = {};
set_default_refusal_time
Referenced by
none
Source
1"'set_default_refusal_time (<seconds>)' - Set the length of time that a refusal lasts if its duration isn't specified."; 2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 3return E_PERM; 4endif 5this.default_refusal_time = toint(args[1]);
refusable_actions
Referenced by
- #90:parse_refuse_arguments line 3:
this:refusable_actions - #90:translate_refusal_synonym line 4:
this:refusable_actions - #90:check_refusal_actions line 3:
this:refusable_actions - #90:remove_expired_refusals line 10:
this:refusable_actions
Source
1"'refusable_actions ()' -> {'page', 'whisper', ...} - Return a list of the actions that can be refused. This is a verb, rather than a property, so that it can be inherited properly. If you override this verb to add new refusable actions, write something like 'return {@pass (), 'action1', 'action2', ...}'. That way people can add new refusable actions at any level of the player class hierarchy, without clobbering any that were added higher up."; 2return {"page", "whisper", "move", "join", "accept", "mail"};
translate_refusal_synonym
Referenced by
- #90:parse_refuse_arguments line 17:
this:translate_refusal_synonym
Source
1"'translate_refusal_synonym (<word>)' -> list - If the <word> is a synonym for some set of refusals, return the list of those refusals. Otherwise return the empty list, {}. Programmers can override this verb to provide more synonyms."; 2word = args[1]; 3if (word == "all") 4return this:refusable_actions(); 5endif 6return {};
default_refusals_text_filter
Referenced by
none
Source
1"'default_refusals_text_filter (<origin>, <actions>)' - Return any actions by this <origin> which should be included in the text returned by :refusals_text. This is the default filter, which includes all actions."; 2return args[2];
refusals_text
Referenced by
- #90:@refusals line 15:
this:refusals_text
Source
1"'refusals_text (<player>, [<filter verb name>])' - Return text describing the given player's refusals. The filter verb name is optional; if it is given, this verb takes an origin and a list of actions and returns any actions which should be included in the refusals text. This verb works only if <player> is a player who has the refusals facility; it does not check for this itself."; 2{who, ?filter_verb = "default_refusals_text_filter"} = args; 3text = {}; 4for i in [1..length(who.refused_origins)] 5origin = who.refused_origins[i]; 6actions = this:(filter_verb)(origin, who.refused_actions[i]); 7if (actions) 8line = ""; 9for action in (actions) 10line = (line + " ") + action; 11endfor 12line = (this:refusal_origin_to_name(origin) + ": ") + line; 13line = (ctime(who.refused_until[i]) + " ") + line; 14text = {@text, line}; 15endif 16endfor 17if (!text) 18text = {"No refusals."}; 19endif 20return text;
player_to_refusal_origin
Referenced by
- #90:parse_refuse_arguments line 45:
this:player_to_refusal_origin - #90:add_refusal line 6:
this:player_to_refusal_origin - #90:refuses_action line 5:
this:player_to_refusal_origin
Source
1"'player_to_refusal_origin (<player>)' -> <origin> - Convert a player to a unique identifier called the player's 'refusal origin'. For most players, it's just their object number. For guests, it is a hash of the site they are connecting from. Converting an origin to an origin is a safe no-op--the code relies on this."; 2who = args[1]; 3if ((((typeof(who) == OBJ) && valid(who)) && (parent(who) == $object_utils:has_property($local, "guest"))) ? $local.guest | $guest) 4return who:connection_name_hash("xx"); 5else 6return who; 7endif
refusal_origin_to_name
Referenced by
- #90:@ref*use line 13:
this:refusal_origin_to_name - #90:refusals_text line 12:
this:refusal_origin_to_name
Source
1"'refusal_origin_to_name (<origin>)' -> string - Convert a refusal origin to a name."; 2origin = args[1]; 3if (origin in {"all guests", "everybody"}) 4return origin; 5elseif (typeof(origin) != OBJ) 6return "a certain guest"; 7elseif (origin == #-1) 8return "Everybody"; 9else 10return $string_utils:name_and_number(origin); 11endif
check_refusal_actions
Referenced by
- #90:add_refusal line 13:
this:check_refusal_actions
Source
1"'check_refusal_actions (<actions>)' - Check a list of refusal actions, and return whether they are all legal."; 2actions = args[1]; 3legal_actions = this:refusable_actions(); 4for action in (actions) 5if (!(action in legal_actions)) 6return 0; 7endif 8endfor 9return 1;
add_refusal
Referenced by
- #90:@ref*use line 12:
this:add_refusal
Source
1"'add_refusal (<origin>, <actions> [, <duration> [, <extra>]])' - Add refusal(s) to this player's list. <Actions> is a list of the actions to be refused. The list should contain only actions, no synonyms. <Origin> is the actor whose actions are to be refused. <Until> is the time that the actions are being refused until, in the form returned by time(). It is optional; if it's not given, it defaults to .default_refusal_time. <Extra> is any extra information; it can be used for comments, or to make finer distinctions about the actions being refused, or whatever. If it is not given, it defaults to 0. The extra information is per-action; that is, it is stored separately for each action that it applies to."; 2if (caller != this) 3return E_PERM; 4endif 5{orig, actions, ?duration = this.default_refusal_time, ?extra = 0} = args; 6origins = this:player_to_refusal_origin(orig); 7if (typeof(origins) != LIST) 8origins = {origins}; 9endif 10if (typeof(actions) != LIST) 11actions = {actions}; 12endif 13if (!this:check_refusal_actions(actions)) 14return E_INVARG; 15endif 16until = time() + duration; 17for origin in (origins) 18if (i = origin in this.refused_origins) 19this.refused_until[i] = until; 20for action in (actions) 21if (j = action in this.refused_actions[i]) 22this.refused_extra[i][j] = extra; 23else 24this.refused_actions[i] = {@this.refused_actions[i], action}; 25this.refused_extra[i] = {@this.refused_extra[i], extra}; 26endif 27endfor 28else 29this.refused_origins = {@this.refused_origins, origin}; 30this.refused_actions = {@this.refused_actions, actions}; 31this.refused_until = {@this.refused_until, until}; 32this.refused_extra = {@this.refused_extra, $list_utils:make(length(actions), extra)}; 33endif 34endfor
remove_refusal
Referenced by
- #90:@unref*use line 23:
this:remove_refusal - #90:remove_expired_refusals line 10:
this:remove_refusal
Source
1"'remove_refusal (<origin>, <actions>)' - Remove any refused <actions> by <origin>. The <actions> list should contain only actions, no synonyms. Return the number of such refusals found (0 if none)."; 2if (caller != this) 3return E_PERM; 4endif 5{origin, actions} = args; 6if (typeof(actions) != LIST) 7actions = {actions}; 8endif 9count = 0; 10i = origin in this.refused_origins; 11if (i) 12for action in (actions) 13if (j = action in this.refused_actions[i]) 14this.refused_actions[i] = listdelete(this.refused_actions[i], j); 15this.refused_extra[i] = listdelete(this.refused_extra[i], j); 16count = count + 1; 17endif 18endfor 19if (!this.refused_actions[i]) 20this.refused_origins = listdelete(this.refused_origins, i); 21this.refused_actions = listdelete(this.refused_actions, i); 22this.refused_until = listdelete(this.refused_until, i); 23this.refused_extra = listdelete(this.refused_extra, i); 24endif 25endif 26return count;
remove_expired_refusals
Referenced by
- #90:refuses_action_* line 6:
this:remove_expired_refusals
Source
1"'remove_expired_refusals ()' - Remove refusal entries which are past their time limits."; 2origins = {}; 3"Before removing any refusals, figure out which ones to remove. Removing one changes the indices and invalidates the loop invariant."; 4for i in [1..length(this.refused_origins)] 5if (time() >= this.refused_until[i]) 6origins = {@origins, this.refused_origins[i]}; 7endif 8endfor 9for origin in (origins) 10this:remove_refusal(origin, this:refusable_actions()); 11endfor
refuses_action
Referenced by
- #90:wh*isper line 2:
this:refuses_action - #90:receive_page line 2:
this:refuses_action - #90:moveto line 8:
this:refuses_action - #90:moveto line 18:
this:refuses_action - #90:receive_message line 4:
this:refuses_action
Source
1"'refuses_action (<origin>, <action>, ...)' - Return whether this object refuses the given <action> by <origin>. <Origin> is typically a player. Extra arguments after <origin>, if any, are used to further describe the action."; 2"Modified by Diopter (#98842) at LambdaMOO"; 3{origin, action, @extra_args} = args; 4extra_args = {origin, @extra_args}; 5rorigin = this:player_to_refusal_origin(origin); 6if (((which = rorigin in this.refused_origins) && (action in this.refused_actions[which])) && this:("refuses_action_" + action)(which, @extra_args)) 7return 1; 8elseif (((((typeof(rorigin) == OBJ) && valid(rorigin)) && (which = rorigin.owner in this.refused_origins)) && (action in this.refused_actions[which])) && this:("refuses_action_" + action)(which, @extra_args)) 9return 1; 10elseif ((((which = $nothing in this.refused_origins) && (rorigin != this)) && (action in this.refused_actions[which])) && this:("refuses_action_" + action)(which, @extra_args)) 11return 1; 12elseif ((((which = "all guests" in this.refused_origins) && $object_utils:isa(origin, $guest)) && (action in this.refused_actions[which])) && this:("refuses_action_" + action)(which, @extra_args)) 13return 1; 14endif 15return 0;
refuses_action_*
Referenced by
none
Source
1"'refuses_action_* (<which>, <origin>, ...)' - The action (such as 'whisper' for the verb :refuses_action_whisper) is being considered for refusal. Return whether the action should really be refused. <Which> is an index into this.refused_origins. By default, always refuse non-outdated actions that get this far."; 2{which, @junk} = args; 3if (time() >= this.refused_until[which]) 4fork (0) 5"This <origin> is no longer refused. Remove any outdated refusals."; 6this:remove_expired_refusals(); 7endfork 8return 0; 9else 10return 1; 11endif
report_refusal
Referenced by
- #90:wh*isper line 4:
this:report_refusal - #90:page_echo_msg line 3:
this:report_refusal
Source
1"'report_refusal (<player>, <message>, ...)' - If refusal reporting is turned on, print the given <message> to report the refusal of some action by <player>. The message may take more than one argument. You can override this verb to do more selective reporting."; 2if (this.report_refusal) 3this:tell(@listdelete(args, 1)); 4endif
wh*isper
Referenced by
none
Source
1"'whisper <message> to <this player>' - Whisper a message to this player which nobody else can see."; 2if (this:refuses_action(player, "whisper")) 3player:tell(this:whisper_refused_msg()); 4this:report_refusal(player, "You just refused a whisper from ", player.name, "."); 5else 6pass(@args); 7endif
receive_page
Referenced by
none
Source
1"'receive_page (<message>)' - Receive a page. If the page is accepted, pass(@args) shows it to the player."; 2if (this:refuses_action(player, "page")) 3this.page_refused = task_id(); 4return 0; 5endif 6this.page_refused = 0; 7return pass(@args);
page_echo_msg
Referenced by
none
Source
1"'page_echo_msg ()' - Return a message to inform the pager what happened to their page."; 2if (task_id() == this.page_refused) 3this:report_refusal(player, "You just refused a page from ", player.name, "."); 4return this:page_refused_msg(); 5else 6return pass(@args); 7endif
moveto acceptable
Referenced by
none
Source
1"'moveto (<destination>)', 'accept (<object>)' - Check whether this :moveto or :accept is allowed or refused. If it is allowed, do it. This code is slightly modified from an original verb by Grump. Upgraded by Bits to account for forthcoming 1.8.0 behavior of callers()."; 2by = callers(); 3"Ignore all the verbs on this."; 4while (((y = by[1])[1] == this) && (y[2] == verb)) 5by = listdelete(by, 1); 6endwhile 7act = (verb == "moveto") ? "move" | "accept"; 8if ((player != this) && this:refuses_action(player, act, args[1])) 9"check player"; 10return 0; 11endif 12last = #-1; 13for k in (by) 14if ((((perms = k[3]) == #-1) && (k[2] != "")) && (k[1] == #-1)) 15elseif ((!perms.wizard) && (perms != this)) 16if (perms != last) 17"check for possible malicious programmer"; 18if (this:refuses_action(perms, act, args[1])) 19return 0; 20endif 21last = perms; 22endif 23endif 24endfor 25return pass(@args);
receive_message
Referenced by
none
Source
1"'receive_message (<message>, <sender>)' - Receive the given mail message from the given sender. This version handles refusal of the message."; 2if ((!$perm_utils:controls(caller_perms(), this)) && (caller != this)) 3return E_PERM; 4elseif (this:refuses_action(args[2], "mail")) 5return this:mail_refused_msg(); 6else 7return pass(@args); 8endif
whisper_refused_msg page_refused_msg mail_refused_msg
Referenced by
- #90:wh*isper line 3:
this:whisper_refused_msg - #90:page_echo_msg line 4:
this:page_refused_msg - #90:receive_message line 5:
this:mail_refused_msg
Source
1"'whisper_refused_msg()', 'page_refused_msg()', etc. - Return a message string."; 2return $string_utils:pronoun_sub(this.(verb), this);
last_huh
Referenced by
none
Source
1set_task_perms(caller_perms()); 2if (pass(@args)) 3return 1; 4endif 5{verb, args} = args; 6if (valid(dobj = $string_utils:literal_object(dobjstr)) && (r = $match_utils:match_verb(verb, dobj, args))) 7return r; 8elseif (valid(iobj = $string_utils:literal_object(iobjstr)) && (r = $match_utils:match_verb(verb, iobj, args))) 9return r; 10else 11return 0; 12endif
ping_features
Referenced by
none
Source
1":ping_features()"; 2" -- cleans up the .features list to remove !valid objects"; 3" ==> cleaned-up .features list"; 4features = this.features; 5for x in (features) 6if (!$recycler:valid(x)) 7features = setremove(features, x); 8endif 9endfor 10return this.features = features;
set_owned_objects
Referenced by
none
Source
1":set_owned_objects( LIST owned-objects list )"; 2" -- set your .owned_objects, ordered as you please"; 3" -- no, it will NOT let you set to to anything you want"; 4if ((caller == this) || $perm_utils:controls(caller_perms(), this)) 5new = args[1]; 6old = this.owned_objects; 7"make sure they're the same"; 8if (length(new) != length(old)) 9return E_INVARG; 10endif 11for i in (new) 12old = setremove(old, i); 13endfor 14if (old) 15"something's funky"; 16return E_INVARG; 17endif 18return this.owned_objects = new; 19else 20return E_PERM; 21endif
init_for_core
Referenced by
- #4:init_for_core line 7:
pass(
Source
1if (caller_perms().wizard) 2pass(); 3if ($code_utils:verb_location() == this) 4this.rooms = {}; 5else 6clear_property(this, "rooms"); 7endif 8endif
@stats @score @points @status
Referenced by
none
Source
1"Allows you to view other player stats, as well as your own."; 2if ((parent(player) == $rpgamer) && (player != this)) 3return player:tell("You can only view your own stats."); 4elseif (dobjstr) 5dobj = $string_utils:match_player(dobjstr); 6x = valid(dobj) ? dobj | $match_utils:match_list(dobjstr, $object_utils:descendants($puppet)); 7dobj = ((typeof(x) == LIST) && x) ? x[1] | dobj; 8if (valid(dobj)) 9dobj:(verb)(); 10else 11player:tell("No definite match for a player by the name \"", dobjstr, "\"."); 12endif 13else 14pass(@args); 15endif 16"WIZ PERMS";
@award
Referenced by
none
Source
1"USAGE: @award major/maj/standard/std/minor/min to <player>"; 2"Awards free points for good roleplay"; 3"The $rp_regulator feature has a wiz-only \"@awards\" verb that lists all recent awards."; 4if (this == iobj) 5return player:tell("I don't understand that."); 6endif 7if ((!(dobjstr in {"major", "maj", "standard", "std", "minor", "min"})) || (!iobjstr)) 8player:tell("USAGE: @award major/maj/standard/std/minor/min to <player>"); 9else 10iobj = $string_utils:match_player(iobjstr); 11if (valid(iobj)) 12if (dobjstr in {"major", "maj"}) 13iobj.free_points = iobj.free_points + 2.5; 14a = 3; 15elseif (dobjstr in {"standard", "std"}) 16iobj.free_points = iobj.free_points + 1.0; 17a = 2; 18else 19iobj.free_points = iobj.free_points + 0.25; 20a = 1; 21endif 22player:tell(dobjstr, " awarded to ", iobj:title(), "."); 23`$rp_regulator.awards = {@$rp_regulator.awards, {iobj, a, player, time()}} ! E_PROPNF => ""'; 24else 25player:tell("No definite match for a player by the name \"", iobjstr, "\"."); 26endif 27endif 28"WIZ PERMS";
@sanctuaries
Referenced by
none
Source
1"@sanctuaries => Tells player all sanctuaries."; 2" If the player is a wizard, fixes unset dump_loc properties."; 3for x in ($object_utils:descendants_suspended($rpg_room)) 4(ticks_left() < 4000) && suspend(0); 5if (x.sanctuary) 6x.dump_loc = (((player.wizard && (!x.f)) && (x.dump_loc == $rpg_room.dump_loc)) && `x.virtual_exits ! E_PROPNF => 0') ? x.virtual_exits[random($)][2] | x.dump_loc; 7mail = (x.sanctuary == 2) ? " (MAIL)" | ""; 8player:tell($string_utils:nn(x), mail, " dumps to ", $string_utils:nn(x.dump_loc)); 9endif 10endfor
whois
Referenced by
none
Source
1"syntax: \"whois <description>\" or \"whois in <#room or org>\""; 2" Use no arguments for a complete rpgamer listing."; 3if (player != this) 4return player:tell("This FO is for administrator use only."); 5"in case someone has made this verb +x."; 6endif 7thelist = {}; 8{one, two} = (pieces = $string_utils:first_word(argstr)) ? pieces | {"", ""}; 9argstr = (one in {"a", "in"}) ? two | argstr; 10org = ""; 11chargen = `$local.chargen ! ANY => $chargen'; 12if (one == "in") 13if ($object_utils:isa(iobj, $room)) 14for p in (iobj.contents) 15if (is_player(p)) 16thelist = {@thelist, p}; 17endif 18endfor 19elseif (two) 20org = (z = $string_utils:match_stringlist(two, $list_utils:slice(chargen.orgs))) ? chargen.orgs[z][1] | two; 21endif 22endif 23if ((one in {"", "in"}) && (!$object_utils:isa(iobj, $room))) 24total = 0; 25thelist = $object_utils:descendants_suspended($rpgamer); 26if (org) 27for x in (thelist) 28if (is_player(x)) 29(ticks_left() < 4000) && suspend(0); 30if (x.org == org) 31blurb = x.wizard ? " [green]******* WIZARD[normal]" | ""; 32blurb = ((!blurb) && $object_utils:isa(x, $frand_class)) ? " [red]*** ADMINISTRATOR[normal]" | blurb; 33player:tell($string_utils:nn(x), blurb); 34total = total + 1; 35endif 36endif 37endfor 38else 39for x in (thelist) 40if (is_player(x)) 41(ticks_left() < 4000) && suspend(0); 42player:tell($string_utils:nn(x), " ", x.org, ", a ", x.gender, " ", x.race); 43total = total + 1; 44endif 45endfor 46endif 47player:tell("_____________"); 48return player:tell(total, " TOTAL"); 49endif 50for p in (players()) 51(ticks_left() < 2000) && suspend(0); 52if (valid(m = $match_utils:match(argstr, {p})) && (m == p)) 53thelist = {@thelist, p}; 54endif 55endfor 56if (thelist == {}) 57thematch = $failed_match; 58elseif (length(thelist) == 1) 59thematch = thelist[1]; 60else 61thematch = thelist; 62endif 63if (typeof(thematch) == LIST) 64matches = {}; 65for z in (thematch) 66suspend(0); 67matches = {@matches, (z.location == this.location) ? "[red]*[normal]" + $string_utils:nn(z) | $string_utils:nn(z)}; 68endfor 69player:tell($string_utils:english_list(matches), " are all players matching that description."); 70player:tell("[red]*[normal] = your location."); 71elseif (thematch == $failed_match) 72player:tell("No match found."); 73else 74player:tell($string_utils:nn(thematch), ", who is in ", $string_utils:nn(thematch.location)); 75endif