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); }
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)); }
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; }
public bool checkForQuestComplete(INPCWrapper n, int number1, int number2, IItemWrapper item, string str, int questType = -1, int questTypeToIgnore = -1) => false;
public void talkToFriend(INPCWrapper n, int friendshipPointChange = 20) { }
public void changeFriendship(int amount, INPCWrapper n) { }
public bool hasItemBeenGifted(INPCWrapper npc, int item_index) => false;
public bool hasGiftTasteBeenRevealed(INPCWrapper npc, int item_index) => false;
public void onGiftGiven(INPCWrapper npc, IObjectWrapper item) { }
public void revealGiftTaste(INPCWrapper npc, IObjectWrapper item) { }
public void revealGiftTaste(INPCWrapper npc, int parent_sheet_index) { }
public VanillaDialogueParser(ref INPCWrapper npc, string dialogueKey) { _workingString = dialogueKey; _npc = npc; }
public MockDialogueWrapper(string dialogue, INPCWrapper npc) { CurrentEmotion = dialogue; }