// ----------------------------------------------------------------------------------------------------- //called when the player is starting a level (new game or new ship) StartLevel(int random) { Assert(!Player_is_dead); InitPlayerPosition(random); verify_console_object(); ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; disable_matcens(); clear_transient_objects(0); //0 means leave proximity bombs // create_player_appearance_effect(ConsoleObject); Do_appearance_effect = 1; #ifdef NETWORK if (Game_mode & GM_MULTI) { #ifndef SHAREWARE if (Game_mode & GM_MULTI_COOP) multi_send_score(); #endif multi_send_position(Players[Player_num].objnum); multi_send_reappear(); } if (Game_mode & GM_NETWORK) network_do_frame(1, 1); #endif ai_reset_all_paths(); ai_init_boss_for_ship(); reset_time(); reset_rear_view(); Auto_fire_fusion_cannon_time = 0; Fusion_charge = 0; Robot_firing_enabled = 1; if (VR_screen_mode == SCREEN_MENU) vr_reset_display(); }
//reset stuff so game is semi-normal when playing from editor void editor_reset_stuff_on_level() { gameseq_init_network_players(); init_player_stats_level(); Viewer = ConsoleObject; ConsoleObject = Viewer = &Objects[Players[Player_num].objnum]; ConsoleObject->id=Player_num; ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; Game_suspended = 0; verify_console_object(); Fuelcen_control_center_destroyed = 0; if (Newdemo_state != ND_STATE_PLAYBACK) gameseq_remove_unused_players(); init_cockpit(); init_robots_for_level(); init_ai_objects(); init_morphs(); init_all_matcens(); init_player_stats_new_ship(); }
// ----------------------------------------------------------------------------------------------------- //called when the player is starting a level (new game or new ship) void StartLevel(int random) { Assert(!Player_is_dead); InitPlayerPosition(random); verify_console_object(); ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; // create_player_appearance_effect(ConsoleObject); Do_appearance_effect = 1; if (Game_mode & GM_MULTI) { if (Game_mode & GM_MULTI_COOP) multi_send_score(); multi_send_reappear(); multi_do_protocol_frame(1, 1); } else // in Singleplayer, after we died ... { disable_matcens(); // ... disable matcens and ... clear_transient_objects(0); // ... clear all transient objects. } ai_reset_all_paths(); ai_init_boss_for_ship(); reset_rear_view(); Auto_fire_fusion_cannon_time = 0; Fusion_charge = 0; if (!(Game_mode & GM_MULTI)) // stuff for Singleplayer only { } }
//reset stuff so game is semi-normal when playing from editor void editor_reset_stuff_on_level() { gameseq_init_network_players(); init_player_stats_level(0); Viewer = ConsoleObject; ConsoleObject = Viewer = &Objects[Players[Player_num].objnum]; ConsoleObject->id=Player_num; ConsoleObject->control_type = CT_FLYING; ConsoleObject->movement_type = MT_PHYSICS; Game_suspended = 0; verify_console_object(); Control_center_destroyed = 0; if (Newdemo_state != ND_STATE_PLAYBACK) gameseq_remove_unused_players(); init_cockpit(); init_robots_for_level(); init_ai_objects(); init_morphs(); init_all_matcens(); init_player_stats_new_ship(Player_num); if (!Game_wind) Game_wind = window_create(&grd_curscreen->sc_canvas, 0, 0, SWIDTH, SHEIGHT, game_handler, NULL); }