state("mgs2_sse") { uint GameTime: 0xD8AEF8; string10 RoomCode: 0xD8ADEC; // mselect in menu int LevelScore: 0x5ADC48; ushort MissionCode: 0xB60C1C; short Options: 0x601F34, 0x6; // 0x200 = previous } startup { vars.D = new ExpandoObject(); vars.D.SplitOnExit = false; vars.QuickEquip = ""; vars.TotalScore = 0; settings.Add("split_level_insta", false, "Split instantly upon hitting the goal"); settings.SetToolTip("split_level_insta", "If disabled, this will split when leaving the level."); } isLoading { return true; } gameTime { return TimeSpan.FromMilliseconds((current.GameTime) * 1000 / 60); } reset { return ( (current.RoomCode != old.RoomCode) && (current.RoomCode == "n_title") ); } update { vars.QuickEquip = ((current.Options & 0x200) == 0x200) ? "Previous" : "Unequip"; } start { if ( (current.RoomCode != old.RoomCode) && (old.RoomCode == "mselect") && (current.RoomCode != "n_title") ) { vars.TotalScore = 0; return true; } return false; } split { if (vars.D.SplitOnExit) { if ( (current.RoomCode != old.RoomCode) || (current.MissionCode != old.MissionCode) ) { vars.D.SplitOnExit = false; return true; } } if ( (current.LevelScore != -1) && (old.LevelScore == -1) ) { vars.TotalScore += current.LevelScore; if (settings["split_level_insta"]) return true; vars.D.SplitOnExit = true; } return false; }