Esempio n. 1
0
 public static bool IsUnDonatedFish(string s)
 {
     if (InternalNameToDonationName.ContainsValue(s))
     {
         return(!MasterPlayerMail.Contains($"AquariumDonated:{s}"));
     }
     return(false);
 }
Esempio n. 2
0
        public static bool IsUnDonatedFish(Item i)
        {
            if (i?.Category != -4)
            {
                return(false);
            }

            return(!MasterPlayerMail.Contains(GetDonatedMailFlag(i)));
        }
Esempio n. 3
0
        public static bool IsUnDonatedFish(Item i)
        {
            if (i?.Category != -4)
            {
                return(false);
            }

            try
            {
                return(!MasterPlayerMail.Contains(GetDonatedMailFlag(i)));
            }
            catch
            {
                _monitor.Log($"An item in the inventory \"{i.Name}\" has a category of Fish but is not a valid fish object.", LogLevel.Error);
                return(false);
            }
        }
Esempio n. 4
0
        public static bool DonateFish(Item i)
        {
            if (!IsUnDonatedFish(i))
            {
                return(false);
            }

            string donatedFlag = GetDonatedMailFlag(i);

            if (!MasterPlayerMail.Contains(donatedFlag))
            {
                if (!Context.IsMainPlayer)
                {
                    _helper.Multiplayer.SendMessage(i.Name, DonateFishMessageType,
                                                    modIDs: new[] { _manifest.UniqueID });
                    _fishSign.UpdateLastDonatedFish(i);
                    return(true);
                }

                MasterPlayerMail.Add(donatedFlag);
                string numDonated = $"AquariumFishDonated:{GetNumDonatedFish()}";
                MasterPlayerMail.Add(numDonated);
            }


            if (ModEntry.Data.ConversationTopicsOnDonate.Contains(i.Name))
            {
                foreach (var farmer in Game1.getAllFarmers())
                {
                    if (farmer.activeDialogueEvents.ContainsKey(donatedFlag))
                    {
                        farmer.activeDialogueEvents[donatedFlag] = 3;
                    }
                    else
                    {
                        farmer.activeDialogueEvents.Add(donatedFlag, 3);
                    }
                }
            }

            _fishSign.UpdateLastDonatedFish(i);

            return(true);
        }
Esempio n. 5
0
        public static bool DonateFish(Item i)
        {
            if (!IsUnDonatedFish(i))
            {
                return(false);
            }

            MasterPlayerMail.Add(GetDonatedMailFlag(i));
            string numDonated = $"AquariumFishDonated:{GetNumDonatedFish()}";

            if (!MasterPlayerMail.Contains(numDonated))
            {
                MasterPlayerMail.Add(numDonated);
            }

            _fishSign.UpdateLastDonatedFish(i);

            return(true);
        }
Esempio n. 6
0
        public static void UnlockAchievement()
        {
            if (Game1.player.achievements.Contains(AchievementEditor.AchievementId))
            {
                return;
            }

            Game1.addHUDMessage(new HUDMessage(_helper.Translation.Get("AchievementName"), true));
            Game1.playSound("achievement");
            Game1.player.achievements.Add(AchievementEditor.AchievementId);

            if (!Context.IsMainPlayer)
            {
                return;
            }
            if (!MasterPlayerMail.Contains("AquariumCompleted"))
            {
                _helper.Events.GameLoop.Saving += AddCompletionFlag;
            }
        }
Esempio n. 7
0
 public static bool IsUnDonatedFish(string s)
 {
     return(!MasterPlayerMail.Contains($"AquariumDonated:{s}"));
 }