Game Class Reference

#include <game.h>

Inheritance diagram for Game:

Inheritance graph
[legend]
Collaboration diagram for Game:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Game ()
virtual ~Game ()
virtual void play_intro ()=0
virtual void end_game (bool success)=0
virtual void top_menu ()=0
virtual void show_quotes ()=0
virtual void show_credits ()=0
virtual bool new_game (Vga_file &shapes)=0
virtual int get_start_tile_x ()=0
virtual int get_start_tile_y ()=0
virtual void show_journey_failed ()=0
void play_flic (const char *archive, int index)
void play_audio (const char *archive, int index)
void play_midi (int track, bool repeat=false)
void add_shape (const char *name, int shapenum)
int get_shape (const char *name)
void add_resource (const char *name, const char *str, int num)
str_int_pair get_resource (const char *name)
bool show_menu (bool skip=false)
void journey_failed_text ()
void set_jive ()
void clear_jive ()

Static Public Member Functions

static void set_new_game ()
static bool is_new_game ()
static bool is_editing ()
static Gamecreate_game (Exult_Game mygame, const char *title=0)
static Exult_Game get_game_type ()
static bool has_expansion ()
static const char * get_avname ()
static int get_avsex ()
static int get_avskin ()
static void set_avname (char *name)
static void set_avsex (int sex)
static void set_avskin (int skin)
static void clear_avname ()
static void clear_avsex ()
static void clear_avskin ()
static std::string get_gametitle ()
static unsigned int get_ticks ()
static void set_ticks (unsigned int t)

Public Attributes

Game_windowgwin
Image_window8win
Image_buffer8ibuf

Protected Attributes

int topx
int topy
int centerx
int centery
Vga_file menushapes
bool jive

Static Protected Attributes

static bool editing_flag

Private Attributes

hash_map< const char *, int,
hashstr, eqstr
shapes
hash_map< const char *, str_int_pair,
hashstr, eqstr
resources
Mousemenu_mouse

Static Private Attributes

static bool new_game_flag
static Exult_Game game_type
static bool expansion
static std::string gametitle
static unsigned int ticks

Detailed Description

Definition at line 54 of file game.h.


Constructor & Destructor Documentation

Game::Game (  ) 

Definition at line 73 of file game.cc.

References centerx, centery, Game_window::get_height(), Image_window8::get_ib8(), Game_window::get_instance(), Game_window::get_width(), Game_window::get_win(), gwin, ibuf, is_editing(), jive, Vga_file::load(), MAINSHP_FLX, menushapes, topx, topy, and win.

Here is the call graph for this function:

Game::~Game (  )  [virtual]

Definition at line 91 of file game.cc.


Member Function Documentation

static void Game::set_new_game (  )  [inline, static]

Definition at line 84 of file game.h.

References new_game_flag.

Referenced by Game_window::init_gamedat().

static bool Game::is_new_game (  )  [inline, static]

Definition at line 85 of file game.h.

References new_game_flag.

Referenced by Actor::read().

static bool Game::is_editing (  )  [inline, static]

Definition at line 86 of file game.h.

References editing_flag.

Referenced by Game(), Game_window::get_game_identity(), Game_map::get_ifix_objects(), Game_map::init(), Game_window::init_gamedat(), Usecode_internal::read(), Game_window::read_npcs(), Game_window::read_schedules(), Game_window::restore_gamedat(), Savefile(), show_menu(), and Usecode_internal::Usecode_internal().

Game * Game::create_game ( Exult_Game  mygame,
const char *  title = 0 
) [static]

Definition at line 95 of file game.cc.

References BLACK_GATE, clear_system_path(), clone_system_path(), config, editing_flag, expansion, EXULT_DEVEL_GAME, game, game_type, gametitle, Game_window::get_game_identity(), Audio::get_midi(), Audio::get_ptr(), get_system_path(), INITGAME, is_system_path_defined(), MyMidiPlayer::load_patches(), SERPENT_ISLE, to_uppercase(), U7mkdir(), and Configuration::value().

Referenced by BuildGameMap(), and Init().

Here is the call graph for this function:

static Exult_Game Game::get_game_type (  )  [inline, static]

Definition at line 88 of file game.h.

References game_type.

Referenced by Spellbook_object::activate(), Game_object::activate(), Container_game_object::activate(), Npc_actor::activate(), Actor::activate(), Usecode_internal::activate_cached(), Container_game_object::add(), Gump_manager::add_gump(), Combat_schedule::approach_foe(), Game_object::attacked(), Actor::attacked(), Bg_dont_wake(), Usecode_internal::call_intrinsic(), Actor::call_readied_usecode(), Usecode_internal::call_usecode(), Cheat::change_skin(), Container_game_object::create_quantity(), Usecode_internal::create_script(), Main_actor::die(), Actor::die(), KeyBinder::DoAction(), Actor::figure_hit_points(), Body_lookup::find(), Actor::find_best_spot(), Paperdoll_gump::find_closest(), Paperdoll_gump::find_object(), Actor::fits_in_spot(), CheatScreen::FlagCheck(), CheatScreen::FlagMenu(), Barge_object::gather(), Game_map::get_ireg_objects(), Actor::get_prefered_slots(), Game_window::get_saveinfo(), Actor::get_shape_real(), Actor::get_tile_info(), Game_object::get_weight(), Paperdoll_gump::GetCharacterInfo(), Paperdoll_gump::GetCharacterInfoSafe(), Paperdoll_gump::GetItemInfo(), Npc_proximity_handler::handle_event(), Background_noise::handle_event(), Game_clock::handle_event(), Spellbook_object::has_ring(), Game_clock::increment(), Init(), Audio::Init_sfx(), Frame_animator::Initialize(), Actor::inventory_shapenum(), Egg_object::is_active(), Is_body(), Is_moving_barge_flag(), Shape_manager::load(), Face_stats::load_config(), Newfile_gump::LoadSaveGameDetails(), CheatScreen::NormalActivate(), CheatScreen::NormalDisplay(), CheatScreen::NormalMenu(), Bake_schedule::now_what(), Talk_schedule::now_what(), Street_maintenance_schedule::now_what(), Paint_map::paint(), Spellbook_gump::paint(), Paperdoll_gump::paint(), Actor::paint(), Paperdoll_gump::paint_object(), Paperdoll_gump::Paperdoll_gump(), Audio::play_wave_sfx(), Usecode_internal::read(), Actor::read(), Game_map::read_ireg_objects(), Game_window::read_save_names(), Actor::reduce_health(), Usecode_internal::remove_party_items(), Game_window::restore_gamedat(), Usecode_internal::run(), Game_window::save_gamedat(), Actor::set_actor_shape(), Actor::set_polymorph(), Actor::set_polymorph_default(), Map_chunk::setup_dungeon_levels(), Game_window::setup_game(), Game_window::setup_load_palette(), Conversation::show_avatar_choices(), Conversation::show_face(), Usecode_internal::show_npc_face(), Sign_gump::Sign_gump(), Sleep_schedule::Sleep_schedule(), MyMidiPlayer::start_music(), Audio::start_music_combat(), MyMidiPlayer::start_sound_effect(), Audio::start_speech(), MyMidiPlayer::start_track(), Barge_object::step(), Cheat::toggle_naked(), Cheat::toggle_Petra(), Schedule::try_street_maintenance(), Usecode_internal::uc_trace_disasm(), Usecode_internal::UI_delayed_execute_usecode_array(), Usecode_internal::UI_display_runes(), Usecode_internal::UI_get_item_flag(), Usecode_internal::UI_get_schedule_type(), Usecode_internal::UI_move_object(), Usecode_internal::UI_on_barge(), Usecode_internal::UI_path_run_usecode(), Usecode_internal::UI_set_item_flag(), Actor::use_food(), Usecode_internal::write(), Actor::write(), and Container_game_object::write_ireg().

static bool Game::has_expansion (  )  [inline, static]

Definition at line 89 of file game.h.

References expansion.

const char * Game::get_avname (  )  [static]

Definition at line 369 of file game.cc.

References av_name.

Referenced by Game_window::init_actors(), Actor::read(), and Game_window::read_npcs().

int Game::get_avsex (  )  [static]

Definition at line 377 of file game.cc.

References av_sex.

Referenced by Game_window::init_actors(), and Actor::read().

int Game::get_avskin (  )  [static]

Definition at line 381 of file game.cc.

References av_skin.

Referenced by Game_window::init_actors(), and Actor::read().

void Game::set_avname ( char *  name  )  [static]

Definition at line 387 of file game.cc.

References av_name.

Referenced by SI_Game::new_game(), BG_Game::new_game(), and show_menu().

void Game::set_avsex ( int  sex  )  [static]

Definition at line 392 of file game.cc.

References av_sex.

Referenced by SI_Game::new_game(), and BG_Game::new_game().

void Game::set_avskin ( int  skin  )  [static]

Definition at line 397 of file game.cc.

References av_skin.

Referenced by SI_Game::new_game(), and BG_Game::new_game().

void Game::clear_avname (  )  [static]

Definition at line 402 of file game.cc.

References av_name, and new_game_flag.

Referenced by Game_window::init_actors().

void Game::clear_avsex (  )  [static]

Definition at line 408 of file game.cc.

References av_sex.

Referenced by Game_window::init_actors().

void Game::clear_avskin (  )  [static]

Definition at line 413 of file game.cc.

References av_skin.

Referenced by Game_window::init_actors().

static std::string Game::get_gametitle (  )  [inline, static]

Definition at line 101 of file game.h.

References gametitle.

Referenced by Game_window::get_game_identity(), Game_window::init_files(), Game_window::init_gamedat(), Audio::Init_sfx(), and Cheat::toggle_map_editor().

virtual void Game::play_intro (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by ActionSIIntro(), Init(), and show_menu().

virtual void Game::end_game ( bool  success  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by ActionEndgame(), show_menu(), and Usecode_internal::UI_run_endgame().

virtual void Game::top_menu (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by show_menu().

virtual void Game::show_quotes (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by show_menu().

virtual void Game::show_credits (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by show_menu(), and Usecode_internal::UI_run_endgame().

virtual bool Game::new_game ( Vga_file shapes  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by show_menu().

virtual int Game::get_start_tile_x (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by Game_window::init_files().

virtual int Game::get_start_tile_y (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by Game_window::init_files().

virtual void Game::show_journey_failed (  )  [pure virtual]

Implemented in BG_Game, and SI_Game.

Referenced by show_menu().

void Game::play_flic ( const char *  archive,
int  index 
)

Definition at line 189 of file game.cc.

References len, playfli::play(), U7object::retrieve(), and win.

Here is the call graph for this function:

void Game::play_audio ( const char *  archive,
int  index 
)

Definition at line 200 of file game.cc.

References Audio::get_ptr(), Audio::playfile(), and Ucscript::speech.

Here is the call graph for this function:

void Game::play_midi ( int  track,
bool  repeat = false 
)

Definition at line 208 of file game.cc.

References BLACK_GATE, game_type, Audio::get_ptr(), SERPENT_ISLE, and Audio::start_music().

Referenced by BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_guardian(), SI_Game::show_credits(), BG_Game::show_credits(), SI_Game::show_quotes(), BG_Game::show_quotes(), SI_Game::top_menu(), and BG_Game::top_menu().

Here is the call graph for this function:

void Game::add_shape ( const char *  name,
int  shapenum 
)

Definition at line 214 of file game.cc.

References shapes.

Referenced by BG_Game::BG_Game(), and SI_Game::SI_Game().

int Game::get_shape ( const char *  name  ) 

Definition at line 219 of file game.cc.

References shapes.

Referenced by ActionCombatStats(), ActionStats(), Container_game_object::activate(), Cstats_button::activate(), Heart_button::activate(), Load_save_button::activate(), Gump_manager::add_gump(), CombatStats_gump::CombatStats_gump(), Stat_bar::double_clicked(), File_gump::File_gump(), Container_gump::initialize(), File_gump::mouse_up(), Jawbone_gump::on_tooth(), Sign_gump::paint(), Cheat_map::paint(), Jawbone_gump::paint_tooth(), Show_atts(), Sign_gump::Sign_gump(), Slider_gump::Slider_gump(), File_gump::text_input(), and Usecode_internal::UI_display_map().

void Game::add_resource ( const char *  name,
const char *  str,
int  num 
)

Definition at line 224 of file game.cc.

References resources.

Referenced by BG_Game::BG_Game(), and SI_Game::SI_Game().

str_int_pair Game::get_resource ( const char *  name  ) 

Definition at line 230 of file game.cc.

References resources.

Referenced by ShapeBrowser::browse_shapes(), Shape_manager::load(), KeyBinder::LoadDefaults(), ShapeBrowser::ShapeBrowser(), and CheatScreen::show_screen().

bool Game::show_menu ( bool  skip = false  ) 

Definition at line 236 of file game.cc.

References MenuList::add_entry(), c_fade_out_time, centerx, Game_window::clear_screen(), end_game(), Palette::fade_out(), Audio::get_ptr(), Vga_file::get_shape(), Shape_frame::get_ybelow(), gwin, MenuList::handle_events(), IDENTITY, Game_window::init_gamedat(), is_editing(), MAINSHP_FLX, menu_mouse, menushapes, new_game(), offset, Game_singletons::pal, play_intro(), set_avname(), MenuList::set_selection(), show_credits(), show_journey_failed(), show_quotes(), snprintf, Audio::stop_music(), top_menu(), topy, and U7exists().

Referenced by Init().

Here is the call graph for this function:

void Game::journey_failed_text (  ) 

Definition at line 359 of file game.cc.

References Font::center_text(), centerx, centery, Palette::fade_in(), Palette::fade_out(), fontManager, FontManager::get_font(), ibuf, Game_singletons::pal, and wait_delay().

Referenced by SI_Game::show_journey_failed(), and BG_Game::show_journey_failed().

Here is the call graph for this function:

void Game::set_jive (  )  [inline]

Definition at line 124 of file game.h.

References jive.

Referenced by ActionSIIntro().

void Game::clear_jive (  )  [inline]

Definition at line 125 of file game.h.

References jive.

Referenced by ActionSIIntro().

static unsigned int Game::get_ticks (  )  [inline, static]

Definition at line 127 of file game.h.

References ticks.

Referenced by Gump_manager::add_gump(), Game_window::add_nearby_npc(), Game_window::check_time_stopped(), Gump_manager::close_all_gumps(), Death_vortex::Death_vortex(), Fire_field_effect::Fire_field_effect(), Get_click(), Game_window::get_focus(), Frame_animator::get_framenum(), Sfx_animator::handle_event(), Frame_animator::handle_event(), Npc_proximity_handler::handle_event(), Text_effect::handle_event(), Text_effect::init(), Projectile_effect::init(), Frame_animator::Initialize(), Game_window::lose_focus(), Combat_schedule::monster_died(), Cloud::next(), Npc_flag_timer::Npc_flag_timer(), Npc_invisibility_timer::Npc_invisibility_timer(), Npc_poison_timer::Npc_poison_timer(), Npc_protection_timer::Npc_protection_timer(), Npc_sleep_timer::Npc_sleep_timer(), Npc_timer::Npc_timer(), Npc_actor::paint(), Game_window::read_gwin(), Actor::reduce_health(), Gump_manager::remove_gump(), Gump_manager::set_gumps_dont_pause_game(), Game_window::set_time_stopped(), Sprites_effect::Sprites_effect(), Actor::start(), Animator::start_animation(), Combat_schedule::start_battle(), Quaking_actor::step(), Barge_object::travel_to_tile(), Schedule::try_street_maintenance(), Usecode_internal::UI_earthquake(), Npc_proximity_handler::wait(), and Weather_effect::Weather_effect().

static void Game::set_ticks ( unsigned int  t  )  [inline, static]

Definition at line 128 of file game.h.

References ticks.

Referenced by Get_click(), Handle_events(), Game_window::setup_game(), Wait_for_arrival(), and Wizard_eye().


Member Data Documentation

bool Game::new_game_flag [static, private]

Definition at line 56 of file game.h.

Referenced by clear_avname(), is_new_game(), and set_new_game().

Exult_Game Game::game_type [static, private]

Definition at line 57 of file game.h.

Referenced by create_game(), get_game_type(), and play_midi().

bool Game::expansion [static, private]

Definition at line 58 of file game.h.

Referenced by create_game(), and has_expansion().

hash_map<const char*, int, hashstr, eqstr> Game::shapes [private]

Reimplemented in BG_Game.

Definition at line 60 of file game.h.

Referenced by add_shape(), get_shape(), SI_Game::new_game(), and SI_Game::play_intro().

hash_map<const char*, str_int_pair, hashstr, eqstr> Game::resources [private]

Definition at line 61 of file game.h.

Referenced by add_resource(), and get_resource().

Mouse* Game::menu_mouse [private]

Definition at line 66 of file game.h.

Referenced by show_menu().

std::string Game::gametitle [static, private]

Definition at line 67 of file game.h.

Referenced by create_game(), and get_gametitle().

unsigned int Game::ticks [static, private]

Definition at line 68 of file game.h.

Referenced by get_ticks(), BG_Game::scene_butterfly(), BG_Game::scene_guardian(), and set_ticks().

bool Game::editing_flag [static, protected]

Definition at line 70 of file game.h.

Referenced by create_game(), and is_editing().

int Game::topx [protected]

Definition at line 71 of file game.h.

Referenced by BG_Game::end_game(), Game(), SI_Game::new_game(), BG_Game::new_game(), SI_Game::play_intro(), BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_lord_british(), SI_Game::show_journey_failed(), BG_Game::show_journey_failed(), SI_Game::top_menu(), and BG_Game::top_menu().

int Game::topy [protected]

Definition at line 71 of file game.h.

Referenced by BG_Game::end_game(), Game(), SI_Game::new_game(), BG_Game::new_game(), BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_lord_british(), BG_Game::scene_moongate(), SI_Game::show_journey_failed(), BG_Game::show_journey_failed(), show_menu(), SI_Game::top_menu(), and BG_Game::top_menu().

int Game::centerx [protected]

Definition at line 71 of file game.h.

Referenced by BG_Game::end_game(), Game(), journey_failed_text(), SI_Game::new_game(), BG_Game::new_game(), SI_Game::play_intro(), BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_guardian(), BG_Game::scene_lord_british(), BG_Game::scene_moongate(), and show_menu().

int Game::centery [protected]

Definition at line 71 of file game.h.

Referenced by BG_Game::end_game(), Game(), journey_failed_text(), SI_Game::play_intro(), BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_guardian(), BG_Game::scene_lord_british(), and BG_Game::scene_moongate().

Vga_file Game::menushapes [protected]

Definition at line 72 of file game.h.

Referenced by Game(), SI_Game::new_game(), SI_Game::show_credits(), BG_Game::show_credits(), SI_Game::show_journey_failed(), BG_Game::show_journey_failed(), show_menu(), SI_Game::show_quotes(), BG_Game::show_quotes(), SI_Game::top_menu(), and BG_Game::top_menu().

bool Game::jive [protected]

Definition at line 73 of file game.h.

Referenced by clear_jive(), Game(), SI_Game::play_intro(), and set_jive().

Game_window* Game::gwin

Reimplemented from Game_singletons.

Definition at line 76 of file game.h.

Referenced by SI_Game::end_game(), BG_Game::end_game(), Game(), SI_Game::new_game(), BG_Game::new_game(), SI_Game::play_intro(), BG_Game::play_intro(), BG_Game::scene_desk(), BG_Game::scene_guardian(), BG_Game::scene_lord_british(), BG_Game::scene_moongate(), SI_Game::show_credits(), BG_Game::show_credits(), show_menu(), SI_Game::show_quotes(), BG_Game::show_quotes(), and SI_Game::SI_Game().

Image_window8* Game::win

Definition at line 77 of file game.h.

Referenced by SI_Game::end_game(), BG_Game::end_game(), Game(), BG_Game::new_game(), play_flic(), SI_Game::play_intro(), BG_Game::scene_butterfly(), BG_Game::scene_desk(), BG_Game::scene_guardian(), and BG_Game::scene_moongate().

Image_buffer8* Game::ibuf

Definition at line 78 of file game.h.

Referenced by BG_Game::end_game(), Game(), journey_failed_text(), SI_Game::new_game(), BG_Game::new_game(), SI_Game::play_intro(), BG_Game::scene_butterfly(), and BG_Game::scene_lord_british().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 14:52:33 2007 for ExultEngine by  doxygen 1.5.1