Example #1
0
        public static string Randon_drop_chance()
        {
            string weapon           = "wA000";
            string shield           = "sA000";
            string hppots           = "hA00";
            Random rng              = new Random();
            int    weapon_or_shield = rng.Next(0, 100);
            int    IS_gonna_drop    = rng.Next(0, 100);

            if (IS_gonna_drop < 100)
            {
                if (weapon_or_shield < 50)
                {
                    weapon        = Dungeon.ReplaceAtIndex(4, (char)rng.Next(49, 58), weapon); //Generates a number between 1 and 9 and assigns it to 4th pos
                    shield_or_nah = false;
                    return(weapon);
                }
                else
                {
                    shield        = Dungeon.ReplaceAtIndex(4, (char)rng.Next(49, 53), shield); //Generates a number between 1 and 9 and assigns it to 4th pos
                    shield_or_nah = true;
                    return(shield);
                }
            }

            return("");
        }
Example #2
0
        public static string RemoveSpaces(string text)
        {
            int count = 0;

            foreach (char i in text)
            {
                if (i == '_')
                {
                    text = Dungeon.ReplaceAtIndex(count, ' ', text);
                }

                count++;
            }

            return(text);
        }