Exit Utilities #279

Parent #72Owner #29Flags readSource hellcore/hellcore.db

Aliases: Exit Utilities

4 verbs · 14 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
opposite_dir odthis none thisrxd#27918
fix_water_exitsthis none thisrxd#27917
fix_out_exitthis none thisrxd#27927
cardinal_namethis none thisrxd#2798

Properties

PropertyDefinerFlagsOwnerValue
cardinal_names#279rc#29{"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"}
cardinal_letters#279rc#29{"n", "ne", "e", "se", "s", "sw", "w", "nw"}
directions#279rc#290
help_msg#72rc#29
list of 11{"Exit Utilities: verbs and properties useful in dealing with exits.", "", ":fix_water_exits(OBJ area) => list of fixed rooms or E_INVARG if not an area.", "Looks for water rooms and exits connected to them, and chparents the exits", "to the correct shoreline/antishoreline/diving/surfacing exits.", "", ":opposite_dir(STR dir) => STR opposite (what would be on the other side of an exit to dir)", "", "Useful properties:", ".cardinal_names => {\"north\", \"northeast\", \"east\", \"southeast\", \"south\", \"southwest\", \"west\", \"northwest\"}", ".cardinal_letters => {\"n\", \"ne\", \"e\", \"se\", \"s\", \"sw\", \"w\", \"nw\"}"}
aliases#1rc#29{"Exit Utilities"}
description#1rc#29<clear>
object_size#1r#29{3986, 1298434451}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #72 Generic Utilities Package#1 root

Children: none

Call graph

calls n279_1 #279:fix_water_exits n42_0 #42:controls n279_1->n42_0 n279_2 #279:fix_out_exit n279_2->n42_0 n20_39 #20:words n279_2->n20_39

Source

opposite_dir od

Spec this none thisFlags rxdOwner #29Definer #279

Referenced by

none

Source

1":opposite_dir(STR dir) => STR opposite (what would be on the other side of an exit to dir)";
2startdir = args[1];
3names = this.cardinal_names;
4letters = this.cardinal_letters;
5if (startdir in names)
6i = startdir in names;
7n = (i <= 4) ? i + 4 | (i - 4);
8return names[n];
9elseif (startdir in letters)
10i = startdir in letters;
11n = (i <= 4) ? i + 4 | (i - 4);
12return letters[n];
13else
14if (startdir in {"in", "out"})
15return (startdir == "in") ? "out" | "in";
16endif
17endif
18return E_INVARG;

fix_water_exits

Spec this none thisFlags rxdOwner #361Definer #279

Referenced by

none

Source

1player = caller_perms();
2where = args[1];
3if (!$perm_utils:controls(player, where))
4return E_PERM;
5endif
6fixed = {};
7if (is_a(where, $area))
8for room in (where.contents)
9if (is_a(room, #1034) || is_a(room, #1047))
10room:("@exitfix")();
11fixed = {@fixed, room};
12endif
13endfor
14return fixed;
15else
16return E_INVARG;
17endif

fix_out_exit

Spec this none thisFlags rxdOwner #361Definer #279

Referenced by

none

Source

1":fix_out_exit => STR name";
2"Fixes an 'out' exit so it shows as out(door to <whatever>)";
3"instead of just 'out'";
4e = args[1];
5if (!$perm_utils:controls(caller_perms(), e))
6raise(E_PERM);
7endif
8if ((e.direction == "out") || (e.name == "out"))
9newname = is_a(e, $door) ? "door " | "";
10if (valid(e.otherside) && valid(e.otherside.location))
11if (e.otherside.location.outdoor)
12suffix = is_a(e, $door) ? "to outside" | "";
13elseif (is_a(e.otherside.location, #279762))
14suffix = is_a(e, $door) ? "to the hallway" | "hallway";
15endif
16else
17raise(E_INVIND, "Bad .otherside or .otherside.location");
18endif
19e.name = tostr(newname, suffix);
20if (!e.name)
21e.name = "out";
22endif
23e.direction = "out";
24to_what = suffix ? $su:words(suffix)[$] | "";
25e:set_aliases({e.name, newname, to_what, "out", "o"});
26return e.name;
27endif

cardinal_name

Spec this none thisFlags rxdOwner #361Definer #279

Referenced by

none

Source

1n = args[1];
2if (i = n in this.cardinal_names)
3return n;
4elseif (i = n in this.cardinal_letters)
5return this.cardinal_names[i];
6else
7return E_INVARG;
8endif