generic blueprint #334
Aliases: generic blueprint
56 verbs · 59 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
initialize | this none this | rxd | #334 | 8 |
invoke | this none this | rxd | #334 | 3 |
edit | this none none | rxd | #334 | 6 |
focus | any any any | rxd | #334 | 28 |
change_focus | this none this | rxd | #334 | 8 |
type | any none none | rxd | #334 | 29 |
focus_for | this none this | rxd | #334 | 12 |
type_for | this none this | rxd | #334 | 15 |
default_room | this none this | rxd | #334 | 6 |
default_exit | this none this | rxd | #334 | 6 |
dig | any at/to any | rxd | #334 | 77 |
ren*ame | any none none | rxd | #334 | 14 |
lose_focus | this none this | rxd | #334 | 6 |
commit | none none none | rxd | #334 | 11 |
desc*ribe | any any any | rxd | #334 | 15 |
mess*ages | any any any | rxd | #334 | 41 |
set_message | this none this | rxd | #334 | 35 |
instantiate | this none this | rxd | #334 | 73 |
del*ete | none none none | rxd | #334 | 53 |
reset | any none none | rxd | #334 | 42 |
furnish | this none this | rxd | #334 | 16 |
copy_props | this none this | rxd | #334 | 14 |
types | this none this | rxd | #334 | 1 |
rooms | none none none | rxd | #334 | 9 |
fertilize | this none this | rxd | #334 | 9 |
_itemize_costs | this none this | rxd | #334 | 10 |
invoice | this none this | rxd | #334 | 12 |
uninstantiate | this none this | rxd | #334 | 34 |
_total_cost | this none this | rxd | #334 | 6 |
bpname | any any any | rxd | #334 | 13 |
bpdesc | any any any | rxd | #334 | 10 |
sky_room | this none this | rxd | #334 | 1 |
@list-costs | this none none | rxd | #334 | 12 |
bury | any none none | rxd | #334 | 59 |
bury_room | this none this | rxd | #334 | 30 |
bury_would_orphan | this none this | rxd | #334 | 20 |
find_path | this none this | rxd | #334 | 24 |
bury_exit | this none this | rxd | #334 | 8 |
instantiate_new | this none this | rxd | #334 | 56 |
path_exists | this none this | rxd | #334 | 23 |
warp | any none none | rxd | #334 | 10 |
instantiate_old | this none this | rxd | #334 | 59 |
valid_blueprint | this none this | rxd | #334 | 6 |
mapicon | any any any | rxd | #334 | 49 |
authorize | any none none | rxd | #334 | 18 |
deauthorize | any none none | rxd | #334 | 14 |
can_edit | this none this | rxd | #334 | 2 |
areaicon | any any any | rxd | #334 | 50 |
clearmess*age | any any any | rxd | #334 | 14 |
type-otherside otype | any none none | rxd | #334 | 30 |
addnote rmnote | none none none | rxd | #334 | 49 |
notes | none none none | rxd | #334 | 2 |
room_removed | this none this | rxd | #334 | 5 |
setdark | any none none | rxd | #334 | 36 |
handle_creature_death | this none this | rxd | #334 | 12 |
should_reset | this none this | rxd | #334 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
help_msg | #334 | rc | #361 | list of 40{"The generic blueprint is an $area that allows you to duplicate its contents, creating an identical area. This allows one to design an area using whatever $room and $exit types are appropriate, then make as many copies of it as necessary (perhaps you have a block filled with row houses that are all alike).", "", "When you create a $blueprint, the blueprint sets up a room at coordinates 0,0,0. You can enter this room and begin building as you normally would by calling its edit() verb on the command line or via eval. Once invoked you will be transported to the virtual space you are building the blueprint for. When you decide that you're finished editing, you can type 'commit' to be taken back to the blueprint's location. Right now this is mostly intended for use in the matrix, where we can get away with such interfaces. ", "", "When you enter the blueprint it is also added to your features list, so several new commands become available to you (or to players, or anyone who edits the $blueprint).", "", "dig -- works just like @dig, except that it autoparents the room and exits to whatever is set by the blueprint's :default_room verb. By default, :default_room returns the first room in the room type list given in its .types property (more on this later)", "", "focus -- allows the architect to focus on a room, exit, or object. Once you've set a focus, you can operate on that object with the commads below.", "", "ren*ame <name>,alias1,alias2,etc -- renames the user's focus", "", "desc*ribe <text for the description> -- set the description of the user's focus object", "", "mess*ages -- shows the available messages for the user's focus", "mess*ages <message_name> <new_message> -- sets the named message to the text given by the new message", "", "type -- show available types for the focus", "type <num> -- select type <num> for the focus", " ", "Note that as a programmer you can also use all of your existing building tools in a $Blueprint, or copy in rooms from elsewhere. The simplified building interface is intended mainly to allow construction by players, and will be expanded as time permits.", "", "Setting up a $Blueprint requires setting a few key properties:", "", "types -- This is a list of lists that defines what can be constructed within this blueprint via the construction tools. Each list element is a list containing a generic type and a list of available subtypes for that generic. The only required types are $room and $exit, so at a bare minimum your $Blueprint's type list should look like this:", "", "types = {{$room, {$room}}, {$exit, {$exit}}", "", "Ideally it would include a concise list that contains the generics that would be common to the type of area that you're trying to create. For instance, the generic host blueprint defines these types for building matrix areas:", "", "types = {{$room, {#1835}}, {$exit, {#2124, #2178}}", "", "The first room and exit in your subtype list are important as they are what will be retured by the blueprint's :default_room and :default_exit methods, which are used to determine the types used by the 'dig' command.", "", "area_type -- This points to the object that will be the parent of the area created to hold the rooms you define in your blueprint. Set this to whatever is appropriate for the area you'll be creating (should be some descendant of $area).", "", "Once you've got it all set up, you'll be ready to call the area's :instantiate method. Be careful about what you instantiate, though, as there is currently no easy way to clean up after yourself and this could be an enormous source of database bloat if not used carefully.", "", ":instantiate will return the object number of a newly-created area that matches the one in the blueprint. You can then link it in however you choose, just don't lose it!", ""} |
adjacent_areas | #114 | rc | #361 | <clear> |
reset_listeners | #114 | rc | #361 | {} |
recalc_paths_on_reset | #114 | rc | #361 | <clear> |
generic_citizen | #114 | rc | #361 | <clear> |
citizen_population | #114 | rc | #361 | <clear> |
thirst_modifier | #114 | rc | #361 | <clear> |
powerplant | #114 | rc | #361 | <clear> |
blank_icon | #114 | rc | #361 | <clear> |
combat_ok | #114 | rc | #361 | <clear> |
combat_fail_msg | #114 | rc | #361 | <clear> |
contiguous_map | #114 | rc | #361 | <clear> |
icon | #114 | rc | #361 | <clear> |
heart | #114 | rc | #361 | "long" |
heart_tick | #114 | rc | #361 | 8 |
reset_interval | #114 | rc | #361 | <clear> |
last_reset | #114 | rc | #361 | 1337755258 |
contiguous_map_offsets | #114 | rc | #361 | <clear> |
area_link_icons | #114 | r | #361 | <clear> |
icon_blocks | #114 | rc | #361 | <clear> |
adjacent_area_rooms | #114 | rc | #361 | <clear> |
value | #114 | rc | #361 | <clear> |
has_proper_name | #114 | rc | #361 | <clear> |
client_blank_icon | #114 | rc | #361 | <clear> |
client_bg_icon | #114 | rc | #361 | <clear> |
default_exit_type | #114 | rc | #361 | <clear> |
gee | #114 | rc | #361 | <clear> |
may_chat | #114 | rc | #361 | <clear> |
players | #114 | rc | #361 | {} |
dont_hibernate | #114 | rc | #361 | 1 |
linkable | #114 | rc | #361 | <clear> |
_allow_combat | #114 | rc | #361 | <clear> |
bigmap | #114 | rc | #361 | <clear> |
next_hop_ok | #114 | rc | #361 | <clear> |
maproom | #114 | rc | #361 | <clear> |
area_code | #114 | rwc | #361 | <clear> |
claimed_by | #114 | rc | #361 | <clear> |
claimable | #114 | rc | #361 | <clear> |
multiland | #114 | rc | #361 | <clear> |
z_sorted_rooms | #114 | rc | #361 | <clear> |
admin_ok | #114 | rc | #361 | <clear> |
show_time | #114 | rc | #361 | <clear> |
knockout_ok | #114 | rc | #361 | <clear> |
dark_night | #114 | rc | #361 | <clear> |
path_link_ok | #114 | rc | #361 | <clear> |
auto_clean | #114 | rc | #361 | <clear> |
docks | #114 | rc | #361 | <clear> |
wall_msg | #114 | rc | #361 | <clear> |
hibernating | #114 | rc | #361 | 0 |
aliases | #1 | rc | #361 | {"generic blueprint"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {0, 0} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | list of 12{"Generic Blueprint", "=================", "The generic blueprint is an $area that allows you to duplicate its contents, creating an identical area. This allows one to design an area using whatever $room and $exit types are appropriate, then make as many copies of it as necessary (perhaps you have a block filled with row houses that are all alike).", "", "When you create a $blueprint, the blueprint sets up a room at coordinates 0,0,0. You can enter this room and begin building as you normally would by calling its edit() verb on the command line or via eval. Once invoked you will be transported to the virtual space you are building the blueprint for. When you decide that you're finished editing, you can type 'commit' to be taken back to the blueprint's location. Right now this is mostly intended for use in the matrix, where we can get away with such interfaces. ", "", "When you enter the blueprint it is also added to your features list, so several new commands become available to you (or to players, or anyone who edits the $blueprint).", "", "dig -- works just like @dig, except that it autoparents the room and exits to whatever is set by the blueprint's :default_room verb. By default, :default_room returns the first room in the room type list given in its .types property (more on this later)", "", "focus -- allows the architect to focus on a room, exit, or object. Once you've set a focus, you can operate on that object with the commads below.", " "} |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #114 generic area → #1 root
Children: none
Call graph
Showing 48 of 104 verbs; 56 not shown.
Source
initialize
Referenced by
none
Source
1room_type = this:default_room(); 2$bpnet:debug($su:nn(this), ": Room type -> ", $su:nn(room_type)); 3if (valid(room_type)) 4room = this.owner:_create(room_type); 5$bpnet:debug($su:nn(this), ": spawn -> ", $su:nn(room)); 6move(room, this); 7this.entrance = room; 8endif
invoke
Referenced by
- #334:edit line 3:
this:invoke
Source
1who = args[1]; 2who:add_feature(this); 3who:moveto(this.entrance);
edit
Referenced by
none
Source
1if (this:can_edit(player)) 2player.location:announce(((player:name() + " disappears into ") + this:dname()) + "."); 3this:invoke(player); 4else 5player:tell(("Sorry, you are not permitted to edit " + this:name()) + "."); 6endif
focus
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!argstr) 5focus = this:focus_for(player); 6if (!$recycler:valid(focus)) 7player:tell("You aren't focusing on anything."); 8else 9player:tell(((("You are currently focusing on " + focus.name) + " (in ") + focus.location.name) + ")."); 10endif 11return; 12endif 13target = dobj; 14if (!$recycler:valid(target)) 15target = $match_utils:match(argstr, {@player.location.contents}); 16if (!$recycler:valid(target)) 17player:tell(("You don't see any \"" + argstr) + "\" to focus on."); 18return; 19endif 20endif 21for x in (this:types()) 22if (is_a(target, x[1])) 23this:change_focus(player, target); 24player:tell(("You focus on " + target:dname()) + "."); 25return; 26endif 27endfor 28player:tell(target:dnamec() + " isn't something you can focus on.");
change_focus
Referenced by
- #334:focus line 23:
this:change_focus
Source
1who = args[1]; 2focus = args[2]; 3for x in (this.focus) 4if (x[1] == who) 5this.focus = setremove(this.focus, x); 6endif 7endfor 8this.focus = setadd(this.focus, {who, focus});
type
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!valid(focus = this:focus_for(player))) 5player:tell("You're not focusing on anything."); 6return; 7endif 8types = this:type_for(focus); 9if (!dobjstr) 10player:tell((focus.name + " is currently of type: ") + parent(focus).name); 11player:tell(("Available types for " + focus.name) + ":"); 12for y in [1..length(types)] 13player:tell((tostr(y) + ". ") + types[y].name); 14endfor 15return; 16player:tell(("There are no types available for " + focus.name) + "."); 17return; 18else 19selection = tonum(dobjstr); 20if ((selection < 1) || (selection > length(types))) 21player:tell(((("\"" + dobjstr) + "\" isn't a valid type choice for ") + focus.name) + "."); 22return; 23endif 24player:tell(((((("Changing " + focus.name) + " from ") + parent(focus).name) + " to ") + types[selection].name) + "."); 25chparent(focus, types[selection]); 26if (is_a(focus, $door) && is_a(focus.otherside, $exit)) 27chparent(focus.otherside, types[selection]); 28endif 29endif
focus_for
Referenced by
- #334:focus line 5:
this:focus_for - #334:type line 4:
this:focus_for - #334:ren*ame line 4:
this:focus_for - #334:ren*ame line 10:
this:focus_for - #334:desc*ribe line 4:
this:focus_for - #334:mess*ages line 4:
this:focus_for - #334:set_message line 2:
this:focus_for - #334:del*ete line 7:
this:focus_for - #334:clearmess*age line 5:
this:focus_for - #334:type-otherside line 4:
this:focus_for
Source
1who = args[1]; 2for x in (this.focus) 3if (x[1] == who) 4if (x[2] in {who.location, @who.location.contents}) 5return x[2]; 6else 7this:lose_focus(who); 8return #-1; 9endif 10endif 11endfor 12return #-1;
type_for
Referenced by
- #334:type line 8:
this:type_for - #334:type-otherside line 12:
this:type_for
Source
1focus = args[1]; 2for x in (this:types()) 3if (is_a(focus, x[1])) 4types = x[2]; 5for y in (types) 6if (!is_a(y, x[1])) 7$nets.bpnet:announce(#2, (((($su:nn(this) + " has type ") + $su:nn(y)) + " for ") + $su:nn(x[1])) + " that isn't a child of it.", 1); 8types = setremove(types, y); 9endif 10endfor 11return types; 12endif 13endfor 14return {}; 15types = x[2];
default_room
Referenced by
- #334:initialize line 1:
this:default_room - #334:dig line 49:
this:default_room - #334:dig line 51:
this:default_room
Source
1for x in (this:types()) 2if (is_a(x[1], $room)) 3return x[2][1]; 4endif 5endfor 6return #-1;
default_exit
Referenced by
- #334:dig line 60:
this:default_exit
Source
1for x in (this:types()) 2if (is_a(x[1], $exit)) 3return x[2][1]; 4endif 5endfor 6return #-1;
dig
Referenced by
none
Source
1"dig <exitspec> to <roomspec>"; 2" <exitspec> can either be a cardinal direction or a namespec for an exit"; 3" pair, which would look something like this:"; 4" northern door,door,north,n|southern door,door,south,s"; 5" As you can see, it's a list of name and aliases for each side of the exit"; 6" pair."; 7" <roomspec> can be either a name,aliases spec for a new room, or a room"; 8" number from an existing room in the blueprint (as given by the 'rooms'"; 9" command)."; 10if (!this:valid_blueprint()) 11return; 12endif 13spec1 = spec2 = ""; 14"parse the roomspec"; 15if (((roomnum = tonum(iobjstr)) < 1) || (roomnum > length(rooms = this:occupants($room)))) 16"this isn't a number spec, so we'll treat it as the name of a new room"; 17dest = #-1; 18else 19dest = rooms[roomnum]; 20endif 21"parse the exitspec"; 22if (cdir = $building_utils:match_cardinal_dir(dobjstr)) 23if (is_a(existing = player.location:match_exit(dobjstr), $exit)) 24player:tell("There's already an exit in that direction."); 25return; 26else 27opposite = $building_utils:opposite_dir(dobjstr); 28if (is_a(dest, $room) && is_a(oexisting = dest:match_exit(opposite), $exit)) 29player:tell(("There's already an exit leading " + opposite) + " back out of ", dest.name, "."); 30return; 31endif 32xaliases1 = {cdir, @$building_utils:exit_aka(cdir)}; 33xaliases2 = {opposite, @$building_utils:exit_aka(opposite)}; 34endif 35else 36"a detailed exit spec was given."; 37specs = $su:explode(dobjstr, "|"); 38if (length(specs) != 2) 39player:tell("Invalid exit spec. They should look like this: this_side_name,alias1,alias2|other_side_name,alias1,alias2"); 40return; 41endif 42xaliases1 = $su:explode(specs[1], ","); 43xaliases2 = $su:explode(specs[2], ","); 44endif 45"create the room if neccesary"; 46if (!valid(dest)) 47player:tell("Creating destination room '", iobjstr, "'."); 48if (this.use_spawn) 49dest = $rpg:spawn(this:default_room()); 50else 51dest = $recycler:_create(this:default_room()); 52$wiz_utils:set_owner(dest, player); 53endif 54dest:moveto(player.location:area()); 55dest:set_name(iobjstr); 56dest.x = dest.y = dest.z = 9999; 57player:tell("Created '", dest.name, "' destination room."); 58endif 59"create the exits"; 60default_exit = this:default_exit(); 61{exit1, exit2} = $building_utils:make_exit_pair(player.location, dest); 62chparent(exit1, default_exit); 63chparent(exit2, default_exit); 64$wiz_utils:set_owner(exit1, this.use_spawn ? #984 | player); 65$wiz_utils:set_owner(exit2, this.use_spawn ? #984 | player); 66exit1:set_name(xaliases1[1]); 67exit1.direction = xaliases1[1]; 68exit1:set_aliases(xaliases1); 69player:tell("Created '", exit1.name, "' as an exit."); 70player.location:add_exit(exit1); 71exit2:set_name(xaliases2[1]); 72exit2.direction = xaliases2[1]; 73exit2:set_aliases(xaliases2); 74player:tell("Created '", exit2.name, "' as an exit."); 75dest:add_exit(exit2); 76player:tell("Exit fully linked!"); 77player.location:set_xyz_rec();
ren*ame
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4focus = this:focus_for(player); 5if (!valid(focus)) 6player:tell(this.not_focused_msg); 7return; 8endif 9if (!dobjstr) 10player:tell($su:from_list(this:focus_for(player).aliases, ", ")); 11else 12player:tell(((("Changed the aliases from " + $su:from_list(focus.aliases, ",")) + " to ") + dobjstr) + "."); 13$building_utils:set_names(focus, dobjstr); 14endif
lose_focus
Referenced by
- #334:focus_for line 7:
this:lose_focus - #334:commit line 10:
this:lose_focus
Source
1who = args[1]; 2for x in (this.focus) 3if (x[1] == who) 4this.focus = setremove(this.focus, x); 5endif 6endfor
commit
Referenced by
- #334:del*ete line 39:
this:commit
Source
1{?who = player} = args; 2if (!this:valid_blueprint()) 3return; 4elseif (!is_in(who, this)) 5return who:tell("I don't understand that."); 6endif 7who.location:announce(((who:name() + " pops out of ") + this:name()) + "."); 8who:moveto(this.location); 9who:remove_feature(this); 10this:lose_focus(who); 11this.location:announce_all_but({who}, ((who:name() + " pops out of ") + this:name()) + ".");
desc*ribe
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4focus = this:focus_for(player); 5if (!valid(focus)) 6player:tell(this.not_focused_msg); 7return; 8endif 9if (!argstr) 10player:tell(("Current description for " + focus.name) + ":"); 11player:tell_lines(focus.description); 12else 13focus:set_description($su:explode(argstr, "//")); 14player:tell(("Description set for " + focus.name) + "."); 15endif
mess*ages
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4focus = this:focus_for(player); 5if (!valid(focus)) 6player:tell(this.not_focused_msg); 7return; 8endif 9if (!argstr) 10found_one = 0; 11props = $object_utils:all_properties(focus); 12if (typeof(props) == ERR) 13player:notify("You can't read the messages on that."); 14return; 15endif 16for pname in (props) 17len = length(pname); 18if ((len > 4) && (pname[len - 3..len] == "_msg")) 19found_one = 1; 20msg = `focus.(pname) ! ANY'; 21if (msg == E_PERM) 22value = "isn't readable by you."; 23elseif (!msg) 24value = "isn't set."; 25elseif (typeof(msg) == LIST) 26value = "is a list."; 27elseif (typeof(msg) != STR) 28value = "is corrupted! **"; 29else 30value = "is " + $string_utils:print(msg); 31endif 32player:notify(tostr(pname[1..len - 4], " ", value)); 33endif 34endfor 35if (!found_one) 36player:notify("That object doesn't have any messages to set."); 37endif 38else 39{message, @content} = $su:explode(argstr); 40this:set_message(message, $su:from_list(content, " ")); 41endif
set_message
Referenced by
- #334:mess*ages line 40:
this:set_message - #334:clearmess*age line 13:
this:set_message
Source
1"Copied from generic area editor FO (#11715):set_message by Satan (#2) Sat Apr 2 16:54:43 2005 PST"; 2focus = this:focus_for(player); 3message = args[1]; 4if (length(args) > 1) 5content = args[2]; 6else 7content = 0; 8endif 9if (content == 0) 10if (E_PROPNF == (get = `focus.(message + "_msg") ! ANY')) 11player:notify(tostr(focus.name, " has no \"", message, "\" message.")); 12elseif (typeof(get) == ERR) 13player:notify(tostr(get)); 14elseif (!get) 15player:notify("Message is not set."); 16else 17player:notify(tostr("The \"", message, "\" message of ", focus.name, ":")); 18player:notify(tostr(get)); 19endif 20else 21set = focus:set_message(message, content); 22if (set) 23if (typeof(set) == STR) 24player:notify(set); 25else 26player:notify(tostr("You set the \"", message, "\" message of ", focus.name, ".")); 27endif 28elseif (set == E_PROPNF) 29player:notify(tostr(focus.name, " has no \"", message, "\" message to set.")); 30elseif (typeof(set) == ERR) 31player:notify(tostr(set)); 32else 33player:notify(tostr("You clear the \"", message, "\" message of ", focus.name, ".")); 34endif 35endif
instantiate
Referenced by
none
Source
1"fertilize everything"; 2"this:fertilize(this);"; 3"first create the area"; 4if (!is_a(this.area_type, $area)) 5return E_INVARG; 6endif 7area = $rpg:spawn(this.area_type); 8area.blank_icon = this.blank_icon; 9"add the uninstantiate verb"; 10$code_utils:copy_verb($blueprint, "uninstantiate", area); 11"now generate the rooms"; 12for room in (this.contents) 13$command_utils:suspend_if_needed(0); 14newroom = $rpg:spawn(parent(room)); 15add_property(room, "copy_room", newroom, {this.owner, "r"}); 16add_property(newroom, "orig_room", room, {this.owner, "r"}); 17newroom:moveto(area); 18this:furnish(room, newroom); 19this:copy_props(room, newroom); 20newroom:set_name(room.name); 21newroom:set_aliases(room.aliases); 22endfor 23done_exits = {}; 24for room in (this.contents) 25"create the exits"; 26$command_utils:suspend_if_needed(0); 27for exit in (room:occupants($exit)) 28if (!(exit in done_exits)) 29newexit = $rpg:spawn(parent(exit)); 30this:copy_props(exit, newexit); 31newother = $rpg:spawn(parent(exit.otherside)); 32this:copy_props(exit.otherside, newother); 33target = room.copy_room; 34othertarget = exit.otherside.location.copy_room; 35if (valid(target)) 36newexit:moveto(target); 37endif 38if (valid(othertarget)) 39newother:moveto(othertarget); 40endif 41newexit.otherside = newother; 42newother.otherside = newexit; 43newexit:set_name(exit.name); 44newexit:set_aliases(exit.aliases); 45newexit.direction = exit.direction; 46newother:set_name(exit.otherside.name); 47newother:set_aliases(exit.otherside.aliases); 48newother.direction = exit.otherside.direction; 49"handle mods"; 50for mod in (exit.contents) 51newmod = $rpg:spawn(parent(mod)); 52if (is_a(newmod, $lock) && $api.lockable:is_on(newexit)) 53newexit.lock = newmod; 54endif 55newmod:moveto(newexit); 56endfor 57done_exits = {@done_exits, exit, exit.otherside}; 58endif 59endfor 60endfor 61for newroom in (area.contents) 62newroom.exits = newroom:occupants($exit); 63delete_property(newroom.orig_room, "copy_room"); 64delete_property(newroom, "orig_room"); 65$command_utils:suspend_if_needed(0); 66endfor 67area:store_sorted_rooms_by_z(); 68{?new_owner = #984} = args; 69if (args && is_player(new_owner)) 70area:chown(new_owner); 71endif 72area.knockout_ok = 1; 73return area;
del*ete
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!is_in(player, this)) 5return player:tell("I don't understand that."); 6endif 7focus = this:focus_for(player); 8if (!valid(focus)) 9player:tell(this.not_focused_msg); 10return; 11endif 12if (is_a(focus, $exit)) 13otherside = focus.otherside; 14recycle_targets = {focus}; 15if (valid(otherside)) 16room = otherside.location; 17if (is_a(room, $room)) 18recycle_targets = setadd(recycle_targets, room); 19for x in (room.contents) 20recycle_targets = setadd(recycle_targets, x); 21endfor 22for x in (room.exits) 23recycle_targets = setadd(recycle_targets, x); 24if (is_a(x.otherside, $exit)) 25recycle_targets = setadd(recycle_targets, x.otherside); 26endif 27endfor 28recycle_targets = setadd(recycle_targets, otherside); 29endif 30endif 31player:tell((((((($ansi.red + "WARNING: ") + $ansi.reset) + "Deleting ") + focus.name) + " will also result in the deletion of ") + $su:english_list($lu:map_verb(recycle_targets, "name"))) + ". Are you sure you want to do this?"); 32if ($command_utils:yes_or_no()) 33set_task_perms(player); 34player:tell("Recycling..."); 35for x in (recycle_targets) 36try 37$cu:sin(0); 38if (is_player(x)) 39this:commit(x); 40elseif (!gamevalid(x)) 41"DO NOTHING."; 42else 43$recycler:_recycle(x); 44endif 45except e (ANY) 46$rpg:report_error(e, {"Object was " + $su:nn(x)}); 47endtry 48endfor 49player:tell("Done."); 50else 51player:tell("Aborted."); 52endif 53endif
reset
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (dobjstr && (dobjstr == "map")) 5player:tell($ansi.bold_on, $ansi.yellow, "Starting map reset...", $ansi.reset); 6this:reset_map(); 7return player:tell($ansi.bold_on, "Finished resetting the map...", $ansi.reset); 8elseif (dobjstr) 9return player:tell("Reset what? You can either 'reset' by itself for a full reset or 'reset map' to redraw radars."); 10endif 11player:tell(""); 12player:tell($ansi.bold_on + "Compiling area ", $su:nn(this), "..." + $ansi.reset); 13this:find_all_paths(); 14suspend(2); 15this:find_transitions(); 16suspend(1); 17this:calculate_offset(); 18suspend(1); 19this:find_reset_listeners(); 20suspend(1); 21player:tell($ansi.yellow + $ansi.bold_on, "Locating airstrips...", $ansi.reset); 22this:write_airstrips(); 23suspend(1); 24if (!is_a(this.bigmap, $bigmap)) 25player:tell($ansi.yellow + $ansi.bold_on, "Storing a cache of z sorted rooms...", $ansi.reset); 26this:store_sorted_rooms_by_z(); 27suspend(1); 28endif 29player:tell($ansi.yellow + $ansi.bold_on, "Rewriting landmark_msg on outdoors...", $ansi.reset); 30this:write_landmarks(); 31suspend(1); 32if (is_a(this.bigmap, $bigmap)) 33player:tell($ansi.yellow + $ansi.bold_on, ("WARNING: This area is part of a $bigmap so I will not redraw radars. Do @reset-maps " + tostr(this.bigmap)) + " to reset it.", $ansi.reset); 34else 35player:tell($ansi.yellow + $ansi.bold_on, "Forcing redraw of all radars...", $ansi.reset); 36this:reset_map(); 37suspend(1); 38endif 39player:tell($ansi.bold_on + $ansi.yellow, "Resetting the area...", $ansi.reset); 40this:do_reset(); 41player:tell($ansi.bold_on + "Done compiling ", $su:nn(this), "." + $ansi.reset); 42player:tell("");
furnish
Referenced by
- #334:instantiate line 18:
this:furnish - #334:instantiate_new line 17:
this:furnish - #334:instantiate_old line 19:
this:furnish
Source
1room = args[2]; 2if (!is_a(room, $room)) 3return E_INVARG; 4endif 5parent = args[1]; 6for x in (parent.contents) 7$cu:sin(0); 8if (is_a(x, $exit)) 9continue; 10elseif (is_a(x, $player)) 11continue; 12endif 13newobj = $rpg:spawn(parent(x)); 14this:copy_props(x, newobj); 15newobj:moveto(room); 16endfor
copy_props
Referenced by
- #334:instantiate line 19:
this:copy_props - #334:instantiate line 30:
this:copy_props - #334:instantiate line 32:
this:copy_props - #334:furnish line 14:
this:copy_props - #334:instantiate_new line 18:
this:copy_props - #334:instantiate_old line 20:
this:copy_props
Source
1set_task_perms(caller_perms()); 2source = args[1]; 3dest = args[2]; 4#271474:announce(#2, tostr("Copying properties from ", $su:nn(source), " to ", $su:nn(dest)), 1); 5dest:set_name(source.name); 6dest:set_aliases(source.aliases); 7for x in ($set_utils:difference($ou:all_properties(source), {"name", "aliases", "copy_room", "otherside"})) 8if (!has_property(dest, x)) 9add_property(dest, x, source.(x), {player, "rc"}); 10else 11dest.(x) = source.(x); 12endif 13yield; 14endfor
types
Referenced by
- #334:focus line 21:
this:types - #334:type_for line 2:
this:types - #334:default_room line 1:
this:types - #334:default_exit line 1:
this:types
Source
1return this.(verb);
rooms
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!is_in(player, this)) 5return player:tell("You need to be inside the blueprint first!"); 6endif 7for x in [1..length(rooms = this:occupants($room))] 8player:tell("[", x, "] ", rooms[x].name); 9endfor
fertilize
Referenced by
- #334:fertilize line 7:
this:fertilize
Source
1set_task_perms(caller_perms()); 2what = args[1]; 3what.r = 1; 4what.f = 1; 5for x in (what.contents) 6if (!is_a(x, $creature)) 7this:fertilize(x); 8endif 9endfor
_itemize_costs
Referenced by
- #114:@list-costs line 2:
$blueprint:_itemize_costs - #334:_itemize_costs line 8:
this:_itemize_costs - #334:invoice line 1:
this:_itemize_costs - #334:_total_cost line 1:
this:_itemize_costs - #334:@list-costs line 5:
$blueprint:_itemize_costs
Source
1target = args[1]; 2invoice = {{target, `target.value ! ANY => 0'}}; 3for x in (target.contents) 4$cu:sin(1); 5if (is_a(x, $creature)) 6continue; 7endif 8invoice = {@invoice, @this:_itemize_costs(x)}; 9endfor 10return invoice;
invoice
Referenced by
none
Source
1line_items = this:_itemize_costs(this); 2lines = (typeof(this.description) == LIST) ? this.description | {this.description}; 3lines = {@lines, (("Invoice for construction of " + $ansi.cyan) + this.name) + $ansi.reset, (($ansi.black + $ansi.bold_on) + $su:left("", 52, "=")) + $ansi.reset, ($su:left("Item", 40) + " ") + $su:center("Cost", 10), (($ansi.black + $ansi.bold_on) + $su:left("", 52, "=")) + $ansi.reset}; 4total = 0; 5for x in (line_items) 6if (x[2] > 0) 7lines = {@lines, (($ansi.bold_on + ($su:left(x[1].name, -40) + " ")) + $su:right(tostr(x[2]), -10)) + $ansi.reset}; 8total = total + x[2]; 9endif 10endfor 11lines = {@lines, $su:right(((($ansi.bold_on + "Total: ") + $ansi.green) + tostr(total)) + $ansi.reset, -52)}; 12player:tell_lines(lines);
uninstantiate
Referenced by
none
Source
1":uninstantiate(OBJ dest [, INT junk]) Destroy all rooms and exits and dump all contents into dest. Returns the list of objects moved there. If junk=true, try to junk objects first."; 2if (this.f) 3return E_INVARG; 4endif 5junkdest = args[1]; 6tryjunk = (length(args) > 1) ? args[2] | 0; 7junk = kill = {}; 8for x in (this.contents) 9for y in (x.contents) 10if (is_a(y, $exit)) 11kill = {@kill, y}; 12else 13if (tryjunk && $rpg:junk(y, 1)) 14kill = {@kill, y}; 15else 16junk = {@junk, y}; 17endif 18endif 19endfor 20kill = {@kill, x}; 21$cu:sin(0); 22endfor 23fork (0) 24for x in (junk) 25x:moveto(junkdest); 26$cu:sin(0); 27endfor 28for x in (kill) 29$recycler:_recycle(x); 30$cu:sin(0); 31endfor 32$recycler:_recycle(this); 33endfork 34return junk;
_total_cost
Referenced by
none
Source
1invoice = this:_itemize_costs(this); 2total = 0; 3for x in (invoice) 4total = total + x[2]; 5endfor 6return total;
bpname
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!is_in(player, this)) 5return player:tell("Nice try."); 6endif 7focus = this; 8if (!argstr) 9player:tell($su:from_list(focus.aliases, ", ")); 10else 11player:tell(((("Changed the aliases from " + $su:from_list(focus.aliases, ",")) + " to ") + dobjstr) + "."); 12$building_utils:set_names(focus, dobjstr); 13endif
bpdesc
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4focus = this; 5if (!argstr) 6player:tell_lines((typeof(this.description) == STR) ? {this.description} | this.description); 7else 8this.description = argstr; 9player:tell(("Changed the description for " + this.name) + " changed."); 10endif
sky_room
Referenced by
none
Source
1return #-1;
@list-costs
Referenced by
none
Source
1total = 0; 2if (!this:can_edit(player)) 3return player:tell("Not yours."); 4endif 5for thing in ($lu:sort_alist($blueprint:_itemize_costs(this), 2)) 6if (thing[2] <= 0) 7continue; 8endif 9total = total + thing[2]; 10player:tell($su:left($su:nn(thing[1]), -50), " ", $ansi.green, "$", $su:right($su:group_number(thing[2]), -15), $ansi.reset); 11endfor 12player:tell($ansi.bold_on, $su:left(" Total:", -50), " ", $ansi.green, "$", $su:right($su:group_number(total), -15), $ansi.reset);
bury
Referenced by
none
Source
1"bury [exit] <exit> -- tries to recycle the exit and the room it leads to, performing sanity checks along the way. If the word 'exit' appears as the first arg then we assume that the user's intention is only to remove the exit, not the room beyond."; 2if (!this:valid_blueprint()) 3return; 4endif 5"handle the case where the user only wants to get rid of the exit"; 6if ((length(dobjstr) > 5) && (dobjstr[1..4] == "exit")) 7if (is_a(exit = $match_utils:match(dobjstr[6..$], {@player.location.exits}), $exit)) 8if (is_a(exit.otherside, $exit) && is_a(room = exit.otherside.location, $room)) 9if (length(room.exits) == 1) 10player:tell(((("You can remove that exit (" + exit:name()) + ") because it's the only way out of ") + room:name()) + ". Try burying the room instead."); 11return; 12endif 13endif 14player:tell(((("Removing exits " + exit:name()) + " and ") + exit.otherside:name()) + "..."); 15this:bury_exit(exit); 16player:tell("Done."); 17return; 18else 19player:tell("Couldn't find an exit by that name."); 20return; 21endif 22endif 23exit = is_a(dobj, $exit) ? dobj | $match_utils:match(dobjstr, {@player.location.exits}); 24if (!is_a(exit, $exit)) 25player:tell(("Couldn't find any exits matching '" + dobjstr) + "'."); 26return; 27elseif (!is_a(exit.otherside, $exit)) 28player:tell(("Burying " + exit:name()) + "."); 29$recycler:_recycle(exit); 30return; 31elseif (!is_a(exit.otherside.location, $room)) 32player:tell(((("Burying " + exit:name()) + " and ") + exit.otherside:name()) + "."); 33$recycler:_recycle(exit.otherside); 34$recycler:_recycle(exit); 35return; 36elseif (exit.otherside.location == this.entrance) 37player:tell(((("You can't bury " + exit.otherside.location:name()) + " because it's the entrance to ") + this:name()) + "."); 38return; 39elseif (this:bury_would_orphan(exit)) 40player:tell(((("You can't bury the room (" + exit.otherside.location:name()) + ") through that exit (") + exit:name()) + ") because it would cut off the path to some other existing rooms. Make sure there is a path to rooms beyond the room you wish to bury (or bury the rooms beyond) before you proceed."); 41return; 42else 43if ($command_utils:yes_or_no(((("That exit (" + exit:name()) + ") leads to ") + exit.otherside.location:name()) + ", are you sure you want to permanently delete that room, its contents, and the exits leading to it?")) 44recycled = this:bury_room(exit.otherside.location); 45if (typeof(recycled) == LIST) 46if (!recycled) 47player:tell("Nothing actually got recycled. Please ask an admin for help."); 48return; 49endif 50player:tell(("Buried " + $su:english_list(recycled)) + "."); 51else 52player:tell("Failed to bury that room because there was something in it that couldn't be junked."); 53return; 54endif 55else 56player:tell("Aborted."); 57return; 58endif 59endif
bury_room
Referenced by
- #334:bury line 44:
this:bury_room
Source
1":bury_room(OBJ room) => recycles the room and any exits leading into it"; 2target = args[1]; 3recycled = {}; 4if ((((!is_a(target, $room)) || (!is_a(target:area(), $blueprint))) || (target == this.entrance)) || (length(target.exits) > 1)) 5return E_INVARG; 6endif 7for junk in ($set_utils:difference(target.contents, target.exits)) 8$cu:sin(0); 9name = junk:name(); 10if ($rpg:junk(junk)) 11recycled = {@recycled, name}; 12else 13return E_INVARG; 14endif 15endfor 16for exit in (target.exits) 17$cu:sin(0); 18if (is_a(exit.otherside, $exit)) 19name = exit.otherside:name(); 20$recycler:_recycle(exit.otherside); 21recycled = {@recycled, name}; 22endif 23name = exit:name(); 24$recycler:_recycle(exit); 25recycled = {@recycled, name}; 26endfor 27name = target:name(); 28$recycler:_recycle(target); 29recycled = {@recycled, name}; 30return recycled;
bury_would_orphan
Referenced by
- #334:bury line 39:
this:bury_would_orphan
Source
1":bury_would_orphan(OBJ exit) => returns true it burying the room this exit points to would orphan some other rooms in the blueprint"; 2exit = args[1]; 3if ((((!is_a(exit:area(), $blueprint)) || (!is_a(exit, $exit))) || (!is_a(exit.otherside, $exit))) || (!is_a(exit.otherside.location, $room))) 4return E_INVARG; 5endif 6target = exit.otherside.location; 7"If there are no other exits then there's no danger"; 8if (length(target.exits) == 1) 9return 0; 10endif 11"If there are other exits make sure the rooms they point to can still be reached"; 12for x in (setremove(target.exits, exit.otherside)) 13if (is_a(x.otherside, $exit) && is_a(room = x.otherside.location, $room)) 14"we found an exit leading somewhere else, make sure somewhere else is still reachable"; 15if (this:path_exists(room, this.entrance, target)) 16return 0; 17endif 18endif 19endfor 20return 1;
find_path
Referenced by
- #334:find_path line 19:
this:find_path
Source
1":find_path(OBJ source_room, OBJ dest_room[, LIST forbidden_rooms]) => tries to find a way to get from source to dest"; 2"Yes, I know this doesn't cache and it's a depth-first search that uses recursion, I just needed something quick to decide whether there's still a path to rooms connected to a room that's about to be deleted by a blueprint user."; 3source = args[1]; 4dest = args[2]; 5"make sure we don't pass back through the source room"; 6if (length(args) > 2) 7forbidden = setadd(args[3], source); 8else 9forbidden = {source}; 10endif 11for x in (source.exits) 12if (is_a(x.otherside, $exit) && is_a(room = x.otherside.location, $room)) 13if (room in forbidden) 14continue; 15endif 16if (room == dest) 17return {x}; 18endif 19if (path = this:find_path(x.otherside.location, dest, forbidden)) 20return {x, @path}; 21endif 22endif 23endfor 24return {};
bury_exit
Referenced by
- #334:bury line 15:
this:bury_exit
Source
1exit = args[1]; 2if ((!is_a(exit, $exit)) || (!is_a(exit:area(), $blueprint))) 3return E_INVARG; 4endif 5if (is_a(exit.otherside, $exit)) 6$recycler:_recycle(exit.otherside); 7endif 8$recycler:_recycle(exit);
instantiate_new
Referenced by
none
Source
1"fertilize everything"; 2"this:fertilize(this);"; 3"first create the area"; 4if (!is_a(this.area_type, $area)) 5return E_INVARG; 6endif 7area = $rpg:spawn(this.area_type); 8"add the uninstantiate verb"; 9$code_utils:copy_verb($blueprint, "uninstantiate", area); 10"now generate the rooms"; 11for room in (this.contents) 12$command_utils:suspend_if_needed(0); 13newroom = $rpg:spawn(parent(room)); 14add_property(room, "copy_room", newroom, {this.owner, "r"}); 15add_property(newroom, "orig_room", room, {this.owner, "r"}); 16newroom:moveto(area); 17this:furnish(room, newroom); 18this:copy_props(room, newroom); 19newroom:set_name(room.name); 20newroom:set_aliases(room.aliases); 21endfor 22done_exits = {}; 23for room in (this.contents) 24"create the exits"; 25$command_utils:suspend_if_needed(0); 26for exit in (room:occupants($exit)) 27if (!(exit in done_exits)) 28newexit = $rpg:spawn(parent(exit)); 29newother = $rpg:spawn(parent(exit.otherside)); 30target = room.copy_room; 31othertarget = exit.otherside.location.copy_room; 32if (valid(target)) 33newexit:moveto(target); 34endif 35if (valid(othertarget)) 36newother:moveto(othertarget); 37endif 38newexit.otherside = newother; 39newother.otherside = newexit; 40newexit:set_name(exit.name); 41newexit:set_aliases(exit.aliases); 42newexit.direction = exit.direction; 43newother:set_name(exit.otherside.name); 44newother:set_aliases(exit.otherside.aliases); 45newother.direction = exit.otherside.direction; 46done_exits = {@done_exits, exit, exit.otherside}; 47endif 48endfor 49endfor 50for newroom in (area.contents) 51newroom.exits = newroom:occupants($exit); 52delete_property(newroom.orig_room, "copy_room"); 53delete_property(newroom, "orig_room"); 54$command_utils:suspend_if_needed(0); 55endfor 56return area;
path_exists
Referenced by
- #334:bury_would_orphan line 15:
this:path_exists
Source
1":path_exists(OBJ source_room, OBJ dest_room, OBJ avoid) => 1 if you can get there from here without going to 'avoid'"; 2"decide whether there's still a path to rooms connected to a room that's about to be deleted by a blueprint user."; 3{source, dest, avoid} = args; 4closed = {avoid}; 5open = {source}; 6while (open) 7current = open[1]; 8if (current == dest) 9return 1; 10endif 11open = open[2..$]; 12neighbors = {}; 13for e in (current.exits) 14if (valid(e.otherside) && valid(next = e.otherside.location)) 15if ((!(next in closed)) && (!(next in open))) 16open = {@open, next}; 17endif 18endif 19endfor 20closed = {@closed, current}; 21$cu:sin(); 22endwhile 23return 0;
warp
Referenced by
none
Source
1if (!is_in(player, this)) 2return player:tell("You need to be inside the blueprint first!"); 3endif 4if (((roomnum = tonum(dobjstr)) < 1) || (roomnum > length(rooms = this:occupants($room)))) 5player:tell("That isn't a valid room, try the 'rooms' command."); 6return; 7endif 8dest = rooms[roomnum]; 9#271474:announce(#2, tostr("Warping player ", $su:nn(player), " from ", $su:nn(player.location), " to ", $su:nn(dest)), 1); 10player:moveto(dest);
instantiate_old
Referenced by
none
Source
1"Copied from generic blueprint area (#334):instantiate by Satan (#2) Fri Sep 26 17:53:31 2008 CDT"; 2if (!is_a(this.area_type, $area)) 3return E_INVARG; 4endif 5"fertilize everything"; 6"this:fertilize(this);"; 7"first create the area"; 8if (!is_a(this.area_type, $area)) 9return E_INVARG; 10endif 11area = $rpg:spawn(this.area_type); 12"add the uninstantiate verb"; 13$code_utils:copy_verb($blueprint, "uninstantiate", area); 14"now generate the rooms"; 15for room in (this.contents) 16$command_utils:suspend_if_needed(0); 17newroom = $rpg:spawn(parent(room)); 18newroom:moveto(area); 19this:furnish(room, newroom); 20this:copy_props(room, newroom); 21if (0) 22newroom:set_name(room.name); 23newroom:set_aliases(room.aliases); 24endif 25endfor 26done_exits = {}; 27for room in (this.contents) 28"create the exits"; 29$command_utils:suspend_if_needed(0); 30for exit in (room:occupants($exit)) 31if (!(exit in done_exits)) 32newexit = $rpg:spawn(parent(exit)); 33newother = $rpg:spawn(parent(exit.otherside)); 34"what follows will not work if there are multiple rooms with the same name"; 35target = $match_utils:match(exit.location.name, area.contents); 36othertarget = $match_utils:match(exit.otherside.location.name, area.contents); 37if (valid(target)) 38newexit:moveto(target); 39endif 40if (valid(othertarget)) 41newother:moveto(othertarget); 42endif 43newexit.otherside = newother; 44newother.otherside = newexit; 45newexit.name = exit.name; 46newexit.aliases = exit.aliases; 47newexit.direction = exit.direction; 48newother.name = exit.otherside.name; 49newother.aliases = exit.otherside.aliases; 50newother.direction = exit.otherside.direction; 51done_exits = {@done_exits, exit, exit.otherside}; 52endif 53endfor 54endfor 55for newroom in (area.contents) 56newroom.exits = newroom:occupants($exit); 57$command_utils:suspend_if_needed(0); 58endfor 59return area;
valid_blueprint
Referenced by
- #334:focus line 1:
this:valid_blueprint - #334:type line 1:
this:valid_blueprint - #334:dig line 10:
this:valid_blueprint - #334:ren*ame line 1:
this:valid_blueprint - #334:commit line 2:
this:valid_blueprint - #334:desc*ribe line 1:
this:valid_blueprint - #334:mess*ages line 1:
this:valid_blueprint - #334:del*ete line 1:
this:valid_blueprint - #334:reset line 1:
this:valid_blueprint - #334:rooms line 1:
this:valid_blueprint - #334:bpname line 1:
this:valid_blueprint - #334:bpdesc line 1:
this:valid_blueprint - #334:bury line 2:
this:valid_blueprint - #334:authorize line 1:
this:valid_blueprint - #334:deauthorize line 1:
this:valid_blueprint - #334:clearmess*age line 2:
this:valid_blueprint - #334:type-otherside line 1:
this:valid_blueprint - #334:setdark line 2:
this:valid_blueprint
Source
1if ((!is_in(player, this)) && (this in player.features)) 2player:remove_feature(this); 3player:tell(("Removed invalid blueprint (" + this:name()) + ") from your command queue. Please try again now that the problem has been cleared."); 4return 0; 5endif 6return 1;
mapicon
Referenced by
none
Source
1"Usage: mapicon <color spec><icon text>"; 2"Sets the current map icon. The following are valid color specs:"; 3" [bold_on]"; 4" [bold_off]"; 5" [reset]"; 6" [underline_on]"; 7" [inverse_on]"; 8" [strikethrough_on]"; 9" [underline_off]"; 10" [inverse_off]"; 11" [strikethrough_off]"; 12" [black]"; 13" [red]"; 14" [green]"; 15" [yellow]"; 16" [blue]"; 17" [purple]"; 18" [cyan]"; 19" [white]"; 20" [bg_black]"; 21" [bg_red]"; 22" [bg_green]"; 23" [bg_yellow]"; 24" [bg_blue]"; 25" [bg_purple]"; 26" [bg_cyan]"; 27" [bg_white]"; 28" [reverse]"; 29" "; 30"Multiple specs may be used (ie '[bg_green][blue][bold_on]FU'"; 31"The last two characters are the text of the map icon."; 32" n.b. use 'map' to see the icons immediately."; 33icon_src = argstr; 34if (icon_src == "help") 35player:tell_lines(#18:get_topic((tostr(this) + ":") + verb)); 36return; 37endif 38sublist = {{"[bold_on]", $ansi.bold_on}, {"[bold_off]", $ansi.bold_off}, {"[reset]", $ansi.reset}, {"[underline_on]", $ansi.underline_on}, {"[inverse_on]", $ansi.inverse_on}, {"[strikethrough_on]", $ansi.strikethrough_on}, {"[underline_off]", $ansi.underline_off}, {"[inverse_off]", $ansi.inverse_off}, {"[strikethrough_off]", $ansi.strikethrough_off}, {"[black]", $ansi.black}, {"[red]", $ansi.red}, {"[green]", $ansi.green}, {"[yellow]", $ansi.yellow}, {"[blue]", $ansi.blue}, {"[purple]", $ansi.purple}, {"[cyan]", $ansi.cyan}, {"[white]", $ansi.white}, {"[bg_black]", $ansi.bg_black}, {"[bg_red]", $ansi.bg_red}, {"[bg_green]", $ansi.bg_green}, {"[bg_yellow]", $ansi.bg_yellow}, {"[bg_blue]", $ansi.bg_blue}, {"[bg_purple]", $ansi.bg_purple}, {"[bg_cyan]", $ansi.bg_cyan}, {"[bg_white]", $ansi.bg_white}, {"[reverse]", $ansi.reverse}}; 39icon_src = $su:subst(icon_src, sublist); 40icon_src = icon_src + $ansi.reset; 41if (length($ansi:strip(icon_src)) != 2) 42player:tell("Icons must be two characters long."); 43return; 44endif 45if (!(player:area() in player.features)) 46return E_INVARG; 47endif 48player.location.icon = icon_src; 49player:tell("Icon for ", player.location.name, " set to ", icon_src);
authorize
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!this:can_edit(player)) 5return player:tell("You don't have permission to edit ", this:dname(), "!"); 6endif 7who = $su:match_player(dobjstr); 8if (!is_a(who, $creature)) 9player:tell(("I don't know who '" + dobjstr) + "' is."); 10return; 11endif 12if (who in this.authorized_users) 13player:tell(who:name() + " is already authorized to edit this blueprint."); 14return; 15else 16this.authorized_users = setadd(this.authorized_users, who); 17player:tell(((("Added " + who:name()) + " to the access control list for ") + this:name()) + "."); 18endif
deauthorize
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4who = $su:match_player(dobjstr); 5if (!is_a(who, $creature)) 6player:tell(("I don't know who '" + dobjstr) + "' is."); 7return; 8endif 9if (who in this.authorized_users) 10this.authorized_users = setremove(this.authorized_users, who); 11player:tell(((who:name() + " is no longer authorized to edit ") + this:name()) + "."); 12else 13player:tell(((who:name() + " was not on the access control list for ") + this:name()) + "."); 14endif
can_edit
Referenced by
- #334:edit line 1:
this:can_edit - #334:@list-costs line 2:
this:can_edit - #334:authorize line 4:
this:can_edit - #334:addnote line 2:
this:can_edit
Source
1who = args[1]; 2return ($perm_utils:controls(who, this) || (who in this.authorized_users)) || who.programmer;
areaicon
Referenced by
none
Source
1"Copied from generic blueprint area (#334):mapicon by Satan (#2) Fri Nov 14 20:45:24 2008 CST"; 2"Usage: mapicon <color spec><icon text>"; 3"Sets the current map icon. The following are valid color specs:"; 4" [bold_on]"; 5" [bold_off]"; 6" [red]"; 7" [reset]"; 8" [underline_on]"; 9" [inverse_on]"; 10" [strikethrough_on]"; 11" [underline_off]"; 12" [inverse_off]"; 13" [strikethrough_off]"; 14" [black]"; 15" [green]"; 16" [yellow]"; 17" [blue]"; 18" [purple]"; 19" [cyan]"; 20" [white]"; 21" [bg_black]"; 22" [bg_red]"; 23" [bg_green]"; 24" [bg_yellow]"; 25" [bg_blue]"; 26" [bg_purple]"; 27" [bg_cyan]"; 28" [bg_white]"; 29" [reverse]"; 30" "; 31"Multiple specs may be used (ie '[bg_green][blue][bold_on]FU'"; 32"The last two characters are the text of the map icon."; 33" n.b. use 'map' to see the icons immediately."; 34icon_src = argstr; 35if (icon_src == "help") 36player:tell_lines(#18:get_topic((tostr(this) + ":") + verb)); 37return; 38endif 39sublist = {{"[bold_on]", $ansi.bold_on}, {"[bold_off]", $ansi.bold_off}, {"[red]", $ansi.red}, {"[reset]", $ansi.reset}, {"[underline_on]", $ansi.underline_on}, {"[inverse_on]", $ansi.inverse_on}, {"[strikethrough_on]", $ansi.strikethrough_on}, {"[underline_off]", $ansi.underline_off}, {"[inverse_off]", $ansi.inverse_off}, {"[strikethrough_off]", $ansi.strikethrough_off}, {"[black]", $ansi.black}, {"[green]", $ansi.green}, {"[yellow]", $ansi.yellow}, {"[blue]", $ansi.blue}, {"[purple]", $ansi.purple}, {"[cyan]", $ansi.cyan}, {"[white]", $ansi.white}, {"[bg_black]", $ansi.bg_black}, {"[bg_red]", $ansi.bg_red}, {"[bg_green]", $ansi.bg_green}, {"[bg_yellow]", $ansi.bg_yellow}, {"[bg_blue]", $ansi.bg_blue}, {"[bg_purple]", $ansi.bg_purple}, {"[bg_cyan]", $ansi.bg_cyan}, {"[bg_white]", $ansi.bg_white}, {"[reverse]", $ansi.reverse}}; 40icon_src = $su:subst(icon_src, sublist); 41icon_src = icon_src + $ansi.reset; 42if (length($ansi:strip(icon_src)) != 2) 43player:tell("Icons must be two characters long."); 44return; 45endif 46if (!(player:area() in player.features)) 47return E_INVARG; 48endif 49this.blank_icon = icon_src; 50player:tell("Background icon for ", this:name(), " set to ", icon_src);
clearmess*age
Referenced by
none
Source
1"Copied from generic blueprint area (#334):mess by Satan (#2) Fri Mar 27 23:41:35 2009 CDT"; 2if (!this:valid_blueprint()) 3return; 4endif 5focus = this:focus_for(player); 6if (!valid(focus)) 7player:tell(this.not_focused_msg); 8return; 9endif 10if (!argstr) 11player:notify("You need to specify a message to clear."); 12else 13this:set_message(argstr, ""); 14endif
type-otherside otype
Referenced by
none
Source
1if (!this:valid_blueprint()) 2return; 3endif 4if (!valid(focus = this:focus_for(player))) 5player:tell("You're not focusing on anything."); 6return; 7endif 8if (!is_a(focus, $exit)) 9player:tell("You can only set otherside types for exits."); 10return; 11endif 12types = this:type_for(focus); 13if (!dobjstr) 14player:tell((focus.otherside.name + " is currently of type: ") + parent(focus.otherside).name); 15player:tell(("Available types for " + focus.otherside.name) + ":"); 16for y in [1..length(types)] 17player:tell((tostr(y) + ". ") + types[y].name); 18endfor 19return; 20player:tell(("There are no types available for " + focus.otherside.name) + "."); 21return; 22else 23selection = tonum(dobjstr); 24if ((selection < 1) || (selection > length(types))) 25player:tell(((("\"" + dobjstr) + "\" isn't a valid type choice for ") + focus.otherside.name) + "."); 26return; 27endif 28player:tell(((((("Changing " + focus.otherside.name) + " from ") + parent(focus.otherside).name) + " to ") + types[selection].name) + "."); 29chparent(focus.otherside, types[selection]); 30endif
addnote rmnote
Referenced by
none
Source
1where = player:room(); 2if (!this:can_edit(player)) 3player:tell("Permission denied."); 4return; 5endif 6if (verb == "addnote") 7player:tell("1. Object request"); 8player:tell("2. Ambience"); 9player:tell("3. Other request"); 10type = $cu:read("Enter a number (1-3):"); 11type = toint(type); 12if (!type) 13return player:tell("You must enter an integer."); 14elseif ((type > 3) || (type < 1)) 15return player:tell("You must enter an integer between 1 and 3."); 16else 17if (type == 1) 18ntype = "obj_notes"; 19color = tostr($ansi.cyan, "Objects: "); 20elseif (type == 2) 21ntype = "ambience_notes"; 22color = tostr($ansi.white, $ansi.bold_on, "Ambience: "); 23else 24ntype = "misc_notes"; 25color = tostr($ansi.yellow, "Misc. Notes: "); 26endif 27endif 28txt = $cu:read("Enter a note (please separate ambience messages with commas):"); 29note = tostr(color, txt, $ansi.reset); 30player:tell("Note added."); 31this.(ntype) = hashremove(this.(ntype), where); 32this.(ntype)[where] = note; 33else 34where:tell_notes(); 35player:tell("Enter the number of the note you want to remove:"); 36if ((type = toint($cu:read())) == 1) 37ntype = "obj_notes"; 38elseif (type == 2) 39ntype = "ambience_notes"; 40elseif (type == 3) 41ntype = "misc_notes"; 42else 43player:tell("Please enter an integer between 1 and 3."); 44return; 45endif 46this.(ntype) = hashremove(this.(ntype), where); 47player:tell("Note removed."); 48where:tell_notes(); 49endif
notes
Referenced by
none
Source
1where = player:room(); 2where:tell_notes();
room_removed
Referenced by
none
Source
1target = args[1]; 2for x in ({"obj_notes", "ambience_notes", "misc_notes"}) 3this.(x) = hashremove(this.(x), target); 4endfor 5return pass(@verb);
setdark
Referenced by
none
Source
1"Set permanent darkness level to 'full', 'high', 'low', 'off'."; 2if (!this:valid_blueprint()) 3return; 4endif 5if (!(area(player) in player.features)) 6return E_INVARG; 7endif 8if (!argstr) 9curr = `this.always_dark ! E_PROPNF => -1'; 10if (curr == -1) 11player:tell("This room has default light settings."); 12else 13desc = {"low", "high", "full"}[curr]; 14player:tell("This room has ", desc, " permanent darkness."); 15endif 16elseif (argstr == "off") 17if (has_property(loc, "always_dark")) 18delete_property(loc, "always_dark"); 19player:tell("Room darkness set to off. This room now will have normal light levels."); 20else 21player:tell("This room already has normal light levels."); 22endif 23else 24setting = argstr in {"low", "high", "full"}; 25loc = player.location; 26if (setting) 27if (has_property(loc, "always_dark")) 28loc.always_dark = setting; 29else 30add_property(loc, "always_dark", setting, {player, "rc"}); 31endif 32player:tell("Room permanent darkness set to ", argstr, "."); 33else 34player:tell("'", argstr, "' is not a valid darkness setting. Use 'off', 'low', 'high', or 'full'."); 35endif 36endif
handle_creature_death
Referenced by
none
Source
1who = args[1]; 2if (is_a(who, $player) && (!is_a(who, $immortal))) 3if (is_a(who:cyberdeck(), $cyberdeck)) 4who.cyberdeck:do_jackout(); 5return 1; 6else 7m = tostr($ansi.bold_on, $ansi.red, who:dnamec(), " died inside me without a valid cyberdeck.", $ansi.reset); 8#271474:_announce(this, m); 9#36188:_announce(this, m); 10endif 11endif 12return 0;
should_reset
Referenced by
none
Source
1return !is_a(this, $blueprint);