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

Comparing deliantra/server/random_maps/special.C (file contents):
Revision 1.15 by root, Mon Jan 15 15:54:19 2007 UTC vs.
Revision 1.18 by root, Sat Jan 27 00:50:13 2007 UTC

1
2/* 1/*
3 CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game for X-windows
4 3 *
5 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
6 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
7 Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
8 7 *
9 This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version. 11 * (at your option) any later version.
13 12 *
14 This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details. 16 * GNU General Public License for more details.
18 17 *
19 You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 21 *
23 The authors can be reached via e-mail at <crossfire@schmorp.de> 22 * The authors can be reached via e-mail at <crossfire@schmorp.de>
24*/ 23 */
25 24
26/* Specials in this file: 25/* Specials in this file:
27 included maps */ 26 included maps */
28 27
29#include <global.h> 28#include <global.h>
159void 158void
160place_fountain_with_specials (maptile *map) 159place_fountain_with_specials (maptile *map)
161{ 160{
162 int ix, iy, i = -1, tries = 0; 161 int ix, iy, i = -1, tries = 0;
163 maptile *fountain_style = find_style ("/styles/misc", "fountains", -1); 162 maptile *fountain_style = find_style ("/styles/misc", "fountains", -1);
163
164 if (!fountain_style)
165 LOG (llevError, "unabel to load stylemap /styles/misc fountains\n"),
166 return;
167
164 object *fountain = get_archetype ("fountain"); 168 object *fountain = get_archetype ("fountain");
165 object *potion = object::create (); 169 object *potion = object::create ();
166 170
167 pick_random_object (fountain_style)->copy_to (potion); 171 pick_random_object (fountain_style)->copy_to (potion);
168 172
202 int ix, iy, i = -1; 206 int ix, iy, i = -1;
203 char buf[16384], *style, *decor, *mon; 207 char buf[16384], *style, *decor, *mon;
204 maptile *exit_style = find_style ("/styles/misc", "obscure_exits", -1); 208 maptile *exit_style = find_style ("/styles/misc", "obscure_exits", -1);
205 int g_xsize, g_ysize; 209 int g_xsize, g_ysize;
206 210
211 if (!exit_style)
212 LOG (llevError, "unabel to load stylemap /styles/misc obscure_exits\n"),
213 return 0;
214
207 object *the_exit = object::create (); 215 object *the_exit = object::create ();
208 216
209 if (!exit_style) 217 if (!exit_style)
210 return; 218 return;
211 219
228 236
229 switch (hole_type) 237 switch (hole_type)
230 { 238 {
231 case GLORY_HOLE: /* treasures */ 239 case GLORY_HOLE: /* treasures */
232 { 240 {
233 g_xsize = RANDOM () % 3 + 4 + RP->difficulty / 4; 241 g_xsize = rndm (3) + 4 + RP->difficulty / 4;
234 g_ysize = RANDOM () % 3 + 4 + RP->difficulty / 4; 242 g_ysize = rndm (3) + 4 + RP->difficulty / 4;
235 style = "onion"; 243 style = "onion";
236 decor = "wealth2"; 244 decor = "wealth2";
237 mon = "none"; 245 mon = "none";
238 break; 246 break;
239 } 247 }
240 248
241 case ORC_ZONE: /* hole with orcs in it. */ 249 case ORC_ZONE: /* hole with orcs in it. */
242 { 250 {
243 g_xsize = RANDOM () % 3 + 4 + RP->difficulty / 4; 251 g_xsize = rndm (3) + 4 + RP->difficulty / 4;
244 g_ysize = RANDOM () % 3 + 4 + RP->difficulty / 4; 252 g_ysize = rndm (3) + 4 + RP->difficulty / 4;
245 style = "onion"; 253 style = "onion";
246 decor = "wealth2"; 254 decor = "wealth2";
247 mon = "orc"; 255 mon = "orc";
248 break; 256 break;
249 } 257 }
250 258
251 case MINING_ZONE: /* hole with orcs in it. */ 259 case MINING_ZONE: /* hole with orcs in it. */
252 { 260 {
253 g_xsize = RANDOM () % 9 + 4 + RP->difficulty / 4; 261 g_xsize = rndm (9) + 4 + RP->difficulty / 4;
254 g_ysize = RANDOM () % 9 + 4 + RP->difficulty / 4; 262 g_ysize = rndm (9) + 4 + RP->difficulty / 4;
255 style = "maze"; 263 style = "maze";
256 decor = "minerals2"; 264 decor = "minerals2";
257 mon = "none"; 265 mon = "none";
258 break; 266 break;
259 } 267 }
297 305
298 /* includes a special map into the random map being made. */ 306 /* includes a special map into the random map being made. */
299 case SPECIAL_SUBMAP: 307 case SPECIAL_SUBMAP:
300 { 308 {
301 special_map = find_style ("/styles/specialmaps", 0, RP->difficulty); 309 special_map = find_style ("/styles/specialmaps", 0, RP->difficulty);
302 if (special_map == NULL) 310 if (!special_map)
303 return; 311 return;
304 312
305 if (find_spot_for_submap (map, layout, &ix, &iy, special_map->width, special_map->height)) 313 if (find_spot_for_submap (map, layout, &ix, &iy, special_map->width, special_map->height))
306 include_map_in_map (map, special_map, ix, iy); 314 include_map_in_map (map, special_map, ix, iy);
307 break; 315 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines