Crossfire Server, Trunk
|
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include "global.h"
#include "sproto.h"
#include "image.h"
#include "quest.h"
#include <gd.h>
#include <gdfonts.h>
#include <gdfontl.h>
#include <gdfontg.h>
#include "inja.hpp"
#include <map>
#include <set>
Go to the source code of this file.
Data Structures | |
class | pageToRender |
struct | struct_equipment |
struct | struct_map_in_quest |
struct | struct_map_in_quest_list |
struct | struct_map_info |
struct | struct_map_list |
struct | struct_npc_info |
struct | struct_quest |
struct | struct_race |
struct | struct_race_list |
struct | struct_region_info |
struct | struct_slaying_info |
Macros | |
#define | S_CONNECT 4 |
#define | S_CONTAINER 2 |
#define | S_DETECTOR 3 |
#define | S_DOOR 0 |
#define | S_KEY 1 |
#define | S_MAX 5 |
#define | SIZE 50 |
#define | size_large sizes[0] |
#define | size_small sizes[1] |
Typedefs | |
typedef std::vector< struct_npc_info * > | npc_list |
Enumerations | |
enum | output_format_type { OF_PNG = 0, OF_JPG = 1 } |
Functions | |
void | account_char_free (Account_Chars *) |
Account_Chars * | account_char_load (const char *) |
void | account_char_save (Account_Chars *) |
void | account_logout (const char *) |
static void | add_map (struct_map_info *info, struct_map_list *list) |
static void | add_map_to_quest (struct_map_info *map, const char *name, const char *description) |
static void | add_map_to_region (struct_map_info *map, region *reg) |
static void | add_map_to_slaying (struct_slaying_info *info, int item, struct_map_info *map) |
static void | add_monster (object *monster, struct_map_info *map) |
static void | add_npc_to_map (npc_list *list, const object *npc) |
static void | add_one_item (object *item, struct_map_info *map) |
static void | add_race_to_list (struct_race *race, struct_race_list *list, int check) |
static void | add_region_link (mapstruct *source, mapstruct *dest) |
static void | add_slaying (struct_map_info *map, object *item) |
void | add_template_to_render (const std::string &template_name, const std::string &output_name, const std::string ¶m) |
static void | add_to_struct_map_in_quest_list (struct_map_in_quest_list *list, struct_map_in_quest *item) |
static void | append_map_list (struct_map_list &dest, struct_map_list &src) |
int | apply_auto (object *op) |
void | apply_auto_fix (mapstruct *) |
static void | check_equipment (object *item, struct_map_info *map) |
static void | check_slaying_inventory (struct_map_info *map, object *item) |
void | clean_tmp_files (void) |
void | command_help (object *, const char *) |
static int | compare_map_info (const struct_map_info *left, const struct_map_info *right) |
static void | create_destination (void) |
static nlohmann::json | create_map_in_quest_array (struct_map_in_quest_list &list) |
static struct_map_info * | create_map_info (void) |
static nlohmann::json | create_map_object (struct_map_info *map, const std::string &key) |
static nlohmann::json | create_maps_array (struct_map_list &maps) |
static nlohmann::json | create_npc_array (npc_list &list) |
static struct_npc_info * | create_npc_info (const object *npc) |
static nlohmann::json | create_quest_object (struct_quest *quest, const std::string &key) |
static nlohmann::json | create_race_array (struct_race_list &list) |
static nlohmann::json | create_region_array (const std::set< region * > ®ions) |
static struct_map_info * | create_tiled_map (void) |
static void | define_quest (const char *name, struct_map_info *mainmap, const char *description) |
void | do_auto_apply (mapstruct *m) |
static void | do_exit_map (mapstruct *map) |
static void | do_help (const char *program) |
static void | do_parameters (int argc, char **argv) |
static void | do_tiled_map_picture (struct_map_info *map) |
void | dragon_ability_gain (object *, int, int) |
void | draw_ext_info (int, int, const object *, uint8_t, uint8_t, const char *txt) |
void | draw_ext_info_format (int, int, const object *, uint8_t, uint8_t, const char *format,...) |
static void | dump_unused_maps (void) |
void | emergency_save (int) |
static struct_equipment * | ensure_unique (struct_equipment *item) |
void | esrv_del_item (player *, object *) |
void | esrv_send_item (object *, object *) |
void | esrv_update_item (int, object *, object *) |
void | esrv_update_spells (player *) |
void | ext_info_map (int, const mapstruct *, uint8_t, uint8_t, const char *str1) |
static void | fill_json (nlohmann::json &json) |
static void | fill_reverse_maps (struct_map_list &list) |
static struct_map_info * | find_map_by_key (const std::string &key) |
static void | find_maps (const char *from) |
player * | find_player_partial_name (const char *) |
static struct_quest * | find_quest_info (const char *name) |
static region * | find_region_by_key (const std::string &key) |
object * | find_skill_by_number (object *, int) |
static void | fix_exits_for_map (struct_map_info *current, struct_map_list *from, int is_from) |
static void | fix_exits_to_tiled_maps (void) |
static void | fix_map_names (void) |
static void | fix_tiled_map (void) |
static void | fix_tiled_map_monsters (void) |
static void | free_equipment (struct_equipment *equip) |
static nlohmann::json | generate_page_and_link (inja::Arguments &args) |
static nlohmann::json | generate_picture_link (inja::Arguments &args) |
static void | generate_picture_path (const char *path, size_t pic_size, char *out, size_t len) |
static int | get_elevation_color (int elevation, gdImagePtr elevationmap) |
static struct_equipment * | get_equipment (void) |
static struct_map_info * | get_map_info (const char *path) |
static struct_quest * | get_quest_info (const char *name) |
static struct_race * | get_race (const char *name) |
static struct_slaying_info * | get_slaying_struct (const char *slaying) |
static inja::Template | get_template (const std::string &filename) |
static void | init_map_list (struct_map_list *list) |
static void | init_race_list (struct_race_list *list) |
static void | init_renderer_env () |
static void | init_struct_map_in_quest_list (struct_map_in_quest_list *list) |
static int | is_blocking (object *item) |
static int | is_road (object *item) |
static int | is_slaying (object *item) |
static int | is_special_equipment (object *item) |
static void | list_map (const char *path) |
int | main (int argc, char **argv) |
static void | merge_tiled_maps (struct_map_info *map, struct_map_info *tiled_map) |
void | move_firewall (object *) |
static std::string | path_from_current (const std::string &path) |
SockList * | player_get_delayed_buffer (player *) |
static void | process_map (struct_map_info *info) |
static void | process_map_lore (struct_map_info *map) |
static void | quest_callback (const quest_definition *quest, void *) |
static void | relative_path (const char *from, const char *to, char *result) |
void | rod_adjust (object *) |
static void | save_picture (FILE *file, gdImagePtr pic) |
void | set_darkness_map (mapstruct *) |
static bool | sort_equipment (const struct_equipment *l, const struct_equipment *r) |
static int | sort_map_info (const void *left, const void *right) |
static int | sort_race (const void *a, const void *b) |
static int | sort_region (const void *left, const void *right) |
static int | sort_slaying (const void *left, const void *right) |
static int | sort_struct_map_in_quest (const void *left, const void *right) |
static int | sort_struct_quest (const void *left, const void *right) |
static std::vector< std::string > | split (const std::string &field, const std::string &by) |
static std::string | templates_root ("templates/") |
static int | tiled_map_need_pic (struct_map_info *map) |
static void | write_pictures_from_real_size (const char *path, gdImagePtr real, int width, int height) |
static void | write_tiled_map_page (struct_map_info *map) |
static void | write_tiled_maps (void) |
static void | write_world_info (void) |
static void | write_world_map (void) |
static const char * | yesno (int value) |
Variables | |
static nlohmann::json | all_data |
static int | cached_pics = 0 |
static int | color_blocking |
static int | color_linked_exit |
static int | color_road |
static int | color_slowing |
static int | color_unlinked_exit |
static int | created_pics = 0 |
static bool | detail_quests = false |
static bool | display_rendered_template = false |
static bool | do_regions_link = false |
static int ** | elevation_info |
static int | elevation_max |
static int | elevation_min |
static std::shared_ptr< inja::Environment > | env |
static int | force_pics = 0 |
static std::vector< char * > | found_maps |
static gdImagePtr * | gdfaces |
static int | generate_pics = 1 |
static const char * | ignore_name [] |
static const char * | ignore_path [] |
static gdImagePtr | infomap |
static int | jpeg_quality = -1 |
static bool | list_system_quests = false |
static int | list_unused_maps = 0 |
static int | map_limit = -1 |
static struct_map_list | maps_list |
static const int | num_sizes = sizeof(sizes)/sizeof(int) |
static const char * | output_extensions [] |
static enum output_format_type | output_format = OF_PNG |
static std::vector< pageToRender > | pages |
static std::vector< std::string > | path_stack |
static int | pics_allocated |
static struct_quest ** | quests = NULL |
static int | quests_allocated = 0 |
static int | quests_count = 0 |
static struct_race_list | races |
static int | rawmaps = 0 |
static size_t | region_allocated = 0 |
static size_t | region_count = 0 |
static std::map< region *, std::set< region * > > | region_links |
static struct struct_region_info ** | regions = NULL |
static std::set< std::string > | rendered_templates |
static std::set< std::string > | reset_groups |
static std::map< struct_map_info *, std::string > | reverse_maps |
static std::map< region *, std::string > | reverse_regions |
static char | root [500] |
static int | show_maps = 0 |
static int | sizes [] = {32, 16, 8, 4, 2} |
static size_t | slaying_allocated = 0 |
static size_t | slaying_count = 0 |
static struct_slaying_info ** | slaying_info = NULL |
static std::vector< struct_equipment * > | special_equipment |
static std::vector< quest_definition * > | system_quests |
static inja::TemplateStorage | templateCache |
static std::vector< std::string > | templates |
static struct_map_list | tiled_map_list |
static int | tileset = 0 |
static int | warn_no_path = 0 |
static int | world_exit_info = 1 |
static int | world_map = 1 |
This program generates, by default, map browsing web pages (but it can be customized for other things).
Quick run: without arguments, will make sensible choices.
For help, try the -help option.
Since this program browses maps from the first map, only maps linked from there will be processed. A command line parameter, "-addmap=", allows to specify more maps.
Maps are generated as the server sees them, that is with weather effects, treasures instead of markers, and things like that.
Generated files use "templates", stored (by default) in "templates/" subdirectory. A list of files to process is specified on the command line (by default "index.html"), and from there the program will generate all requested pages.
Templates use the inja C++ template engine, found at https://github.com/pantor/inja Provided templates should give much samples of use, see "index.html" for entry point.
The following objects exist:
The following variables are available to the templates:
As well as default callbacks provided by inja, mapper adds the following ones:
For maps, 5 pictures are generated, with sizes of 32, 16, 8, 4 and 2 pixels for tiles.
To build this program, add the '–enable-mapper' flag to 'configure' then run 'make' at the server root. It requires the GD library and its development files.
Definition in file mapper.cpp.
#define S_CONNECT 4 |
Definition at line 390 of file mapper.cpp.
#define S_CONTAINER 2 |
Definition at line 388 of file mapper.cpp.
#define S_DETECTOR 3 |
Definition at line 389 of file mapper.cpp.
#define S_DOOR 0 |
Connection/slaying information.
Definition at line 386 of file mapper.cpp.
#define S_KEY 1 |
Definition at line 387 of file mapper.cpp.
#define S_MAX 5 |
Definition at line 391 of file mapper.cpp.
#define SIZE 50 |
#define size_large sizes[0] |
Definition at line 314 of file mapper.cpp.
#define size_small sizes[1] |
Definition at line 315 of file mapper.cpp.
typedef std::vector<struct_npc_info *> npc_list |
List of NPCs with a custom message.
Definition at line 186 of file mapper.cpp.
enum output_format_type |
Map output formats.
Enumerator | |
---|---|
OF_PNG | PNG, default value. |
OF_JPG | JPG. |
Definition at line 330 of file mapper.cpp.
void account_char_free | ( | Account_Chars * | ) |
This frees all data associated with the character information.
chars | Data to free. The caller should make sure it no longer uses any data in this list. |
Definition at line 3414 of file mapper.cpp.
Referenced by account_add_player_cmd(), free_newsocket(), init_connection(), key_confirm_quit(), kill_player_permadeath(), send_account_players(), set_player_socket(), and START_TEST().
Account_Chars* account_char_load | ( | const char * | ) |
For a given account name, load the character information and return it. It is the responsibility of the caller to call account_char_free() on the returned value to free it.
account_name | Name of the account. The name should be validated before this routine is called (eg, passed checks for legitimate characters and logged in) |
Definition at line 3407 of file mapper.cpp.
Referenced by account_add_player_cmd(), send_account_players(), and START_TEST().
void account_char_save | ( | Account_Chars * | ) |
Saves the character information for the given account.
chars | previously loaded/generated list of character information for this account. |
Definition at line 3411 of file mapper.cpp.
Referenced by account_add_player_cmd(), free_newsocket(), key_confirm_quit(), kill_player_permadeath(), save_player(), and START_TEST().
void account_logout | ( | const char * | ) |
Remove 'account_name' from the list of logged in accounts.
Definition at line 3420 of file mapper.cpp.
Referenced by free_newsocket().
|
static |
Adds a map to specified array, if it isn't already.
info | map to add. |
list | list to add to. |
Definition at line 1167 of file mapper.cpp.
References guildoracle::list, and disinfect::map.
Referenced by add_map_to_region(), add_map_to_slaying(), add_monster(), add_one_item(), append_map_list(), CREMapInformationManager::checkItem(), create_tiled_map(), do_parameters(), fix_exits_for_map(), fix_exits_to_tiled_maps(), fix_tiled_map_monsters(), get_map_info(), merge_tiled_maps(), and process_map().
|
static |
Links a map to a quest.
map | map to link. |
name | quest name. |
description | associated link description. Must not be NULL. |
Definition at line 963 of file mapper.cpp.
References add_to_struct_map_in_quest_list(), struct_map_in_quest::description, get_quest_info(), disinfect::map, struct_map_in_quest::map, give::name, and struct_map_in_quest::quest.
Referenced by process_map_lore().
|
static |
Links a map to a region.
Will not readd the map if already linked.
map | map name. |
reg | region to link the map to. |
Definition at line 1308 of file mapper.cpp.
References add_map(), struct_region_info::is_world, disinfect::map, maps_list, struct_region_info::reg, region_allocated, region_count, regions, struct_region_info::sum, struct_region_info::sum_x, struct_region_info::sum_y, diamondslots::x, and diamondslots::y.
Referenced by process_map().
|
static |
Adds the specified map to the slaying information if not already present.
info | structure to add to. |
item | one of the S_xxx values specifying what type of slaying this is. |
map | map to add. |
Definition at line 1419 of file mapper.cpp.
References add_map(), disinfect::map, and struct_slaying_info::maps.
Referenced by add_slaying().
|
static |
Adds a monster to the monster list.
monster | monster to add. Can be any part. |
map | map to add the monster to. |
Definition at line 626 of file mapper.cpp.
References add_map(), add_race_to_list(), get_race(), object::head, object::level, disinfect::map, MAX, MIN, object::name, and struct_race::origin.
Referenced by process_map().
Add the specified NPC to the list.
list | where to add the NPC. |
npc | NPC to add. Must have a name and message. |
Definition at line 1151 of file mapper.cpp.
References create_npc_info(), guildoracle::list, and npc_dialog::npc.
Referenced by process_map().
|
static |
Adds an item to the list of special items.
item | item to add. |
map | map it is on. |
Definition at line 506 of file mapper.cpp.
References add_map(), arch_to_object(), calc_item_power(), struct_equipment::calc_power, struct_equipment::diff, ensure_unique(), find_artifact(), FLAG_IDENTIFIED, FLAG_UNPAID, free_equipment(), FREE_OBJ_FREE_INVENTORY, FREE_OBJ_NO_DESTROY_CALLBACK, get_equipment(), get_ob_diff(), give_artifact_abilities(), artifact::item, llevError, LOG(), disinfect::map, give::name, struct_equipment::name, object::name, object::name_pl, object::nrof, object_free(), object_give_identified_properties(), struct_equipment::origin, struct_equipment::power, QUERY_FLAG, SET_FLAG, sstring, stringbuffer_finish(), stringbuffer_new(), diamondslots::x, object::x, diamondslots::y, and object::y.
Referenced by check_equipment().
|
static |
Appends a race to a race list.
race | race to add. |
list | list to add to. |
check | if 0, don't check if race is already on the list ; else don't make duplicated entries. |
Definition at line 285 of file mapper.cpp.
References bigchest::check, and guildoracle::list.
Referenced by add_monster(), fix_tiled_map_monsters(), and get_race().
Creates a link between two maps if they are on different regions.
source | map from. |
dest | map to. |
Definition at line 1356 of file mapper.cpp.
References convert::dest, get_region_by_map(), and region_links.
Referenced by CREMapInformationManager::checkItem(), and process_map().
|
static |
Adds the item's information to the map.
map | map containing the item. |
item | item which slaying field we're considering. |
Definition at line 1431 of file mapper.cpp.
References add_map_to_slaying(), CONTAINER, DETECTOR, get_slaying_struct(), LOCKED_DOOR, disinfect::map, S_CONNECT, S_CONTAINER, S_DETECTOR, S_DOOR, S_KEY, and SPECIAL_KEY.
Referenced by check_slaying_inventory(), and process_map().
void add_template_to_render | ( | const std::string & | template_name, |
const std::string & | output_name, | ||
const std::string & | param | ||
) |
Push the specified template, with optional param, on the list of files to process.
template_name | template name to use. |
output_name | output file name. |
param | additional parameter to the template. |
Definition at line 2591 of file mapper.cpp.
References pages, ring_occidental_mages::r, and rendered_templates.
Referenced by generate_page_and_link(), and main().
|
static |
Definition at line 904 of file mapper.cpp.
References say::item, and guildoracle::list.
Referenced by add_map_to_quest().
|
static |
Append the contents of src to dest.
dest | where to put items. |
src | what to append to dest, unchanged. |
Definition at line 2336 of file mapper.cpp.
References add_map(), struct_map_list::count, convert::dest, disinfect::map, and struct_map_list::maps.
Referenced by fill_json().
int apply_auto | ( | object * | op | ) |
Map was just loaded, handle op's initialization.
Generates shop floor's item, and treasures.
op | object to initialize. |
Definition at line 3344 of file mapper.cpp.
References BOOK, CLEAR_FLAG, create_treasure(), FLAG_AUTO_APPLY, FLAG_CURSED, FLAG_DAMNED, FLAG_IS_A_TEMPLATE, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, generate_treasure(), HAS_RANDOM_ITEMS, identify(), MAX, object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), give::op, QUERY_FLAG, SET_FLAG, SHOP_FLOOR, Ice::tmp, and TREASURE.
Referenced by do_auto_apply().
void apply_auto_fix | ( | mapstruct * | ) |
Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff). Calls apply_auto() if appropriate.
m | map to fix. |
Those are dummy functions defined to resolve all symboles. Added as part of glue cleaning. Ryo 2005-07-15
Definition at line 3396 of file mapper.cpp.
Referenced by enter_unique_map(), generate_random_map(), mapfile_load(), and START_TEST().
|
static |
Checks if item and its inventory are worthy to be listed.
item | item to check. |
map | map the item is on. |
Definition at line 580 of file mapper.cpp.
References add_one_item(), FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, is_special_equipment(), and disinfect::map.
Referenced by process_map().
|
static |
Recursively checks if the object should be considered for slaying information.
map | map containing the items. |
item | item to consider. Must not be NULL. |
Definition at line 1459 of file mapper.cpp.
References add_slaying(), FOR_INV_FINISH, FOR_INV_PREPARE, commongive::inv, is_slaying(), and disinfect::map.
Referenced by process_map().
void clean_tmp_files | ( | void | ) |
Save unique maps and clean up temporary map files unless recycling temporary maps. The function name is somewhat misleading.
Definition at line 3312 of file mapper.cpp.
Referenced by fatal(), and LOG().
void command_help | ( | object * | , |
const char * | |||
) |
Player is asking for some help.
op | player asking for information. |
params | what kind of help to ask for. |
Definition at line 3417 of file mapper.cpp.
Referenced by command_knowledge(), command_party(), command_quest(), command_shutdown(), and commands_init().
|
static |
Compares struct_map_info according to the map name or the path if equal.
left | first item. |
right | second item. |
Definition at line 822 of file mapper.cpp.
References c, struct_map_info::name, struct_map_info::path, strcasecmp(), and struct_map_info::tiled_group.
Referenced by sort_map_info().
|
static |
Ensures destination directory exists.
Definition at line 2980 of file mapper.cpp.
References make_path_to_file(), and root.
Referenced by main().
|
static |
Return an array of map-in-quest items.
list | items to return the JSON of. |
Definition at line 2255 of file mapper.cpp.
References nlohmann::basic_json::array, guildoracle::list, m, nlohmann::basic_json::push_back(), item::q, and reverse_maps.
Referenced by create_map_object(), and create_quest_object().
|
static |
Returns an initialised struct_map_info.
Definition at line 1188 of file mapper.cpp.
References struct_map_info::exits_from, struct_map_info::exits_to, init_map_list(), init_race_list(), init_struct_map_in_quest_list(), struct_map_info::min_monster, struct_map_info::monsters, struct_map_info::npcs, struct_map_info::quests, struct_map_info::readable, struct_map_info::tiled_group, and struct_map_info::tiled_maps.
Referenced by create_tiled_map(), and get_map_info().
|
static |
Return a JSON map object.
map | map to return the JSON of. |
key | map unique identifier. |
Definition at line 2278 of file mapper.cpp.
References create_map_in_quest_array(), create_maps_array(), create_npc_array(), create_race_array(), castle_read::key, disinfect::map, and reverse_regions.
Referenced by fill_json().
|
static |
Return an array of map identifiers.
maps | items to return the JSON of. |
Definition at line 2203 of file mapper.cpp.
References nlohmann::basic_json::array, m, disinfect::map, maps, rotate-tower::result, and reverse_maps.
Referenced by create_map_object(), and fill_json().
|
static |
Return an array of NPC information.
list | items to return the JSON of. |
Definition at line 2219 of file mapper.cpp.
References guildoracle::list, npc_dialog::npc, and rotate-tower::result.
Referenced by create_map_object().
|
static |
Create the struct_npc_info from the specified NPC. It must have a name and message.
npc | NPC to gather info for. |
Definition at line 1133 of file mapper.cpp.
References struct_npc_info::message, struct_npc_info::name, npc_dialog::npc, struct_npc_info::x, and struct_npc_info::y.
Referenced by add_npc_to_map().
|
static |
Return a JSON quest object.
quest | quest to return the JSON of. |
key | quest unique key. |
Definition at line 2302 of file mapper.cpp.
References create_map_in_quest_array(), castle_read::key, and reverse_maps.
Referenced by fill_json().
|
static |
Return an array of monster information.
list | items to return the JSON of. |
Definition at line 2238 of file mapper.cpp.
References guildoracle::list, and rotate-tower::result.
Referenced by create_map_object().
|
static |
Return an array of region identifiers.
regions | regions to process. |
Definition at line 2346 of file mapper.cpp.
References nlohmann::basic_json::array, nlohmann::basic_json::push_back(), ring_occidental_mages::r, regions, and reverse_regions.
Referenced by fill_json().
|
static |
Create a new tiled map and link it to the tiled map list.
Definition at line 1210 of file mapper.cpp.
References add_map(), create_map_info(), and tiled_map_list.
Referenced by process_map().
|
static |
Sets the main map for a quest.
name | quest name. |
mainmap | main map to associate. |
description | quest description. Must not be NULL. |
Definition at line 1029 of file mapper.cpp.
References get_quest_info(), give::name, and struct_map_info::path.
Referenced by process_map_lore().
void do_auto_apply | ( | mapstruct * | m | ) |
Definition at line 3192 of file mapper.cpp.
References ALTAR, apply_auto(), check_trigger(), CLASS, CONTAINER, create_treasure(), FIREWALL, FLAG_AUTO_APPLY, FLAG_IS_LINKED, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, HAS_RANDOM_ITEMS, HEAD, m, MAP_HEIGHT, MAP_WIDTH, object_update_speed(), PLAYER, PLAYER_CHANGER, POTION, QUERY_FLAG, ROD, SCROLL, SPELL, SPELLBOOK, TIMED_GATE, Ice::tmp, TREASURE, TRIGGER_BUTTON, TRIGGER_PEDESTAL, WAND, diamondslots::x, and diamondslots::y.
Referenced by process_map().
|
static |
Proceses exit / road / blocking information for specified map into the global infomap map.
If map isn't a world map, won't do anything.
map | map to write info for. |
Definition at line 726 of file mapper.cpp.
References color_blocking, color_linked_exit, color_road, color_slowing, color_unlinked_exit, elevation_info, elevation_max, elevation_min, EXIT, FOR_MAP_FINISH, FOR_MAP_PREPARE, HEAD, infomap, is_blocking(), is_road(), disinfect::map, MAP_HEIGHT, MAP_WIDTH, MAX, MIN, object::move_slow, object::slaying, TELEPORTER, object::type, diamondslots::x, and diamondslots::y.
Referenced by process_map().
|
static |
Prints usage information, and exit.
program | program path. |
Definition at line 2861 of file mapper.cpp.
Referenced by do_parameters().
|
static |
Handles command-line parameters.
argc | number of parameters, including program name. |
argv | arguments, including program name. |
Definition at line 2898 of file mapper.cpp.
References add_map(), detail_quests, display_rendered_template, do_help(), do_regions_link, force_pics, generate_pics, get_map_info(), jpeg_quality, list_system_quests, list_unused_maps, map_limit, maps_list, OF_JPG, output_format, python_init::path, rawmaps, root, show_maps, templates, templates_root(), tileset, warn_no_path, world_exit_info, and world_map.
Referenced by main().
|
static |
Generates the large and small pictures for a tiled map. This uses the large/small pictures made during process_map(), so having a map limit could lead to maps not found and invalid results.
map | tiled map to make the picture of. |
Definition at line 2033 of file mapper.cpp.
References disinfect::count, replace::current, generate_pics, generate_picture_path(), disinfect::map, OF_PNG, make_face_from_files::out, output_format, size_large, tiled_map_need_pic(), and write_pictures_from_real_size().
Referenced by write_tiled_map_page().
void dragon_ability_gain | ( | object * | , |
int | , | ||
int | |||
) |
When a dragon-player gains a new stage of evolution, he gets some treasure.
who | the dragon player. |
atnr | the attack-number of the ability focus. |
level | ability level. |
Definition at line 3318 of file mapper.cpp.
Referenced by dragon_level_gain().
void draw_ext_info | ( | int | , |
int | , | ||
const object * | , | ||
uint8_t | , | ||
uint8_t | , | ||
const char * | txt | ||
) |
Dummy functions to link the library.
Definition at line 3290 of file mapper.cpp.
References logfile.
Referenced by adj_stealchance(), adjust_sign_msg(), alchemy_failure_effect(), animate_weapon(), apply_builder_floor(), apply_builder_item(), apply_builder_remove(), apply_builder_wall(), apply_builder_window(), apply_by_living(), apply_check_apply_restrictions(), apply_check_item_power(), apply_check_owner(), apply_manual(), apply_map_builder(), apply_sign(), apply_special(), armour_improver_type_apply(), attack_hth(), attack_melee_weapon(), attack_message(), attack_ob_simple(), attempt_do_alchemy(), attempt_jump(), attempt_recipe(), attempt_steal(), basic_emote(), blocked_link(), book_type_apply(), can_pay(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_change_map_lightlevel(), cast_cone(), cast_consecrate(), cast_create_food(), cast_create_obj(), cast_create_town_portal(), cast_curse(), cast_heal(), cast_identify(), cast_invisible(), cast_item_curse_or_bless(), cast_light(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), cast_transfer(), cast_word_of_recall(), cf_handle_type_apply(), cfapi_player_message(), change_abil(), change_spell(), charge_mana_effect(), check_heal_and_mana(), check_login(), check_name(), check_pick(), command_abil(), command_accountpasswd(), command_addexp(), command_afk(), command_arrest(), command_banish(), command_body(), command_bowmode(), command_brace(), command_create(), command_delete(), command_diff(), command_drop(), command_dropall(), command_dump(), command_empty(), command_face(), command_fire(), command_follow(), command_forget_spell(), command_free(), command_freeze(), command_goto(), command_gsay(), command_insert_into(), command_inventory(), command_invisible(), command_kill_pets(), command_language(), command_learn_spell_or_prayer(), command_list(), command_loadplugin(), command_loadtest(), command_lock_item(), command_mark(), command_mon_aggr(), command_nowiz(), command_overlay_reset(), command_overlay_save(), command_party(), command_passwd(), command_patch(), command_peaceful(), command_pickup(), command_possess(), command_purge_quest(), command_purge_quest_definitions(), command_quest(), command_quit(), command_remove(), command_rename_item(), command_reply(), command_reset(), command_resistances(), command_rskill(), command_run(), command_save(), command_search_items(), command_setgod(), command_settings(), command_showpets(), command_shutdown(), command_sound(), command_stack_clear(), command_stack_list(), command_statistics(), command_stats(), command_strings(), command_style_map_info(), command_summon(), command_swap(), command_take(), command_teleport(), command_tell_all(), command_title(), command_toggle_shout(), command_unloadplugin(), command_use(), command_uskill(), command_whereabouts(), command_wimpy(), command_wizcast(), command_wizpass(), confuse_living(), create_aura(), create_bomb(), cure_disease(), current_map_info(), dimension_door(), dispel_rune(), display_help_file(), display_motd(), display_new_pickup(), display_who_entry(), dm_stack_peek(), dm_stack_pop(), dm_stack_push(), do_dump(), do_hidden_move(), do_shutdown(), do_skill(), do_skill_attack(), do_skill_by_number(), do_tell(), do_throw(), do_turn(), do_wizard_dm(), do_wizard_hide(), dragon_ability_gain(), dragon_eat_flesh(), drain_specific_stat(), drop(), drop_object(), eat_common(), emergency_save(), enter_map(), examine(), examine_fluff(), examine_monster(), examine_rod_charge_level(), examine_wand_charge_level(), exit_type_apply(), exit_type_move_on(), find_or_create_connection_for_map(), find_traps(), fire(), fire_arch_from_position(), fire_bow(), fire_misc_object(), food_type_apply(), get_other_player_from_name(), god_enchants_weapon(), god_intervention(), god_removes_curse(), handle_newcs_player(), help_topics(), hide(), hiscore_check(), hiscore_display(), hole_type_move_on(), identify_altar_type_move_on(), improve_armour(), improve_weapon(), improve_weapon_magic(), improve_weapon_stat(), infect_object(), inscribe_scroll_cmd(), inventory(), jump(), key_change_class(), key_confirm_quit(), key_roll_stat(), kill_object(), kill_player(), kill_player_not_permadeath(), kill_player_permadeath(), knowledge_add_probe_monster(), knowledge_alchemy_attempt(), knowledge_display(), knowledge_do_attempt(), knowledge_do_display(), knowledge_item_can_be_used_alchemy(), knowledge_show(), knowledge_write_player_data(), lighter_type_apply(), list_players(), lock_item_cmd(), look_at(), look_at_cmd(), magic_wall(), map_info(), mark_item_cmd(), meditate(), mimic_type_apply(), monster_can_see_enemy(), monster_communicate(), move_marker(), move_player_attack(), move_symptom(), paralyze_living(), party_send_message(), perceive_self(), pets_follow_owner(), pets_move(), pets_move_golem(), pets_summon_golem(), pets_summon_object(), pick_lock(), pick_up(), pick_up_object(), player_attack_door(), player_lvl_adj(), plugins_display_list(), poison_living(), poison_type_apply(), poisoning_type_process(), potion_type_apply(), power_crystal_type_apply(), pray(), pray_at_altar(), prayer_failure(), prepare_weapon(), print_los(), probe(), put_object_in_sack(), quest_info(), quest_set_state(), quest_write_player_data(), receive_party_password(), receive_play_again(), receive_player_name(), receive_player_password(), recharge(), remove_curse(), remove_depletion(), remove_force(), restore_player(), ring_bell(), save_player(), scroll_failure(), scroll_type_apply(), send_rules(), set_pickup_mode(), shop_describe(), shop_inventory_type_apply(), shop_mat_type_move_on(), show_commands(), show_matching_spells(), show_skills(), skill_attack(), skill_ident(), slow_living(), spell_failure(), spellbook_type_apply(), spring_trap(), tailor_god_spell(), town_portal_destroy_existing(), town_portal_find_force(), trap_disarm(), trapdoor_type_move_on(), treasure_type_apply(), trigger_type_apply(), unapply_for_ob(), unhide(), use_alchemy(), use_oratory(), weapon_improver_type_apply(), write_mark(), write_note(), write_on_item(), write_rune(), write_scroll(), and wrong_password().
void draw_ext_info_format | ( | int | , |
int | , | ||
const object * | , | ||
uint8_t | , | ||
uint8_t | , | ||
const char * | format, | ||
... | |||
) |
Definition at line 3294 of file mapper.cpp.
References logfile.
|
static |
Writes the list of unused maps, maps found in the directories but not linked from the other maps.
Definition at line 2778 of file mapper.cpp.
References dump(), found_maps, disinfect::map, python_init::path, and root.
Referenced by main().
void emergency_save | ( | int | ) |
Save all players.
flag | if non zero, it means that we want to try and save everyone, but keep the game running. Thus, we don't want to free any information. |
Definition at line 3309 of file mapper.cpp.
Referenced by fatal(), and LOG().
|
static |
Searches the item list for an identical item, except maps.
item | item to search. The variable may be freed, so must not be used after calling this function. |
Definition at line 482 of file mapper.cpp.
References free_equipment(), say::item, and special_equipment.
Referenced by add_one_item().
Tells the client to delete an item. Uses the item command with a -1 location.
Definition at line 3328 of file mapper.cpp.
Referenced by object_remove(), and transmute_item_to_flower().
Sends item's info to player.
Definition at line 3315 of file mapper.cpp.
Referenced by apply_container(), cast_detection(), dragon_ability_gain(), object_insert_in_ob(), and transmute_item_to_flower().
Updates object *op for player *pl.
flags is a list of values to update to the client (as defined in newclient.h - might as well use the same value both places.
Definition at line 3331 of file mapper.cpp.
Referenced by animate_weapon(), apply_container(), apply_race_and_class(), apply_special(), book_type_apply(), cancellation(), cast_identify(), cast_item_curse_or_bless(), cfapi_object_set_property(), command_drop(), command_dropall(), command_insert_into(), command_lock_item(), command_rename_item(), command_take(), detect_curse_on_item(), detect_magic_on_item(), drain_wand_charge(), drop_object(), empty_container(), god_enchants_weapon(), god_removes_curse(), hit_with_one_attacktype(), improve_armour(), improve_weapon(), improve_weapon_magic(), insert_objects(), key_change_class(), object_decrease_nrof(), object_increase_nrof(), object_remove(), object_update(), pick_up_object(), player_changer_type_process(), power_crystal_type_apply(), put_object_in_sack(), remove_curse(), sell_item(), send_changed_object(), send_updates(), shop_pay_unpaid_callback(), spellbook_type_apply(), unapply_special(), and weapon_improver_type_apply().
void esrv_update_spells | ( | player * | ) |
This looks for any spells the player may have that have changed their stats. It then sends an updspell packet for each spell that has changed in this way.
Definition at line 3334 of file mapper.cpp.
Referenced by fix_player().
void ext_info_map | ( | int | , |
const mapstruct * | , | ||
uint8_t | , | ||
uint8_t | , | ||
const char * | str1 | ||
) |
Writes to everyone on the specified map
color | The color of the message |
map | The map where the players receiving the message are located |
type | The message type |
subtype | The message subtype |
str1 | The message to be sent |
Definition at line 3302 of file mapper.cpp.
References logfile.
Referenced by cfapi_map_message(), change_map_light(), command_me(), monster_do_say(), monster_do_talk_npc(), operate_altar(), and trigger_connected().
|
static |
Add all global variables to the data available to templates.
json | what to fill. |
Definition at line 2361 of file mapper.cpp.
References append_map_list(), nlohmann::basic_json::array, buf, struct_race_list::count, struct_map_in_quest_list::count, struct_map_list::count, create_map_object(), create_maps_array(), create_quest_object(), create_region_array(), detail_quests, nlohmann::basic_json::diff(), fill_reverse_maps(), find_quest_info(), init_map_list(), say::item, region::longname, m, disinfect::map, maps, struct_map_list::maps, struct_quest::maps, maps_list, region::msg, region::name, nlohmann::basic_json::push_back(), item::q, quests, quests_count, struct_race_list::races, races, region_count, region_links, regions, reset_groups, reverse_maps, reverse_regions, S_CONNECT, S_CONTAINER, S_DETECTOR, S_DOOR, S_KEY, slaying_count, slaying_info, sort_map_info(), sort_struct_map_in_quest(), special_equipment, system_quests, and tiled_map_list.
Referenced by main().
|
static |
Fill the reverse_maps array with the provided list.
list | maps to put. |
Definition at line 2317 of file mapper.cpp.
References buf, guildoracle::list, disinfect::map, reverse_maps, sort_map_info(), and sort_race().
Referenced by fill_json().
|
static |
Get the map with the specified key, nullptr if not found.
key | key of the map to find. |
Definition at line 2179 of file mapper.cpp.
References c, is_valid_types_gen::found, castle_read::key, and reverse_maps.
Referenced by generate_page_and_link(), and generate_picture_link().
|
static |
Recursively find all all maps in a directory.
from | path to search from, without trailing /. |
Definition at line 2738 of file mapper.cpp.
References closedir(), Settings::datadir, mad_mage_user::file, found_maps, HUGE_BUF, ignore_name, ignore_path, Settings::mapdir, opendir(), python_init::path, readdir(), settings, and takeitem::status.
Referenced by main().
player* find_player_partial_name | ( | const char * | ) |
Find a player by a partial name.
plname | name to match. |
Definition at line 3403 of file mapper.cpp.
Referenced by cfapi_player_find(), command_follow(), command_quest(), command_stats(), command_teleport(), do_follow(), and do_tell().
|
static |
Gets the information for a quest if it exists.
name | quest's name. |
Definition at line 917 of file mapper.cpp.
References give::name, quests, and quests_count.
Referenced by fill_json(), and get_quest_info().
|
static |
Get the region with the specified key, nullptr if not found.
key | key of the region to find. |
Definition at line 2191 of file mapper.cpp.
References c, is_valid_types_gen::found, castle_read::key, and reverse_regions.
Referenced by generate_page_and_link().
This returns the first skill pointer of the given subtype (the one that accumulates exp, has the level, etc).
It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.
This code is basically the same as find_skill_by_name() above, but instead of a skill name, we search by matching subtype.
Warning: skill subtypes are not unique to skills, various skills (eg harvesting-like) will share the same subtype, so this function should only be used if the skill's subtype is known to be used only by one skill.
who | player applying a skill. |
skillno | skill subtype. |
Definition at line 3324 of file mapper.cpp.
Referenced by compute_price_variation_with_bargaining(), cost_approx_str(), do_skill_by_number(), examine_autoidentify(), god_enchants_weapon(), monster_can_detect_enemy(), object_check_move_on(), price_approx(), and scroll_type_apply().
|
static |
Changes for the list all maps to the tiled map they are part of, if applicable.
current | map currently being processed. |
from | list that contains the exits to/from map to be fixed. |
is_from | if non zero, from is exit_from field, else it is an exit_to. |
Definition at line 1929 of file mapper.cpp.
References add_map(), struct_map_list::count, replace::current, struct_map_info::exits_from, struct_map_info::exits_to, disinfect::map, struct_map_list::maps, say::max, and struct_map_info::tiled_group.
Referenced by fix_exits_to_tiled_maps().
|
static |
Changes all exits to maps in a tiled map to point directly to the tiled map. Same for region lists.
Definition at line 1948 of file mapper.cpp.
References add_map(), struct_map_list::count, struct_map_info::exits_from, struct_map_info::exits_to, fix_exits_for_map(), disinfect::map, struct_map_list::maps, maps_list, struct_region_info::maps_list, say::max, region_count, regions, and struct_map_info::tiled_group.
Referenced by main().
|
static |
Ensures all maps have a name (if there was a limit to map processing, some maps will have a NULL name which causes issues).
Definition at line 1842 of file mapper.cpp.
References struct_map_list::count, struct_map_info::filename, disinfect::map, struct_map_list::maps, maps_list, and struct_map_info::name.
Referenced by main().
|
static |
Ensures all tiled maps have a name, a region, a filename and a path. Will try to find a suitable name and region from the maps in the group.
Definition at line 1860 of file mapper.cpp.
References struct_map_info::cfregion, struct_map_list::count, struct_map_info::filename, disinfect::map, struct_map_list::maps, give::name, struct_map_info::name, region::name, struct_map_info::path, create-tower::tile, tiled_map_list, and struct_map_info::tiled_maps.
Referenced by main().
|
static |
Makes all monsters point to tiled maps instead of map when appliable, and merge map monster to tiled map.
Definition at line 1976 of file mapper.cpp.
References add_map(), add_race_to_list(), struct_race_list::count, struct_map_list::count, disinfect::map, struct_map_list::maps, maps_list, say::max, struct_map_info::monsters, struct_race::origin, struct_race_list::races, races, and struct_map_info::tiled_group.
Referenced by main().
|
static |
Frees a struct_equipment.
equip | item to free. |
Definition at line 448 of file mapper.cpp.
References struct_equipment::diff, and struct_equipment::name.
Referenced by add_one_item(), and ensure_unique().
|
static |
Create a link to a page, generating it if needed.
args | link arguments. |
Definition at line 2527 of file mapper.cpp.
References add_template_to_render(), make_face_from_files::args, find_map_by_key(), find_region_by_key(), disinfect::map, and path_from_current().
Referenced by init_renderer_env().
|
static |
Return the link to the picture of the specified item.
args | function arguments. |
Definition at line 2557 of file mapper.cpp.
References make_face_from_files::args, find_map_by_key(), disinfect::map, output_extensions, output_format, and path_from_current().
Referenced by init_renderer_env().
|
static |
Definition at line 1467 of file mapper.cpp.
References make_face_from_files::out, output_extensions, output_format, python_init::path, and root.
Referenced by do_tiled_map_picture(), process_map(), tiled_map_need_pic(), and write_pictures_from_real_size().
|
static |
Gets the color for an elevation.
elevation | elevation to get color for. |
elevationmap | picture that will get the color. |
Definition at line 711 of file mapper.cpp.
References elevation_max, and elevation_min.
Referenced by write_world_info().
|
static |
Gets an empty struct_equipment.
Definition at line 435 of file mapper.cpp.
References init_map_list(), and struct_equipment::origin.
Referenced by add_one_item().
|
static |
Gets or creates if required the info structure for a map.
path | map to consider. |
Definition at line 1260 of file mapper.cpp.
References add_map(), struct_map_list::count, create_map_info(), struct_map_info::filename, disinfect::map, struct_map_list::maps, maps_list, python_init::path, struct_map_info::path, and Ice::tmp.
Referenced by CREMapInformationManager::checkItem(), do_parameters(), main(), and process_map().
|
static |
Gets the information for a quest, create the field if needed.
name | quest's name. |
Definition at line 934 of file mapper.cpp.
References find_quest_info(), init_struct_map_in_quest_list(), struct_quest::maps, give::name, struct_quest::name, struct_quest::number, quests, quests_allocated, and quests_count.
Referenced by add_map_to_quest(), and define_quest().
|
static |
Returns the race for specified name.
name | monster's name. |
Definition at line 597 of file mapper.cpp.
References add_race_to_list(), struct_race_list::count, struct_race::count, init_map_list(), say::item, give::name, struct_race::name, struct_race_list::races, and races.
Referenced by add_monster().
|
static |
Returns a struct_slaying_info for specified slaying. Creates a new one if required.
slaying | value to get the structure of. |
Definition at line 1388 of file mapper.cpp.
References init_map_list(), banquet::l, struct_slaying_info::maps, S_MAX, struct_slaying_info::slaying, slaying_allocated, slaying_count, and slaying_info.
Referenced by add_slaying().
|
static |
Definition at line 3001 of file mapper.cpp.
References env, npc_dialog::filename, and templateCache.
Referenced by main().
|
static |
Initialises a list structure.
list | list to blank. |
Definition at line 408 of file mapper.cpp.
References guildoracle::list.
Referenced by create_map_info(), fill_json(), get_equipment(), get_race(), get_slaying_struct(), and main().
|
static |
Blanks a struct_race_list.
list | list to blank. |
Definition at line 269 of file mapper.cpp.
References guildoracle::list.
Referenced by create_map_info(), and main().
|
static |
Initialize env and set various callbacks and options.
Definition at line 2623 of file mapper.cpp.
References make_face_from_files::args, nlohmann::basic_json::array, buf, replace::current, env, is_valid_types_gen::found, generate_page_and_link(), generate_picture_link(), path_stack, ring_occidental_mages::r, relative_path(), root, make_face_from_files::str, templates_root(), and autojail::value.
Referenced by main().
|
static |
Definition at line 898 of file mapper.cpp.
References guildoracle::list.
Referenced by create_map_info(), and get_quest_info().
|
static |
Checks if item blocks movement or not.
item | object to test. |
Definition at line 697 of file mapper.cpp.
References MOVE_ALL.
Referenced by do_exit_map().
|
static |
Checks if object is considered a road or not.
item | object to check. |
Definition at line 661 of file mapper.cpp.
References FLAG_IS_FLOOR, and QUERY_FLAG.
Referenced by do_exit_map().
|
static |
Is the slaying field relevant for this item?
item | item to check. |
Definition at line 1375 of file mapper.cpp.
References CHECK_INV, CONTAINER, LOCKED_DOOR, and SPECIAL_KEY.
Referenced by check_slaying_inventory(), and process_map().
|
static |
Definition at line 416 of file mapper.cpp.
References AMULET, FLAG_NO_PICK, IS_ARMOR, IS_ARROW, IS_SHIELD, IS_WEAPON, MOVE_ALL, QUERY_FLAG, RING, ROD, and WAND.
Referenced by check_equipment().
|
static |
Marks specified path as processed.
path | map to remove. |
Definition at line 1287 of file mapper.cpp.
References found_maps, disinfect::map, and python_init::path.
Referenced by process_map().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 3011 of file mapper.cpp.
References add_template_to_render(), all_data, all_regions, cached_pics, color_blocking, color_linked_exit, color_road, color_slowing, color_unlinked_exit, struct_race_list::count, struct_map_list::count, create_destination(), created_pics, create-tower::current_map, Settings::debug, detail_quests, display_rendered_template, do_parameters(), do_regions_link, dump_unused_maps(), elevation_info, elevation_max, elevation_min, env, nlohmann::basic_json::erase(), region::fallback, mad_mage_user::file, fill_json(), find_faceset(), find_maps(), first_map_path, fix_exits_to_tiled_maps(), fix_map_names(), fix_tiled_map(), fix_tiled_map_monsters(), force_pics, found_maps, gdfaces, generate_pics, get_faces_count(), get_map_info(), get_region_struct(), get_template(), infomap, init_globals(), init_gods(), init_library(), init_map_list(), init_race_list(), init_readable(), init_renderer_env(), is_valid_faceset(), jpeg_quality, list_system_quests, list_unused_maps, llevError, region::longname, map_limit, struct_map_list::maps, maps_list, say::max, region::name, OF_JPG, output_extensions, output_format, pages, path_stack, pics_allocated, process_map(), quest_callback(), quest_for_each(), quests, quests_count, struct_race_list::races, races, rawmaps, region_count, regions, root, settings, show_maps, slaying_count, slaying_info, sort_equipment(), sort_map_info(), sort_race(), sort_region(), sort_slaying(), sort_struct_quest(), special_equipment, strdup_local, system_quests, guildbuy::temp, templates, templates_root(), tiled_map_list, tileset, warn_no_path, world_exit_info, world_map, write_tiled_maps(), write_world_info(), write_world_map(), and yesno().
|
static |
Merge two tiled maps groups. This can happen if based on processing we do one map with tiled maps, another with tiled maps, and later figure out the tiles are actually linked.
map | the map that being processed has a tiling to a map in another group. Its group will be the final merging group. |
tiled_map | the map tiled to another group. Its group will disappear. |
Definition at line 1226 of file mapper.cpp.
References add_map(), struct_map_list::count, Ice::g, disinfect::map, struct_map_list::maps, struct_map_info::tiled_group, tiled_map_list, and struct_map_info::tiled_maps.
Referenced by process_map().
void move_firewall | ( | object * | ) |
Move for FIREWALL.
firewalls fire other spells. The direction of the wall is stored in op->direction. walls can have hp, so they can be torn down.
op | firewall. |
Definition at line 3306 of file mapper.cpp.
Referenced by legacy_ob_process(), and trigger_connected().
|
static |
Compute the relative path from the specified file to the current file.
path | path to get from. |
Definition at line 2510 of file mapper.cpp.
References replace::current, python_init::path, path_stack, and relative_path().
Referenced by generate_page_and_link(), and generate_picture_link().
Get a delayed socket buffer, that will be sent after the player's tick is complete. Will fatal() if memory error.
pl | player to get a buffer for. |
Definition at line 3399 of file mapper.cpp.
Referenced by draw_ext_info(), and quest_set_state().
|
static |
Processes a map.
Generates the map pictures (big and small), and exit information.
info | map to process. |
Definition at line 1499 of file mapper.cpp.
References add_map(), add_map_to_region(), add_monster(), add_npc_to_map(), add_region_link(), add_slaying(), add_string(), archininventory::arch, BOOK, cached_pics, struct_map_info::cfregion, check_equipment(), check_slaying_inventory(), create_pathname(), create_tiled_map(), created_pics, face_info::data, face_info::datalen, delete_map(), do_auto_apply(), do_exit_map(), do_regions_link, EXIT, EXIT_PATH, struct_map_info::exits_from, struct_map_info::exits_to, face_sets::faces, struct_map_info::filename, find_archetype(), find_faceset(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, force_pics, gdfaces, generate_pics, generate_picture_path(), get_face_fallback(), get_map_info(), get_region_by_map(), struct_map_info::height, mapstruct::in_memory, is_slaying(), struct_map_info::level, list_map(), list_unused_maps, struct_map_info::lore, m, MAP_HEIGHT, MAP_IN_MEMORY, MAP_WIDTH, MAX_BUF, merge_tiled_maps(), struct_map_info::name, struct_map_info::npcs, num_sizes, object_get_multi_size(), struct_map_info::path, path_combine_and_normalize(), struct_map_info::pic_was_done, pics_allocated, PLAYER_CHANGER, process_map_lore(), QUERY_FLAG, rawmaps, struct_map_info::readable, ready_map_name(), struct_map_info::reset_group, reset_groups, mapstruct::reset_time, show_maps, SIGN, size_large, TELEPORTER, struct_map_info::tiled_group, struct_map_info::tiled_maps, struct_map_info::tiles, tileset, warn_no_path, struct_map_info::width, write_pictures_from_real_size(), diamondslots::x, and diamondslots::y.
Referenced by main().
|
static |
Extracts from the map's lore quest information if found. May modify map->lore.
map | map to process. |
Definition at line 1048 of file mapper.cpp.
References add_map_to_quest(), define_quest(), disinfect::map, give::name, and give::next.
Referenced by process_map().
|
static |
Definition at line 2162 of file mapper.cpp.
References list_system_quests, and system_quests.
Referenced by main().
|
static |
Computes the shortest path from one file to another.
from | origin. |
to | destination. |
result | string that will contain the calculated path. Must be large enough, no test done. |
Definition at line 783 of file mapper.cpp.
References rotate-tower::result.
Referenced by init_renderer_env(), and path_from_current().
void rod_adjust | ( | object * | ) |
Adjusts rod attributes. This function must be called after a new rod has been created.
rod | the rod to update |
Definition at line 3337 of file mapper.cpp.
Referenced by fix_generated_item().
|
static |
Saves a map to a file, based on jpg/png settings.
file | opened file to which to save. |
pic | picture to save. |
Definition at line 1342 of file mapper.cpp.
References mad_mage_user::file, jpeg_quality, OF_PNG, and output_format.
Referenced by write_pictures_from_real_size(), write_world_info(), and write_world_map().
void set_darkness_map | ( | mapstruct * | ) |
Set the darkness level for a map, based on the time of the day.
m | map to alter. |
Definition at line 3321 of file mapper.cpp.
Referenced by generate_random_map(), and ready_map_name().
|
static |
Sort 2 struct_equipment.
l | |
r | items to compare. |
Definition at line 462 of file mapper.cpp.
References banquet::l, ring_occidental_mages::r, and strcasecmp().
Referenced by main().
|
static |
Sorts the struct_map_info according to the map name or the path if equal.
left | first item. |
right | second item. |
Definition at line 852 of file mapper.cpp.
References compare_map_info(), banquet::l, and ring_occidental_mages::r.
Referenced by fill_json(), fill_reverse_maps(), and main().
|
static |
Sort 2 struct_race.
a | |
b | items to compare. |
Definition at line 648 of file mapper.cpp.
References disinfect::a, Ice::b, banquet::l, ring_occidental_mages::r, and strcasecmp().
Referenced by fill_reverse_maps(), and main().
|
static |
Sorts an array of struct_region_info by region name.
left | first region. |
right | second region. |
Definition at line 868 of file mapper.cpp.
Referenced by main().
|
static |
Helper function to sort an array of struct_slaying_info.
left | first item. |
right | second item. |
Definition at line 2848 of file mapper.cpp.
References banquet::l, ring_occidental_mages::r, and strcasecmp().
Referenced by main().
|
static |
Sorts 2 struct_map_in_quest, on the map's name or path.
left | |
right | items to compare. |
Definition at line 985 of file mapper.cpp.
References c, banquet::l, struct_map_info::name, struct_map_info::path, ring_occidental_mages::r, strcasecmp(), and struct_map_info::tiled_group.
Referenced by fill_json().
|
static |
Sorts 2 struct_quest, on the map's name or path.
left | |
right | items to compare. |
Definition at line 1013 of file mapper.cpp.
References banquet::l, ring_occidental_mages::r, and strcasecmp().
Referenced by main().
|
static |
Definition at line 2606 of file mapper.cpp.
References is_valid_types_gen::found, and rotate-tower::result.
Referenced by arch2xml::arch2xml(), assets_pack(), cfapi_object_split(), CREMapInformationManager::checkEvent(), inja::JsonNode::convert_dot_to_json_ptr(), Crossfire_Object_Split(), python::do_cjson(), trigger::do_delayed_trigger(), CFDataFile.CFDataFile::getData(), guild_dues.GuildDues::handle_jack(), python::handle_say(), PngLoader::load(), load_bells(), load_citylife(), CFWorld::loc_from_ob(), banksay::main_employee(), FaceMakerDialog::makeFaces(), FaceMakerDialog::parse(), SoundFiles::refreshSounds(), SoundsDialog::SoundsDialog(), CFCampfire.CFCampfire::timer(), and eliza.eliza::translate().
|
static |
Directory to get templates from, with a leading /.
Referenced by do_parameters(), init_renderer_env(), and main().
|
static |
Definition at line 2003 of file mapper.cpp.
References generate_picture_path(), disinfect::map, and num_sizes.
Referenced by do_tiled_map_picture().
|
static |
Definition at line 1471 of file mapper.cpp.
References generate_picture_path(), make_path_to_file(), MAX_BUF, num_sizes, make_face_from_files::out, python_init::path, save_picture(), size_large, and sizes.
Referenced by do_tiled_map_picture(), and process_map().
|
static |
Writes the page for a tiled map group.
Definition at line 2141 of file mapper.cpp.
References do_tiled_map_picture(), and disinfect::map.
Referenced by write_tiled_maps().
|
static |
Outputs all tiled map pages.
Definition at line 2151 of file mapper.cpp.
References struct_map_list::count, disinfect::map, struct_map_list::maps, tiled_map_list, and write_tiled_map_page().
Referenced by main().
|
static |
Writes the exit information world map.
Definition at line 2796 of file mapper.cpp.
References elevation_info, elevation_max, elevation_min, mad_mage_user::file, get_elevation_color(), infomap, output_extensions, output_format, python_init::path, root, save_picture(), world_exit_info, diamondslots::x, and diamondslots::y.
Referenced by main().
|
static |
Generates a big world map.
Definition at line 1739 of file mapper.cpp.
References smoking_pipe::color, mad_mage_user::file, infomap, give::name, OF_PNG, make_face_from_files::out, output_extensions, output_format, region_allocated, regions, root, save_picture(), SIZE, struct_region_info::sum, struct_region_info::sum_x, struct_region_info::sum_y, world_map, diamondslots::x, and diamondslots::y.
Referenced by main().
|
static |
Helper to write yes/no.
value | value to print. |
Definition at line 2996 of file mapper.cpp.
References autojail::value.
Referenced by main().
|
static |
All JSON data available to templates.
Definition at line 2169 of file mapper.cpp.
Referenced by main().
|
static |
Non recreated pics.
Definition at line 327 of file mapper.cpp.
Referenced by main(), and process_map().
|
static |
Block all movement.
Definition at line 373 of file mapper.cpp.
Referenced by do_exit_map(), and main().
|
static |
Exit leading to another map.
Definition at line 371 of file mapper.cpp.
Referenced by do_exit_map(), and main().
|
static |
Road or equivalent.
Definition at line 372 of file mapper.cpp.
Referenced by do_exit_map(), and main().
|
static |
|
static |
Color for exits without a path set.
Definition at line 370 of file mapper.cpp.
Referenced by do_exit_map(), and main().
|
static |
Picture statistics. Total created pics.
Definition at line 326 of file mapper.cpp.
Referenced by main(), and process_map().
|
static |
Whether to show all quests details or not.
Definition at line 321 of file mapper.cpp.
Referenced by do_parameters(), fill_json(), and main().
|
static |
Whether to display the template to be rendered or not.
Definition at line 323 of file mapper.cpp.
Referenced by do_parameters(), and main().
|
static |
Definition at line 381 of file mapper.cpp.
Referenced by CREMapInformationManager::checkItem(), do_parameters(), main(), and process_map().
|
static |
All elevation spots in the "world_" maps.
Definition at line 376 of file mapper.cpp.
Referenced by do_exit_map(), main(), and write_world_info().
|
static |
Lowest elevation found.
Definition at line 378 of file mapper.cpp.
Referenced by do_exit_map(), get_elevation_color(), main(), and write_world_info().
|
static |
Maximal elevation found.
Definition at line 377 of file mapper.cpp.
Referenced by do_exit_map(), get_elevation_color(), main(), and write_world_info().
|
static |
Rendering environment.
Definition at line 2168 of file mapper.cpp.
Referenced by animate_bomb(), change_object(), CREMapInformationManager::checkEvent(), CREMapInformationManager::checkItem(), do_execute_event(), do_test(), esrv_move_object(), explode_bullet(), get_template(), init_renderer_env(), knowledge_alchemy_attempt(), main(), mimic_type_apply(), pick_up_object(), remove_unpaid_objects(), inja::render_to(), save_throw_object(), and spring_trap().
|
static |
To force picture regeneration even if map didn't change.
Definition at line 311 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
Maps found in directories.
Definition at line 366 of file mapper.cpp.
Referenced by dump_unused_maps(), find_maps(), list_map(), and main().
|
static |
Definition at line 176 of file mapper.cpp.
Referenced by main(), and process_map().
|
static |
Whether to generate the picture or not.
Definition at line 310 of file mapper.cpp.
Referenced by do_parameters(), do_tiled_map_picture(), main(), and process_map().
|
static |
File names to ignore for map search.
Definition at line 2724 of file mapper.cpp.
Referenced by find_maps().
|
static |
Directories to ignore for map search.
Definition at line 2713 of file mapper.cpp.
Referenced by find_maps().
|
static |
World map with exits / roads / blocking / ...
Definition at line 369 of file mapper.cpp.
Referenced by do_exit_map(), main(), write_world_info(), and write_world_map().
|
static |
Quality for jpg pictures.
Definition at line 345 of file mapper.cpp.
Referenced by do_parameters(), main(), and save_picture().
|
static |
Whether to show 'system' quests or not.
Definition at line 322 of file mapper.cpp.
Referenced by do_parameters(), main(), and quest_callback().
|
static |
If set, program will list maps found in directory but not linked from the first maps.
Definition at line 365 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
Maximum number of maps to browse, -1 for all.
Definition at line 316 of file mapper.cpp.
Referenced by do_parameters(), and main().
|
static |
Maps to process or found.
Definition at line 236 of file mapper.cpp.
Referenced by add_map_to_region(), do_parameters(), fill_json(), fix_exits_to_tiled_maps(), fix_map_names(), fix_tiled_map_monsters(), get_map_info(), and main().
|
static |
Definition at line 313 of file mapper.cpp.
Referenced by process_map(), tiled_map_need_pic(), and write_pictures_from_real_size().
|
static |
Extensions depending on output format.
Definition at line 336 of file mapper.cpp.
Referenced by generate_picture_link(), generate_picture_path(), main(), write_world_info(), and write_world_map().
|
static |
Selected output format.
Definition at line 342 of file mapper.cpp.
Referenced by do_parameters(), do_tiled_map_picture(), generate_picture_link(), generate_picture_path(), main(), save_picture(), write_world_info(), and write_world_map().
|
static |
List of pages to render.
Definition at line 2583 of file mapper.cpp.
Referenced by add_template_to_render(), and main().
|
static |
Path, relative to output root, of pages being generated.
Definition at line 2501 of file mapper.cpp.
Referenced by init_renderer_env(), main(), and path_from_current().
|
static |
Number of created pictures for GD.
Definition at line 307 of file mapper.cpp.
Referenced by main(), and process_map().
|
static |
All quests in the game.
Definition at line 892 of file mapper.cpp.
Referenced by CREResourcesWindow::addQuest(), fill_json(), find_quest_info(), generate_quest(), get_quest_info(), main(), readDirectory(), and START_TEST().
|
static |
Allocated items in quests.
Definition at line 896 of file mapper.cpp.
Referenced by get_quest_info().
|
static |
Count of quests.
Definition at line 894 of file mapper.cpp.
Referenced by fill_json(), find_quest_info(), get_quest_info(), main(), and quest_display().
|
static |
Monsters found in maps.
Definition at line 260 of file mapper.cpp.
Referenced by fill_json(), fix_tiled_map_monsters(), get_race(), and main().
|
static |
Whether to generate raw pics or instancied ones.
Definition at line 348 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
Allocated size of regions.
Definition at line 363 of file mapper.cpp.
Referenced by add_map_to_region(), and write_world_map().
|
static |
Count of regions.
Definition at line 362 of file mapper.cpp.
Referenced by add_map_to_region(), fill_json(), fix_exits_to_tiled_maps(), and main().
Definition at line 383 of file mapper.cpp.
Referenced by add_region_link(), and fill_json().
|
static |
Found regions.
Definition at line 361 of file mapper.cpp.
Referenced by add_map_to_region(), create_region_array(), fill_json(), fix_exits_to_tiled_maps(), main(), and write_world_map().
|
static |
List of generated files, to not generate multiple times.
Definition at line 2170 of file mapper.cpp.
Referenced by add_template_to_render().
|
static |
All defined reset groups.
Definition at line 262 of file mapper.cpp.
Referenced by fill_json(), and process_map().
|
static |
Link between a map and its unique identifier.
Definition at line 2171 of file mapper.cpp.
Referenced by create_map_in_quest_array(), create_maps_array(), create_quest_object(), fill_json(), fill_reverse_maps(), and find_map_by_key().
|
static |
Link between a region and its unique identifier.
Definition at line 2172 of file mapper.cpp.
Referenced by create_map_object(), create_region_array(), fill_json(), and find_region_by_key().
|
static |
Path to store generated files. Relative or absolute, shouldn't end with a /
Definition at line 304 of file mapper.cpp.
Referenced by addArchetypes(), addAssetData(), AssetFieldCompleter::AssetFieldCompleter(), inja::Template::count_variables(), create_destination(), CREResourcesWindow::CREResourcesWindow(), do_parameters(), CREMainWindow::doResourceWindow(), dump_unused_maps(), generate_picture_path(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >::handle_value(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::handle_value(), init_renderer_env(), main(), CREResourcesWindow::setFilter(), AnimationPanel::updateItem(), CREMessagePanel::updateItem(), write_world_info(), and write_world_map().
|
static |
If set, will generate much information on map loaded.
Definition at line 317 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
Definition at line 312 of file mapper.cpp.
Referenced by write_pictures_from_real_size().
|
static |
Allocated size of slaying_info.
Definition at line 401 of file mapper.cpp.
Referenced by get_slaying_struct().
|
static |
Count of items in slaying_info.
Definition at line 400 of file mapper.cpp.
Referenced by fill_json(), get_slaying_struct(), and main().
|
static |
Found slaying fields.
Definition at line 399 of file mapper.cpp.
Referenced by fill_json(), get_slaying_struct(), and main().
|
static |
Special equipment list.
Definition at line 250 of file mapper.cpp.
Referenced by ensure_unique(), fill_json(), and main().
|
static |
Definition at line 2160 of file mapper.cpp.
Referenced by fill_json(), main(), and quest_callback().
|
static |
Definition at line 3000 of file mapper.cpp.
Referenced by get_template().
|
static |
List of template files to start processing from.
Definition at line 2618 of file mapper.cpp.
Referenced by do_parameters(), and main().
|
static |
Pseudo-maps grouping other maps.
Definition at line 239 of file mapper.cpp.
Referenced by create_tiled_map(), fill_json(), fix_tiled_map(), main(), merge_tiled_maps(), and write_tiled_maps().
|
static |
Tileset to use to generate pics.
Definition at line 320 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
Whether to warn of exits without a path
Definition at line 351 of file mapper.cpp.
Referenced by do_parameters(), main(), and process_map().
|
static |
If set, will generate a world map of exits.
Definition at line 319 of file mapper.cpp.
Referenced by do_parameters(), main(), and write_world_info().
|
static |
If set, will generate a world map.
Definition at line 318 of file mapper.cpp.
Referenced by do_parameters(), main(), and write_world_map().