public void ResetLogic() { oldEnemyEncounter = null; currentEndTimeState = EndTimeState.NotArrivedYet; InitSplits(); LogToFile("LOGIC RESET"); }
public void ResetLogic() { oldListeningToTitleSong = false; oldEnemyEncounter = null; currentEndTimeState = EndTimeState.NotArrivedYet; InitSplits(); }
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); }
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); }