Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

world Struct Reference

#include <world.h>


Detailed Description

The current game state.

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.)

See also:
w get_w

Definition at line 67 of file world.h.

Data Fields

world_descriptor desc
char * constfileoffset
 Pointer to the start of the constant data file.

tiledesctiledescs
 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 mapdesccurrent_map
CONST struct filelinkitemdescs
CONST struct spelldescspelldescs
CONST struct shopdescshopdescs
CONST struct classdescplayerclasses
CONST struct filelinkshuffledata
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
monsterwandering_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.


Field Documentation

char* world::constfileoffset
 

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().

CONST struct mapdesc* world::current_map
 

Definition at line 90 of file world.h.

Referenced by follow_connection(), main_menu(), and restore_game().

struct filelink world::current_map_link
 

Definition at line 89 of file world.h.

Referenced by follow_connection(), main_menu(), and restore_game().

struct world_descriptor world::desc
 

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().

uchar world::game_flags[64]
 

Extra space reserved for use by data-file-defined functions.

Definition at line 145 of file world.h.

uchar world::interrupt
 

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().

CONST struct filelink* world::itemdescs
 

Definition at line 91 of file world.h.

Referenced by link_data_file().

ulong* world::itemids
 

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().

struct itemsinfo world::items
 

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().

uchar world::level
 

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().

struct monster world::m[MONSTERS_MAX]
 

Monsters occupying the current level.

Definition at line 106 of file world.h.

Referenced by base_coat(), cause_confusion(), compress_monsters(), confuse_monster(), find_monster_description(), gather_wandering_monsters(), load_level(), monst_anger(), monst_attack_type(), monst_battle_pet(), monst_can_attack_player(), monst_detect_player(), monst_facing(), monst_heal(), monst_is_aligned_with_plr(), monst_is_peaceful(), monst_is_pet(), monst_remove(), monst_swing_monst(), monst_takedamage(), monstbytile(), monstcanmove(), monstmove(), monstmoveawayfromplayer(), monstmoverandomly(), monstmoveto(), monstmovetowardsplayer(), pet_move(), place_monster(), player_can_see(), plr_attack(), plr_moveto(), save_level(), scare_monster_force(), throw_item(), timepass(), webspinner_build(), and webspinner_cower().

ushort world::mapsize_x
 

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().

ushort world::mapsize_y
 

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().

uchar world::maxlevel
 

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().

uchar world::messagevis
 

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().

uchar world::options[NUM_OPTIONS]
 

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().

ushort world::pad
 

Definition at line 119 of file world.h.

CONST struct classdesc* world::playerclasses
 

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().

struct player world::plr
 

Definition at line 107 of file world.h.

Referenced by add_timer(), apply_stat_mod_desc(), apply_timers(), attack_tile(), award_item_points(), award_mark(), awardXP(), calc_light(), calc_light_tile(), cast_spell(), char_info(), cleanup(), deref_jump_table(), distribute_attributes(), do_drop_item(), draw(), draw_tile(), end_game(), enter_map(), facing_towards(), follow_connection(), force_follow_connection(), gather_wandering_monsters(), gen_map(), get_plr(), give_item_slip(), hunger_status(), init_inventory(), init_player(), init_skills(), init_spells(), init_timers(), item_step(), learn_spell(), manip_door(), marks_to_advance(), mod_from_attribute(), monst_attack_plr(), monst_attack_type(), monst_can_attack_player(), monst_chat(), monst_detect_player(), monst_hit_plr(), monst_is_aligned_with_plr(), monstcanmove(), monstmove(), monstmoveawayfromplayer(), monstmoverandomly(), monstmoveto(), monstmovetowardsplayer(), monstname(), numSpellsKnown(), pet_move(), pickup(), place_player_on_map(), place_wandering_monsters(), player_can_see(), player_facing(), plr_attack(), plr_attack_monster_roll(), plr_mod_stat(), plr_move(), plr_moveto(), plr_restore_stat(), plr_run(), plr_search(), plr_takedamage(), plr_walk(), potion_numbness_expire(), print_skills(), prompt_dir(), refresh_spell(), remove_expired_timers(), restore_game(), save_game(), spell_confusion(), spellByIndex(), spellString(), study_book(), study_spell(), throw_item(), timepass(), tool_holysymbol(), update_player(), weapon_skill_attack(), weapon_skill_damage(), and webspinner_cower().

CONST struct shopdesc* world::shopdescs
 

Definition at line 93 of file world.h.

Referenced by link_data_file(), place_shop(), and plr_moveto().

CONST struct filelink* world::shuffledata
 

Definition at line 95 of file world.h.

Referenced by deref_file_ptr_partial(), and link_data_file().

uint* world::shuffletranslation
 

Definition at line 96 of file world.h.

Referenced by cleanup(), deref_file_ptr_partial(), init_shuffle_tab(), restore_game(), and save_game().

CONST struct spelldesc* world::spelldescs
 

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().

struct tile** world::t
 

Layout of the current level.

Definition at line 100 of file world.h.

Referenced by addrandommonst(), base_coat(), bigmap_place_corridor(), bigmap_place_room(), bigmap_place_vault(), bigmap_postpass(), calc_light_tile(), cave_pass(), cb_cave(), cb_cave_partial(), cleanup(), compress_tiles(), connection_fill(), count_adjacent_tiles(), count_items(), dll_fill_room(), do_drop_item(), draw_tile(), follow_connection(), force_follow_connection(), illuminate(), light_room(), load_level(), make_connections(), make_door(), make_noise(), manip_door(), monst_detect_player(), monst_remove(), monstbytile(), monstcanmove(), monstmoveto(), pickup(), place_corridors(), place_doors(), place_fountain(), place_hole(), place_item(), place_items(), place_monster(), place_player_on_map(), place_player_randomly(), place_room(), place_shop(), player_can_see(), plr_moveto(), plr_search(), plr_walk(), replace(), resize_map_store(), restore_game(), save_game(), save_level(), throw_item(), tile_is_occupied(), tile_is_passable(), tile_is_transparent(), top_item(), trace_path(), tracevision(), UI_TF_DrawEffect(), webspinner_build(), and webspinner_cower().

struct tiledesc* world::tiledescs
 

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().

ulong world::time
 

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().

struct monster* world::wandering_monsters
 

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().

ushort world::wandering_monsters_num
 

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().


The documentation for this struct was generated from the following file:
Generated on Thu May 20 13:12:14 2004 for CalcRogue by doxygen 1.3.6