generic maze and terrain room #119

Parent #104Owner #2Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: generic maze and terrain room, terrain, maze

21 verbs · 67 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
@exsetany none nonerd#11915
descriptionthis none thisrxd#11911
tell_exitsthis none thisrxd#11914
strip_testthis none thisrxd#11922
parse_dirthis none thisrxd#11911
loc_maze_waythis none thisrxd#11983
loc_waythis none thisrxd#11952
n s e w ne nw se sw u d north south east west northwest northeast southeast southwest up downany none nonerxd#11914
player_to_locthis none thisrxd#11926
exits entrancesthis none thisrxd#1197
contentsthis none thisrxd#11914
match_locthis none thisrxd#1195
l*ookany any anyrd#11932
no_can_go_msgthis none thisrxd#11916
@mylocnone none nonerd#1191
set_object_locthis none thisrxd#1193
@maze*-moveany none nonerd#11933
goany any anyrxd#11915
random_exitthis none thisrxd#1193
globifythis none thisrxd#11936
match_fakethis none thisrxd#1199

Properties

PropertyDefinerFlagsOwnerValue
compass#119r#2
list of 10{"n", "s", "e", "w", "nw", "ne", "se", "sw", "u", "d"}
long_ways#119r#2
list of 10{"north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down"}
room_type#119rc#20
strip_way#119rc#2"n"
relocate_msg#119rc#2"%N %<goes> "
loc_arrive_msg#119rc#2"%N %<arrives> from "
no_can_go_msg#119rc#2"You can't go that way."
north_border_msg#119rc#2""
south_border_msg#119rc#2""
west_border_msg#119rc#2""
east_border_msg#119rc#2""
strip_pairs#119r#2{{"n", "s"}, {"e", "w"}, {"nw", "se"}, {"ne", "sw"}, {"u", "d"}}
bot_locked#104rc#2<clear>
fakes#104r#36<clear>
retail#104rc#20
seat#104r#36<clear>
pool#104r#36<clear>
seat_desc#104r#36<clear>
pool_desc#104r#36<clear>
sit_phrase#104rc#2<clear>
stand_phrase#104rc#2<clear>
swim_phrase#104rc#2<clear>
dry_phrase#104rc#2<clear>
push_phrase#104rc#2<clear>
seat_aliai#104r#36<clear>
pool_aliai#104r#36<clear>
seat_contents#104r#36<clear>
pool_contents#104r#36<clear>
seat_max#104r#36<clear>
pool_max#104r#36<clear>
details#104rc#2<clear>
temp_detail_index#104rc#2<clear>
temp_detail_desc#104rc#2<clear>
outdoors#104r#36<clear>
attack_queue#104r#2<clear>
battle_on#104r#2<clear>
stop_msg#104rc#2<clear>
remove_msg#104rc#2<clear>
dump_msg#104rc#2<clear>
dump_loc#104rc#2<clear>
sanctuary#104rc#2<clear>
ansi_title#104r#36<clear>
dark_desc#104rc#2<clear>
title_style#104rc#2<clear>
build_help#104rc#2
list of 37{"Terrain rooms are globes, endless plains, grids of 8x8 (64 positions), 1x8 strips (8 positions in a row, .strip_way indicates a member of the 'strip_pair' and sets the direction in which the strip runs), or 1x10 strips going up<->down, with the y coordinate being the substitute for z.", "", "In up<->down strips, {x,0} is the top, {x,9} is the bottom.", "In 8x8 grids, {1,1} is the northwest corner, {8,8} is the southeast corner.", "", "Customized descriptions: Create a prop named '.desc_23' to describe terrain at 2,3", "", "Set the terrain type: @set terrain.room_type to <0-4>", " 0=open plain, 1=maze, 2=strip, 3=endless plain,", " 4=globe(actually a tall spheroid)", "", "$terrexit should be used as parent for exits *to* and *from* terrain rooms.", "Go to the grid location you want the exit to be, and type '@exset <#exit>' to make the exit into a terrexit, and set its .x_loc and .y_loc. This will work for both the exit and the return entrance.", "", "@myloc is a useful verb to tell you your location in the grid", "@maze*-move <x y> will teleport you (if you're a builder) to the x&y coordinates (ie @maze 4 5), and @maze*-move <exit/out> will send you to a random exit.", "..............................................................", "DETAILING THE TERRAIN", " Remember: Any virtual detail you add using the following verbs is accessible from anywhere in the grid and should be mentioned in the terrain description. If you only want a detail accessible from a single grid location, you will have to create an object to represent that detail.", " Type 3 terrains (endless plains) have an anomaly at {0, 0} -- basically, the player can't go there. This can be dealt with in a variety of creative ways, the most obvious being to write custom descriptions for the surrounding grid coordinates. ", "", "======= PROPERTIES =======", "@set here.sit_phrase, here.stand_phrase, here.swim_phrase, here.dry_phrase, and here.push_phrase.", "", "All of these messages are pronoun and verb parsed.", "", "EXAMPLE: @set here.push_phrase to \"%N %<runs> up and %<pushes> %d into the pool!\", where %N is the player and %d is the victim.", "", "Movement specific messages, and their defaults:", "terrain.relocate_msg \"%N %<goes> \"", "terrain.loc_arrive_msg \"%N %<arrives> from \"", "terrain.no_can_go_msg \"You can't go that way.\"", "These next four only work if the terrain is not a strip or endless plain:", " terrain.north_border_msg \"\" --- Fill this in if your northern border is different than the rest, or as a description of the north pole for globes.", " terrain.south_border_msg \"\" --- Fill this in if your southern border is different than the rest, or as a description of the south pole for globes.", " terrain.west_border_msg \"\" --- Fill this in if your western border is different than the rest.", " terrain.east_border_msg \"\" --- Fill this in if your eastern border is different than the rest."}
battle_task#104r#2<clear>
dig_level#104rc#2<clear>
holes#104r#2<clear>
help_msg#104rc#2{"@myloc => returns x & y coordinates of the player.", "eg. northwest corner is {x=1, y=1}, southeast corner is {x=8, y=8}, {x=5, y=4} is somewhere in the middle."}
who_location_msg#3rc#2<clear>
free_home#3rc#2<clear>
victim_ejection_msg#3rc#2<clear>
ejection_msg#3rc#2<clear>
oejection_msg#3rc#2<clear>
residents#3rc#2<clear>
free_entry#3rc#2<clear>
entrances#3c#2<clear>
blessed_object#3rc#2<clear>
blessed_task#3rc#2<clear>
exits#3c#2<clear>
dark#3rc#2<clear>
ctype#3rc#2<clear>
key#1c#20
aliases#1rc#2{"generic maze and terrain room", "terrain", "maze"}
description#1rc#2<clear>
object_size#1r#36{23829, -1090650497}
html#1rc#2<clear>

Ancestry

Ancestors (nearest first): #104 RPG room#3 generic room#1 Root Class

Children: #147 Main Street

Call graph

calls n119_0 #119:@exset n52_6 #52:ancestors n119_0->n52_6 n6_92 #6:_chparent n119_0->n6_92 n6_18 #6:tell n119_0->n6_18 n119_1 #119:description n1_9 #1:description n119_1->n1_9 n119_2 #119:tell_exits n119_2->n6_18 n119_6 #119:loc_way n119_2->n119_6 n119_4 #119:parse_dir n119_2->n119_4 n27_6 #27:equal n119_2->n27_6 n20_6 #20:english_list n119_2->n20_6 n104_41 #104:tell_exits n119_2->n104_41 n119_6->n119_4 n119_3 #119:strip_test n119_6->n119_3 n119_19 #119:globify n119_6->n119_19 n119_5 #119:loc_maze_way n119_6->n119_5 n26_13 #26:mod n119_19->n26_13 n26_19 #26:AND n119_19->n26_19 n119_7 #119:n n119_7->n6_18 n119_7->n119_6 n119_7->n119_4 n3_5 #3:match_exit n119_7->n3_5 n104_47 #104:match n119_7->n104_47 n119_11 #119:match_loc n119_7->n119_11 n119_8 #119:player_to_loc n119_7->n119_8 n119_13 #119:no_can_go_msg n119_7->n119_13 n119_8->n6_18 n119_8->n119_4 n104_21 #104:stand n119_8->n104_21 n35_1 #35:say_action n119_8->n35_1 n3_4 #3:announce n119_8->n3_4 n20_34 #20:pronoun_sub n119_8->n20_34 n104_43 #104:look_self n119_8->n104_43 n119_9 #119:exits n119_9->n119_11 n119_10 #119:contents n119_10->n119_11 n119_12 #119:l*ook n119_12->n6_18 n119_12->n119_6 n119_12->n119_4 n119_12->n3_5 n119_12->n119_11 n119_12->n119_13 n119_12->n35_1 n119_12->n104_43 n104_4 #104:l*ook n119_12->n104_4 n119_14 #119:@myloc n119_14->n6_18 n119_16 #119:@maze*-move n119_16->n6_18 n119_16->n35_1 n119_16->n104_43 n119_18 #119:random_exit n119_16->n119_18 n20_39 #20:words n119_16->n20_39 n119_15 #119:set_object_loc n119_16->n119_15 n119_18->n119_15 n119_17 #119:go n119_17->n6_18 n119_17->n3_5 n119_17->n119_11 n119_17->n20_39 n3_14 #3:go n119_17->n3_14 n119_20 #119:match_fake n104_51 #104:_hole n119_20->n104_51 n104_25 #104:match_fake n119_20->n104_25

Source

@exset

Spec any none noneFlags rdOwner #2Definer #119

Referenced by

none

Source

1"Usage: @exset(exit) => Sets parent(exit) to $terrexit, sets exit.(x,y)_loc to player's.";
2"       Make sure you're standing where you want the exit to enter or leave.";
3if (valid(dobj) && (caller == this.owner))
4if ($exit in $object_utils:ancestors(dobj))
5if ((dobj.source == this) || (dobj.dest == this))
6if (parent(dobj) != $terrexit)
7player:_chparent(dobj, $terrexit);
8endif
9dobj.x_loc = player.x_loc;
10dobj.y_loc = player.y_loc;
11return player:tell(dobj, " has been set for your current coordinates.");
12endif
13endif
14endif
15player:tell("You must own this room, and the object of the command must be an exit to or from this location.");

description

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

none

Source

1desc = ("desc_" + tostr(player.x_loc)) + tostr(player.y_loc);
2if (d = `this.(desc) ! E_PROPNF => ""')
3return d;
4elseif (this.room_type == 4)
5if ((player.y_loc < 16) && this.north_border_msg)
6return this.north_border_msg;
7elseif ((player.y_loc > 284) && this.south_border_msg)
8return this.south_border_msg;
9endif
10endif
11return pass();

tell_exits

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

none

Source

1wayset = {};
2for w in (this.compass)
3if (this:loc_way(w, player.x_loc, player.y_loc) != {0, 0})
4wayset = setadd(wayset, this:parse_dir(w, "long"));
5endif
6endfor
7(ticks_left() < 4400) && suspend(0);
8allways = $set_utils:diff(this.long_ways, {"up", "down"});
9if ($set_utils:equal(wayset, allways))
10player:tell("You can move horizontally in any direction.");
11elseif (wayset != {})
12player:tell("You can move ", $string_utils:english_list(wayset), ".");
13endif
14pass(@args);

strip_test

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1dir = args[1];
2x = args[2];
3y = args[3];
4ok = 0;
5if ((((dir in {"n", "u"}) && (y > 0)) && (x < 9)) && (x > 0))
6ok = 1;
7elseif ((((dir in {"s", "d"}) && (y < 9)) && (x < 9)) && (x > 0))
8ok = 1;
9elseif ((((dir == "e") && (x < 9)) && (y < 9)) && (y > 0))
10ok = 1;
11elseif ((((dir == "w") && (x > 0)) && (y < 9)) && (y > 0))
12ok = 1;
13elseif (((dir == "nw") && (x > 0)) && (y > 0))
14ok = 1;
15elseif (((dir == "sw") && (x > 0)) && (y < 9))
16ok = 1;
17elseif (((dir == "ne") && (x < 9)) && (y > 0))
18ok = 1;
19elseif (((dir == "se") && (x < 9)) && (y < 9))
20ok = 1;
21endif
22return ok;

parse_dir

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE:  :parse_dir(STR,<empty string OR 2nd STR arg if you want long name>) => STR";
2if (args[2] == "")
3"name needs to be short version";
4long = args[1] in this.long_ways;
5dir = long ? this.compass[long] | args[1];
6else
7"name needs to be long version";
8short = args[1] in this.compass;
9dir = short ? this.long_ways[short] | args[1];
10endif
11return dir;

loc_maze_way

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE: this:loc_maze_way(dir,object.x_loc, object.y_loc, destination_x, destination_y) => {destination_x, destination_y} or {0,0} ";
2(ticks_left() < 6000) && suspend(0);
3dir = args[1];
4x = args[2];
5y = args[3];
6dx = args[4];
7dy = args[5];
8waysout = {};
9if ((x in {4, 5}) && (y in {4, 5}))
10if ((((!(({x, y} == {4, 4}) && (dir == "nw"))) && (!(({x, y} == {5, 4}) && (dir == "ne")))) && (!(({x, y} == {4, 5}) && (dir == "sw")))) && (!(({x, y} == {5, 5}) && (dir == "se"))))
11return {dx, dy};
12endif
13return {0, 0};
14elseif ({x, y} == {3, 4})
15waysout = {@waysout, "e"};
16elseif ({x, y} == {6, 5})
17waysout = {@waysout, "w"};
18endif
19if (x == 1)
20if (y == 1)
21waysout = {@waysout, "s", "se"};
22elseif (y == 2)
23waysout = {@waysout, "n"};
24elseif (y == 8)
25waysout = {@waysout, "e"};
26endif
27elseif (x == 2)
28if (y == 2)
29waysout = {@waysout, "nw"};
30elseif (y == 8)
31waysout = {@waysout, "w"};
32endif
33elseif (x in {4, 5})
34if (y == 3)
35waysout = {@waysout, "s"};
36elseif (y == 6)
37waysout = {@waysout, "n"};
38endif
39elseif (x == 7)
40if (y == 7)
41waysout = {@waysout, "se"};
42elseif (y == 1)
43waysout = {@waysout, "e"};
44endif
45elseif (x == 8)
46if (y == 1)
47waysout = {@waysout, "w"};
48elseif ((y == 3) && (x in {4, 5}))
49waysout = {@waysout, "s"};
50elseif ((y == 6) && (x in {4, 5}))
51waysout = {@waysout, "n"};
52elseif (y == 7)
53waysout = {@waysout, "s"};
54elseif (y == 8)
55waysout = {@waysout, "nw", "n"};
56endif
57endif
58if (abs(x - y) > 2)
59waysout = {@waysout, "s", "n"};
60endif
61if (x == y)
62waysout = {@waysout, "ne", "sw"};
63elseif ((x - y) == -1)
64waysout = {@waysout, "w"};
65elseif ((x - y) == 1)
66waysout = {@waysout, "e"};
67elseif ((x - y) == -2)
68waysout = {@waysout, "s", "ne", "e", "w"};
69elseif ((x - y) == 2)
70waysout = {@waysout, "n", "sw", "e", "w"};
71elseif ((x - y) == -3)
72waysout = {@waysout, "e"};
73elseif ((x - y) == 3)
74waysout = {@waysout, "w"};
75endif
76if ((x + y) == 11)
77waysout = {@waysout, "nw"};
78elseif ((x + y) == 9)
79waysout = {@waysout, "nw", "se"};
80elseif ((x + y) == 7)
81waysout = {@waysout, "se"};
82endif
83return (dir in waysout) ? {dx, dy} | {0, 0};

loc_way

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE: this:loc_way(direction, object.x_loc,object.y_loc) => valid {x,y} or {0,0} ";
2dir = this:parse_dir(args[1], "");
3x = args[2];
4y = args[3];
5if (dir == "nw")
6x = x - 1;
7y = y - 1;
8elseif (dir == "n")
9y = y - 1;
10elseif (dir == "ne")
11x = x + 1;
12y = y - 1;
13elseif (dir == "e")
14x = x + 1;
15elseif (dir == "se")
16x = x + 1;
17y = y + 1;
18elseif (dir == "s")
19y = y + 1;
20elseif (dir == "sw")
21x = x - 1;
22y = y + 1;
23elseif (dir == "w")
24x = x - 1;
25endif
26if (this.room_type == 2)
27for pair in (this.strip_pairs)
28if ((this.strip_way in pair) && (dir in pair))
29if (this:strip_test(dir, x, y))
30if (dir == "u")
31y = y - 1;
32elseif (dir == "d")
33y = y + 1;
34endif
35return {x, y};
36endif
37endif
38endfor
39elseif (dir in {"u", "d"})
40return {0, 0};
41elseif (this.room_type == 4)
42return this:globify(dir, x, y);
43elseif (this.room_type == 3)
44return {x, y};
45elseif ((((x > 0) && (x < 9)) && (y > 0)) && (y < 9))
46if (this.room_type == 1)
47return this:loc_maze_way(dir, args[2], args[3], x, y);
48else
49return {x, y};
50endif
51endif
52return {0, 0};

n s e w ne nw se sw u d north south east west northwest northeast southeast southwest up down

Spec any none noneFlags rxdOwner #2Definer #119

Referenced by

none

Source

1target = this:loc_way(verb, player.x_loc, player.y_loc);
2ex = this:match_exit(verb);
3if ((ex != $failed_match) && (this:match(verb) != $failed_match))
4if (this:match_loc(player, ex))
5return ex:invoke();
6endif
7endif
8if (target != {0, 0})
9this:player_to_loc(verb, target);
10elseif ((verb in {"up", "down", "u", "d"}) && (this.room_type != 2))
11player:tell("You can't go that way.");
12else
13player:tell(this:no_can_go_msg({player.x_loc, player.y_loc}, this:parse_dir(verb, "long")));
14endif

player_to_loc

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE: this:player_to_loc(dir,loc) where loc is a list set of x,y integers and dir is a string => loc";
2dir = this:parse_dir(args[1], "long");
3loc = args[2];
4if (player in this.seat_contents)
5this:stand();
6endif
7if (player.obvious)
8$you:say_action(tostr(this.relocate_msg, dir, "."));
9else
10player:tell("You move ", dir, ".");
11endif
12player.x_loc = loc[1];
13player.y_loc = loc[2];
14for pair in (this.strip_pairs)
15place = this:parse_dir(dir, "") in pair;
16if (place)
17if (place == 1)
18dir = pair[2];
19else
20dir = pair[1];
21endif
22dir = this:parse_dir(dir, "long");
23this:announce($string_utils:pronoun_sub(tostr(this.loc_arrive_msg, dir, "."), player));
24return this:look_self("");
25endif
26endfor

exits entrances

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

none

Source

1outs = {};
2for ex in (this.(verb))
3if (this:match_loc(player, ex))
4outs = {@outs, ex};
5endif
6endfor
7return outs;

contents

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

none

Source

1stuff = {};
2invoker = player;
3for who in (callers())
4"test for bot";
5if (`who[1].alert ! ANY => 0')
6invoker = who[1];
7endif
8endfor
9for op in (this.contents)
10if (this:match_loc(invoker, op))
11stuff = {@stuff, op};
12endif
13endfor
14return stuff;

match_loc

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE: match_loc(object1,object2) => yes or no to object matching same loc. Bad objects will appear everywhere for easy fixing.";
2object1 = args[1];
3object2 = args[2];
4does_match = `((object1.x_loc == object2.x_loc) && (object1.y_loc == object2.y_loc)) ? 1 | 0 ! E_PROPNF => 1';
5return does_match;

l*ook

Spec any any anyFlags rdOwner #2Definer #119

Referenced by

none

Source

1if (!args)
2return pass(@args);
3elseif ((!dobjstr) && (prepstr in {"at", "in", "on"}))
4dobjstr = iobjstr;
5iobjstr = "";
6prepstr = "";
7else
8dobjstr = dobjstr + (prepstr && ((dobjstr && " ") + prepstr));
9dobjstr = dobjstr + (iobjstr && ((dobjstr && " ") + iobjstr));
10endif
11if (valid(exit = this:match_exit(dobjstr)))
12if (this:match_loc(player, exit))
13return exit:look_self();
14endif
15endif
16if ((dobjstr in this.compass) || (dobjstr in this.long_ways))
17dir = this:parse_dir(dobjstr, "long");
18$you:say_action(tostr("%N %<looks> ", dir, "."));
19loc = this:loc_way(dobjstr, player.x_loc, player.y_loc);
20temp = {player.x_loc, player.y_loc};
21if (loc != {0, 0})
22player.x_loc = loc[1];
23player.y_loc = loc[2];
24this:look_self("");
25player.x_loc = temp[1];
26player.y_loc = temp[2];
27return;
28elseif (!((dobjstr in {"up", "u", "down", "d"}) && (this.room_type != 2)))
29return player:tell(this:no_can_go_msg(temp, dir));
30endif
31endif
32pass(@args);

no_can_go_msg

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE:  no_can_go_msg({player.xloc,player.y_loc}, <long direction name>) => appropriate message.";
2x = args[1][1];
3y = args[1][2];
4dir = args[2];
5if (this.room_type < 2)
6if (((y == 1) && (dir in {"north", "northeast", "northwest"})) && this.north_border_msg)
7return this.north_border_msg;
8elseif (((y == 8) && (dir in {"south", "southeast", "southwest"})) && this.south_border_msg)
9return this.south_border_msg;
10elseif (((x == 1) && (dir in {"west", "northwest", "southwest"})) && this.west_border_msg)
11return this.west_border_msg;
12elseif (((x == 8) && (dir in {"east", "northeast", "southeast"})) && this.east_border_msg)
13return this.east_border_msg;
14endif
15endif
16return this.no_can_go_msg;

@myloc

Spec none none noneFlags rdOwner #2Definer #119

Referenced by

none

Source

1player:tell("{", player.x_loc, ",", player.y_loc, "}");

set_object_loc

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1OBJ = args[1];
2OBJ.x_loc = args[2];
3OBJ.y_loc = args[3];

@maze*-move

Spec any none noneFlags rdOwner #2Definer #119

Referenced by

none

Source

1"USAGE: \"@maze exit\" => will move you to a random exit";
2"       \"@maze <xy>\" => will move you to the xy coordinates";
3if (!`player.join_msg ! E_PROPNF => 0')
4return player:tell("You call it @corn.");
5endif
6if (dobjstr in {"exit", "out"})
7$you:say_action("%N %<teleports> out.");
8this:random_exit(player);
9else
10loc = $string_utils:words($string_utils:subst(dobjstr, {{",", " "}, {"-", " "}, {"+", " "}}));
11x = toint(loc[1]);
12y = `toint(loc[2]) ! E_RANGE => player.y_loc';
13if ((this.room_type < 3) && (!(this.strip_way in {"u", "d"})))
14if ((((y > 8) || (x > 8)) || (y < 1)) || (x < 1))
15return player:tell("@maze-move is restricted to normal coordinates 1 through 8.");
16endif
17elseif ((this.room_type == 2) && (this.strip_way in {"u", "d"}))
18if ((y > 9) || (y < 0))
19return player:tell("@maze-move is restricted to y coordinates 0 through 9.");
20endif
21elseif (this.room_type == 4)
22if (o = ((y < 1) || (y > 299)) ? "y" | (((x < 1) || (x > 299)) ? "x" | ""))
23return player:tell("The ", o, " coordinate is out-of-range.");
24elseif (((r = abs(y - 150)) + abs(x - 150)) > 151)
25q = 150 - r;
26return player:tell("The longitude (x) range is ", 150 - q, " through ", 150 + q, " at that latitude (y).");
27endif
28endif
29$you:say_action("%N %<teleports> out.");
30this:set_object_loc(player, x, y);
31endif
32$you:say_action("%N %<teleports> in.");
33this:look_self("");

go

Spec any any anyFlags rxdOwner #2Definer #119

Referenced by

none

Source

1if ((dobjstr && valid(e = this:match_exit(dobjstr))) && this:match_loc(player, e))
2return pass(@args);
3elseif (`!this:(dobjstr)() ! E_VERBNF => 0')
4return 1;
5elseif (length(dirs = $string_utils:words(dobjstr)) > 1)
6for dir in (dirs)
7(ticks_left() < 4000) && suspend(0);
8e = `!this:(dir)() ! E_VERBNF => 666';
9if (e == 666)
10return player:tell("You can't go that way.") || 1;
11endif
12endfor
13return 1;
14endif
15return pass(@args);

random_exit

Spec this none thisFlags rxdOwner #2Definer #119

Referenced by

Source

1"USAGE: random_exit(obj) => sets obj.x_loc & obj.y_loc to match an exit picked at random.";
2ex = this.exits[random($)];
3this:set_object_loc(args[1], ex.x_loc, ex.y_loc);

globify

Spec this none thisFlags rxdOwner #36Definer #119

Referenced by

Source

1"USAGE: :globify(dir,x,y) where dir is in this.compass and x & y are integers";
2"       => a new {x, y} for global navigation. Used when this.room_type == 4";
3{dir, x, y} = {@args};
4(ticks_left() < 6000) && suspend(0);
5q = abs(x - 150);
6r = abs(y - 150);
7if (way = dir in {"n", "ne", "nw", "s", "se", "sw"})
8north = (way < 4) ? 1 | 0;
9if ((y <= 0) && north)
10return {0, 0};
11elseif ((y >= 300) && (!north))
12return {0, 0};
13elseif (x == 150)
14return {x, y};
15endif
16tuck = ((q + r) >= 150) || $math_utils:mod(y, 2);
17if ($math_utils:XOR(y < 150, north) && tuck)
18x = (x > 150) ? x + 1 | (x - 1);
19elseif (tuck)
20x = (x > 150) ? x - 1 | (x + 1);
21endif
22endif
23if ((q + r) > 150)
24if (x < 150)
25x = 149 + q;
26elseif (x > 150)
27x = 151 - q;
28elseif (y == 150)
29if (x <= 0)
30x = 299;
31elseif (x >= 300)
32x = 1;
33endif
34endif
35endif
36return {x, y};

match_fake

Spec this none thisFlags rxdOwner #36Definer #119

Referenced by

none

Source

1if (args[1] == "hole")
2if (!this:_hole())
3return tostr("You see no hole here.");
4else
5return tostr("The hole is empty.");
6endif
7else
8return pass(@args);
9endif