/// <summary> /// Gets the fish that can be found on the submarine /// </summary> /// <param name="millisecondsAfterNibble"></param> /// <param name="bait"></param> /// <param name="waterDepth"></param> /// <param name="who"></param> /// <param name="baitPotency"></param> /// <returns /> public override SVOBject getFish( float millisecondsAfterNibble, int bait, int waterDepth, Farmer who, double baitPotency, Vector2 bobberTile, string locationName) { List <int> nightMarketFish = FishItem.Get(Locations.NightMarket).Select(x => x.Id).ToList(); if (Game1.random.NextDouble() < 0.15) { return(new SVOBject(nightMarketFish[0], 1, false, -1, 0)); } if (Game1.random.NextDouble() < 0.23) { return(new SVOBject(nightMarketFish[1], 1, false, -1, 0)); } if (Game1.random.NextDouble() < 0.30) { return(new SVOBject(nightMarketFish[2], 1, false, -1, 0)); } if (Game1.random.NextDouble() < 0.01) { return(new SVOBject(797, 1, false, -1, 0)); } return(new SVOBject(152, 1, false, -1, 0)); }
/// <summary> /// Gets the fish location data string for the given season /// </summary> /// <param name="season">The season</param> /// <returns /> private string GetFishLocationDataForSeason(Seasons season, string defaultString) { // This location thing is just how the game did it... probably don't need fish locations // in the backwoods, but doing this just to be safe Locations location = (Location == Locations.Backwoods) ? Locations.Mountain : Location; if (!Globals.Config.RandomizeFish) { return(defaultString); } List <int> allFishIds = FishItem.Get().Select(x => x.Id).ToList(); List <int> fishIds = FishItem.Get(location, season).Select(x => x.Id).ToList(); string[] stringParts = defaultString.Split(' '); int fishIdIndex = 0; for (int i = 0; i < stringParts.Length; i += 2) { // Skips over algae, etc. if (allFishIds.Contains(int.Parse(stringParts[i]))) { stringParts[i] = fishIds[fishIdIndex].ToString(); fishIdIndex++; } } if (fishIdIndex != fishIds.Count) { Globals.ConsoleError($"Didn't assign all the fish to {Location.ToString()} in the {season.ToString()}! Assigned {fishIdIndex} out of {fishIds.Count}."); } return(string.Join(" ", stringParts)); }
/// <summary> /// Copies a select set of info from one fish to another /// </summary> /// <param name="fromFish">The fish to copy from</param> /// <param name="toFish">The fish to copy to</param> private static void CopyFishInfo(FishItem fromFish, FishItem toFish) { toFish.Times = new Range(fromFish.Times.MinValue, fromFish.Times.MaxValue); toFish.ExcludedTimes = new Range(fromFish.ExcludedTimes.MinValue, fromFish.ExcludedTimes.MaxValue); toFish.Weathers = new List <Weather>(fromFish.Weathers); toFish.MinWaterDepth = fromFish.MinWaterDepth; toFish.DepthMultiplier = fromFish.DepthMultiplier; toFish.AvailableLocations = new List <Locations>(fromFish.AvailableLocations); toFish.AvailableSeasons = new List <Seasons>(fromFish.AvailableSeasons); }
/// <summary> /// Sets the item mappings for all the spring objects /// Includes the cherry sapling becuase that's the first fruit tree and we need to /// replace the fruit tree sapling images as well /// </summary> private void SetAllItemMappings() { PointsToItemIds = new Dictionary <Point, int>(); AddPointsToIdsMapping(FishItem.Get(true).Select(x => x.Id).ToList()); AddPointsToIdsMapping(BootData.AllBoots.Select(x => x.Id).ToList()); AddPointsToIdsMapping(CropItem.Get().Select(x => x.Id).ToList()); AddPointsToIdsMapping(CropItem.Get().Select(x => x.MatchingSeedItem.Id).ToList()); AddPointsToIdsMapping(new List <int> { (int)ObjectIndexes.CherrySapling, (int)ObjectIndexes.CoffeeBean }); }
/// <summary> /// Generates the bundle for the given season /// </summary> /// <param name="season">The season</param> /// <param name="color">The color to use</param> private void GenerateSeasonBundle(Seasons season, BundleColors color) { string seasonString = Globals.GetTranslation($"seasons-{season.ToString().ToLower()}"); seasonString = $"{seasonString[0].ToString().ToUpper()}{seasonString.Substring(1)}"; Name = Globals.GetTranslation("bundle-fishtank-seasonal", new { season = seasonString }); List <RequiredItem> potentialItems = RequiredItem.CreateList(FishItem.Get(season)); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Math.Min(Range.GetRandomValue(6, 8), RequiredItems.Count); Color = color; }
/// <summary> /// Gets the fish object info string /// </summary> /// <param name="fish">The fish</param> /// <returns /> private static string GetFishObjectInformation(FishItem fish) { string defaultObjectInfo = FishData.DefaultObjectInformation[fish.Id]; string[] objectInfoParts = defaultObjectInfo.Split('/'); objectInfoParts[0] = fish.OverrideName; objectInfoParts[4] = fish.OverrideName; objectInfoParts[5] = fish.Description; objectInfoParts[6] = fish.ObjectInformationSuffix; return(string.Join("/", objectInfoParts)); }
/// <summary> /// Writes the relevant changes to the spoiler log /// </summary> public static void WriteToSpoilerLog() { if (!Globals.Config.Fish.Randomize) { return; } List <FishItem> allRandomizedFish = FishItem.GetListAsFishItem(true); Globals.SpoilerWrite("==== FISH ===="); foreach (FishItem fish in allRandomizedFish) { Globals.SpoilerWrite($"{fish.Id}: {fish.Name}"); Globals.SpoilerWrite($"Difficulty: {fish.DartChance} - Level Req: {fish.MinFishingLevel} - Water depth: {fish.MinWaterDepth}"); Globals.SpoilerWrite(fish.Description); Globals.SpoilerWrite("---"); } Globals.SpoilerWrite(""); }
/// <summary> /// Randomizes quest items to get, people, rewards, etc. /// </summary> /// <returns>The quest information to modify</returns> public static QuestInformation Randomize() { People = NPC.QuestableNPCsList; Crops = ItemList.GetCrops(true).ToList(); Dishes = ItemList.GetCookeditems().ToList(); FishList = FishItem.Get().ToList(); Items = ItemList.GetItemsBelowDifficulty(ObtainingDifficulties.Impossible).ToList(); PopulateQuestDictionary(); PopulateMailDictionary(); Dictionary <int, string> questReplacements = new Dictionary <int, string>(); Dictionary <string, string> mailReplacements = new Dictionary <string, string>(); RandomizeQuestsAndMailStrings(questReplacements, mailReplacements); WriteToSpoilerLog(questReplacements); return(new QuestInformation(questReplacements, mailReplacements)); }
/// <summary> /// Generates the reward for the bundle /// </summary> protected override void GenerateReward() { var tackles = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.Spinner, 1), new RequiredItem((int)ObjectIndexes.DressedSpinner), new RequiredItem((int)ObjectIndexes.TrapBobber), new RequiredItem((int)ObjectIndexes.CorkBobber), new RequiredItem((int)ObjectIndexes.LeadBobber), new RequiredItem((int)ObjectIndexes.TreasureHunter) }; var potentialRewards = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.RecyclingMachine), new RequiredItem((int)ObjectIndexes.Bait, 500), new RequiredItem((int)ObjectIndexes.WildBait, 500), Globals.RNGGetRandomValueFromList(tackles), Globals.RNGGetRandomValueFromList(RequiredItem.CreateList(FishItem.Get(), 25, 50)), Globals.RNGGetRandomValueFromList(RequiredItem.CreateList(ItemList.GetUniqueBeachForagables(), 25, 50)), }; Reward = Globals.RNGGetRandomValueFromList(potentialRewards); }
/// <summary> /// Populates the bundle with the name, required items, minimum required, and color /// </summary> protected override void Populate() { BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes); List <RequiredItem> potentialItems = new List <RequiredItem>(); switch (BundleType) { case BundleTypes.FishTankSpringFish: GenerateSeasonBundle(Seasons.Spring, BundleColors.Green); break; case BundleTypes.FishTankSummerFish: GenerateSeasonBundle(Seasons.Summer, BundleColors.Red); break; case BundleTypes.FishTankFallFish: GenerateSeasonBundle(Seasons.Fall, BundleColors.Orange); break; case BundleTypes.FishTankWinterFish: GenerateSeasonBundle(Seasons.Winter, BundleColors.Cyan); break; case BundleTypes.FishTankOceanFood: Name = Globals.GetTranslation("bundle-fishtank-ocean-food"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.CrispyBass, (int)ObjectIndexes.FriedEel, (int)ObjectIndexes.AlgaeSoup, (int)ObjectIndexes.CrabCakes, (int)ObjectIndexes.SpicyEel, (int)ObjectIndexes.PaleBroth, (int)ObjectIndexes.Sashimi, (int)ObjectIndexes.MakiRoll, (int)ObjectIndexes.TomKhaSoup, (int)ObjectIndexes.BakedFish, (int)ObjectIndexes.TroutSoup, (int)ObjectIndexes.Chowder, (int)ObjectIndexes.LobsterBisque, (int)ObjectIndexes.DishOTheSea, (int)ObjectIndexes.FishStew, (int)ObjectIndexes.FriedCalamari, (int)ObjectIndexes.SalmonDinner, (int)ObjectIndexes.FishTaco }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = 4; Color = BundleColors.Yellow; break; case BundleTypes.FishTankLegendary: Name = Globals.GetTranslation("bundle-fishtank-legendary"); RequiredItems = RequiredItem.CreateList(FishItem.GetLegendaries().Cast <Item>().ToList()); MinimumRequiredItems = Range.GetRandomValue(3, 4); Color = BundleColors.Red; break; case BundleTypes.FishTankLocation: List <Locations> locations = new List <Locations> { Locations.Town, Locations.Mountain, Locations.Desert, Locations.Woods, Locations.Forest, Locations.NightMarket, Locations.Beach }; Locations location = Globals.RNGGetRandomValueFromList(locations); string locationString = Globals.GetTranslation($"fish-{location.ToString().ToLower()}-location"); Name = Globals.GetTranslation("bundle-fishtank-location", new { location = locationString }); RequiredItems = RequiredItem.CreateList(Globals.RNGGetRandomValuesFromList(FishItem.Get(location), 8)); MinimumRequiredItems = Math.Min(RequiredItems.Count, Range.GetRandomValue(2, 4)); Color = BundleColors.Blue; break; case BundleTypes.FishTankRainFish: Name = Globals.GetTranslation("bundle-fishtank-rain-fish"); RequiredItems = RequiredItem.CreateList( Globals.RNGGetRandomValuesFromList(FishItem.Get(Weather.Rainy), 8) ); MinimumRequiredItems = Math.Min(RequiredItems.Count, 4); Color = BundleColors.Blue; break; case BundleTypes.FishTankNightFish: Name = Globals.GetTranslation("bundle-fishtank-night-fish"); RequiredItems = RequiredItem.CreateList( Globals.RNGGetRandomValuesFromList(FishItem.GetNightFish(), 8) ); MinimumRequiredItems = Math.Min(RequiredItems.Count, 4); Color = BundleColors.Purple; break; case BundleTypes.FishTankQualityFish: Name = Globals.GetTranslation("bundle-fishtank-quality-fish"); potentialItems = RequiredItem.CreateList( Globals.RNGGetRandomValuesFromList(FishItem.Get(), 8) ); potentialItems.ForEach(x => x.MinimumQuality = ItemQualities.Gold); RequiredItems = potentialItems; MinimumRequiredItems = 4; Color = BundleColors.Yellow; break; case BundleTypes.FishTankBeachForagables: Name = Globals.GetTranslation("bundle-fishtank-beach-foragables"); RequiredItems = RequiredItem.CreateList( Globals.RNGGetRandomValuesFromList(ItemList.GetUniqueBeachForagables(), 6) ); Color = BundleColors.Yellow; break; case BundleTypes.FishTankFishingTools: Name = Globals.GetTranslation("bundle-fishtank-fishing-tools"); potentialItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.Spinner, 1), new RequiredItem((int)ObjectIndexes.DressedSpinner, 1), new RequiredItem((int)ObjectIndexes.TrapBobber, 1), new RequiredItem((int)ObjectIndexes.CorkBobber, 1), new RequiredItem((int)ObjectIndexes.LeadBobber, 1), new RequiredItem((int)ObjectIndexes.TreasureHunter, 1), new RequiredItem((int)ObjectIndexes.Bait, 25, 50), new RequiredItem((int)ObjectIndexes.WildBait, 10, 20) }; RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 4); Color = BundleColors.Blue; break; case BundleTypes.FishTankUnique: Name = Globals.GetTranslation("bundle-fishtank-unique"); List <Item> nightFish = FishItem.Get(Locations.NightMarket); List <Item> minesFish = FishItem.Get(Locations.UndergroundMine); List <Item> desertFish = FishItem.Get(Locations.Desert); List <Item> woodsFish = FishItem.Get(Locations.Woods); RequiredItems = new List <RequiredItem> { new RequiredItem(Globals.RNGGetRandomValueFromList(nightFish)), new RequiredItem(Globals.RNGGetRandomValueFromList(minesFish)), new RequiredItem(Globals.RNGGetRandomValueFromList(desertFish)), new RequiredItem(Globals.RNGGetRandomValueFromList(woodsFish)) }; MinimumRequiredItems = Range.GetRandomValue(RequiredItems.Count - 1, RequiredItems.Count); Color = BundleColors.Cyan; break; case BundleTypes.FishTankColorBlue: Name = Globals.GetTranslation("bundle-fishtank-blue"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.Aquamarine, (int)ObjectIndexes.Diamond, (int)ObjectIndexes.FrozenTear, (int)ObjectIndexes.DwarfScrollIII, (int)ObjectIndexes.ElvishJewelry, (int)ObjectIndexes.GlassShards, (int)ObjectIndexes.Anchovy, (int)ObjectIndexes.Tuna, (int)ObjectIndexes.Sardine, (int)ObjectIndexes.Bream, (int)ObjectIndexes.Salmon, (int)ObjectIndexes.Herring, (int)ObjectIndexes.Squid, (int)ObjectIndexes.IcePip, (int)ObjectIndexes.Sturgeon, (int)ObjectIndexes.Albacore, (int)ObjectIndexes.MidnightSquid, (int)ObjectIndexes.SpookFish, (int)ObjectIndexes.Glacierfish, (int)ObjectIndexes.Clam, (int)ObjectIndexes.Periwinkle, (int)ObjectIndexes.JojaCola, (int)ObjectIndexes.BrokenGlasses, (int)ObjectIndexes.BrokenCD, (int)ObjectIndexes.BlueberryTart, (int)ObjectIndexes.Sugar, (int)ObjectIndexes.BasicRetainingSoil, (int)ObjectIndexes.QualityRetainingSoil, (int)ObjectIndexes.RainbowShell, (int)ObjectIndexes.BlueSlimeEgg, (int)ObjectIndexes.CrystalFruit, (int)ObjectIndexes.SturdyRing, (int)ObjectIndexes.AquamarineRing, (int)ObjectIndexes.FrozenGeode, (int)ObjectIndexes.Opal, (int)ObjectIndexes.Aerinite, (int)ObjectIndexes.Kyanite, (int)ObjectIndexes.GhostCrystal, (int)ObjectIndexes.Celestine, (int)ObjectIndexes.Soapstone, (int)ObjectIndexes.Slate, (int)ObjectIndexes.Spinner, (int)ObjectIndexes.WarpTotemBeach, (int)ObjectIndexes.Battery }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Blue; break; case BundleTypes.FishTankColorPurple: Name = Globals.GetTranslation("bundle-fishtank-purple"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.Amethyst, (int)ObjectIndexes.AncientDrum, (int)ObjectIndexes.SuperCucumber, (int)ObjectIndexes.PumpkinSoup, (int)ObjectIndexes.RootsPlatter, (int)ObjectIndexes.IridiumBar, (int)ObjectIndexes.Wine, (int)ObjectIndexes.IridiumOre, (int)ObjectIndexes.SeaUrchin, (int)ObjectIndexes.SweetPea, (int)ObjectIndexes.WildPlum, (int)ObjectIndexes.Blackberry, (int)ObjectIndexes.Crocus, (int)ObjectIndexes.Vinegar, (int)ObjectIndexes.PurpleMushroom, (int)ObjectIndexes.SpeedGro, (int)ObjectIndexes.DeluxeSpeedGro, (int)ObjectIndexes.IridiumBand, (int)ObjectIndexes.AmethystRing, (int)ObjectIndexes.FireOpal, (int)ObjectIndexes.Fluorapatite, (int)ObjectIndexes.Obsidian, (int)ObjectIndexes.FairyStone, (int)ObjectIndexes.BlackberryCobbler, (int)ObjectIndexes.IridiumSprinkler, (int)ObjectIndexes.DressedSpinner }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Purple; break; } }
public static void Randomize(EditedObjectInformation editedObjectInfo) { List <FishItem> legendaryFish = FishItem.GetLegendaries().Cast <FishItem>().ToList(); List <FishItem> normalFish = FishItem.Get().Cast <FishItem>().ToList(); List <FishItem> normalFishCopy = new List <FishItem>(); foreach (FishItem fish in normalFish) { FishItem fishInfo = new FishItem(fish.Id, true); CopyFishInfo(fish, fishInfo); normalFishCopy.Add(fishInfo); } List <string> fishNames = NameAndDescriptionRandomizer.GenerateFishNames(normalFish.Count + legendaryFish.Count); foreach (FishItem fish in normalFish) { FishItem fishToReplace = Globals.RNGGetAndRemoveRandomValueFromList(normalFishCopy); int newDartChance = GenerateRandomFishDifficulty(); FishBehaviorType newBehaviorType = Globals.RNGGetRandomValueFromList( Enum.GetValues(typeof(FishBehaviorType)).Cast <FishBehaviorType>().ToList()); string newName = Globals.RNGGetAndRemoveRandomValueFromList(fishNames); if (!Globals.Config.Fish.Randomize) { continue; } CopyFishInfo(fishToReplace, fish); fish.DartChance = newDartChance; fish.BehaviorType = newBehaviorType; fish.OverrideName = newName; if (fish.IsMinesFish) { if (!fish.AvailableLocations.Contains(Locations.UndergroundMine)) { fish.AvailableLocations.Add(Locations.UndergroundMine); } } if (Globals.Config.Fish.Randomize) { if (fish.IsSubmarineOnlyFish) { fish.DifficultyToObtain = ObtainingDifficulties.RareItem; } else { fish.DifficultyToObtain = ObtainingDifficulties.LargeTimeRequirements; } } editedObjectInfo.FishReplacements.Add(fish.Id, fish.ToString()); editedObjectInfo.ObjectInformationReplacements.Add(fish.Id, GetFishObjectInformation(fish)); } foreach (FishItem fish in legendaryFish) { FishBehaviorType newBehaviorType = Globals.RNGGetRandomValueFromList( Enum.GetValues(typeof(FishBehaviorType)).Cast <FishBehaviorType>().ToList()); string newName = Globals.RNGGetAndRemoveRandomValueFromList(fishNames); if (!Globals.Config.Fish.Randomize) { continue; } fish.BehaviorType = newBehaviorType; fish.OverrideName = newName; editedObjectInfo.FishReplacements.Add(fish.Id, fish.ToString()); editedObjectInfo.ObjectInformationReplacements.Add(fish.Id, GetFishObjectInformation(fish)); } WriteToSpoilerLog(); }
/// <summary> /// Creates a bundle for the crafts room /// </summary> protected override void Populate() { // Force one resource bundle so that there's one possible bundle to complete if (!RoomBundleTypes.Contains(BundleTypes.CraftingResource)) { BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes); } else { RoomBundleTypes.Remove(BundleTypes.CraftingResource); BundleType = BundleTypes.CraftingResource; } List <RequiredItem> potentialItems; int numberOfChoices; switch (BundleType) { case BundleTypes.CraftingResource: Name = Globals.GetTranslation("bundle-crafting-resource"); RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.Wood, 100, 250), new RequiredItem((int)ObjectIndexes.Stone, 100, 250), new RequiredItem((int)ObjectIndexes.Fiber, 10, 50), new RequiredItem((int)ObjectIndexes.Clay, 10, 50), new RequiredItem((int)ObjectIndexes.Hardwood, 1, 10) }; Color = BundleColors.Orange; break; case BundleTypes.CraftingHappyCrops: Name = Globals.GetTranslation("bundle-crafting-happy-crops"); RequiredItem qualityCrop = new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetCrops())); qualityCrop.MinimumQuality = ItemQualities.Gold; potentialItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.Sprinkler, 1, 5), new RequiredItem((int)ObjectIndexes.QualitySprinkler, 1, 5), new RequiredItem((int)ObjectIndexes.IridiumSprinkler, 1), new RequiredItem((int)ObjectIndexes.BasicFertilizer, 10, 20), new RequiredItem((int)ObjectIndexes.QualityFertilizer, 10, 20), new RequiredItem((int)ObjectIndexes.BasicRetainingSoil, 10, 20), new RequiredItem((int)ObjectIndexes.QualityRetainingSoil, 10, 20), qualityCrop }; numberOfChoices = Range.GetRandomValue(6, 8); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, numberOfChoices); MinimumRequiredItems = Range.GetRandomValue(numberOfChoices - 2, numberOfChoices); Color = BundleColors.Green; break; case BundleTypes.CraftingTree: Name = Globals.GetTranslation("bundle-crafting-tree"); potentialItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.MapleSeed, 1, 5), new RequiredItem((int)ObjectIndexes.Acorn, 1, 5), new RequiredItem((int)ObjectIndexes.PineCone, 1), new RequiredItem((int)ObjectIndexes.OakResin, 1), new RequiredItem((int)ObjectIndexes.MapleSyrup, 1), new RequiredItem((int)ObjectIndexes.PineTar, 1), new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetFruit()), 1), new RequiredItem((int)ObjectIndexes.Wood, 100, 200), new RequiredItem((int)ObjectIndexes.Hardwood, 25, 50), new RequiredItem((int)ObjectIndexes.Driftwood, 5, 10), }; numberOfChoices = Range.GetRandomValue(6, 8); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, numberOfChoices); MinimumRequiredItems = Range.GetRandomValue(numberOfChoices - 2, numberOfChoices); Color = BundleColors.Green; break; case BundleTypes.CraftingTotems: Name = Globals.GetTranslation("bundle-crafting-totems"); RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.WarpTotemFarm), new RequiredItem((int)ObjectIndexes.WarpTotemBeach), new RequiredItem((int)ObjectIndexes.WarpTotemMountains), new RequiredItem((int)ObjectIndexes.WarpTotemDesert), new RequiredItem((int)ObjectIndexes.RainTotem), }; MinimumRequiredItems = Range.GetRandomValue(3, 4); Color = BundleColors.Red; break; case BundleTypes.CraftingBindle: Name = Globals.GetTranslation("bundle-crafting-bindle"); potentialItems = new List <RequiredItem> { new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetCookeditems())), new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetForagables())), new RequiredItem(Globals.RNGGetRandomValueFromList(FishItem.Get())), new RequiredItem(Globals.RNGGetRandomValueFromList( ItemList.Items.Values.Where(x => x.Id > 0 && x.DifficultyToObtain <= ObtainingDifficulties.LargeTimeRequirements).ToList()).Id ), }; RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.ChewingStick), new RequiredItem((int)ObjectIndexes.Cloth), }; RequiredItems.AddRange(Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(2, 3))); MinimumRequiredItems = RequiredItems.Count - 1; Color = BundleColors.Yellow; break; case BundleTypes.CraftingSpringForaging: GenerateForagingBundle(Seasons.Spring, BundleColors.Green); break; case BundleTypes.CraftingSummerForaging: GenerateForagingBundle(Seasons.Summer, BundleColors.Red); break; case BundleTypes.CraftingFallForaging: GenerateForagingBundle(Seasons.Fall, BundleColors.Orange); break; case BundleTypes.CraftingWinterForaging: GenerateForagingBundle(Seasons.Winter, BundleColors.Cyan); break; case BundleTypes.CraftingColorOrange: Name = Globals.GetTranslation("bundle-crafting-orange"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.RustySpur, (int)ObjectIndexes.RustyCog, (int)ObjectIndexes.Lobster, (int)ObjectIndexes.Crab, (int)ObjectIndexes.GlazedYams, (int)ObjectIndexes.FriedEel, (int)ObjectIndexes.SpicyEel, (int)ObjectIndexes.PaleAle, (int)ObjectIndexes.Chanterelle, (int)ObjectIndexes.CopperBar, (int)ObjectIndexes.QualityFertilizer, (int)ObjectIndexes.CopperOre, (int)ObjectIndexes.NautilusShell, (int)ObjectIndexes.SpiceBerry, (int)ObjectIndexes.WinterRoot, (int)ObjectIndexes.Tigerseye, (int)ObjectIndexes.Baryte, (int)ObjectIndexes.LemonStone, (int)ObjectIndexes.Orpiment, (int)ObjectIndexes.PumpkinPie, (int)ObjectIndexes.Apricot, (int)ObjectIndexes.Orange, (int)ObjectIndexes.LobsterBisque, (int)ObjectIndexes.CrabCakes, (int)ObjectIndexes.JackOLantern }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Orange; break; case BundleTypes.CraftingColorYellow: Name = Globals.GetTranslation("bundle-crafting-yellow"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.Daffodil, (int)ObjectIndexes.Dandelion, (int)ObjectIndexes.Topaz, (int)ObjectIndexes.Sap, (int)ObjectIndexes.DwarfScrollIV, (int)ObjectIndexes.DriedStarfish, (int)ObjectIndexes.BoneFlute, (int)ObjectIndexes.GoldenMask, (int)ObjectIndexes.GoldenRelic, (int)ObjectIndexes.StrangeDoll1, (int)ObjectIndexes.Hay, (int)ObjectIndexes.Omelet, (int)ObjectIndexes.CheeseCauliflower, (int)ObjectIndexes.FriedCalamari, (int)ObjectIndexes.LuckyLunch, (int)ObjectIndexes.Pizza, (int)ObjectIndexes.FishTaco, (int)ObjectIndexes.Spaghetti, (int)ObjectIndexes.Tortilla, (int)ObjectIndexes.FarmersLunch, (int)ObjectIndexes.Oil, (int)ObjectIndexes.Morel, (int)ObjectIndexes.DuckMayonnaise, (int)ObjectIndexes.MapleSeed, (int)ObjectIndexes.GoldBar, (int)ObjectIndexes.Honey, (int)ObjectIndexes.Beer, (int)ObjectIndexes.MuscleRemedy, (int)ObjectIndexes.BasicFertilizer, (int)ObjectIndexes.GoldenPumpkin, (int)ObjectIndexes.GoldOre, (int)ObjectIndexes.StrawFloor, (int)ObjectIndexes.Cheese, (int)ObjectIndexes.TruffleOil, (int)ObjectIndexes.CoffeeBean, (int)ObjectIndexes.TreasureChest, (int)ObjectIndexes.Mead, (int)ObjectIndexes.GlowRing, (int)ObjectIndexes.SmallGlowRing, (int)ObjectIndexes.RingOfYoba, (int)ObjectIndexes.TopazRing, (int)ObjectIndexes.Calcite, (int)ObjectIndexes.Jagoite, (int)ObjectIndexes.Pyrite, (int)ObjectIndexes.Sandstone, (int)ObjectIndexes.Hematite, (int)ObjectIndexes.MapleSyrup, (int)ObjectIndexes.SolarEssence }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Yellow; break; } }
/// <summary> /// Creates a bundle for the pantry /// </summary> protected override void Populate() { BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes); List <RequiredItem> potentialItems = new List <RequiredItem>(); switch (BundleType) { case BundleTypes.PantryAnimal: Name = Globals.GetTranslation("bundle-pantry-animal"); potentialItems = RequiredItem.CreateList(ItemList.GetAnimalProducts()); potentialItems.Add(new RequiredItem((int)ObjectIndexes.Hay, 25, 50)); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(6, 8)); MinimumRequiredItems = Range.GetRandomValue(RequiredItems.Count - 2, RequiredItems.Count); Color = BundleColors.Orange; break; case BundleTypes.PantryQualityCrops: Name = Globals.GetTranslation("bundle-pantry-quality-crops"); potentialItems = RequiredItem.CreateList(ItemList.GetCrops()); potentialItems.ForEach(x => x.MinimumQuality = ItemQualities.Gold); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(4, 6); Color = BundleColors.Green; break; case BundleTypes.PantryQualityForagables: Name = Globals.GetTranslation("bundle-pantry-quality-foragables"); potentialItems = RequiredItem.CreateList(ItemList.GetForagables()); potentialItems.ForEach(x => x.MinimumQuality = ItemQualities.Gold); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(4, 6); Color = BundleColors.Green; break; case BundleTypes.PantryCooked: Name = Globals.GetTranslation("bundle-pantry-cooked"); potentialItems = RequiredItem.CreateList(ItemList.GetCookeditems()); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(6, 8)); MinimumRequiredItems = Range.GetRandomValue(3, 4); Color = BundleColors.Green; break; case BundleTypes.PantryFlower: Name = Globals.GetTranslation("bundle-pantry-flower"); potentialItems = RequiredItem.CreateList(ItemList.GetFlowers()); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(6, 8)); MinimumRequiredItems = RequiredItems.Count - 2; Color = BundleColors.Green; break; case BundleTypes.PantrySpringCrops: GenerateBundleForSeasonCrops(Seasons.Spring, BundleColors.Green); break; case BundleTypes.PantrySummerCrops: GenerateBundleForSeasonCrops(Seasons.Summer, BundleColors.Red); break; case BundleTypes.PantryFallCrops: GenerateBundleForSeasonCrops(Seasons.Fall, BundleColors.Orange); break; case BundleTypes.PantryEgg: Name = Globals.GetTranslation("bundle-pantry-egg"); potentialItems = RequiredItem.CreateList( ItemList.Items.Values.Where(x => x.Name.Contains("Egg") && x.Id > -4).ToList()); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(RequiredItems.Count - 3, RequiredItems.Count - 2); Color = BundleColors.Yellow; break; case BundleTypes.PantryRareFoods: Name = Globals.GetTranslation("bundle-pantry-rare-foods"); SeedItem starFruitSeed = (SeedItem)ItemList.Items[(int)ObjectIndexes.StarfruitSeeds]; SeedItem gemBerrySeed = (SeedItem)ItemList.Items[(int)ObjectIndexes.RareSeed]; RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.AncientFruit), new RequiredItem(starFruitSeed.CropGrowthInfo.CropId), new RequiredItem(gemBerrySeed.CropGrowthInfo.CropId), }; MinimumRequiredItems = 2; Color = BundleColors.Blue; break; case BundleTypes.PantryDesert: Name = Globals.GetTranslation("bundle-pantry-desert"); RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.IridiumOre, 5), Globals.RNGGetRandomValueFromList(new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.GoldenMask), new RequiredItem((int)ObjectIndexes.GoldenRelic), }), Globals.RNGGetRandomValueFromList(RequiredItem.CreateList(FishItem.Get(Locations.Desert))), Globals.RNGGetRandomValueFromList(RequiredItem.CreateList(ItemList.GetUniqueDesertForagables(), 1, 3)), new RequiredItem((int)ObjectIndexes.StarfruitSeeds, 5) }; MinimumRequiredItems = 4; Color = BundleColors.Yellow; break; case BundleTypes.PantryDessert: Name = Globals.GetTranslation("bundle-pantry-dessert"); potentialItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.CranberryCandy), new RequiredItem((int)ObjectIndexes.PlumPudding), new RequiredItem((int)ObjectIndexes.PinkCake), new RequiredItem((int)ObjectIndexes.PumpkinPie), new RequiredItem((int)ObjectIndexes.RhubarbPie), new RequiredItem((int)ObjectIndexes.Cookie), new RequiredItem((int)ObjectIndexes.IceCream), new RequiredItem((int)ObjectIndexes.MinersTreat), new RequiredItem((int)ObjectIndexes.BlueberryTart), new RequiredItem((int)ObjectIndexes.BlackberryCobbler), new RequiredItem((int)ObjectIndexes.MapleBar), }; RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = 4; Color = BundleColors.Cyan; break; case BundleTypes.PantryMexicanFood: Name = Globals.GetTranslation("bundle-pantry-mexican-food"); RequiredItems = new List <RequiredItem> { new RequiredItem((int)ObjectIndexes.Tortilla), new RequiredItem((int)ObjectIndexes.Corn, 1, 5), new RequiredItem((int)ObjectIndexes.Tomato, 1, 5), new RequiredItem((int)ObjectIndexes.HotPepper, 1, 5), new RequiredItem((int)ObjectIndexes.FishTaco), new RequiredItem((int)ObjectIndexes.Rice), new RequiredItem((int)ObjectIndexes.Cheese), }; MinimumRequiredItems = Range.GetRandomValue(4, 5); Color = BundleColors.Red; break; case BundleTypes.PantryColorBrown: Name = Globals.GetTranslation("bundle-pantry-brown"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.WildHorseradish, (int)ObjectIndexes.CaveCarrot, (int)ObjectIndexes.EarthCrystal, (int)ObjectIndexes.Coconut, (int)ObjectIndexes.Torch, (int)ObjectIndexes.ChippedAmphora, (int)ObjectIndexes.ChewingStick, (int)ObjectIndexes.AncientSeed, (int)ObjectIndexes.DwarvishHelm, (int)ObjectIndexes.Driftwood, (int)ObjectIndexes.BrownEgg, (int)ObjectIndexes.LargeBrownEgg, (int)ObjectIndexes.BakedFish, (int)ObjectIndexes.ParsnipSoup, (int)ObjectIndexes.CompleteBreakfast, (int)ObjectIndexes.FriedMushroom, (int)ObjectIndexes.CarpSurprise, (int)ObjectIndexes.Hashbrowns, (int)ObjectIndexes.Pancakes, (int)ObjectIndexes.CrispyBass, (int)ObjectIndexes.Bread, (int)ObjectIndexes.TomKhaSoup, (int)ObjectIndexes.ChocolateCake, (int)ObjectIndexes.Cookie, (int)ObjectIndexes.EggplantParmesan, (int)ObjectIndexes.SurvivalBurger, (int)ObjectIndexes.WheatFlour, (int)ObjectIndexes.HardwoodFence, (int)ObjectIndexes.Acorn, (int)ObjectIndexes.PineCone, (int)ObjectIndexes.WoodFence, (int)ObjectIndexes.Gate, (int)ObjectIndexes.WoodFloor, (int)ObjectIndexes.Clay, (int)ObjectIndexes.WeatheredFloor, (int)ObjectIndexes.Wood, (int)ObjectIndexes.Coffee, (int)ObjectIndexes.CommonMushroom, (int)ObjectIndexes.WoodPath, (int)ObjectIndexes.Hazelnut, (int)ObjectIndexes.Truffle, (int)ObjectIndexes.Geode, (int)ObjectIndexes.Mudstone, (int)ObjectIndexes.AmphibianFossil, (int)ObjectIndexes.PalmFossil, (int)ObjectIndexes.PlumPudding, (int)ObjectIndexes.RoastedHazelnuts, (int)ObjectIndexes.Bruschetta, (int)ObjectIndexes.QualitySprinkler, (int)ObjectIndexes.PoppyseedMuffin, (int)ObjectIndexes.RainTotem, (int)ObjectIndexes.WarpTotemMountains, (int)ObjectIndexes.CorkBobber, (int)ObjectIndexes.PineTar, (int)ObjectIndexes.MapleBar }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Orange; break; case BundleTypes.PantryColorGreen: Name = Globals.GetTranslation("bundle-pantry-green"); potentialItems = RequiredItem.CreateList(new List <int> { (int)ObjectIndexes.Emerald, (int)ObjectIndexes.Jade, (int)ObjectIndexes.CactusFruit, (int)ObjectIndexes.DwarfScrollII, (int)ObjectIndexes.StrangeDoll2, (int)ObjectIndexes.Snail, (int)ObjectIndexes.Seaweed, (int)ObjectIndexes.GreenAlgae, (int)ObjectIndexes.Salad, (int)ObjectIndexes.BeanHotpot, (int)ObjectIndexes.TroutSoup, (int)ObjectIndexes.IceCream, (int)ObjectIndexes.Stuffing, (int)ObjectIndexes.FiddleheadFern, (int)ObjectIndexes.GrassStarter, (int)ObjectIndexes.Pickles, (int)ObjectIndexes.Juice, (int)ObjectIndexes.FieldSnack, (int)ObjectIndexes.DuckFeather, (int)ObjectIndexes.AlgaeSoup, (int)ObjectIndexes.SlimeCharmerRing, (int)ObjectIndexes.BurglarsRing, (int)ObjectIndexes.JadeRing, (int)ObjectIndexes.EmeraldRing, (int)ObjectIndexes.Alamite, (int)ObjectIndexes.Geminite, (int)ObjectIndexes.Jamborite, (int)ObjectIndexes.Malachite, (int)ObjectIndexes.PetrifiedSlime, (int)ObjectIndexes.OceanStone, (int)ObjectIndexes.Coleslaw, (int)ObjectIndexes.FiddleheadRisotto, (int)ObjectIndexes.GreenSlimeEgg, (int)ObjectIndexes.WarpTotemFarm, (int)ObjectIndexes.OakResin, (int)ObjectIndexes.FishStew, (int)ObjectIndexes.Escargot, (int)ObjectIndexes.Slime, (int)ObjectIndexes.Fiber, (int)ObjectIndexes.OilOfGarlic, (int)ObjectIndexes.WildBait }); RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, 8); MinimumRequiredItems = Range.GetRandomValue(3, 6); Color = BundleColors.Green; break; } }
/// <summary> /// Gets the fish location data string for all the seasons /// Note that the original behaviors for carps and catfish were changed here for ease /// of ensuring that all locations have all the fish they need /// </summary> /// <returns /> private string GetFishLocationData() { Locations location = (Location == Locations.Backwoods) ? Locations.Mountain : Location; switch (location) { case Locations.Desert: string desertDefaultString = "153 -1 164 -1 165 -1"; string desertSpringData = GetFishLocationDataForSeason(Seasons.Spring, desertDefaultString); string desertSummerData = GetFishLocationDataForSeason(Seasons.Summer, desertDefaultString); string desertFallData = GetFishLocationDataForSeason(Seasons.Fall, desertDefaultString); string desertWinterData = GetFishLocationDataForSeason(Seasons.Winter, desertDefaultString); return($"{desertSpringData}/{desertSummerData}/{desertFallData}/{desertWinterData}"); case Locations.BusStop: return("-1/-1/-1/-1"); case Locations.Forest: string forestSpringData = GetFishLocationDataForSeason(Seasons.Spring, "153 -1 145 0 143 0 137 1 132 0 706 0 702 0"); string forestSummerData = GetFishLocationDataForSeason(Seasons.Summer, "153 -1 145 0 144 -1 138 0 132 0 706 0 704 0 702 0"); string forestFallData = GetFishLocationDataForSeason(Seasons.Fall, "143 0 153 -1 140 -1 139 0 137 1 132 0 706 0 702 0 699 0"); string forestWinterData = GetFishLocationDataForSeason(Seasons.Winter, "699 0 143 0 153 -1 144 -1 141 -1 140 -1 132 0 707 0 702 0"); return($"{forestSpringData}/{forestSummerData}/{forestFallData}/{forestWinterData}"); case Locations.Town: string townSpringData = GetFishLocationDataForSeason(Seasons.Spring, "137 -1 132 -1 143 -1 145 -1 153 -1 706 -1"); string townSummerData = GetFishLocationDataForSeason(Seasons.Summer, "138 -1 132 -1 144 -1 145 -1 153 -1 706 -1"); string townFallData = GetFishLocationDataForSeason(Seasons.Fall, "139 -1 137 -1 132 -1 140 -1 143 -1 153 -1 706 -1 699 -1"); string townWinterData = GetFishLocationDataForSeason(Seasons.Winter, "132 -1 140 -1 141 -1 143 -1 144 -1 153 -1 707 -1 699 -1"); return($"{townSpringData}/{townSummerData}/{townFallData}/{townWinterData}"); case Locations.Mountain: string mountainSpringData = GetFishLocationDataForSeason(Seasons.Spring, "136 -1 142 -1 153 -1 702 -1 700 -1 163 -1"); string mountainSummerData = GetFishLocationDataForSeason(Seasons.Summer, "136 -1 142 -1 153 -1 138 -1 702 -1 700 -1 698 -1"); string mountainFallData = GetFishLocationDataForSeason(Seasons.Fall, "136 -1 140 -1 142 -1 153 -1 702 -1 700 -1"); string mountainWinterData = GetFishLocationDataForSeason(Seasons.Winter, "136 -1 140 -1 141 -1 153 -1 707 -1 702 -1 700 -1 698 -1"); return($"{mountainSpringData}/{mountainSummerData}/{mountainFallData}/{mountainWinterData}"); case Locations.Railroad: return($"-1/-1/-1/-1"); case Locations.Beach: string beachSpringData = GetFishLocationDataForSeason(Seasons.Spring, "129 -1 131 -1 147 -1 148 -1 152 -1 708 -1"); string beachSummerData = GetFishLocationDataForSeason(Seasons.Summer, "128 -1 130 -1 146 -1 149 -1 150 -1 152 -1 155 -1 708 -1 701 -1"); string beachFallData = GetFishLocationDataForSeason(Seasons.Fall, "129 -1 131 -1 148 -1 150 -1 152 -1 154 -1 155 -1 705 -1 701 -1"); string beachWinterData = GetFishLocationDataForSeason(Seasons.Winter, "708 -1 130 -1 131 -1 146 -1 147 -1 150 -1 151 -1 152 -1 154 -1 705 -1"); return($"{beachSpringData}/{beachSummerData}/{beachFallData}/{beachWinterData}"); case Locations.Woods: string woodsDefaultString = "734 -1 142 -1 143 -1"; string woodsSpringData = GetFishLocationDataForSeason(Seasons.Spring, woodsDefaultString); string woodsSummerData = GetFishLocationDataForSeason(Seasons.Summer, "734 -1 142 -1 157 -1"); string woodsFallData = GetFishLocationDataForSeason(Seasons.Fall, woodsDefaultString); string woodsWinterData = GetFishLocationDataForSeason(Seasons.Winter, "734 -1 157 -1 143 -1"); return($"{woodsSpringData}/{woodsSummerData}/{woodsFallData}/{woodsWinterData}"); case Locations.UndergroundMine: string fishString = "153 -1 157 -1 "; List <int> undergroundFish = FishItem.Get(Locations.UndergroundMine) .Where(x => !new int[] { 158, 161, 162 }.Contains(x.Id)) // The three mines fish that are not ghost fish .Select(x => x.Id) .ToList(); fishString += $"{string.Join(" -1 ", undergroundFish)} -1"; return($"{fishString}/{fishString}/{fishString}/{fishString}"); default: Globals.ConsoleError($"No location data found for {LocationName}!"); return("-1/-1/-1/-1/-1"); } }
/// <summary> /// Populates the given fish with the default info /// </summary> /// <param name="fish">The fish</param> public static void FillDefaultFishInfo(FishItem fish) { string input = DefaultStringData[fish.Id]; string[] fields = input.Split('/'); if (fields.Length != 13) { Globals.ConsoleError($"Incorrect number of fields when parsing fish with input: {input}"); return; } // Name // Skipped because it's computed from the id // Dart Chance if (!int.TryParse(fields[(int)FishFields.DartChance], out int dartChance)) { Globals.ConsoleError($"Could not parse the dart chance when parsing fish with input: {input}"); return; } fish.DartChance = dartChance; // Behavior type string behaviorTypeString = fields[(int)FishFields.BehaviorType]; switch (behaviorTypeString) { case "mixed": fish.BehaviorType = FishBehaviorType.Mixed; break; case "dart": fish.BehaviorType = FishBehaviorType.Dart; break; case "smooth": fish.BehaviorType = FishBehaviorType.Smooth; break; case "floater": fish.BehaviorType = FishBehaviorType.Floater; break; case "sinker": fish.BehaviorType = FishBehaviorType.Sinker; break; default: Globals.ConsoleError($"Fish behavior type {behaviorTypeString} not found when parsing fish with input: {input}"); return; } // Min Size if (!int.TryParse(fields[(int)FishFields.MinSize], out int minSize)) { Globals.ConsoleError($"Could not parse the min size when parsing fish with input: {input}"); return; } fish.MinSize = minSize; // Max Size if (!int.TryParse(fields[(int)FishFields.MaxSize], out int maxSize)) { Globals.ConsoleError($"Could not parse the max size when parsing fish with input: {input}"); return; } fish.MaxSize = maxSize; // Times List <int> times = ParseTimes(fields[(int)FishFields.Times]); if (times.Count == 2) { fish.Times = new Range(times[0], times[1]); } else if (times.Count == 4) { if (times[0] < times[1] && times[1] < times[2] && times[2] < times[3]) { fish.Times = new Range(times[0], times[3]); fish.ExcludedTimes = new Range(times[1], times[2]); } else { Globals.ConsoleError($"Times are not in chronological order when parsing fish with input: {input}"); } } // Seasons string[] seasonStrings = fields[(int)FishFields.Seasons].Split(' '); foreach (string seasonString in seasonStrings) { switch (seasonString.ToLower()) { case "spring": fish.AvailableSeasons.Add(Seasons.Spring); break; case "summer": fish.AvailableSeasons.Add(Seasons.Summer); break; case "fall": fish.AvailableSeasons.Add(Seasons.Fall); break; case "winter": fish.AvailableSeasons.Add(Seasons.Winter); break; default: Globals.ConsoleError($"Tries to parse {seasonString} into a season when parsing fish with input: {input}"); return; } } // Weather string weather = fields[(int)FishFields.Weather]; switch (weather) { case "sunny": fish.Weathers.Add(Weather.Sunny); break; case "rainy": fish.Weathers.Add(Weather.Rainy); break; case "both": fish.Weathers.Add(Weather.Sunny); fish.Weathers.Add(Weather.Rainy); break; default: Globals.ConsoleError($"Unexpected weather string when parsing fish with input: {input}"); break; } // Unused fish.UnusedData = fields[(int)FishFields.Unused]; // Min Water Depth, if (!int.TryParse(fields[(int)FishFields.MinWaterDepth], out int minWaterDepth)) { Globals.ConsoleError($"Could not parse the min water depth when parsing fish with input: {input}"); return; } fish.MinWaterDepth = minWaterDepth; // Spawn Multiplier, if (!double.TryParse(fields[(int)FishFields.SpawnMultiplier], out double spawnMultiplier)) { Globals.ConsoleError($"Could not parse the spawn multiplier when parsing fish with input: {input}"); return; } fish.SpawnMultiplier = spawnMultiplier; // Depth Multiplier, if (!double.TryParse(fields[(int)FishFields.DepthMultiplier], out double depthMultiplier)) { Globals.ConsoleError($"Could not parse the depth multiplier when parsing fish with input: {input}"); return; } fish.DepthMultiplier = depthMultiplier; // Min Fishing Level if (!int.TryParse(fields[(int)FishFields.MinFishingLevel], out int minFishingLevel)) { Globals.ConsoleError($"Could not parse the min fishing level when parsing fish with input: {input}"); return; } fish.MinFishingLevel = minFishingLevel; }
/// <summary> /// Gets the fish that can be found on the submarine /// </summary> /// <param name="millisecondsAfterNibble"></param> /// <param name="bait"></param> /// <param name="waterDepth"></param> /// <param name="who"></param> /// <param name="baitPotency"></param> /// <returns /> public override SVOBject getFish( float millisecondsAfterNibble, int bait, int waterDepth, Farmer who, double baitPotency, Vector2 bobberTile, string locationName) { List <int> nightMarketFish = FishItem.Get(Locations.NightMarket).Select(x => x.Id).ToList(); bool flag = false; if (who != null && who.CurrentTool is FishingRod && (who.CurrentTool as FishingRod).getBobberAttachmentIndex() == 856) { flag = true; } // Blobfish if (Game1.random.NextDouble() < 0.1 + (flag ? 0.1 : 0.0)) { return(new SVOBject(nightMarketFish[0], 1, false, -1, 0)); } // SpookFish if (Game1.random.NextDouble() < 0.18 + (flag ? 0.05 : 0.0)) { return(new SVOBject(nightMarketFish[1], 1, false, -1, 0)); } // MidnightSquid if (Game1.random.NextDouble() < 0.28) { return(new SVOBject(nightMarketFish[2], 1, false, -1, 0)); } // Sea cucumber, super cucumber and octopus; only included if fish aren't randomized if (!Globals.Config.Fish.Randomize) { if (Game1.random.NextDouble() < 0.1) { return(new SVOBject(154, 1, false, -1, 0)); } if (Game1.random.NextDouble() < 0.08 + (flag ? 0.1 : 0.0)) { return(new SVOBject(155, 1, false, -1, 0)); } if (Game1.random.NextDouble() < 0.05) { return(new SVOBject(149, 1, false, -1, 0)); } } // Pearl if (Game1.random.NextDouble() < 0.01 + (flag ? 0.02 : 0.0)) { return(new SVOBject(797, 1, false, -1, 0)); } // Seaweed return(new SVOBject(152, 1, false, -1, 0)); }