/// <summary>
        /// Sets the ToString information for the given crops
        /// </summary>
        /// <param name="editedObjectInfo">The object info containing changes to apply</param>
        /// <param name="crops">The crops to set</param>
        /// <param name="randomNames">The random names to give the crops</param>
        private static void SetCropAndSeedInformation(
            EditedObjectInformation editedObjectInfo,
            List <CropItem> crops,
            List <string> randomNames,
            List <string> randomDescriptions)
        {
            for (int i = 0; i < crops.Count; i++)
            {
                CropItem crop        = crops[i];
                string   name        = randomNames[i];
                string   description = Globals.RNGGetAndRemoveRandomValueFromList(randomDescriptions);
                crop.OverrideName = name;
                crop.Description  = description;

                SeedItem seed = ItemList.GetSeedFromCrop(crop);
                seed.OverrideDisplayName = seed.CropGrowthInfo.IsTrellisCrop ?
                                           Globals.GetTranslation("trellis-text", new { itemName = name }) :
                                           Globals.GetTranslation("seed-text", new { itemName = name });
                seed.OverrideName = seed.CropGrowthInfo.IsTrellisCrop ?
                                    $"{name} Starter" :
                                    $"{name} Seeds";

                seed.Price = GetRandomSeedPrice();
                crop.Price = CalculateCropPrice(seed);

                if (!Globals.Config.RandomizeCrops)
                {
                    continue;
                }

                editedObjectInfo.ObjectInformationReplacements[crop.Id] = crop.ToString();
                editedObjectInfo.ObjectInformationReplacements[seed.Id] = seed.ToString();
            }
        }
Example #2
0
        /// <summary>
        /// Generates a random name for the given weapon type
        /// </summary>
        /// <param name="type">The weapon type</param>
        /// <param name="slingshotTier">
        ///		The slingshot tier, from 0 - 2 = worst to best
        /// </param>
        /// <returns></returns>
        public string GenerateRandomWeaponName(WeaponType type, WeaponIndexes slingshotId = 0)
        {
            string typeString = "";

            switch (type)
            {
            case WeaponType.SlashingSword:
            case WeaponType.StabbingSword:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(Swords);
                break;

            case WeaponType.Dagger:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(Daggers);
                break;

            case WeaponType.ClubOrHammer:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(HammersAndClubs);
                break;

            case WeaponType.Slingshot:
                return(GenerateRandomSlingshotName(slingshotId));

            default:
                Globals.ConsoleError($"Trying to generate weapon name for invalid type: {type}");
                return("ERROR");
            }

            return(GenerateRandomNonSlingshotName(typeString));
        }
        /// <summary>
        /// Gets a random file name that matches the weapon type at the given position
        /// Will remove the name found from the list
        /// </summary>
        /// <param name="position">The position</param>
        /// <returns>The selected file name</returns>
        protected override string GetRandomFileName(Point position)
        {
            string fileName = "";

            switch (GetWeaponTypeFromPosition(position))
            {
            case WeaponType.SlashingSword:
            case WeaponType.StabbingSword:
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(SwordImages);
                break;

            case WeaponType.Dagger:
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(DaggerImages);
                break;

            case WeaponType.ClubOrHammer:
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(HammerAndClubImages);
                break;

            case WeaponType.Slingshot:
                // TODO:Use slingshot images when we actually randomize them
                break;

            default:
                Globals.ConsoleError($"No weapon type defined at image position: {position.X}, {position.Y}");
                break;
            }

            if (string.IsNullOrEmpty(fileName))
            {
                Globals.ConsoleWarn($"Using default image for weapon at image position - you may not have enough weapon images: {position.X}, {position.Y}");
                return(null);
            }
            return(fileName);
        }
Example #4
0
        private static List <string> CreateNameFromPieces(int numberOfNames, List <string> adjectives, List <string> prefixes, List <string> suffixes)
        {
            List <string> createdNames = new List <string>();
            string        newName      = "default name";

            for (int i = 0; i < numberOfNames; i++)
            {
                if (prefixes.Count > 0 && suffixes.Count > 0)
                {
                    newName = $"{Globals.RNGGetAndRemoveRandomValueFromList(prefixes)}{Globals.RNGGetAndRemoveRandomValueFromList(suffixes)}";
                    if (newName.StartsWith("Mc"))
                    {
                        newName = $"Mc{newName.Substring(2, 1).ToUpper()}{newName.Substring(3)}";
                    }

                    if (Globals.RNGGetNextBoolean(10) && adjectives.Count > 0)
                    {
                        newName = $"{Globals.RNGGetAndRemoveRandomValueFromList(adjectives)} {newName}";
                    }
                    createdNames.Add(newName);
                }
                else
                {
                    Globals.ConsoleError("Error generating new name: not enough prefixes/suffixes in lists");
                }
            }

            return(createdNames);
        }
Example #5
0
        /// <summary>
        /// Generates a random slingshot name
        /// </summary>
        /// <param name="slingshotId">The id of the slingshot weapon</param>
        /// <returns></returns>
        private string GenerateRandomSlingshotName(WeaponIndexes slingshotId)
        {
            string typeString = "";

            switch (slingshotId)
            {
            case WeaponIndexes.Slingshot:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(Tier1Slingshots);
                break;

            case WeaponIndexes.MasterSlingshot:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(Tier2Slingshots);
                break;

            case WeaponIndexes.GalaxySlingshot:
                typeString = Globals.RNGGetAndRemoveRandomValueFromList(Tier3Slingshots);
                break;

            default:
                Globals.ConsoleError($"Trying to generate slingshot name for invalid id: {slingshotId}");
                return("ERROR");
            }

            return($"{typeString} Slingshot");
        }
        private static List <string> CreateDescriptionFromPieces(int numberOfDescriptions, List <string> descriptionBases, List <string> nouns, List <string> adjectives, List <string> names)
        {
            List <string> createdDescriptions = new List <string>();
            string        newDescription      = "default description";

            for (int i = 0; i < numberOfDescriptions; i++)
            {
                if (descriptionBases.Count > 0 && adjectives.Count > 1 && nouns.Count > 1 && names.Count > 0)
                {
                    newDescription = Globals.RNGGetAndRemoveRandomValueFromList(descriptionBases);
                    newDescription = newDescription.Replace("[noun]", Globals.RNGGetAndRemoveRandomValueFromList(nouns));
                    newDescription = newDescription.Replace("[noun2]", Globals.RNGGetAndRemoveRandomValueFromList(nouns));
                    newDescription = newDescription.Replace("[adjective]", Globals.RNGGetAndRemoveRandomValueFromList(adjectives));
                    newDescription = newDescription.Replace("[adjective2]", Globals.RNGGetAndRemoveRandomValueFromList(adjectives));
                    newDescription = newDescription.Replace("[name]", Globals.RNGGetAndRemoveRandomValueFromList(names));
                    createdDescriptions.Add(newDescription);
                }
                else
                {
                    Globals.ConsoleError("Error generating new description: not enough descriptions or string replacements in lists.");
                }
            }

            return(createdDescriptions);
        }
Example #7
0
        /// <summary>
        /// Creates a bundle for the Joja mart
        /// </summary>
        protected override void Populate()
        {
            BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes);
            List <RequiredItem> potentialItems = new List <RequiredItem>();

            switch (BundleType)
            {
            case BundleTypes.JojaMissing:
                Name = Globals.GetTranslation("bundle-joja-missing");

                RequiredItems = new List <RequiredItem>
                {
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.EndgameItem)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.RareItem)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.LargeTimeRequirements)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.MediumTimeRequirements)),
                    new RequiredItem(
                        Globals.RNGGetRandomValueFromList(ItemList.GetItemsBelowDifficulty(ObtainingDifficulties.Impossible, new List <int> {
                        (int)ObjectIndexes.AnyFish
                    }))
                        )
                };
                MinimumRequiredItems = 5;
                Color = BundleColors.Blue;
                break;
            }
        }
        /// <summary>
        /// Gets a random file name that matches the crop growth image at the given position
        /// Will remove the name found from the list
        /// </summary>
        /// <param name="position">The position</param>
        /// <returns>The selected file name</returns>
        protected override string GetRandomFileName(Point position)
        {
            string fileName = "";

            int  cropId = CropGrowthImagePointsToIds[position];
            Item item   = ItemList.Items[cropId];

            SeedItem seedItem = item.Id == (int)ObjectIndexes.CoffeeBean ?
                                (SeedItem)item : ((CropItem)item).MatchingSeedItem;
            CropGrowthInformation growthInfo = seedItem.CropGrowthInfo;

            FixWidthValue(seedItem.CropGrowthInfo.GraphicId);

            if (item.IsFlower)
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(FlowerImages);

                if (!seedItem.CropGrowthInfo.TintColorInfo.HasTint)
                {
                    fileName = $"{fileName.Substring(0, fileName.Length - 4)}-NoHue.png";
                }
            }

            else if (growthInfo.IsTrellisCrop)
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(TrellisImages);
            }

            else if (growthInfo.RegrowsAfterHarvest)
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(RegrowingImages);
            }

            else
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(NormalImages);

                if (growthInfo.GrowthStages.Count <= 4)
                {
                    fileName += "-4.png";
                }

                else
                {
                    fileName += "-5.png";
                }
            }

            if (string.IsNullOrEmpty(fileName) || fileName == "-4.png" || fileName == "-5.png")
            {
                Globals.ConsoleWarn($"Using default image for crop growth - you may not have enough crop growth images: {position.X}, {position.Y}");
                return(null);
            }


            CropIdsToImageNames[cropId] = Path.GetFileName(fileName).Replace("-4.png", ".png").Replace("-5.png", ".png").Replace("-NoHue.png", ".png");
            return(fileName);
        }
Example #9
0
 /// <summary>
 /// Adds a foragable to the given list
 /// </summary>
 /// <param name="foragableList">The list of all foragables to choose from</param>
 /// <param name="listToPopulate">The list to populate</param>
 /// <returns>Whether there's more in the list to add after the call</returns>
 private static bool AddToList(List <Item> foragableList, List <Item> listToPopulate)
 {
     if (foragableList.Count == 0)
     {
         return(false);
     }
     listToPopulate.Add(Globals.RNGGetAndRemoveRandomValueFromList(foragableList));
     return(foragableList.Count > 0);
 }
Example #10
0
        /// <summary>
        /// Generates a random name for a non-slingshot item (weapon or boots), given the already generated type string
        /// </summary>
        /// <param name="typeString">The type string</param>
        /// <returns>The name in the format: [adjective] (noun) (typeString) [of suffix]</returns>
        private string GenerateRandomNonSlingshotName(string typeString)
        {
            string adjective = Globals.RNGGetNextBoolean() ? "" : Globals.RNGGetAndRemoveRandomValueFromList(Adjectives);
            string noun      = Globals.RNGGetAndRemoveRandomValueFromList(Nouns);
            string suffix    = Globals.RNGGetNextBoolean() ? "" : Globals.RNGGetAndRemoveRandomValueFromList(Suffixes);

            suffix = string.IsNullOrEmpty(suffix) ? "" : $"of {suffix}";

            return($"{adjective} {noun} {typeString} {suffix}".Trim());
        }
Example #11
0
        /// <summary>
        /// Gets a random file name from the files to pull from and removes the found entry from the list
        /// </summary>
        /// <param name="position">The position of the instrument - unused in this version of the function</param>
        /// <returns></returns>
        protected virtual string GetRandomFileName(Point position)
        {
            string fileName = Globals.RNGGetAndRemoveRandomValueFromList(FilesToPullFrom);

            if (string.IsNullOrEmpty(fileName))
            {
                Globals.ConsoleWarn($"Not enough images at directory (need more images, using default image): {ImageDirectory}");
                return(null);
            }

            return(fileName);
        }
Example #12
0
        /// <summary>
        /// Populates the bundle with the name, required items, minimum required, and color
        /// </summary>
        protected override void Populate()
        {
            int moneyAmount = 0;

            BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes);
            int bundleNameFlavorID = 1;

            switch (BundleType)
            {
            case BundleTypes.Vault2500:
                bundleNameFlavorID = Range.GetRandomValue(1, 7);
                moneyAmount        = Range.GetRandomValue(500, 3500);
                break;

            case BundleTypes.Vault5000:
                bundleNameFlavorID = Range.GetRandomValue(1, 6);
                moneyAmount        = Range.GetRandomValue(4000, 7000);
                break;

            case BundleTypes.Vault10000:
                bundleNameFlavorID = Range.GetRandomValue(1, 6);
                moneyAmount        = Range.GetRandomValue(7500, 12500);
                break;

            case BundleTypes.Vault25000:
                bundleNameFlavorID = Range.GetRandomValue(1, 7);
                moneyAmount        = Range.GetRandomValue(20000, 30000);
                break;

            default:
                return;
            }

            RequiredItems = new List <RequiredItem> {
                new RequiredItem()
                {
                    MoneyAmount = moneyAmount
                }
            };

            string moneyString      = moneyAmount.ToString("N0", new CultureInfo(Globals.ModRef.Helper.Translation.Locale));
            string bundleNameFlavor = Globals.GetTranslation($"{BundleType.ToString()}-{bundleNameFlavorID}");

            Name            = $"{Globals.GetTranslation("vault-money-format", new { moneyString })}: {bundleNameFlavor}";
            ImageNameSuffix = $"-{bundleNameFlavorID}";

            Color = Globals.RNGGetRandomValueFromList(
                Enum.GetValues(typeof(BundleColors)).Cast <BundleColors>().ToList());
        }
Example #13
0
        /// <summary>
        /// Randomizes all the music to another song
        /// </summary>
        /// <returns>A dictionary of song names to their alternatives</returns>
        public static void Randomize()
        {
            List <string> musicReplacementPool = new List <string>(MusicList);

            MusicReplacements = new Dictionary <string, string>();
            _lastCurrentSong  = "";

            foreach (string song in MusicList)
            {
                string replacementSong = Globals.RNGGetAndRemoveRandomValueFromList(musicReplacementPool);
                MusicReplacements.Add(song, replacementSong);
            }

            WriteToSpoilerLog();
        }
        /// <summary>
        /// Gets a mapping of all monster items to some other random monster item
        /// Also swaps the item obtainability and crafting amounts
        /// </summary>
        /// <param name="allMonsters">The monster info</param>
        /// <returns />
        private static Dictionary <int, int> GetMonsterDropReplacements(List <Monster> allMonsters)
        {
            Dictionary <int, Item> items = new Dictionary <int, Item>();

            foreach (Monster monster in allMonsters)
            {
                foreach (ItemDrop itemDrop in monster.ItemDrops)
                {
                    Item itemToDrop = itemDrop.ItemToDrop;
                    if (!items.ContainsKey(itemToDrop.Id) && itemToDrop.IsMonsterItem)
                    {
                        items.Add(itemToDrop.Id,
                                  new Item(itemToDrop.Id)
                        {
                            DifficultyToObtain     = itemToDrop.DifficultyToObtain,
                            ItemsRequiredForRecipe = itemToDrop.ItemsRequiredForRecipe
                        }
                                  );
                    }
                }
            }

            List <int>            uniqueIds    = items.Keys.ToList();
            Dictionary <int, int> replacements = new Dictionary <int, int>();

            foreach (int id in items.Keys.ToArray())
            {
                int newId = Globals.RNGGetAndRemoveRandomValueFromList(uniqueIds);
                replacements.Add(id, newId);

                Item newItem     = ItemList.Items[newId];
                Item oldItemInfo = items[id];
                newItem.DifficultyToObtain     = oldItemInfo.DifficultyToObtain;
                newItem.ItemsRequiredForRecipe = oldItemInfo.ItemsRequiredForRecipe;
            }

            return(replacements);
        }
Example #15
0
        /// <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;
            }
        }
Example #16
0
        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>
        /// 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.BulletinNews:
                Name           = Globals.GetTranslation("bundle-bulletin-news");
                potentialItems = new List <RequiredItem>()
                {
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                    new RequiredItem((int)ObjectIndexes.SoggyNewspaper),
                };
                RequiredItems = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(1, 8));
                Color         = BundleColors.Orange;
                break;

            case BundleTypes.BulletinCleanup:
                Name          = Globals.GetTranslation("bundle-bulletin-cleanup");
                RequiredItems = RequiredItem.CreateList(ItemList.GetTrash(), 1, 5);
                Color         = BundleColors.Green;
                break;

            case BundleTypes.BulletinHated:
                Name                 = Globals.GetTranslation("bundle-bulletin-hated"); potentialItems = RequiredItem.CreateList(NPC.UniversalHates);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(4, 6);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinLoved:
                Name                 = Globals.GetTranslation("bundle-bulletin-loved");
                RequiredItems        = RequiredItem.CreateList(NPC.UniversalLoves);
                MinimumRequiredItems = 2;
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinAbigail:
                Name                 = Globals.GetTranslation("Abigail-name");
                potentialItems       = RequiredItem.CreateList(Abigail.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinAlex:
                Name                 = Globals.GetTranslation("Alex-name");
                potentialItems       = RequiredItem.CreateList(Alex.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinCaroline:
                Name                 = Globals.GetTranslation("Caroline-name");
                potentialItems       = RequiredItem.CreateList(Caroline.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinClint:
                Name                 = Globals.GetTranslation("Clint-name");
                potentialItems       = RequiredItem.CreateList(Clint.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinDwarf:
                Name                 = Globals.GetTranslation("Dwarf-name");
                potentialItems       = RequiredItem.CreateList(Dwarf.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinDemetrius:
                Name                 = Globals.GetTranslation("Demetrius-name");
                potentialItems       = RequiredItem.CreateList(Demetrius.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinElliott:
                Name                 = Globals.GetTranslation("Elliott-name");
                potentialItems       = RequiredItem.CreateList(Elliott.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinEmily:
                Name                 = Globals.GetTranslation("Emily-name");
                potentialItems       = RequiredItem.CreateList(Emily.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinEvelyn:
                Name                 = Globals.GetTranslation("Evelyn-name");
                potentialItems       = RequiredItem.CreateList(Evelyn.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinGeorge:
                Name                 = Globals.GetTranslation("George-name");
                potentialItems       = RequiredItem.CreateList(George.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinGus:
                Name                 = Globals.GetTranslation("Gus-name");
                potentialItems       = RequiredItem.CreateList(Gus.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinHaley:
                Name                 = Globals.GetTranslation("Haley-name");
                potentialItems       = RequiredItem.CreateList(Haley.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinHarvey:
                Name                 = Globals.GetTranslation("Harvey-name");
                potentialItems       = RequiredItem.CreateList(Harvey.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinJas:
                Name                 = Globals.GetTranslation("Jas-name");
                potentialItems       = RequiredItem.CreateList(Jas.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinJodi:
                Name                 = Globals.GetTranslation("Jodi-name");
                potentialItems       = RequiredItem.CreateList(Jodi.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinKent:
                Name                 = Globals.GetTranslation("Kent-name");
                potentialItems       = RequiredItem.CreateList(Kent.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinKrobus:
                Name                 = Globals.GetTranslation("Krobus-name");
                potentialItems       = RequiredItem.CreateList(Krobus.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinLeah:
                Name                 = Globals.GetTranslation("Leah-name");
                potentialItems       = RequiredItem.CreateList(Leah.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinLewis:
                Name                 = Globals.GetTranslation("Lewis-name");
                potentialItems       = RequiredItem.CreateList(Lewis.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Green;
                break;

            case BundleTypes.BulletinLinus:
                Name                 = Globals.GetTranslation("Linus-name");
                potentialItems       = RequiredItem.CreateList(Linus.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinMarnie:
                Name                 = Globals.GetTranslation("Marnie-name");
                potentialItems       = RequiredItem.CreateList(Marnie.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinMaru:
                Name                 = Globals.GetTranslation("Maru-name");
                potentialItems       = RequiredItem.CreateList(Maru.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinPam:
                Name                 = Globals.GetTranslation("Pam-name");
                potentialItems       = RequiredItem.CreateList(Pam.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinPenny:
                Name                 = Globals.GetTranslation("Penny-name");
                potentialItems       = RequiredItem.CreateList(Penny.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Yellow;
                break;

            case BundleTypes.BulletinPierre:
                Name                 = Globals.GetTranslation("Pierre-name");
                potentialItems       = RequiredItem.CreateList(Pierre.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Orange;
                break;

            case BundleTypes.BulletinRobin:
                Name                 = Globals.GetTranslation("Robin-name");
                potentialItems       = RequiredItem.CreateList(Robin.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Yellow;
                break;

            case BundleTypes.BulletinSam:
                Name                 = Globals.GetTranslation("Sam-name");
                potentialItems       = RequiredItem.CreateList(Sam.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinSandy:
                Name                 = Globals.GetTranslation("Sandy-name");
                potentialItems       = RequiredItem.CreateList(Sandy.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinSebastian:
                Name                 = Globals.GetTranslation("Sebastian-name");
                potentialItems       = RequiredItem.CreateList(Sebastian.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinShane:
                Name                 = Globals.GetTranslation("Shane-name");
                potentialItems       = RequiredItem.CreateList(Shane.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Blue;
                break;

            case BundleTypes.BulletinVincent:
                Name                 = Globals.GetTranslation("Vincent-name");
                potentialItems       = RequiredItem.CreateList(Vincent.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinWilly:
                Name                 = Globals.GetTranslation("Willy-name");
                potentialItems       = RequiredItem.CreateList(Willy.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Red;
                break;

            case BundleTypes.BulletinWizard:
                Name                 = Globals.GetTranslation("Wizard-name");
                potentialItems       = RequiredItem.CreateList(Wizard.Loves);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Math.Min(Math.Max(RequiredItems.Count - 2, 3), RequiredItems.Count);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BulletinColorPink:
                Name           = Globals.GetTranslation("bundle-bulletin-pink");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.Shrimp,
                    (int)ObjectIndexes.StrangeBun,
                    (int)ObjectIndexes.SalmonDinner,
                    (int)ObjectIndexes.PinkCake,
                    (int)ObjectIndexes.Sashimi,
                    (int)ObjectIndexes.IceCream,
                    (int)ObjectIndexes.Salmonberry,
                    (int)ObjectIndexes.Coral,
                    (int)ObjectIndexes.Dolomite,
                    (int)ObjectIndexes.Nekoite,
                    (int)ObjectIndexes.StarShards,
                    (int)ObjectIndexes.Peach,
                    (int)ObjectIndexes.BugMeat,
                    (int)ObjectIndexes.Bait
                });
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(3, 6);
                Color = BundleColors.Red;
                break;

            case BundleTypes.BulletinColorWhite:
                Name           = Globals.GetTranslation("bundle-bulletin-white");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.Leek,
                    (int)ObjectIndexes.Quartz,
                    (int)ObjectIndexes.OrnamentalFan,
                    (int)ObjectIndexes.DinosaurEgg,
                    (int)ObjectIndexes.ChickenStatue,
                    (int)ObjectIndexes.WhiteAlgae,
                    (int)ObjectIndexes.WhiteEgg,
                    (int)ObjectIndexes.LargeWhiteEgg,
                    (int)ObjectIndexes.Milk,
                    (int)ObjectIndexes.LargeMilk,
                    (int)ObjectIndexes.FriedEgg,
                    (int)ObjectIndexes.RicePudding,
                    (int)ObjectIndexes.IceCream,
                    (int)ObjectIndexes.Mayonnaise,
                    (int)ObjectIndexes.IronBar,
                    (int)ObjectIndexes.RefinedQuartz,
                    (int)ObjectIndexes.IronOre,
                    (int)ObjectIndexes.SpringOnion,
                    (int)ObjectIndexes.SnowYam,
                    (int)ObjectIndexes.Rice,
                    (int)ObjectIndexes.GoatCheese,
                    (int)ObjectIndexes.Cloth,
                    (int)ObjectIndexes.GoatMilk,
                    (int)ObjectIndexes.LargeGoatMilk,
                    (int)ObjectIndexes.Wool,
                    (int)ObjectIndexes.DuckEgg,
                    (int)ObjectIndexes.RabbitsFoot,
                    (int)ObjectIndexes.PaleBroth,
                    (int)ObjectIndexes.Esperite,
                    (int)ObjectIndexes.Lunarite,
                    (int)ObjectIndexes.Marble,
                    (int)ObjectIndexes.PrehistoricScapula,
                    (int)ObjectIndexes.PrehistoricTibia,
                    (int)ObjectIndexes.PrehistoricSkull,
                    (int)ObjectIndexes.SkeletalHand,
                    (int)ObjectIndexes.PrehistoricRib,
                    (int)ObjectIndexes.PrehistoricVertebra,
                    (int)ObjectIndexes.SkeletalTail,
                    (int)ObjectIndexes.NautilusFossil,
                    (int)ObjectIndexes.Trilobite,
                    (int)ObjectIndexes.ArtichokeDip,
                    (int)ObjectIndexes.LeadBobber,
                    (int)ObjectIndexes.Chowder
                });
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(3, 6);
                Color = BundleColors.Yellow;
                break;
            }
        }
        /// <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;
            }
        }
Example #19
0
 /// <summary>
 /// Gets a random file name from the files to pull from and removes the found entry from the list
 /// </summary>
 /// <param name="position">The position of the instrument - unused in this version of the function</param>
 /// <returns></returns>
 protected virtual string GetRandomFileName(Point position)
 {
     return(Globals.RNGGetAndRemoveRandomValueFromList(_filesToPullFrom));
 }
Example #20
0
        /// <summary>
        /// Generates a random boot name
        /// </summary>
        /// <returns>The name in the format: [adjective] (noun) (boot string) [of suffix]</returns>
        public string GenerateRandomBootName()
        {
            string bootName = Globals.RNGGetAndRemoveRandomValueFromList(Boots);

            return(GenerateRandomNonSlingshotName(bootName));
        }
        /// <summary>
        /// Gets a random file name that matches the crop growth image at the given position (fish excluded)
        /// Will remove the name found from the list
        /// </summary>
        /// <param name="position">The position</param>
        /// <returns>The selected file name</returns>
        protected override string GetRandomFileName(Point position)
        {
            ImageWidthInPx = 16;

            int    itemId       = PointsToItemIds[position];
            string fileName     = "";
            string subDirectory = "";

            if (BootData.AllBoots.Any(x => x.Id == itemId))
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(BootImages);

                if (string.IsNullOrEmpty(fileName))
                {
                    Globals.ConsoleWarn($"Could not find the boot image for id {itemId}; using default image instead.");
                    return(null);
                }

                return(fileName);
            }

            Item item = ItemList.Items[itemId];

            if (item.Id == (int)ObjectIndexes.CherrySapling)
            {
                ImageWidthInPx = 96;
                return($"{ImageDirectory}/fruitTreeSprites.png");
            }

            if (item.IsFish)
            {
                fileName = Globals.RNGGetAndRemoveRandomValueFromList(FishImages);

                if (string.IsNullOrEmpty(fileName))
                {
                    Globals.ConsoleWarn($"Could not find the fish image for {item.Name}; using default image instead.");
                    return(null);
                }

                return(fileName);
            }

            int cropId = item.Id;

            if (item.IsCrop || item.Id == (int)ObjectIndexes.CoffeeBean)
            {
                subDirectory = "/Crops";
            }

            else if (item.IsSeed)
            {
                SeedItem seedItem = (SeedItem)item;
                cropId       = seedItem.CropGrowthInfo.CropId;
                subDirectory = "/Seeds";
            }

            if (item.IsFlower)
            {
                subDirectory = "/Flowers";

                CropItem cropItem = (CropItem)item;
                if (cropItem.MatchingSeedItem.CropGrowthInfo.TintColorInfo.HasTint)
                {
                    ImageWidthInPx = 32;                     // Flower images include the stem and the top if they have tint
                }
            }

            if (!CropIdsToImageNames.TryGetValue(cropId, out fileName))
            {
                Globals.ConsoleWarn($"Could not find the matching image for {item.Name}; using default image instead.");
                return(null);
            }

            return($"{ImageDirectory}{subDirectory}/{fileName}");
        }
        /// <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>
        /// Randomizes the crops - currently only does prices, and only for seasonal crops
        /// </summary>
        /// <param name="editedObjectInfo">The edited object information</param>
        /// crop format: name/price/-300/Seeds -74/name/tooltip
        private static void RandomizeCrops(EditedObjectInformation editedObjectInfo)
        {
            List <int> regrowableSeedIdsToRandomize = ItemList.GetSeeds().Cast <SeedItem>()
                                                      .Where(x => x.Randomize && x.CropGrowthInfo.RegrowsAfterHarvest)
                                                      .Select(x => x.Id)
                                                      .ToList();
            List <int> regrowableSeedIdsToRandomizeCopy = new List <int>(regrowableSeedIdsToRandomize);

            List <int> nonRegrowableSeedIdsToRandomize = ItemList.GetSeeds().Cast <SeedItem>()
                                                         .Where(x => x.Randomize && !x.CropGrowthInfo.RegrowsAfterHarvest)
                                                         .Select(x => x.Id)
                                                         .ToList();
            List <int> nonRegrowableSeedIdsToRandomizeCopy = new List <int>(nonRegrowableSeedIdsToRandomize);

            // Fill up a dictionary to remap the seed values
            Dictionary <int, int> seedMappings = new Dictionary <int, int>();           // Original value, new value

            foreach (int originalRegrowableSeedId in regrowableSeedIdsToRandomize)
            {
                seedMappings.Add(originalRegrowableSeedId, Globals.RNGGetAndRemoveRandomValueFromList(regrowableSeedIdsToRandomizeCopy));
            }

            foreach (int originalNonRegrowableSeedId in nonRegrowableSeedIdsToRandomize)
            {
                seedMappings.Add(originalNonRegrowableSeedId, Globals.RNGGetAndRemoveRandomValueFromList(nonRegrowableSeedIdsToRandomizeCopy));
            }

            // Loop through the dictionary and reassign the values, keeping the seasons the same as before
            foreach (KeyValuePair <int, int> seedMapping in seedMappings)
            {
                int originalValue = seedMapping.Key;
                int newValue      = seedMapping.Value;

                CropGrowthInformation cropInfoToAdd = CropGrowthInformation.ParseString(CropGrowthInformation.DefaultStringData[newValue]);
                cropInfoToAdd.GrowingSeasons = CropGrowthInformation.ParseString(CropGrowthInformation.DefaultStringData[originalValue]).GrowingSeasons;
                cropInfoToAdd.GrowthStages   = GetRandomGrowthStages(cropInfoToAdd.GrowthStages.Count);
                cropInfoToAdd.CanScythe      = Globals.RNGGetNextBoolean(10);
                cropInfoToAdd.DaysToRegrow   = cropInfoToAdd.RegrowsAfterHarvest ? Range.GetRandomValue(1, 7) : -1;

                if (!Globals.Config.RandomizeCrops)
                {
                    continue;
                }                                                                 // Preserve the original seasons/etc
                CropGrowthInformation.CropIdsToInfo[originalValue] = cropInfoToAdd;
            }

            // Set the object info
            List <CropItem> randomizedCrops = ItemList.GetCrops(true).Cast <CropItem>()
                                              .Where(x => nonRegrowableSeedIdsToRandomize.Union(regrowableSeedIdsToRandomize).Contains(x.MatchingSeedItem.Id))
                                              .ToList();
            List <CropItem> vegetables = randomizedCrops.Where(x => !x.IsFlower).ToList();
            List <CropItem> flowers    = randomizedCrops.Where(x => x.IsFlower).ToList();

            List <string> vegetableNames   = NameAndDescriptionRandomizer.GenerateVegetableNames(vegetables.Count + 1);
            List <string> cropDescriptions = NameAndDescriptionRandomizer.GenerateCropDescriptions(randomizedCrops.Count);

            SetCropAndSeedInformation(
                editedObjectInfo,
                vegetables,
                vegetableNames,
                cropDescriptions);                 // Note: It removes the descriptions it uses from the list after assigning them- may want to edit later

            SetUpCoffee(editedObjectInfo, vegetableNames[vegetableNames.Count - 1]);
            SetUpRice(editedObjectInfo);

            SetCropAndSeedInformation(
                editedObjectInfo,
                flowers,
                NameAndDescriptionRandomizer.GenerateFlowerNames(flowers.Count),
                cropDescriptions);                 // Note: It removes the descriptions it uses from the list after assigning them- may want to edit later

            SetUpCookedFood(editedObjectInfo);
        }
        /// <summary>
        /// Randomizes all the music to another song
        /// </summary>
        /// <returns>A dictionary of song names to their alternatives</returns>
        public static Dictionary <string, string> Randomize()
        {
            List <string> musicList = new List <string>
            {
                "50s",
                "AbigailFlute",
                "AbigailFluteDuet",
                "aerobics",
                "breezy",
                "bugLevelLoop",
                "Cavern",
                "christmasTheme",
                "Cloth",
                "CloudCountry",
                "clubloop",
                "communityCenter",
                "cowboy_boss",
                "cowboy_outlawsong",
                "Cowboy_OVERWORLD",
                "Cowboy_singing",
                "Cowboy_undead",
                "crane_game",
                "crane_game_fast",
                "Crystal Bells",
                "desolate",
                "distantBanjo",
                "echos",
                "elliottPiano",
                "EmilyDance",
                "EmilyDream",
                "EmilyTheme",
                "event1",
                "event2",
                "fall_day_ambient",
                "fall1",
                "fall2",
                "fall3",
                "fallFest",
                "FlowerDance",
                "Frost_Ambient",
                "grandpas_theme",
                "gusviolin",
                "harveys_theme_jazz",
                "heavy",
                "honkytonky",
                "Hospital_Ambient",
                "Icicles",
                "jaunty",
                "jojaOfficeSoundscape",
                "junimoKart",
                "junimoKart_ghostMusic",
                "junimoKart_mushroomMusic",
                "junimoKart_slimeMusic",
                "junimoKart_whaleMusic",
                "junimoStarSong",
                "kindadumbautumn",
                "Lava_Ambient",
                "libraryTheme",
                "MainTheme",
                "MarlonsTheme",
                "marnieShop",
                "mermaidSong",
                "moonlightJellies",
                "movie_classic",
                "movie_nature",
                "movie_wumbus",
                "movieTheater",
                "movieTheaterAfter",
                "musicboxsong",
                "Near The Planet Core",
                "night_market",
                "Of Dwarves",
                "Overcast",
                "playful",
                "poppy",
                "ragtime",
                "sadpiano",
                "Saloon1",
                "sam_acoustic1",
                "sam_acoustic2",
                "sampractice",
                "Secret Gnomes",
                "SettlingIn",
                "shaneTheme",
                "shimmeringbastion",
                "spaceMusic",
                "spirits_eve",
                "spring_day_ambient",
                "spring_night_ambient",
                "spring1",
                "spring2",
                "spring3",
                "springtown",
                "starshoot",
                "submarine_song",
                "summer_day_ambient",
                "summer1",
                "summer2",
                "summer3",
                "SunRoom",
                "sweet",
                "tickTock",
                "tinymusicbox",
                "title_night",
                "tribal",
                "Upper_Ambient",
                "wavy",
                "wedding",
                "winter_day_ambient",
                "winter1",
                "winter2",
                "winter3",
                "WizardSong",
                "woodsTheme",
                "XOR",
                "tropical_island_day_ambient",
                "VolcanoMines",
                "Volcano_Ambient"
            };
            List <string> musicReplacementPool            = new List <string>(musicList);
            Dictionary <string, string> musicReplacements = new Dictionary <string, string>();

            foreach (string song in musicList)
            {
                string replacementSong = Globals.RNGGetAndRemoveRandomValueFromList(musicReplacementPool);
                musicReplacements.Add(song.ToLower(), replacementSong);
            }

            WriteToSpoilerLog(musicReplacements);
            return(musicReplacements);
        }
Example #25
0
        /// <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.BoilerArtifacts:
                Name           = Globals.GetTranslation("bundle-boiler-artifacts");
                potentialItems = RequiredItem.CreateList(
                    ItemList.GetArtifacts().Where(x => x.DifficultyToObtain < ObtainingDifficulties.RareItem).ToList()
                    );
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = 3;
                Color = BundleColors.Orange;
                break;

            case BundleTypes.BoilerMinerals:
                Name                 = Globals.GetTranslation("bundle-boiler-minerals");
                potentialItems       = RequiredItem.CreateList(ItemList.GetGeodeMinerals());
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(4, 6);
                Color                = BundleColors.Purple;
                break;

            case BundleTypes.BoilerGeode:
                Name          = Globals.GetTranslation("bundle-boiler-geode");
                RequiredItems = new List <RequiredItem>
                {
                    new RequiredItem((int)ObjectIndexes.Geode, 1, 10),
                    new RequiredItem((int)ObjectIndexes.FrozenGeode, 1, 10),
                    new RequiredItem((int)ObjectIndexes.MagmaGeode, 1, 10),
                    new RequiredItem((int)ObjectIndexes.OmniGeode, 1, 10),
                };
                Color = BundleColors.Red;
                break;

            case BundleTypes.BoilerGemstone:
                Name           = Globals.GetTranslation("bundle-boiler-gemstone");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.Quartz,
                    (int)ObjectIndexes.FireQuartz,
                    (int)ObjectIndexes.EarthCrystal,
                    (int)ObjectIndexes.FrozenTear,
                    (int)ObjectIndexes.Aquamarine,
                    (int)ObjectIndexes.Amethyst,
                    (int)ObjectIndexes.Emerald,
                    (int)ObjectIndexes.Ruby,
                    (int)ObjectIndexes.Topaz,
                    (int)ObjectIndexes.Jade,
                    (int)ObjectIndexes.Diamond
                }, 1, 5);
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(6, 8));
                MinimumRequiredItems = Range.GetRandomValue(RequiredItems.Count - 2, RequiredItems.Count);
                Color = BundleColors.Blue;
                break;

            case BundleTypes.BoilerMetal:
                Name           = Globals.GetTranslation("bundle-boiler-metal");
                potentialItems = new List <RequiredItem>
                {
                    new RequiredItem((int)ObjectIndexes.CopperOre, 5, 10),
                    new RequiredItem((int)ObjectIndexes.IronOre, 5, 10),
                    new RequiredItem((int)ObjectIndexes.GoldOre, 5, 10),
                    new RequiredItem((int)ObjectIndexes.IridiumOre, 5, 10),
                    new RequiredItem((int)ObjectIndexes.CopperBar, 1, 5),
                    new RequiredItem((int)ObjectIndexes.IronBar, 1, 5),
                    new RequiredItem((int)ObjectIndexes.GoldBar, 1, 5),
                    new RequiredItem((int)ObjectIndexes.IridiumBar, 1, 5),
                };
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, Range.GetRandomValue(6, 8));
                MinimumRequiredItems = Range.GetRandomValue(RequiredItems.Count - 2, RequiredItems.Count);
                Color = BundleColors.Red;
                break;

            case BundleTypes.BoilerExplosive:
                Name          = Globals.GetTranslation("bundle-boiler-explosive");
                RequiredItems = new List <RequiredItem>
                {
                    new RequiredItem((int)ObjectIndexes.CherryBomb, 1, 5),
                    new RequiredItem((int)ObjectIndexes.Bomb, 1, 5),
                    new RequiredItem((int)ObjectIndexes.MegaBomb, 1, 5),
                };
                Color = BundleColors.Red;
                break;

            case BundleTypes.BoilerRing:
                Name          = Globals.GetTranslation("bundle-boiler-ring");
                RequiredItems = RequiredItem.CreateList(
                    Globals.RNGGetRandomValuesFromList(ItemList.GetRings(), 8)
                    );
                MinimumRequiredItems = Range.GetRandomValue(4, 6);
                Color = BundleColors.Yellow;
                break;

            case BundleTypes.BoilerSpoopy:
                Name           = Globals.GetTranslation("bundle-boiler-spoopy");
                potentialItems = new List <RequiredItem>
                {
                    new RequiredItem((int)ObjectIndexes.Pumpkin, 6),
                    new RequiredItem((int)ObjectIndexes.JackOLantern, 6),
                    new RequiredItem((int)ObjectIndexes.Ghostfish, 6),
                    new RequiredItem((int)ObjectIndexes.BatWing, 6),
                    new RequiredItem((int)ObjectIndexes.VoidEssence, 6),
                    new RequiredItem((int)ObjectIndexes.VoidEgg, 6),
                    new RequiredItem((int)ObjectIndexes.PurpleMushroom, 6),
                    new RequiredItem((int)ObjectIndexes.GhostCrystal, 6),
                    new RequiredItem((int)ObjectIndexes.SpookFish, 6)
                };
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 6);
                MinimumRequiredItems = 3;
                Color = BundleColors.Purple;
                break;

            case BundleTypes.BoilerMonster:
                Name          = Globals.GetTranslation("bundle-boiler-monster");
                RequiredItems = new List <RequiredItem>()
                {
                    new RequiredItem((int)ObjectIndexes.BugMeat, 10, 50),
                    new RequiredItem((int)ObjectIndexes.Slime, 10, 50),
                    new RequiredItem((int)ObjectIndexes.BatWing, 10, 50),
                    new RequiredItem((int)ObjectIndexes.SolarEssence, 10, 50),
                    new RequiredItem((int)ObjectIndexes.VoidEssence, 10, 50)
                };
                Color = BundleColors.Red;
                break;

            case BundleTypes.BoilerColorBlack:
                Name           = Globals.GetTranslation("bundle-boiler-black");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.RareDisc,
                    (int)ObjectIndexes.Catfish,
                    (int)ObjectIndexes.ScorpionCarp,
                    (int)ObjectIndexes.TigerTrout,
                    (int)ObjectIndexes.Halibut,
                    (int)ObjectIndexes.MakiRoll,
                    (int)ObjectIndexes.Bomb,
                    (int)ObjectIndexes.VoidEgg,
                    (int)ObjectIndexes.VoidMayonnaise,
                    (int)ObjectIndexes.Coal,
                    (int)ObjectIndexes.Blackberry,
                    (int)ObjectIndexes.VampireRing,
                    (int)ObjectIndexes.Neptunite,
                    (int)ObjectIndexes.ThunderEgg,
                    (int)ObjectIndexes.BatWing,
                    (int)ObjectIndexes.VoidEssence,
                });
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(3, 6);
                Color = BundleColors.Purple;
                break;

            case BundleTypes.BoilerColorRed:
                Name           = Globals.GetTranslation("bundle-boiler-red");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.Ruby,
                    (int)ObjectIndexes.FireQuartz,
                    (int)ObjectIndexes.DwarfScrollI,
                    (int)ObjectIndexes.RedMullet,
                    (int)ObjectIndexes.RedSnapper,
                    (int)ObjectIndexes.LavaEel,
                    (int)ObjectIndexes.Bullhead,
                    (int)ObjectIndexes.Woodskip,
                    (int)ObjectIndexes.Crimsonfish,
                    (int)ObjectIndexes.PepperPoppers,
                    (int)ObjectIndexes.RhubarbPie,
                    (int)ObjectIndexes.RedPlate,
                    (int)ObjectIndexes.CranberrySauce,
                    (int)ObjectIndexes.Holly,
                    (int)ObjectIndexes.CherryBomb,
                    (int)ObjectIndexes.MegaBomb,
                    (int)ObjectIndexes.Jelly,
                    (int)ObjectIndexes.EnergyTonic,
                    (int)ObjectIndexes.RedMushroom,
                    (int)ObjectIndexes.RedSlimeEgg,
                    (int)ObjectIndexes.ExplosiveAmmo,
                    (int)ObjectIndexes.RubyRing,
                    (int)ObjectIndexes.MagmaGeode,
                    (int)ObjectIndexes.Helvite,
                    (int)ObjectIndexes.Jasper,
                    (int)ObjectIndexes.RadishSalad,
                    (int)ObjectIndexes.FruitSalad,
                    (int)ObjectIndexes.CranberryCandy,
                    (int)ObjectIndexes.Apple,
                    (int)ObjectIndexes.Pomegranate,
                    (int)ObjectIndexes.Cherry,
                    (int)ObjectIndexes.TreasureHunter,
                    (int)ObjectIndexes.CrabPot,
                    (int)ObjectIndexes.LifeElixir
                });
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(3, 6);
                Color = BundleColors.Red;
                break;

            case BundleTypes.BoilerColorGray:
                Name           = Globals.GetTranslation("bundle-boiler-gray");
                potentialItems = RequiredItem.CreateList(new List <int>
                {
                    (int)ObjectIndexes.Stone,
                    (int)ObjectIndexes.Arrowhead,
                    (int)ObjectIndexes.AncientSword,
                    (int)ObjectIndexes.RustySpoon,
                    (int)ObjectIndexes.PrehistoricTool,
                    (int)ObjectIndexes.Anchor,
                    (int)ObjectIndexes.PrehistoricHandaxe,
                    (int)ObjectIndexes.DwarfGadget,
                    (int)ObjectIndexes.Tilapia,
                    (int)ObjectIndexes.Chub,
                    (int)ObjectIndexes.Lingcod,
                    (int)ObjectIndexes.Crayfish,
                    (int)ObjectIndexes.Cockle,
                    (int)ObjectIndexes.Mussel,
                    (int)ObjectIndexes.Oyster,
                    (int)ObjectIndexes.Trash,
                    (int)ObjectIndexes.SoggyNewspaper,
                    (int)ObjectIndexes.StoneFence,
                    (int)ObjectIndexes.IronFence,
                    (int)ObjectIndexes.StoneFloor,
                    (int)ObjectIndexes.CrystalFloor,
                    (int)ObjectIndexes.TeaSet,
                    (int)ObjectIndexes.GravelPath,
                    (int)ObjectIndexes.MagnetRing,
                    (int)ObjectIndexes.SmallMagnetRing,
                    (int)ObjectIndexes.WarriorRing,
                    (int)ObjectIndexes.SavageRing,
                    (int)ObjectIndexes.Bixite,
                    (int)ObjectIndexes.Granite,
                    (int)ObjectIndexes.Basalt,
                    (int)ObjectIndexes.Limestone,
                    (int)ObjectIndexes.Sprinkler,
                    (int)ObjectIndexes.BarbedHook,
                    (int)ObjectIndexes.TrapBobber,
                    (int)ObjectIndexes.OmniGeode,
                });
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = Range.GetRandomValue(3, 6);
                Color = BundleColors.Blue;
                break;
            }
        }