/// <summary>
        /// Randomizes boots - currently only changes defense and immunity
        /// </summary>
        /// <returns />
        public static Dictionary <int, string> Randomize()
        {
            Boots.Clear();
            WeaponAndArmorNameRandomizer nameRandomizer = new WeaponAndArmorNameRandomizer();

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

            foreach (BootItem originalBoot in BootData.AllBoots)
            {
                int statPool = Globals.RNGGetIntWithinPercentage(originalBoot.Defense + originalBoot.Immunity, 30);
                int defense  = Range.GetRandomValue(0, statPool);
                int immunity = statPool - defense;

                BootItem newBootItem = new BootItem(
                    originalBoot.Id,
                    nameRandomizer.GenerateRandomBootName(),
                    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);
        }
Esempio n. 2
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);
        }