コード例 #1
0
 /// <summary>
 /// Hit the payload.
 /// </summary>
 private void Payload_II()
 {
     if (!Emerald_Coast_Trigger_Activated)
     {
         // Secretly put us back in the main menu if we are in a stage.
         Invoke_External_Class.Exit_Stage_X();
         Emerald_Coast_Trigger_Activated = true;
     }
 }
コード例 #2
0
        /// <summary>
        /// Loads a level with a specified ID into the game.
        /// </summary>
        public void Load_Level_ID(int LevelID)
        {
            // Write Passed in Level ID
            Program.Sonic_Heroes_Process.WriteMemory((IntPtr)SonicHeroesVariables.Stage_CurrentStage.PlayerStageIDToLoad, BitConverter.GetBytes(LevelID));
            Program.Sonic_Heroes_Process.WriteMemory((IntPtr)SonicHeroesVariables.Stage_CurrentStage.PlayerStageChoiceMainMenu, BitConverter.GetBytes(LevelID));

            // Check if in level.
            byte In_Level = Program.Sonic_Heroes_Process.ReadMemory <byte>((IntPtr)SonicHeroes.Variables.SonicHeroesVariables.Game_CurrentState.CurrentlyInLevel, 1);

            if (In_Level == 1)
            {
                // Secretly put us back in the main menu if we are in a stage.
                Invoke_External_Class.Exit_Stage_X();
                Menu_Enter_Hook_ASM.Activate();
                Menu_Enter_Hook.Activate();
            }
            else
            {
                Force_Load_Level_Method();
            }
        }