コード例 #1
0
        private Dialogue GenerateLocationDialogue(GameLocation location, NPC companion)
        {
            if (DialogueHelper.GenerateStaticDialogue(companion, location, "companionOnce") is CompanionDialogue dialogueOnce &&
                !this.StateMachine.CompanionManager.Farmer.hasOrWillReceiveMail(dialogueOnce.Tag))
            {
                // Remember only once spoken dialogue
                dialogueOnce.Remember = true;
                return(dialogueOnce);
            }

            // Generate standard companion various dialogue if no once dialogue defined or once dialogue spoken
            return(DialogueHelper.GenerateDialogue(companion, location, "companion"));
        }
コード例 #2
0
        public Dialogue GenerateLocationDialogue(GameLocation location, string suffix = "")
        {
            NPC companion = this.Companion;

            // Try generate only once spoken dialogue in game save
            if (DialogueHelper.GenerateStaticDialogue(companion, location, $"companionOnce{suffix}") is CompanionDialogue dialogueOnce &&
                !this.CompanionManager.Farmer.hasOrWillReceiveMail(dialogueOnce.Tag))
            {
                // Remember only once spoken dialogue (as received mail. Keep it forever in loaded game after game saved)
                dialogueOnce.Remember = true;
                return(dialogueOnce);
            }

            // Try generate standard companion various dialogue. This dialogue can be shown only once per day (per recruited companion session)
            if (DialogueHelper.GenerateDialogue(companion, location, $"companion{suffix}") is CompanionDialogue dialogue && !this.SpokenDialogues.Contains(dialogue.Tag))
            {
                dialogue.SpecialAttributes.Add("session"); // Remember this dialogue in this companion session when will be spoken
                return(dialogue);
            }

            // Try generate dialogue which can be shown repeately in day (current companion session). If none defined, returns null
            return(DialogueHelper.GenerateDialogue(companion, location, "companionRepeat"));
        }