SetNauticalExitAliases
-
north
fore
-
east
starboard
-
west
port
-
south
aft
fore
f
foreword
port
p
starboard
sb
aft
a
.*)$|^go (?.*)$|^(?forward|fore|starboard|aft|port|north|south|east|west|northeast|northwest|southeast|southwest|in|out|up|down|f|s|sb|a|p|n|e|w|ne|nw|se|sw|o|u|d)$"
lookdir.pattern = "^look (?forward|fore|starboard|aft|port|north|south|east|west|northeast|northwest|southeast|southwest|in|out|up|down|f|s|sb|a|p|n|e|w|ne|nw|se|sw|o|u|d)$"
foreach (exit, AllExits()) {
if (DoesInherit(exit.parent.parent, "shiptype")) {
alias = exit.alias
if (DictionaryContains(game.shipDirs, alias)) {
repl = StringDictionaryItem(game.shipDirs,alias)
exit.alias = repl
}
}
}
]]>
list1 = Split("north;northeast;east;southeast;south;southwest;west;northwest;up;down;in;out;fore;port;starboard;aft", ";")
list2 = Split("south;southwest;west;northwest;north;northeast;east;southeast;down;up;out;in;aft;starboard;port;fore", ";")
n = IndexOf(list1, dir)
if (not n = -1) {
return (StringListItem(list2, n))
}
return (dir)
switch (exit.alias) {
case ("in") {
s = "inside"
}
case ("out") {
s = "outside"
}
case ("up") {
s = "above"
}
case ("down") {
s = "below"
}
//Added by KV for Nautical Directions:
case ("starboard") {
s = "port"
addthe = false
}
case ("port") {
s = "starboard"
addthe = false
}
case ("aft") {
s = "fore"
addthe = false
}
case ("fore") {
s = "aft"
addthe = false
}
// End of KV's addition
default {
if (addthe) {
s = "the " + exit.alias
}
else {
s = exit.alias
}
}
}
return (s)