Exemple #1
0
        public void ResetLogic()
        {
            oldEnemyEncounter   = null;
            currentEndTimeState = EndTimeState.NotArrivedYet;

            InitSplits();
            LogToFile("LOGIC RESET");
        }
Exemple #2
0
        public void ResetLogic()
        {
            oldListeningToTitleSong = false;
            oldEnemyEncounter       = null;
            currentEndTimeState     = EndTimeState.NotArrivedYet;

            InitSplits();
        }
Exemple #3
0
        private bool ShouldEnd()
        {
            int  currentSong;
            long musicCoroutine;
            int  currentRoomId;

            try
            {
                if (!gameMemory.ReadFirstMusicId(out currentSong))
                {
                    return(false);
                }
                if (!gameMemory.ReadMusicCoroutineInProgress(out musicCoroutine))
                {
                    return(false);
                }
                if (!gameMemory.ReadCurrentRoomId(out currentRoomId))
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                return(false);
            }

            if (currentEndTimeState == EndTimeState.NotArrivedYet)
            {
                if (currentRoomId == (int)GameEnums.Room.BugariaEndThrone)
                {
                    currentEndTimeState = EndTimeState.ArrivedInRoom;
                }
            }
            else
            {
                bool newMusicCouroutineInProgress = (musicCoroutine != 0);

                if (currentEndTimeState == EndTimeState.ArrivedInRoom && currentSong == (int)GameEnums.Song.LevelUp)
                {
                    currentEndTimeState = EndTimeState.SongLevelUpStarting;
                }
                else if (currentEndTimeState == EndTimeState.SongLevelUpStarting && !newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.SongLevelIsPlaying;
                }
                else if (currentEndTimeState == EndTimeState.SongLevelIsPlaying && newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.SongIsFading;
                }
                else if (currentEndTimeState == EndTimeState.SongIsFading && !newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.NotArrivedYet;
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        private bool ShouldEnd()
        {
            int  currentSong;
            long musicCoroutine;
            int  currentRoomId;

            try
            {
                if (!gameMemory.ReadFirstMusicId(out currentSong))
                {
                    LogToFile("ShouldEnd: Couldn't read the first music id");
                    return(false);
                }
                if (!gameMemory.ReadMusicCoroutineInProgress(out musicCoroutine))
                {
                    LogToFile("ShouldEnd: Couldn't read the music coroutine");
                    return(false);
                }
                if (!gameMemory.ReadCurrentRoomId(out currentRoomId))
                {
                    LogToFile("ShouldEnd: Couldn't read the current room id");
                    return(false);
                }
            }
            catch (Exception ex)
            {
                LogToFile("ShouldEnd: Unhandled exception while reading memory: " + ex.Message);
                return(false);
            }

            if (currentEndTimeState == EndTimeState.NotArrivedYet)
            {
                if (currentRoomId == (int)GameEnums.Room.BugariaEndThrone)
                {
                    currentEndTimeState = EndTimeState.ArrivedInRoom;
                    LogToFile("ShouldEnd: Just arrived in the room");
                }
            }
            else
            {
                bool newMusicCouroutineInProgress = (musicCoroutine != 0);

                if (currentEndTimeState == EndTimeState.ArrivedInRoom && currentSong == (int)GameEnums.Song.LevelUp)
                {
                    currentEndTimeState = EndTimeState.SongLevelUpStarting;
                    LogToFile("ShouldEnd: The level up song is starting");
                }
                else if (currentEndTimeState == EndTimeState.SongLevelUpStarting && !newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.SongLevelIsPlaying;
                    LogToFile("ShouldEnd: The level up song is playing");
                }
                else if (currentEndTimeState == EndTimeState.SongLevelIsPlaying && newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.SongIsFading;
                    LogToFile("ShouldEnd: The level up song is fading");
                }
                else if (currentEndTimeState == EndTimeState.SongIsFading && !newMusicCouroutineInProgress)
                {
                    currentEndTimeState = EndTimeState.NotArrivedYet;
                    LogToFile("ShouldEnd: The level up song is done fading");
                    return(true);
                }
            }

            return(false);
        }