Example #1
0
        /// <summary>
        /// Setup companion for new day
        /// </summary>
        public void NewDaySetup()
        {
            if (this.CurrentStateFlag != StateFlag.RESET)
            {
                throw new InvalidStateException($"State machine {this.Name} must be in reset state!");
            }

            // Today is festival day? Player can't recruit this companion
            if (Utility.isFestivalDay(Game1.dayOfMonth, Game1.currentSeason))
            {
                this.Monitor.Log($"{this.Name} is unavailable to recruit due to festival today.");
                this.MakeUnavailable();
                return;
            }

            // Setup dialogues for companion for this day
            DialogueHelper.SetupCompanionDialogues(this.Companion, this.ContentLoader.LoadStrings($"Dialogue/{this.Name}"));

            // Spoused or married with her/him? Enhance dialogues with extra spouse dialogues for this day
            if (Helper.IsSpouseMarriedToFarmer(this.Companion, this.CompanionManager.Farmer) && this.ContentLoader.CanLoad($"Dialogue/{this.Name}Spouse"))
            {
                DialogueHelper.SetupCompanionDialogues(this.Companion, this.ContentLoader.LoadStrings($"Dialogue/{this.Name}Spouse"));
            }

            this.RecruitedToday = false;
            this.MakeAvailable();
        }
Example #2
0
        /// <summary>
        /// Setup companion for new day
        /// </summary>
        public void NewDaySetup()
        {
            if (this.CurrentStateFlag != StateFlag.RESET)
            {
                throw new InvalidStateException($"State machine {this.Name} must be in reset state!");
            }

            // Today is festival day? Player can't recruit this companion
            if (Utility.isFestivalDay(Game1.dayOfMonth, Game1.currentSeason))
            {
                this.Monitor.Log($"{this.Name} is unavailable to recruit due to festival today.");
                this.MakeUnavailable();
                return;
            }

            // Setup dialogues for companion for this day
            DialogueHelper.SetupCompanionDialogues(this.Companion, this.ContentLoader.LoadStrings($"Dialogue/{this.Name}"));

            this.RecruitedToday  = false;
            this.SuggestedToday  = false;
            this.CanSuggestToday = Game1.random.NextDouble() > .5f &&
                                   !(this.Companion.isMarried() && SDate.Now().DayOfWeek == DayOfWeek.Monday);
            this.SpokenDialogues.Clear();
            this.MakeAvailable();
            if (this.CanSuggestToday)
            {
                this.Monitor.Log($"{this.Name} can suggest adventure today!");
            }
        }
        public void NewDaySetup()
        {
            if (this.CurrentStateFlag != StateFlag.RESET)
            {
                throw new InvalidStateException($"State machine {this.Name} must be in reset state!");
            }

            if (Utility.isFestivalDay(Game1.dayOfMonth, Game1.currentSeason))
            {
                this.Monitor.Log($"{this.Name} is unavailable to recruit due to festival today.");
                this.MakeUnavailable();
                return;
            }

            DialogueHelper.SetupCompanionDialogues(this.Companion, this.ContentLoader.LoadStrings($"Dialogue/{this.Name}"));

            if (Helper.IsSpouseMarriedToFarmer(this.Companion, this.CompanionManager.Farmer))
            {
                DialogueHelper.SetupCompanionDialogues(this.Companion, this.ContentLoader.LoadStrings($"Dialogue/{this.Name}Spouse"));
            }

            this.RecruitedToday = false;
            this.MakeAvailable();
        }