#include <world.h>
Everything about the current game state is bundled up into this structure (or pointers contained within it), for easy saving and easy access. There is exactly one instance, which is always pointed to by w (and which can be retrieved with get_w). Being in a single structure means that a single pointer, which is stored in a register, can be used to keep track of it, and this structure can be written verbatim to save the game (BUT pointers will need to be re-set when restoring.)
Definition at line 67 of file world.h.
Data Fields | |
| world_descriptor | desc |
| char * | constfileoffset |
| Pointer to the start of the constant data file. | |
| tiledesc * | tiledescs |
| DLL export table (export from DLL to main program and data file) DLL interface table (export from main program to DLL). | |
| filelink | current_map_link |
| CONST struct mapdesc * | current_map |
| CONST struct filelink * | itemdescs |
| CONST struct spelldesc * | spelldescs |
| CONST struct shopdesc * | shopdescs |
| CONST struct classdesc * | playerclasses |
| CONST struct filelink * | shuffledata |
| uint * | shuffletranslation |
| ushort | mapsize_x |
| Size of the current level. | |
| ushort | mapsize_y |
| Size of the current level. | |
| tile ** | t |
| Layout of the current level. | |
| itemsinfo | items |
| Items on the floor of the current level. | |
| monster | m [MONSTERS_MAX] |
| Monsters occupying the current level. | |
| player | plr |
| monster * | wandering_monsters |
| Monsters currently between levels. | |
| ushort | wandering_monsters_num |
| Number of wandering monsters. | |
| ushort | pad |
| ulong * | itemids |
| Which item types have been identified. | |
| ulong | time |
| Number of player-turns into the game. | |
| uchar | level |
| The level number (index in mapdescs). | |
| uchar | maxlevel |
| The highest level number the player has ever been on. | |
| uchar | messagevis |
| uchar | interrupt |
| Whether the player is interrupted. | |
| uchar | options [NUM_OPTIONS] |
| uchar | game_flags [64] |
| Extra space reserved for use by data-file-defined functions. | |
|
|
Pointer to the start of the constant data file.
Definition at line 78 of file world.h. Referenced by call_attackfunc(), call_genericfunc(), call_stepfunc(), call_throwhitfunc(), call_usefunc(), deref_file_ptr(), deref_file_ptr_partial(), sys_cleanup(), and sys_init_data_file(). |
|
|
Definition at line 90 of file world.h. Referenced by follow_connection(), main_menu(), and restore_game(). |
|
|
Definition at line 89 of file world.h. Referenced by follow_connection(), main_menu(), and restore_game(). |
|
|
Definition at line 69 of file world.h. Referenced by give_gold(), init_discoveries(), init_inventory(), init_player(), init_shuffle_tab(), init_spells(), link_data_file(), list_discoveries(), main_menu(), numSpellsKnown(), place_items(), place_shop(), restore_game(), save_game(), and sys_init_data_file(). |
|
|
Extra space reserved for use by data-file-defined functions.
|
|
|
Whether the player is interrupted. To handle a multi-turn action, set this to zero, and continue unless/until it becomes nonzero. Any message will set this. Definition at line 140 of file world.h. Referenced by enter_map(), plr_run(), plr_takedamage(), plr_walk(), study_spell(), and vmessage(). |
|
|
Definition at line 91 of file world.h. Referenced by link_data_file(). |
|
|
Which item types have been identified. One BIT per item type, indicating whether or not it's been identified. Access only through identify_type and type_is_identified Definition at line 126 of file world.h. Referenced by cleanup(), identify_type(), init_discoveries(), restore_game(), save_game(), and type_is_identified(). |
|
|
Items on the floor of the current level.
Definition at line 103 of file world.h. Referenced by add_item(), cleanup_items(), compress_items(), count_items(), delete_item(), draw_item(), init_items(), item_step(), load_level(), pickup(), place_item(), restore_game(), save_game(), save_level(), and top_item(). |
|
|
The level number (index in mapdescs).
Definition at line 130 of file world.h. Referenced by dll_fill_room(), follow_connection(), load_level(), main_menu(), options_menu(), and save_level(). |
|
|
|
Size of the current level.
Definition at line 98 of file world.h. Referenced by resize_map_store(), restore_game(), save_game(), and save_level(). |
|
|
Size of the current level.
Definition at line 99 of file world.h. Referenced by resize_map_store(), restore_game(), save_game(), and save_level(). |
|
|
The highest level number the player has ever been on.
Definition at line 132 of file world.h. Referenced by cleanup_save(), follow_connection(), and main_menu(). |
|
|
Whether there should be a message displayed in the message field (to decide when to clear old messages). Definition at line 135 of file world.h. Referenced by draw(), full_redraw(), initialize(), and vmessage(). |
|
|
Definition at line 142 of file world.h. Referenced by _UI_TF_DrawTile(), auto_follow_connection(), award_high_score(), cb_options_menu(), draw(), init_options(), initialize(), item_step(), load_options(), options_menu(), save_game(), save_level(), UI_MF_clear(), UI_MF_history(), and UI_MF_sendmsg(). |
|
|
|
|
|
Definition at line 94 of file world.h. Referenced by char_info(), distribute_attributes(), init_player(), init_skills(), link_data_file(), marks_to_advance(), playerclassname(), study_book(), and study_spell(). |
|
|
|
Definition at line 93 of file world.h. Referenced by link_data_file(), place_shop(), and plr_moveto(). |
|
|
Definition at line 95 of file world.h. Referenced by deref_file_ptr_partial(), and link_data_file(). |
|
|
Definition at line 96 of file world.h. Referenced by cleanup(), deref_file_ptr_partial(), init_shuffle_tab(), restore_game(), and save_game(). |
|
|
Definition at line 92 of file world.h. Referenced by cast_spell(), learn_spell(), link_data_file(), refresh_spell(), spellString(), study_book(), and study_spell(). |
|
|
|
DLL export table (export from DLL to main program and data file) DLL interface table (export from main program to DLL). Pointer to table of tile descriptors which specifies what the tiles look like and qualities such as whether they are transparent to vision Definition at line 88 of file world.h. Referenced by draw_tile(), link_data_file(), monstcanmove(), place_items(), place_player_randomly(), throw_item(), trace_path(), and tracevision(). |
|
|
Number of player-turns into the game.
Definition at line 128 of file world.h. Referenced by add_timer(), cast_spell(), initialize(), learn_spell(), refresh_spell(), remove_expired_timers(), spellString(), study_spell(), timepass(), and UI_TF_Scroll(). |
|
|
Monsters currently between levels. Wandering monsters: Monsters not on a level, but between levels (usually because they're following the player through stairs, but they might stay here for awhile if the player enters a no-monsters-allowed level. Definition at line 115 of file world.h. Referenced by gather_wandering_monsters(), place_wandering_monsters(), restore_game(), and save_game(). |
|
|
Number of wandering monsters.
Definition at line 117 of file world.h. Referenced by gather_wandering_monsters(), place_wandering_monsters(), restore_game(), and save_game(). |
1.3.6