internal override void update() { if (ChapterEndCalling) { InChapterEnd = true; ChapterEndCalling = false; } if (InChapterEnd && get_scene_map() != null) { bool cont = false; while (!cont) { cont = true; switch (ChapterEndTimer) { case 0: // End of chapter support gains if (SupportPoints) { Global.game_map.apply_chapter_support(); } // Send metrics if (SendMetrics) { #if DEBUG if (!Global.game_temp.chapter_skipped) if (!Global.UnitEditorActive) #endif send_metrics(); } // Show rankings if (ShowRankings) { Global.game_temp.menu_call = true; Global.game_temp.rankings_call = true; } cont = false; ChapterEndTimer++; break; case 1: // Wait for rankings screen to finish if (!Global.game_temp.menu_call && !Global.game_temp.menuing) { // Reclaim siege engines and show popups for them var constructors = Global.game_map.allies .Select(x => Global.game_map.units[x]) .Where(x => x.can_reclaim(true)) .ToList(); var siegeEngineLocs = constructors.SelectMany(x => x.reclaim_targets()) .Distinct() .ToList(); if (siegeEngineLocs.Any()) { // Show popup Global.game_system.play_se(System_Sounds.Gain); Global.game_map.get_scene_map().set_popup("Recovered siege engines.", 113); for (int i = 0; i < siegeEngineLocs.Count; i++) { Siege_Engine siegeEngine = Global.game_map.get_siege(siegeEngineLocs[i]); // Add a copy of the siege engine's item to the convoy // (leave the original item on the map so it's visible during the outro) Item_Data item = new Item_Data(siegeEngine.item); Global.game_battalions.add_item_to_convoy(item, true); } } ChapterEndTimer++; cont = false; } break; case 2: // Wait for popup to clear if (!Global.game_map.get_scene_map().is_map_popup_active()) { InChapterEnd = false; ChapterEndTimer = 0; ShowRankings = false; SendMetrics = false; SupportPoints = false; } break; } } } }
internal void add_siege_engine(Siege_Engine siege) { SiegeEngines.Add(siege.id, siege); }