Exemplo n.º 1
0
        public IDialogueWrapper GetDialogue(ref INPCWrapper npc, bool useSeason)
        {
            var checkInlaw = new List <bool>()
            {
                false
            };

            if (_gameWrapper.player.spouse != string.Empty)
            {
                checkInlaw.Insert(0, true);
            }
            foreach (var isMarried in checkInlaw)
            {
                var season = Season.Unknown;
                if (!string.IsNullOrEmpty(_gameWrapper.currentSeason))
                {
                    if (!Enum.TryParse <Season>(_gameWrapper.currentSeason, true, out season))
                    {
                        continue;
                    }
                }

                var conditions = new DialogueConditions(
                    npc,
                    _gameWrapper.year.ToString("00"),
                    useSeason ? season : Season.Unknown,
                    _gameWrapper.dayOfMonth,
                    ParseDayOfWeek(npc, _gameWrapper.shortDayNameFromDayOfSeason(_gameWrapper.dayOfMonth)),
                    isMarried ? MarriageAppend(_gameWrapper.player.spouse) : string.Empty,
                    _gameWrapper.player.friendshipData.TryGetValue(npc.Name, out IFriendshipWrapper friendshipValue)
            ? friendshipValue.Points
            : 0);

                IDialogueWrapper dialogue;
                if (FirstPassDialogue(conditions, out dialogue))
                {
                    return(dialogue);
                }
                if (HeartDialogue(conditions, out dialogue))
                {
                    return(dialogue);
                }
                if (NullIfTruePass(conditions))
                {
                    continue;
                }
                if (LastPassDialogue(conditions, out dialogue))
                {
                    return(dialogue);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        private DayOfWeek ParseDayOfWeek(INPCWrapper npc, string day)
        {
            if (npc.Name == "Pierre" &&
                (_gameWrapper.isLocationAccessible("CommunityCenter") ||
                 _gameWrapper.player.HasTownKey) && day == "Wed")
            {
                day = "Sat";
            }

            return((DayOfWeek)Enum.Parse(typeof(DayOfWeek), day));
        }
Exemplo n.º 3
0
        public bool CheckIfDialogueContainsKey(INPCWrapper npc, string key,
                                               out IDialogueWrapper dialogue, Func <bool> extraConditions = null)
        {
            if (npc.Dialogue.ContainsKey(key) && (extraConditions?.Invoke() ?? true))
            {
                dialogue = _factory.CreateInstance <IDialogueWrapper>(npc.Dialogue[key], npc);
                return(true);
            }

            dialogue = null;
            return(false);
        }
        public DialogueConditions(INPCWrapper npc, string year, Season season, int dayOfMonth,
                                  DayOfWeek dayOfWeek, string inlaw, int friendship)
        {
            Npc         = npc;
            _year       = "1";
            Season      = season;
            _dayOfMonth = 1;
            DayOfWeek   = dayOfWeek;
            Inlaw       = inlaw;
            _friendship = 0;

            // Struct restriction: all values must be set before conditional code can be run
            Year       = year;
            DayOfMonth = dayOfMonth;
            Friendship = friendship;
        }
Exemplo n.º 5
0
 public bool checkForQuestComplete(INPCWrapper n, int number1, int number2, IItemWrapper item, string str, int questType = -1,
                                   int questTypeToIgnore = -1) =>
 false;
Exemplo n.º 6
0
 public void talkToFriend(INPCWrapper n, int friendshipPointChange = 20)
 {
 }
Exemplo n.º 7
0
 public void changeFriendship(int amount, INPCWrapper n)
 {
 }
Exemplo n.º 8
0
 public bool hasItemBeenGifted(INPCWrapper npc, int item_index) => false;
Exemplo n.º 9
0
 public bool hasGiftTasteBeenRevealed(INPCWrapper npc, int item_index) => false;
Exemplo n.º 10
0
 public void onGiftGiven(INPCWrapper npc, IObjectWrapper item)
 {
 }
Exemplo n.º 11
0
 public void revealGiftTaste(INPCWrapper npc, IObjectWrapper item)
 {
 }
Exemplo n.º 12
0
 public void revealGiftTaste(INPCWrapper npc, int parent_sheet_index)
 {
 }
Exemplo n.º 13
0
 public VanillaDialogueParser(ref INPCWrapper npc, string dialogueKey)
 {
     _workingString = dialogueKey;
     _npc           = npc;
 }
 public MockDialogueWrapper(string dialogue, INPCWrapper npc)
 {
     CurrentEmotion = dialogue;
 }