generic maze and terrain room #119
Aliases: generic maze and terrain room, terrain, maze
21 verbs · 67 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
@exset | any none none | rd | #119 | 15 |
description | this none this | rxd | #119 | 11 |
tell_exits | this none this | rxd | #119 | 14 |
strip_test | this none this | rxd | #119 | 22 |
parse_dir | this none this | rxd | #119 | 11 |
loc_maze_way | this none this | rxd | #119 | 83 |
loc_way | this none this | rxd | #119 | 52 |
n s e w ne nw se sw u d north south east west northwest northeast southeast southwest up down | any none none | rxd | #119 | 14 |
player_to_loc | this none this | rxd | #119 | 26 |
exits entrances | this none this | rxd | #119 | 7 |
contents | this none this | rxd | #119 | 14 |
match_loc | this none this | rxd | #119 | 5 |
l*ook | any any any | rd | #119 | 32 |
no_can_go_msg | this none this | rxd | #119 | 16 |
@myloc | none none none | rd | #119 | 1 |
set_object_loc | this none this | rxd | #119 | 3 |
@maze*-move | any none none | rd | #119 | 33 |
go | any any any | rxd | #119 | 15 |
random_exit | this none this | rxd | #119 | 3 |
globify | this none this | rxd | #119 | 36 |
match_fake | this none this | rxd | #119 | 9 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
compass | #119 | r | #2 | list of 10{"n", "s", "e", "w", "nw", "ne", "se", "sw", "u", "d"} |
long_ways | #119 | r | #2 | list of 10{"north", "south", "east", "west", "northwest", "northeast", "southeast", "southwest", "up", "down"} |
room_type | #119 | rc | #2 | 0 |
strip_way | #119 | rc | #2 | "n" |
relocate_msg | #119 | rc | #2 | "%N %<goes> " |
loc_arrive_msg | #119 | rc | #2 | "%N %<arrives> from " |
no_can_go_msg | #119 | rc | #2 | "You can't go that way." |
north_border_msg | #119 | rc | #2 | "" |
south_border_msg | #119 | rc | #2 | "" |
west_border_msg | #119 | rc | #2 | "" |
east_border_msg | #119 | rc | #2 | "" |
strip_pairs | #119 | r | #2 | {{"n", "s"}, {"e", "w"}, {"nw", "se"}, {"ne", "sw"}, {"u", "d"}} |
bot_locked | #104 | rc | #2 | <clear> |
fakes | #104 | r | #36 | <clear> |
retail | #104 | rc | #2 | 0 |
seat | #104 | r | #36 | <clear> |
pool | #104 | r | #36 | <clear> |
seat_desc | #104 | r | #36 | <clear> |
pool_desc | #104 | r | #36 | <clear> |
sit_phrase | #104 | rc | #2 | <clear> |
stand_phrase | #104 | rc | #2 | <clear> |
swim_phrase | #104 | rc | #2 | <clear> |
dry_phrase | #104 | rc | #2 | <clear> |
push_phrase | #104 | rc | #2 | <clear> |
seat_aliai | #104 | r | #36 | <clear> |
pool_aliai | #104 | r | #36 | <clear> |
seat_contents | #104 | r | #36 | <clear> |
pool_contents | #104 | r | #36 | <clear> |
seat_max | #104 | r | #36 | <clear> |
pool_max | #104 | r | #36 | <clear> |
details | #104 | rc | #2 | <clear> |
temp_detail_index | #104 | rc | #2 | <clear> |
temp_detail_desc | #104 | rc | #2 | <clear> |
outdoors | #104 | r | #36 | <clear> |
attack_queue | #104 | r | #2 | <clear> |
battle_on | #104 | r | #2 | <clear> |
stop_msg | #104 | rc | #2 | <clear> |
remove_msg | #104 | rc | #2 | <clear> |
dump_msg | #104 | rc | #2 | <clear> |
dump_loc | #104 | rc | #2 | <clear> |
sanctuary | #104 | rc | #2 | <clear> |
ansi_title | #104 | r | #36 | <clear> |
dark_desc | #104 | rc | #2 | <clear> |
title_style | #104 | rc | #2 | <clear> |
build_help | #104 | rc | #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 | #104 | r | #2 | <clear> |
dig_level | #104 | rc | #2 | <clear> |
holes | #104 | r | #2 | <clear> |
help_msg | #104 | rc | #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 | #3 | rc | #2 | <clear> |
free_home | #3 | rc | #2 | <clear> |
victim_ejection_msg | #3 | rc | #2 | <clear> |
ejection_msg | #3 | rc | #2 | <clear> |
oejection_msg | #3 | rc | #2 | <clear> |
residents | #3 | rc | #2 | <clear> |
free_entry | #3 | rc | #2 | <clear> |
entrances | #3 | c | #2 | <clear> |
blessed_object | #3 | rc | #2 | <clear> |
blessed_task | #3 | rc | #2 | <clear> |
exits | #3 | c | #2 | <clear> |
dark | #3 | rc | #2 | <clear> |
ctype | #3 | rc | #2 | <clear> |
key | #1 | c | #2 | 0 |
aliases | #1 | rc | #2 | {"generic maze and terrain room", "terrain", "maze"} |
description | #1 | rc | #2 | <clear> |
object_size | #1 | r | #36 | {23829, -1090650497} |
html | #1 | rc | #2 | <clear> |
Ancestry
Ancestors (nearest first): #104 RPG room → #3 generic room → #1 Root Class
Children: #147 Main Street
Call graph
Source
@exset
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
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
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
Referenced by
- #119:loc_way line 29:
this:strip_test
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
Referenced by
- #119:tell_exits line 4:
this:parse_dir - #119:loc_way line 2:
this:parse_dir - #119:n line 13:
this:parse_dir - #119:player_to_loc line 2:
this:parse_dir - #119:player_to_loc line 15:
this:parse_dir - #119:player_to_loc line 22:
this:parse_dir - #119:l*ook line 17:
this:parse_dir
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
Referenced by
- #119:loc_way line 47:
this:loc_maze_way
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
Referenced by
- #119:tell_exits line 3:
this:loc_way - #119:n line 1:
this:loc_way - #119:l*ook line 19:
this:loc_way
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
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
Referenced by
- #119:n line 9:
this:player_to_loc
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
Referenced by
none
Source
1outs = {}; 2for ex in (this.(verb)) 3if (this:match_loc(player, ex)) 4outs = {@outs, ex}; 5endif 6endfor 7return outs;
contents
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
Referenced by
- #119:n line 4:
this:match_loc - #119:exits line 3:
this:match_loc - #119:contents line 10:
this:match_loc - #119:l*ook line 12:
this:match_loc - #119:go line 1:
this:match_loc
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
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
Referenced by
- #119:n line 13:
this:no_can_go_msg - #119:l*ook line 29:
this:no_can_go_msg
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
Referenced by
none
Source
1player:tell("{", player.x_loc, ",", player.y_loc, "}");
set_object_loc
Referenced by
- #57:@summon line 9:
$terrain:set_object_loc - #119:@maze*-move line 30:
this:set_object_loc - #119:random_exit line 3:
this:set_object_loc
Source
1OBJ = args[1]; 2OBJ.x_loc = args[2]; 3OBJ.y_loc = args[3];
@maze*-move
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
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
Referenced by
- #119:@maze*-move line 8:
this:random_exit
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
Referenced by
- #119:loc_way line 42:
this:globify
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
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