ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/exit.C
(Generate patch)

Comparing deliantra/server/random_maps/exit.C (file contents):
Revision 1.38 by root, Fri Mar 26 00:59:21 2010 UTC vs.
Revision 1.43 by root, Sat Jun 26 22:10:18 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2001 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
115 4 means leftward 115 4 means leftward
116 5 means northward 116 5 means northward
117 6 means southward 117 6 means southward
118*/ 118*/
119void 119void
120place_exits (maptile *map, char **maze, char *exitstyle, int orientation, random_map_params *RP) 120place_exits (maptile *map, char **maze, const char *exitstyle, int orientation, random_map_params *RP)
121{ 121{
122 char styledirname[1024];
123 maptile *style_map_down = 0; /* harder maze */ 122 maptile *style_map_down = 0; /* harder maze */
124 maptile *style_map_up = 0; /* easier maze */ 123 maptile *style_map_up = 0; /* easier maze */
125 object *the_exit_down; /* harder maze */ 124 object *the_exit_down; /* harder maze */
126 object *the_exit_up; /* easier maze */ 125 object *the_exit_up; /* easier maze */
127 int cx = -1, cy = -1; /* location of a map center */ 126 int cx = -1, cy = -1; /* location of a map center */
138 137
139 switch (orientation) 138 switch (orientation)
140 { 139 {
141 case 1: 140 case 1:
142 { 141 {
143 sprintf (styledirname, "/styles/exitstyles/up");
144 style_map_up = find_style (styledirname, exitstyle, -1); 142 style_map_up = find_style ("/styles/exitstyles/up" , exitstyle, RP->difficulty);
145 sprintf (styledirname, "/styles/exitstyles/down");
146 style_map_down = find_style (styledirname, exitstyle, -1); 143 style_map_down = find_style ("/styles/exitstyles/down", exitstyle, RP->difficulty);
147 break; 144 break;
148 } 145 }
149 146
150 case 2: 147 case 2:
151 { 148 {
152 sprintf (styledirname, "/styles/exitstyles/down");
153 style_map_up = find_style (styledirname, exitstyle, -1); 149 style_map_up = find_style ("/styles/exitstyles/down", exitstyle, RP->difficulty);
154 sprintf (styledirname, "/styles/exitstyles/up");
155 style_map_down = find_style (styledirname, exitstyle, -1); 150 style_map_down = find_style ("/styles/exitstyles/up" , exitstyle, RP->difficulty);
156 break; 151 break;
157 } 152 }
158 153
159 default: 154 default:
160 { 155 {
161 sprintf (styledirname, "/styles/exitstyles/generic"); 156 style_map_up =
162 style_map_up = find_style (styledirname, exitstyle, -1); 157 style_map_down = find_style ("/styles/exitstyles/generic", exitstyle, RP->difficulty);
163 style_map_down = style_map_up;
164 break; 158 break;
165 } 159 }
166 } 160 }
167 161
168 the_exit_up = style_map_up 162 the_exit_up = style_map_up
282 if (downx == -1) 276 if (downx == -1)
283 find_in_layout (0, 0, &downx, &downy, maze, RP); 277 find_in_layout (0, 0, &downx, &downy, maze, RP);
284 278
285 if (the_exit_down) 279 if (the_exit_down)
286 { 280 {
287 char buf[16384];
288
289 int i = find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1); 281 int i = rmg_find_free_spot (the_exit_down, map, downx, downy, 1, SIZEOFFREE1 + 1);
290 the_exit_down->x = downx + freearr_x[i]; 282 the_exit_down->x = downx + freearr_x[i];
291 the_exit_down->y = downy + freearr_y[i]; 283 the_exit_down->y = downy + freearr_y[i];
292 RP->origin_x = the_exit_down->x; 284 RP->origin_x = the_exit_down->x;
293 RP->origin_y = the_exit_down->y; 285 RP->origin_y = the_exit_down->y;
286
287 dynbuf_text buf;
294 write_map_parameters_to_string (buf, RP); 288 write_map_parameters_to_string (buf, RP);
295 the_exit_down->msg = buf; 289 the_exit_down->msg = buf;
296 290
297 /* the identifier for making a random map. */ 291 /* the identifier for making a random map. */
298 if (RP->dungeon_level >= RP->dungeon_depth && *RP->final_map) 292 if (RP->dungeon_level >= RP->dungeon_depth && *RP->final_map)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines