Crossfire Server, Trunk
|
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "random_map.h"
#include "rproto.h"
Go to the source code of this file.
Macros | |
#define | GLORY_HOLE 1 |
#define | MINING_ZONE 3 |
#define | NO_SPECIAL 0 |
#define | NR_OF_HOLE_TYPES 3 |
#define | NUM_OF_SPECIAL_TYPES 4 |
#define | ORC_ZONE 2 |
#define | SPECIAL_EXIT 3 |
#define | SPECIAL_FOUNTAIN 2 |
#define | SPECIAL_SUBMAP 1 |
Functions | |
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) |
Those functions handle placement of fountains, submaps, and so on.
Definition in file special.cpp.
#define GLORY_HOLE 1 |
Definition at line 42 of file special.cpp.
#define MINING_ZONE 3 |
Definition at line 44 of file special.cpp.
#define NO_SPECIAL 0 |
Definition at line 32 of file special.cpp.
#define NR_OF_HOLE_TYPES 3 |
Definition at line 45 of file special.cpp.
#define NUM_OF_SPECIAL_TYPES 4 |
Definition at line 31 of file special.cpp.
#define ORC_ZONE 2 |
Definition at line 43 of file special.cpp.
#define SPECIAL_EXIT 3 |
Definition at line 35 of file special.cpp.
#define SPECIAL_FOUNTAIN 2 |
Definition at line 34 of file special.cpp.
#define SPECIAL_SUBMAP 1 |
Definition at line 33 of file special.cpp.
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.
map | map to insert. |
layout | where to insert into. |
ix | |
iy | coordinates of suitable location if return is 1. |
xsize | |
ysize | size of layout. |
Definition at line 154 of file special.cpp.
References banquet::l, m, disinfect::map, MAP_HEIGHT, MAP_WIDTH, RANDOM, settings, and Settings::special_break_map.
Referenced by place_specials_in_map().
Copy in_map into dest_map at point x,y. This also copies shop information if set in in_map.
dest_map | map where to copy to. |
in_map | map to copy from. |
x | |
y | coordinates to put in_map to. |
Definition at line 86 of file special.cpp.
References add_button_link(), CALLOC, FLAG_IS_LINKED, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_AND_CLEAR, shopitems::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, mapstruct::shopgreed, mapstruct::shopitems, mapstruct::shopmax, mapstruct::shopmin, mapstruct::shoprace, strdup_local, Ice::tmp, diamondslots::x, and diamondslots::y.
Referenced by place_specials_in_map().
void nuke_map_region | ( | mapstruct * | map, |
int | xstart, | ||
int | ystart, | ||
int | xsize, | ||
int | ysize | ||
) |
Erases all objects (except floor) in the given rectangle.
map | map to process. |
xstart | |
ystart | top-left coordinates of zone. |
xsize | |
ysize | size of zone. |
Definition at line 59 of file special.cpp.
References FLAG_IS_FLOOR, FOR_MAP_FINISH, FOR_MAP_PREPARE, HEAD, disinfect::map, object_free_drop_inventory(), object_remove(), QUERY_FLAG, and Ice::tmp.
Referenced by include_map_in_map().
void place_fountain_with_specials | ( | mapstruct * | map | ) |
Places a special fountain on the map.
map | map to place to. |
Definition at line 217 of file special.cpp.
References object::anim_speed, object::animation, CLEAR_FLAG, archetype::clone, object::face, find_archetype(), find_style(), FLAG_ANIMATE, FLAG_CLIENT_ANIM_RANDOM, FLAG_IDENTIFIED, FLAG_NO_PICK, FREE_AND_CLEAR_STR, FREE_AND_COPY, freearr_x, freearr_y, disinfect::map, MAP_HEIGHT, MAP_WIDTH, object::material, object::materialname, object::name, archetype::name, object::name_pl, object_copy_with_inv(), object_find_first_free_spot(), object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_set_value(), object_update_speed(), pick_random_object(), QUERY_FLAG, RANDOM, SET_FLAG, and object::speed.
Referenced by place_specials_in_map().
Place an exit with a resource map.
map | where to put the exit. |
hole_type | type of random map to link to, see HOLE_xxx. |
RP | parameters from which map was generated. |
Definition at line 277 of file special.cpp.
References add_string(), buf, RMParms::decoroptions, RMParms::decorstyle, RMParms::difficulty, RMParms::difficulty_given, RMParms::difficulty_increase, RMParms::doorstyle, RMParms::dungeon_depth, RMParms::dungeon_level, RMParms::exit_on_final_map, RMParms::exitstyle, RMParms::final_map, find_style(), RMParms::floorstyle, freearr_x, freearr_y, GLORY_HOLE, RMParms::layoutoptions1, RMParms::layoutoptions2, RMParms::layoutstyle, llevError, LOG(), disinfect::map, MAP_HEIGHT, MAP_WIDTH, MIN_RANDOM_MAP_SIZE, MINING_ZONE, mon, RMParms::monsterstyle, NR_OF_HOLE_TYPES, object_copy(), object_find_first_free_spot(), object_insert_in_map_at(), object_new(), object_set_msg(), OPT_WALLS_ONLY, ORC_ZONE, RMParms::orientation, RMParms::origin_x, RMParms::origin_y, pick_random_object(), RANDOM, RMParms::random_seed, object::slaying, stringbuffer_finish(), CFInsulter::style, RMParms::symmetry, RMParms::this_map, RMParms::treasureoptions, RMParms::treasurestyle, RMParms::wallstyle, write_map_parameters_to_string(), RMParms::Xsize, and RMParms::Ysize.
Referenced by place_specials_in_map().
Main function for specials.
map | map to alter. |
layout | layout the map was generated from. |
RP | parameters the map was generated from. |
Definition at line 396 of file special.cpp.
References RMParms::difficulty, find_spot_for_submap(), find_style(), include_map_in_map(), disinfect::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().