Crossfire Server, Trunk
|
This module links unused exits to random maps. The random map parameters vary based on the map it is in, but each exit will always use the same random seed to have the same layout and content. More...
Files | |
file | random_house_generator.cpp |
Data Structures | |
struct | house_zone_struct |
Functions | |
static void | add_exit_to_item (object *exit, const house_zone_struct *zone, const mapstruct *map) |
static void | add_exits_to_map (const mapstruct *map) |
static int | cfrhg_globalEventListener (int *type,...) |
static int | get_exit_seed (const object *exit, const mapstruct *map) |
static const house_zone_struct * | get_map_zone (const mapstruct *map) |
static int | is_suitable_exit (object *exit) |
void | random_house_generator_close () |
void | random_house_generator_init (Settings *settings) |
Variables | |
static event_registration | eg |
const char * | house_zone_struct::mappath |
const char * | house_zone_struct::monsterstyle |
static const house_zone_struct | zones [] |
This module links unused exits to random maps. The random map parameters vary based on the map it is in, but each exit will always use the same random seed to have the same layout and content.
Exits will only point to a random map if both their slaying and msg fields are empty.
|
static |
Change an empty exit to point to a random map.
exit | exit to alter. |
zone | zone we're part of, to know the random map parameters. |
map | map the exit is on. |
Definition at line 135 of file random_house_generator.cpp.
References add_string(), get_exit_seed(), disinfect::map, MAX_BUF, house_zone_struct::monsterstyle, object::msg, roll-o-matic::params, and object::slaying.
Referenced by add_exits_to_map().
|
static |
Checks if the map should be processed, and if so process it.
map | map to work on. |
Definition at line 161 of file random_house_generator.cpp.
References add_exit_to_item(), FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_zone(), is_suitable_exit(), disinfect::map, MAP_HEIGHT, MAP_WIDTH, diamondslots::x, and diamondslots::y.
Referenced by cfrhg_globalEventListener().
|
static |
Global server event handling. Only uses EVENT_MAPLOAD.
type | unused. |
Definition at line 185 of file random_house_generator.cpp.
References add_exits_to_map(), make_face_from_files::args, EVENT_MAPLOAD, disinfect::map, and is_valid_types_gen::type.
Referenced by random_house_generator_init().
Get the random map seed. Will always yield the same value for the same (position included) exit.
exit | exit to get the seed of. |
map | map the exit is on. |
Definition at line 109 of file random_house_generator.cpp.
References object::arch, HUGE_BUF, make_face_from_files::int, disinfect::map, archetype::name, ring_occidental_mages::r, object::x, and object::y.
Referenced by add_exit_to_item().
|
static |
Get the random map parameters of a map.
map | map to get the zone of. |
Definition at line 71 of file random_house_generator.cpp.
References disinfect::map, house_zone_struct::mappath, and zones.
Referenced by add_exits_to_map().
|
static |
Should we add a random map to this exit?
exit | exit to check. |
Definition at line 89 of file random_house_generator.cpp.
References EXIT, object::msg, object::slaying, and object::type.
Referenced by add_exits_to_map().
void random_house_generator_close | ( | ) |
Close the module.
Definition at line 220 of file random_house_generator.cpp.
References eg, EVENT_MAPLOAD, and events_unregister_global_handler().
void random_house_generator_init | ( | Settings * | settings | ) |
Module initialisation.
Definition at line 210 of file random_house_generator.cpp.
References cfrhg_globalEventListener(), Settings::disabled_plugins, eg, EVENT_MAPLOAD, events_register_global_handler(), and settings.
|
static |
Definition at line 205 of file random_house_generator.cpp.
Referenced by events_register_global_handler(), random_house_generator_close(), and random_house_generator_init().
const char* house_zone_struct::mappath |
Full map path.
Definition at line 45 of file random_house_generator.cpp.
Referenced by get_map_zone().
const char* house_zone_struct::monsterstyle |
Style of monsters.
Definition at line 46 of file random_house_generator.cpp.
Referenced by add_exit_to_item().
|
static |
Maps we work on.
Definition at line 50 of file random_house_generator.cpp.
Referenced by add_npc_to_random_map(), and get_map_zone().