Пример #1
0
        /// <summary>
        /// Gets a random item difficulty
        /// - 1/2 = no req
        /// - 1/4 = small time req
        /// - 1/8 = medium time req
        /// - 1/16 = large time req
        /// - 1/32 = uncommon
        /// - 1/64 = rare
        /// </summary>
        /// <returns></returns>
        private static ObtainingDifficulties GetRandomItemDifficulty()
        {
            if (Globals.RNGGetNextBoolean())
            {
                return(ObtainingDifficulties.NoRequirements);
            }

            else if (Globals.RNGGetNextBoolean())
            {
                return(ObtainingDifficulties.SmallTimeRequirements);
            }

            else if (Globals.RNGGetNextBoolean())
            {
                return(ObtainingDifficulties.MediumTimeRequirements);
            }

            else if (Globals.RNGGetNextBoolean())
            {
                return(ObtainingDifficulties.LargeTimeRequirements);
            }

            else if (Globals.RNGGetNextBoolean())
            {
                return(ObtainingDifficulties.UncommonItem);
            }

            else
            {
                return(ObtainingDifficulties.RareItem);
            }
        }
Пример #2
0
        /// <summary>
        /// Uses either two really easy to get items (one being a resource), or one slightly harder to get item
        /// /// </summary>
        /// <returns>The item string</returns>
        private string GetStringForEasy()
        {
            bool useHarderItem = Globals.RNGGetNextBoolean();

            if (useHarderItem)
            {
                return(ItemList.GetRandomCraftableItem(
                           new List <ObtainingDifficulties> {
                    ObtainingDifficulties.SmallTimeRequirements
                },
                           this
                           ).GetStringForCrafting());
            }

            Item resourceItem = ItemList.GetRandomCraftableItem(
                new List <ObtainingDifficulties> {
                ObtainingDifficulties.NoRequirements
            },
                this,
                null,
                true
                );
            Item otherItem = ItemList.GetRandomCraftableItem(
                new List <ObtainingDifficulties> {
                ObtainingDifficulties.NoRequirements
            },
                this,
                new List <int> {
                Id, resourceItem.Id
            }
                );

            return($"{resourceItem.GetStringForCrafting()} {otherItem.GetStringForCrafting()}");
        }
Пример #3
0
        /// <summary>
        /// Gets the level you learn this skill at
        /// </summary>
        /// <returns>
        /// Any value in the given range. Excludes 0, 5, and 10.
        /// Returns 9 if it's 10; returns 1 if it's 0; returns 4 or 6 if it's 5
        /// </returns>
        public int GetLevelLearnedAt()
        {
            Range levelRange     = new Range(OverrideBaseLevelLearnedAt - 3, OverrideBaseLevelLearnedAt + 3);
            int   generatedLevel = levelRange.GetRandomValue();

            if (generatedLevel > 8)
            {
                return(9);
            }
            if (generatedLevel < 1)
            {
                return(1);
            }
            if (generatedLevel == 5)
            {
                generatedLevel = Globals.RNGGetNextBoolean() ? 4 : 6;
            }

            if (!Globals.Config.CraftingRecipies.Randomize || !Globals.Config.CraftingRecipies.RandomizeLevels)
            {
                return(BaseLevelLearnedAt);
            }

            return(generatedLevel);
        }
        /// <summary>
        /// Randomizes monster stats/drops/etc.
        /// - Skips coin range randomization - not sure what it's for
        /// - Skips whether a monster is a glider, as flying monster spawns are hard-coded... don't want to
        ///   accidently spawn a non-flying monster somewhere it can't move
        /// </summary>
        /// <returns />
        public static Dictionary <string, string> Randomize()
        {
            Dictionary <string, string> replacements = new Dictionary <string, string>();

            List <Monster>                allMonsters      = MonsterData.GetAllMonsters();
            Dictionary <int, int>         monsterItemSwaps = GetMonsterDropReplacements(allMonsters);
            Dictionary <string, ItemDrop> extraItemDrops   = new Dictionary <string, ItemDrop>();

            foreach (Monster monster in allMonsters)
            {
                monster.HP     = Math.Max(Globals.RNGGetIntWithinPercentage(monster.HP, HPVariance), 1);
                monster.Damage = Math.Max(Globals.RNGGetIntWithinPercentage(monster.Damage, DamageVariance), 1);
                monster.RandomMovementDuration = Globals.RNGGetNextBoolean(35) ? 0 : Range.GetRandomValue(1, 3000);
                RandomizeMonsterDrops(monster, monsterItemSwaps, extraItemDrops);
                RandomizeResilience(monster);
                monster.Jitteriness = Range.GetRandomValue(0, 2) / 100d;
                RandomizeMoveTowardPlayerThreshold(monster);
                monster.Speed      = Range.GetRandomValue(1, 4);
                monster.MissChance = Range.GetRandomValue(0, 5) / 100d;
                monster.Experience = Math.Max(Globals.RNGGetIntWithinPercentage(monster.Experience, ExperienceVariance), 1);

                replacements.Add(monster.Name, monster.ToString());
            }

            WriteToSpoilerLog(allMonsters, monsterItemSwaps, extraItemDrops);

            return(replacements);
        }
Пример #5
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);
        }
Пример #6
0
        /// <summary>
        /// Gets the level you learn this skill at
        /// </summary>
        /// <returns>
        /// Any value in the given range. Excludes 0, 5, and 10.
        /// Returns 9 if it's 10; returns 1 if it's 0; returns 4 or 6 if it's 5
        /// </returns>
        public int GetLevelLearnedAt()
        {
            if (!Globals.Config.RandomizeCraftingRecipeLevels_Needs_Above_Setting_On)
            {
                return(BaseLevelLearnedAt);
            }

            Range levelRange     = new Range(BaseLevelLearnedAt - 3, BaseLevelLearnedAt + 3);
            int   generatedLevel = levelRange.GetRandomValue();

            if (generatedLevel > 8)
            {
                return(9);
            }
            if (generatedLevel < 1)
            {
                return(1);
            }
            if (generatedLevel == 5)
            {
                return(Globals.RNGGetNextBoolean() ? 4 : 6);
            }

            return(generatedLevel);
        }
        /// <summary>
        /// Generates the reward for the bundle
        /// </summary>
        protected override void GenerateReward()
        {
            if (Globals.RNGGetNextBoolean(1))
            {
                Reward = new RequiredItem((int)ObjectIndexes.PrismaticShard);
            }

            else if (Globals.RNGGetNextBoolean(5))
            {
                List <Item> universalLoves = NPC.UniversalLoves.Where(x =>
                                                                      x.Id != (int)ObjectIndexes.PrismaticShard).ToList();

                Reward = Globals.RNGGetRandomValueFromList(RequiredItem.CreateList(universalLoves, 5, 10));
            }

            List <RequiredItem> potentialRewards = new List <RequiredItem>
            {
                new RequiredItem((int)ObjectIndexes.JunimoKartArcadeSystem),
                new RequiredItem((int)ObjectIndexes.PrairieKingArcadeSystem),
                new RequiredItem((int)ObjectIndexes.SodaMachine),
                new RequiredItem((int)ObjectIndexes.Beer, 43),
                new RequiredItem((int)ObjectIndexes.Salad, Range.GetRandomValue(5, 25)),
                new RequiredItem((int)ObjectIndexes.Bread, Range.GetRandomValue(5, 25)),
                new RequiredItem((int)ObjectIndexes.Spaghetti, Range.GetRandomValue(5, 25)),
                new RequiredItem((int)ObjectIndexes.Pizza, Range.GetRandomValue(5, 25)),
                new RequiredItem((int)ObjectIndexes.Coffee, Range.GetRandomValue(5, 25))
            };

            Reward = Globals.RNGGetRandomValueFromList(potentialRewards);
        }
 /// <summary>
 /// Attempt to generate a random reward - 10% chance
 /// </summary>
 /// /// <returns>True if successful, false otherwise</returns>
 protected bool TryGenerateRandomReward()
 {
     if (Room != CommunityCenterRooms.Joja && Globals.RNGGetNextBoolean(10))
     {
         GenerateRandomReward();
         return(true);
     }
     return(false);
 }
Пример #9
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());
        }
        /// <summary>
        /// Randomizes the resilience of a monster
        /// </summary>
        /// <param name="monster"></param>
        private static void RandomizeResilience(Monster monster)
        {
            if (monster.Resilience == 0)
            {
                monster.Resilience = Globals.RNGGetNextBoolean(ResilienceVariance) ? 1 : 0;
            }

            else
            {
                monster.Resilience = Globals.RNGGetIntWithinPercentage(monster.Resilience, ResilienceVariance);
            }
        }
        /// <summary>
        /// Assigns a random defense value to the weapon
        /// - 95% chance of 0
        /// - else 1-5
        /// </summary>
        /// <param name="weapon">The weapon to add the defense value</param>
        private static void RandomizeWeaponDefense(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(95))
            {
                weapon.AddedDefense = 0;
            }

            else
            {
                weapon.AddedDefense = Range.GetRandomValue(1, 5);
            }
        }
        /// <summary>
        /// Assigns a random precision value to the weapon
        /// - 80% chance of 0
        /// - else 1 - 10
        /// </summary>
        /// <param name="weapon">The weapon to assign the precision value</param>
        private static void RandomizeWeaponPrecision(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(80))
            {
                weapon.AddedPrecision = 0;
            }

            else
            {
                weapon.AddedPrecision = Range.GetRandomValue(1, 10);
            }
        }
        /// <summary>
        /// Assigns a random AOE value to the weapon
        /// - 80% chance of 0
        /// - Else, value from 1 - 4
        /// </summary>
        /// <param name="weapon">The weapon to assign the AOE to</param>
        private static void RandomizeWeaponAOE(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(80))
            {
                weapon.AddedAOE = 0;
            }

            else
            {
                weapon.AddedAOE = Range.GetRandomValue(1, 4);
            }
        }
        /// <summary>
        /// Assigns a random weapon knockback
        /// - 5% chance of 1.6 - 2.0
        /// - else 0.5 - 1.6
        /// </summary>
        /// <param name="weapon">The weapon to set the knockback for</param>
        private static void RandomizeWeaponKnockback(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(5))
            {
                weapon.Knockback = Range.GetRandomValue(16, 20) / 10d;
            }

            else
            {
                weapon.Knockback = Range.GetRandomValue(5, 16) / 10d;
            }
        }
        /// <summary>
        /// Randomizes the threshold that the monster must hit in order to move toward the player
        /// - 5% chance of it being a large number
        /// </summary>
        /// <param name="monster">The monster to set the value of</param>
        private static void RandomizeMoveTowardPlayerThreshold(Monster monster)
        {
            if (Globals.RNGGetNextBoolean(5))
            {
                monster.MovesTowardPlayerThreshold = Range.GetRandomValue(8, 12);
            }

            else
            {
                monster.MovesTowardPlayerThreshold = Range.GetRandomValue(0, 4);
            }
        }
Пример #16
0
        /// <summary>
        /// Randomizes boots - currently only changes defense and immunity
        /// </summary>
        /// <returns />
        public static Dictionary <int, string> Randomize()
        {
            Boots.Clear();
            WeaponAndArmorNameRandomizer nameRandomizer = new WeaponAndArmorNameRandomizer();
            List <string> descriptions = NameAndDescriptionRandomizer.GenerateBootDescriptions(BootData.AllBoots.Count);

            Dictionary <int, string> bootReplacements = new Dictionary <int, string>();
            List <BootItem>          bootsToUse       = new List <BootItem>();

            for (int i = 0; i < BootData.AllBoots.Count; i++)
            {
                BootItem originalBoot = BootData.AllBoots[i];
                int      statPool     = Globals.RNGGetIntWithinPercentage(originalBoot.Defense + originalBoot.Immunity, 30);
                int      defense      = Range.GetRandomValue(0, statPool);
                int      immunity     = statPool - defense;

                if ((defense + immunity) == 0)
                {
                    if (Globals.RNGGetNextBoolean())
                    {
                        defense = 1;
                    }

                    else
                    {
                        immunity = 1;
                    }
                }

                BootItem newBootItem = new BootItem(
                    originalBoot.Id,
                    nameRandomizer.GenerateRandomBootName(),
                    descriptions[i],
                    originalBoot.NotActuallyPrice,
                    defense,
                    immunity,
                    originalBoot.ColorSheetIndex
                    );

                bootsToUse.Add(newBootItem);
                Boots.Add(newBootItem.Id, newBootItem);
            }

            foreach (BootItem bootToAdd in bootsToUse)
            {
                bootReplacements.Add(bootToAdd.Id, bootToAdd.ToString());
            }

            WriteToSpoilerLog(bootsToUse);
            return(bootReplacements);
        }
Пример #17
0
        /// <summary>
        /// Gets the crafting string for an item that is easy to get and that you need to craft many of
        /// Consists of 1 or 2 items that have no reqiurements to obtain
        /// </summary>
        /// <returns></returns>
        private string GetStringForEasyAndNeedMany()
        {
            Item item = ItemList.GetRandomCraftableItem(
                new List <ObtainingDifficulties> {
                ObtainingDifficulties.NoRequirements
            },
                this,
                null,
                true
                );

            int numberRequired = Globals.RNGGetNextBoolean() ? 1 : 2;

            return($"{item.Id} {numberRequired}");
        }
        /// <summary>
        /// Gets a random item drop - starts at noreqs and has a 50% chance to continue down the rarity chain
        /// - No req = 1/2, 5-8% drop rate
        /// - Small time req = 1/4, 4-6% drop rate
        /// - Med time req = 1/8, 3-5% drop rate
        /// - Large time req = 1/16, 2-4% drop rate
        /// - Uncommon = 1/32, 1-2% drop rate
        /// - Rare = 1/64, 0.1-0.5% drop rate
        /// </summary>
        /// <returns>The random item drop</returns>
        private static ItemDrop GetRandomItemDrop()
        {
            double probability = 0;
            Item   item        = null;

            if (Globals.RNGGetNextBoolean())
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.NoRequirements);
                probability = Range.GetRandomValue(5, 8) / 100d;
            }

            else if (Globals.RNGGetNextBoolean())
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.SmallTimeRequirements);
                probability = Range.GetRandomValue(4, 6) / 100d;
            }

            else if (Globals.RNGGetNextBoolean())
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.MediumTimeRequirements);
                probability = Range.GetRandomValue(3, 5) / 100d;
            }

            else if (Globals.RNGGetNextBoolean())
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.LargeTimeRequirements);
                probability = Range.GetRandomValue(2, 4) / 100d;
            }

            else if (Globals.RNGGetNextBoolean())
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.UncommonItem);
                probability = Range.GetRandomValue(1, 2) / 100d;
            }

            else
            {
                item        = ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.RareItem);
                probability = Range.GetRandomValue(1, 5) / 1000d;
            }

            return(new ItemDrop(item.Id, probability));
        }
        /// <summary>
        /// Randomize the weapon crit stats
        /// - 1% chance of a 0.1% crit with a multiplier of 100
        /// - 4% chance of 8-12% crit with a multiplier of 3 - 3.1x
        /// - Else, 2-3% crit with a multiplier of 3 - 4x
        /// </summary>
        /// <param name="weapon">The weapon to randomize</param>
        private static void RandomizeWeaponCrits(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(1))
            {
                weapon.CritChance     = 0.001;
                weapon.CritMultiplier = 100;
            }

            else if (Globals.RNGGetNextBoolean(4))
            {
                weapon.CritChance     = Range.GetRandomValue(8, 12) / 100d;
                weapon.CritMultiplier = Range.GetRandomValue(30, 31) / 10d;
            }

            else
            {
                weapon.CritChance     = Range.GetRandomValue(20, 30) / 1000d;
                weapon.CritMultiplier = Range.GetRandomValue(30, 40) / 10d;
            }
        }
        /// <summary>
        /// Assigns the weapon's speed
        /// - 5% chance of max speed
        /// - 10% chance of slow speed (-16 to -1)
        /// - 50% chance of 0
        /// - Else, value from -8 to 8
        /// </summary>
        /// <param name="weapon">The weapon to set the speed for</param>
        private static void RandomizeWeaponSpeed(WeaponItem weapon)
        {
            if (Globals.RNGGetNextBoolean(5))
            {
                weapon.Speed = 308;
            }

            else if (Globals.RNGGetNextBoolean(10))
            {
                weapon.Speed = Range.GetRandomValue(-16, -1);
            }

            else if (Globals.RNGGetNextBoolean())
            {
                weapon.Speed = 0;
            }

            else
            {
                weapon.Speed = Range.GetRandomValue(-8, 8);
            }
        }
Пример #21
0
        /// <summary>
        /// Generates the reward for the bundle
        /// </summary>
        protected override void GenerateReward()
        {
            RequiredItem randomOre = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.CopperOre, 100),
                new RequiredItem((int)ObjectIndexes.IronOre, 100),
                new RequiredItem((int)ObjectIndexes.GoldOre, 100),
                new RequiredItem((int)ObjectIndexes.IridiumOre, 10),
            });

            RequiredItem randomBar = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.CopperBar, 15),
                new RequiredItem((int)ObjectIndexes.IronBar, 15),
                new RequiredItem((int)ObjectIndexes.GoldBar, 15),
                new RequiredItem((int)ObjectIndexes.IridiumBar)
            });

            RequiredItem randomGeode = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.Geode, 25),
                new RequiredItem((int)ObjectIndexes.FrozenGeode, 25),
                new RequiredItem((int)ObjectIndexes.MagmaGeode, 25),
                new RequiredItem((int)ObjectIndexes.OmniGeode, 25)
            });

            RequiredItem randomMonsterDrop = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.BugMeat, 200),
                new RequiredItem((int)ObjectIndexes.Slime, 150),
                new RequiredItem((int)ObjectIndexes.BatWing, 100),
                new RequiredItem((int)ObjectIndexes.SolarEssence, 50),
                new RequiredItem((int)ObjectIndexes.VoidEssence, 50)
            });

            RequiredItem randomExplosive = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.CherryBomb, 25, 50),
                new RequiredItem((int)ObjectIndexes.Bomb, 25, 50),
                new RequiredItem((int)ObjectIndexes.MegaBomb, 25, 50)
            });

            RequiredItem randomGemstone = Globals.RNGGetRandomValueFromList(new List <RequiredItem>()
            {
                new RequiredItem((int)ObjectIndexes.Quartz, 25, 50),
                new RequiredItem((int)ObjectIndexes.FireQuartz, 25, 50),
                new RequiredItem((int)ObjectIndexes.EarthCrystal, 25, 50),
                new RequiredItem((int)ObjectIndexes.FrozenTear, 25, 50),
                new RequiredItem((int)ObjectIndexes.Aquamarine, 25, 50),
                new RequiredItem((int)ObjectIndexes.Amethyst, 25, 50),
                new RequiredItem((int)ObjectIndexes.Emerald, 25, 50),
                new RequiredItem((int)ObjectIndexes.Ruby, 25, 50),
                new RequiredItem((int)ObjectIndexes.Topaz, 25, 50),
                new RequiredItem((int)ObjectIndexes.Jade, 25, 50),
                new RequiredItem((int)ObjectIndexes.Diamond, 10, 30),
            });

            var potentialRewards = new List <RequiredItem>
            {
                randomOre,
                randomBar,
                randomGeode,
                randomMonsterDrop,
                randomExplosive,
                randomGemstone,
                new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetGeodeMinerals()), 25),
                new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetArtifacts())),
                new RequiredItem(Globals.RNGGetRandomValueFromList(ItemList.GetRings())),
                new RequiredItem((int)ObjectIndexes.Crystalarium),
                new RequiredItem((int)ObjectIndexes.MayonnaiseMachine),
                new RequiredItem((int)ObjectIndexes.Coal, 100)
            };

            if (Globals.RNGGetNextBoolean(1))             // 1% chance of a prismatic shard reward
            {
                Reward = new RequiredItem((int)ObjectIndexes.PrismaticShard);
            }

            else
            {
                Reward = Globals.RNGGetRandomValueFromList(potentialRewards);
            }
        }
        /// <summary>
        /// Attempt to generate a random bundle - 10% chance
        /// </summary>
        /// <returns>True if successful, false otherwise</returns>
        protected bool TryGenerateRandomBundle()
        {
            if (Room != CommunityCenterRooms.Vault && Room != CommunityCenterRooms.Joja && Globals.RNGGetNextBoolean(10))
            {
                PopulateRandomBundle();
                return(true);
            }

            return(false);
        }
Пример #23
0
        /// <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);
        }