public void HandleLoadEnd(long timestamp, string zoneName) { if (settings.LoadRemovalEnabled) { loadTimes += timestamp - startTimestamp.GetValueOrDefault(timestamp); state.IsGameTimePaused = false; state.LoadingTimes = TimeSpan.FromMilliseconds(loadTimes); } IZone zone = Zone.Parse(zoneName, encounteredZones); if (settings.LabSpeedrunningEnabled) { if (state.CurrentPhase == TimerPhase.NotRunning && LAB_ENTRANCE.Equals(previousZone)) { // Start the timer on the first zone of the lab. timer.Start(); } else { // And split on subsequent zones. timer.Split(); } } else if (settings.AutoSplitEnabled) { if (!encounteredZones.Contains(zone) && settings.SplitZones.Contains(zone)) { timer.Split(); } // Keep track of all encountered zones for part prediction. encounteredZones.Add(zone); } previousZone = zone; }
public void HandleIzaroDialogue(long timestamp, string dialogue) { // Izaro can sometimes give a long speech when first entering. Check that this is not the case. int numWords = dialogue.Split(new char[] { ' ' }).Length; if (timer.CurrentState.CurrentPhase == TimerPhase.NotRunning && LAB_ENTRANCE.Equals(previousZone) && numWords < 20) { // The dialogue should be triggered upon activating the lab device. timer.Start(); labStarted = true; } }
public void HandleLoadEnd(long timestamp, string zoneName) { if (settings.LoadRemovalEnabled) { loadTimes += timestamp - startTimestamp.GetValueOrDefault(timestamp); timer.CurrentState.IsGameTimePaused = false; timer.CurrentState.LoadingTimes = TimeSpan.FromMilliseconds(loadTimes); } IZone zone = Zone.Parse(zoneName, encounteredZones); if (settings.AutoSplitEnabled) { if (settings.CriteriaToSplit == ComponentSettings.SplitCriteria.Labyrinth) { if (labStarted && LAB_ENTRANCE.Equals(zone)) { timer.Reset(); labStarted = false; } else if (labStarted && (settings.LabSplitType == ComponentSettings.LabSplitMode.AllZones || (settings.LabSplitType == ComponentSettings.LabSplitMode.Trials && ASPIRANTS_TRIAL.Equals(zone)))) { timer.Split(); } } else if (settings.CriteriaToSplit == ComponentSettings.SplitCriteria.Zones) { if (ShouldSplitForCrtieraZone(zone)) { timer.Split(); } // Keep track of all encountered zones for part prediction. encounteredZones.Add(zone); } } previousZone = zone; }