Crossfire Server, Trunk  R20763
special.c File Reference
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "random_map.h"
#include "rproto.h"
+ Include dependency graph for special.c:

Go to the source code of this file.


#define GLORY_HOLE   1
#define MINING_ZONE   3
#define NO_SPECIAL   0
#define NR_OF_HOLE_TYPES   3
#define ORC_ZONE   2
#define SPECIAL_EXIT   3
#define SPECIAL_SUBMAP   1


int find_spot_for_submap (mapstruct *map, char **layout, int *ix, int *iy, int xsize, int ysize)
void include_map_in_map (mapstruct *dest_map, const mapstruct *in_map, int x, int y)
void nuke_map_region (mapstruct *map, int xstart, int ystart, int xsize, int ysize)
void place_fountain_with_specials (mapstruct *map)
void place_special_exit (mapstruct *map, int hole_type, const RMParms *RP)
void place_specials_in_map (mapstruct *map, char **layout, RMParms *RP)

Detailed Description

Those functions handle placement of fountains, submaps, and so on.

Definition in file special.c.

Function Documentation

◆ find_spot_for_submap()

int find_spot_for_submap ( mapstruct map,
char **  layout,
int *  ix,
int *  iy,
int  xsize,
int  ysize 

Finds a place to put a submap into.

mapmap to insert.
layoutwhere to insert into.
iycoordinates of suitable location if return is 1.
ysizesize of layout.
0 if no space found, 1 else.

Definition at line 154 of file special.c.

References MAP_HEIGHT, MAP_WIDTH, RANDOM, settings, and Settings::special_break_map.

Referenced by place_specials_in_map().

+ Here is the caller graph for this function:

◆ include_map_in_map()

void include_map_in_map ( mapstruct dest_map,
const mapstruct in_map,
int  x,
int  y 

Copy in_map into dest_map at point x,y. This also copies shop information if set in in_map.

dest_mapmap where to copy to.
in_mapmap to copy from.
ycoordinates to put in_map to.

Definition at line 86 of file special.c.

References add_button_link(), CALLOC, FLAG_IS_LINKED, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_AND_CLEAR, shopitem::index, INS_NO_MERGE, INS_NO_WALK_ON, MAP_HEIGHT, MAP_WIDTH, nuke_map_region(), object_copy_with_inv(), object_create_arch(), object_insert_in_map_at(), QUERY_FLAG, mapdef::shopgreed, mapdef::shopitems, mapdef::shopmax, mapdef::shopmin, mapdef::shoprace, and strdup_local.

Referenced by place_specials_in_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nuke_map_region()

void nuke_map_region ( mapstruct map,
int  xstart,
int  ystart,
int  xsize,
int  ysize 

Erases all objects (except floor) in the given rectangle.

mapmap to process.
ystarttop-left coordinates of zone.
ysizesize of zone.

Definition at line 59 of file special.c.

References FLAG_IS_FLOOR, FOR_MAP_FINISH, FOR_MAP_PREPARE, HEAD, object_free_drop_inventory(), object_remove(), and QUERY_FLAG.

Referenced by include_map_in_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ place_fountain_with_specials()

void place_fountain_with_specials ( mapstruct map)

◆ place_special_exit()

◆ place_specials_in_map()

void place_specials_in_map ( mapstruct map,
char **  layout,
RMParms RP 

Main function for specials.

mapmap to alter.
layoutlayout the map was generated from.
RPparameters the map was generated from.

Definition at line 393 of file special.c.

References RMParms::difficulty, find_spot_for_submap(), find_style(), include_map_in_map(), MAP_HEIGHT, MAP_WIDTH, NUM_OF_SPECIAL_TYPES, place_fountain_with_specials(), place_special_exit(), RANDOM, SPECIAL_EXIT, SPECIAL_FOUNTAIN, and SPECIAL_SUBMAP.

Referenced by generate_random_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: