void GetCurrentSchedule() { for (int i = 0; i < Schedules.Count; i++) { NPCSchedule schedule = Schedules[i]; TimeManager.WeekDays currentDay = TimeManager.Instance.CurrentWeekDayName; if (schedule.ActiveDays.Contains(currentDay)) { CurrentSchedule = schedule; return; } } }
public override void Interact() { int currentHour = TimeManager.Instance.CurrentHour; TimeManager.WeekDays currentDay = TimeManager.Instance.CurrentWeekDayName; if (OpeningHours.Contains(currentHour) && OpeningDays.Contains(currentDay)) { base.Warp(); } else { PixelCrushers.DialogueSystem.DialogueManager.ShowAlert("Opening hours: " + openingHour + " - " + closingHour); } }
public bool CheckValidity() { if (CalendarManager.Instance.CurrentEvent != null && FestivalAllowed == false) { return(false); } if (EventManager.Instance.PlayedEvents.Contains(this)) { // Debug.Log("already played"); return(false); } int currentDay = TimeManager.Instance.PassedDays; if (currentDay < MinimumDays) { // Debug.Log("Too early"); return(false); } string currentLocation = GameManager.Instance.LevelName; string previousLocation = GameManager.Instance.PreviousLevelName; if (currentLocation != Location) { // Debug.Log("wrong location"); return(false); } if (FromLocation != string.Empty && previousLocation != FromLocation) { // Debug.Log("from wrong location"); return(false); } if (PreRequisites.Count > 0) { foreach (GameEvent prerequisite in PreRequisites) { if (EventManager.Instance.PlayedEvents.Contains(prerequisite) == false) { // Debug.Log("prerequisite not seen"); return(false); } } } TimeManager.MonthNames currentMonth = TimeManager.Instance.CurrentMonth.Name; if (AllowedMonths.Count > 0 && AllowedMonths.Contains(currentMonth) == false) { // Debug.Log("wrong season"); return(false); } TimeManager.WeekDays currentWeekday = TimeManager.Instance.CurrentWeekDayName; if (AllowedWeekdays.Count > 0 && AllowedWeekdays.Contains(currentWeekday) == false) { // Debug.Log("wrong week day"); return(false); } WeatherType currentWeather = WeatherManager.Instance.CurrentWeather; if (AllowedWeathers.Count > 0 && AllowedWeathers.Contains(currentWeather) == false) { // Debug.Log("wrong weather"); return(false); } int currentHour = TimeManager.Instance.CurrentHour; int currentMinute = TimeManager.Instance.CurrentMinute; if (HourSpan.StartHour != -1 && TimeManager.Instance.CheckWithinHourSpan(HourSpan, currentHour, currentMinute) == false) { // Debug.Log("not within timespan"); return(false); } return(true); }