public Save_Info(Save_Info info) { File_Id = info.File_Id; Time = info.Time; Chapter_Id = info.Chapter_Id; Difficulty = info.Difficulty; Style = info.Style; Map_Save_Exists = info.Map_Save_Exists; Suspend_Exists = info.Suspend_Exists; AvailableChapters = new List <string>(info.AvailableChapters); }
private Suspend_Info(Suspend_Info source) { Chapter_Id = source.Chapter_Id; Lord_Actor_Face = source.Lord_Actor_Face; Turn = source.Turn; Units = source.Units; Playtime = source.Playtime; Gold = source.Gold; Save_Id = source.Save_Id; Preparations = source.Preparations; HomeBase = source.HomeBase; Difficulty = source.Difficulty; Style = source.Style; Time = source.Time; ScreenshotData = source.ScreenshotData.ToArray(); SuspendModifiedTime = source.SuspendModifiedTime; }
internal Metrics_Data(Gameplay_Metrics gameplay) { Chapter = Global.game_system.chapter_id; StartTime = Global.game_system.chapter_start_time; Difficulty = Global.game_system.Difficulty_Mode; Style = Global.game_system.Style; PlayTime = Global.game_system.chapter_play_time; RankTurns = Global.game_system.chapter_turn; RankCombat = Global.game_system.chapter_damage_taken; RankExp = Global.game_system.chapter_exp_gain; RankCompletion = Global.game_system.chapter_completion; RankSurvival = Global.game_system.chapter_deaths; Deployed = Global.game_system.deployed_unit_count; DeployedLvl = Global.game_system.deployed_unit_avg_level; Battalion = Global.battalion.actors.Count; BattalionLvl = Global.battalion.average_level; GameplayStartTime = Global.game_system.gameplay_start_time; Gameplay = gameplay; }
public void TitleNewGame(int fileId, Mode_Styles style, Difficulty_Modes difficulty) { Global.save_file = new Tactile.IO.Save_File(); Global.save_file.Style = style; Global.save_file.Difficulty = difficulty; Global.game_options.reset_options(); Global.start_game_file_id = fileId; Global.start_new_game = true; // Save file on creation CallSaveData(); Loading_Suspend = false; Closing = true; Timer = 0; if (Global.save_files_info == null) { Global.save_files_info = new Dictionary <int, Tactile.IO.Save_Info>(); } Global.save_files_info.Add( Global.start_game_file_id, Tactile.IO.Save_Info.new_file()); }
public Mode_Style_Info_Panel(Mode_Styles style) { var window = new System_Color_Window(); window.width = WIDTH; window.height = 48; window.color_override = Constants.Difficulty.STYLE_COLOR_REDIRECT[style]; window.small = true; Window = window; Size = new Vector2(WIDTH, Window.height); Style = new TextSprite(); Style.loc = new Vector2(24, -8); Style.SetFont(Config.UI_FONT, Global.Content, "Yellow"); Style.text = style.ToString(); Description = new TextSprite(); Description.loc = new Vector2(16, 8); Description.SetFont(Config.UI_FONT, Global.Content, "Blue"); Description.text = Global.system_text["Style " + style.ToString()]; active = false; }
public void reset() { Instant_Move = false; Selected_Unit_Id = -1; //Rng = new List<int>(); reset_rng(); Preset_Rng = new List <int>(); Saved_Rns = new List <int>(); Saving_Rns = false; Preparations = false; Home_Base = false; Menu_Canto = Canto_Records.None; Battler_1_Id = -1; Battler_2_Id = -1; Aoe_Targets = new List <int>(); Staff_User_Id = -1; Staff_Target_Id = -1; Staff_Target_Loc = new Vector2(-1, -1); Rescuer_Id = -1; Rescuee_Id = -1; Item_User = -1; Item_Used = -1; Item_Inventory_Target = -1; ItemPromotionId = -1; ItemTargetLoc = new Vector2(-1, -1); Visitor_Id = -1; Visit_Loc = new Vector2(-1, -1); Shopper_Id = -1; Shop_Loc = new Vector2(-1, -1); SecretShop = false; In_Arena = false; Wager = -1; Arena_Distance = -1; Arena_Round = -1; Arena_Retreat = false; Stolen_Item = -1; Discarder_Id = -1; SupportGainId = -1; SupportGainTargets = new List <int>(); Battle_Mode = Constants.Animation_Modes.Map; Status_Page = 0; Unit_Page = 0; Unit_Sort = 0; Unit_Sort_Up = true; DataPage = 0; Supply_Item_Type = 0; Objective_Text = ""; Victory_Text = ""; Loss_Text = ""; Objective_Mode = new int[] { 0, 0 }; Loss_On_Death = new HashSet <int>(); Ally_Loss_On_Death = new List <int>(); Difficulty_Mode = Difficulty_Modes.Normal; Style = Global.save_file == null ? Mode_Styles.Standard : Global.save_file.Style; Previous_Chapters = new List <string>(); Rankings = new PastRankings(); Total_Play_Time = 0; Chapter_Save_Progression_Keys = new string[0]; Victory = false; Failure = false; clear_events(); }
public void read(BinaryReader reader, Version loadedVersion) { Instant_Move = reader.ReadBoolean(); Character_Anim_Count = reader.ReadInt32(); Selected_Unit_Id = reader.ReadInt32(); if (loadedVersion.older_than(0, 4, 3, 2)) { List <int> rand = new List <int>(); rand.read(reader); reset_rng(); } else { Rand = Rng.read(reader, loadedVersion); } //reset_rng(); //Debug Preset_Rng.read(reader); Preparations = reader.ReadBoolean(); if (!loadedVersion.older_than(0, 4, 3, 6)) { Home_Base = reader.ReadBoolean(); } Menu_Canto = (Canto_Records)reader.ReadInt32(); Battler_1_Id = reader.ReadInt32(); Battler_2_Id = reader.ReadInt32(); Aoe_Targets.read(reader); Staff_User_Id = reader.ReadInt32(); Staff_Target_Id = reader.ReadInt32(); Staff_Target_Loc = Staff_Target_Loc.read(reader); Rescuer_Id = reader.ReadInt32(); Rescuee_Id = reader.ReadInt32(); Item_User = reader.ReadInt32(); Item_Used = reader.ReadInt32(); if (!loadedVersion.older_than(0, 4, 6, 1)) { Item_Inventory_Target = reader.ReadInt32(); } if (!loadedVersion.older_than(0, 6, 6, 0)) { ItemPromotionId = reader.ReadInt32(); } if (!loadedVersion.older_than(0, 6, 4, 1)) { ItemTargetLoc = ItemTargetLoc.read(reader); } Shopper_Id = reader.ReadInt32(); Shop_Loc = Shop_Loc.read(reader); if (!loadedVersion.older_than(0, 5, 0, 5)) { SecretShop = reader.ReadBoolean(); } In_Arena = reader.ReadBoolean(); Wager = reader.ReadInt32(); Arena_Distance = reader.ReadInt32(); Arena_Round = reader.ReadInt32(); Stolen_Item = reader.ReadInt32(); Dance_Item = reader.ReadInt32(); Discarder_Id = reader.ReadInt32(); if (!loadedVersion.older_than(0, 5, 5, 4)) { SupportGainId = reader.ReadInt32(); SupportGainTargets.read(reader); } Battle_Mode = (Constants.Animation_Modes)reader.ReadInt32(); Objective_Text = reader.ReadString(); Victory_Text = reader.ReadString(); Loss_Text = reader.ReadString(); Objective_Mode = Objective_Mode.read(reader); Loss_On_Death.read(reader); Ally_Loss_On_Death.read(reader); if (loadedVersion.older_than(0, 4, 2, 0)) { Difficulty_Mode = reader.ReadBoolean() ? Difficulty_Modes.Hard: Difficulty_Modes.Normal; } else { Difficulty_Mode = (Difficulty_Modes)reader.ReadInt32(); } Style = (Mode_Styles)reader.ReadInt32(); if (!loadedVersion.older_than(0, 4, 0, 4)) { Previous_Chapters.read(reader); } if (!loadedVersion.older_than(0, 4, 4, 0)) { Chapter_Id = reader.ReadString(); if (!loadedVersion.older_than(0, 5, 6, 3)) { PreviousChapterIds.read(reader); } else { PreviousChapterIds.Clear(); string previous_chapter = reader.ReadString(); if (!string.IsNullOrEmpty(previous_chapter)) { if (!Global.data_chapters.ContainsKey(Chapter_Id)) { throw new KeyNotFoundException(string.Format("Problem loading save, cannot find chapter {0}", Chapter_Id)); } else if (!Global.data_chapters.ContainsKey(previous_chapter)) { throw new KeyNotFoundException(string.Format("Problem loading save, cannot find chapter {0}", previous_chapter)); } else { string progression_id; if (!Global.data_chapters[Chapter_Id].Prior_Chapters .Intersect(Global.data_chapters[previous_chapter].Progression_Ids) .Any()) { #if DEBUG //throw new KeyNotFoundException(string.Format( // "Chapter {0}'s prior chapters do not match chapter {1}'s progression ids", // Chapter_Id, previous_chapter)); #endif // Incorrect but eh @Debug progression_id = Global.data_chapters[Chapter_Id].Prior_Chapters.First(); } else { progression_id = Global.data_chapters[Chapter_Id].Prior_Chapters .Intersect(Global.data_chapters[previous_chapter].Progression_Ids) .First(); } PreviousChapterIds.Add(progression_id, previous_chapter); } } } } if (!loadedVersion.older_than(0, 6, 7, 0)) { Rankings = PastRankings.read(reader, Difficulty_Mode); } else { Rankings = new PastRankings(); } Total_Play_Time = reader.ReadInt32(); Chapter_Play_Time = reader.ReadInt32(); if (!loadedVersion.older_than(0, 4, 6, 3)) { Chapter_Start_Time = DateTime.FromBinary(reader.ReadInt64()); if (!loadedVersion.older_than(0, 6, 3, 1)) { GameplayStartTime = DateTime.FromBinary(reader.ReadInt64()); } else { GameplayStartTime = Chapter_Start_Time; } Deployed_Unit_Count = reader.ReadInt32(); Deployed_Unit_Avg_Level = reader.ReadInt32(); } Chapter_Turn = reader.ReadInt32(); Chapter_Exp_Gain = reader.ReadInt32(); Chapter_Damage_Taken = reader.ReadInt32(); Chapter_Deaths = reader.ReadInt32(); Chapter_Completion = reader.ReadInt32(); if (!loadedVersion.older_than(0, 4, 4, 3)) { Home_Base_Background = reader.ReadString(); } SWITCHES = Event_Variable_Data <bool> .read(reader, Config.EVENT_DATA_LENGTH); VARIABLES = Event_Variable_Data <int> .read(reader, Config.EVENT_DATA_LENGTH); //Event_Processor.read_data(reader); //Debug }