コード例 #1
0
ファイル: DungeonMaker.cs プロジェクト: Sinellil/roguelike-cs
        private void SpawnPrinceItems(int budgetScale)
        {
            int dungeonID = 6;

            int dungeonStartLevel = Game.Dungeon.DungeonInfo.GetDungeonStartLevel(dungeonID);
            int dungeonEndLevel = Game.Dungeon.DungeonInfo.GetDungeonEndLevel(dungeonID);

            int totalPotions = 1 + Game.Random.Next(3);
            /*
            //bonus potions for the dragon level
            for (int j = 0; j < totalPotions; j++)
            {
                int randomChance = Game.Random.Next(100);

                Item potion;

                if (randomChance < 50)
                    potion = new Items.Potion();
                else
                    potion = new Items.PotionMPRestore();

                PlaceItemOnLevel(potion, dungeonEndLevel, 0);
            }*/

            for (int i = dungeonStartLevel; i <= dungeonEndLevel; i++)
            {

                //Spawn bonus potions

                totalPotions = 2 + Game.Random.Next(4);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(100);

                    Item potion;

                    if (randomChance < 25)
                        potion = new Items.PotionSpeedUp();
                    else if(randomChance < 50)
                        potion = new Items.PotionSightUp();
                    else if(randomChance < 75)
                        potion = new Items.PotionToHitUp();
                    else
                        potion = new Items.PotionDamUp();

                    PlaceItemOnLevel(potion, i, 50);
                }

                //Spawn restore / heal potions

                totalPotions = 1 + Game.Random.Next(3);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(100);

                    Item potion;

                    if (randomChance < 50)
                        potion = new Items.Potion();
                    else
                        potion = new Items.PotionMPRestore();

                    PlaceItemOnLevel(potion, i, 50);
                }
            }
        }
コード例 #2
0
ファイル: DungeonMaker.cs プロジェクト: Sinellil/roguelike-cs
        private void SpawnWaterCaveItems(int budgetScale)
        {
            int dungeonID = 1;

            int dungeonStartLevel = Game.Dungeon.DungeonInfo.GetDungeonStartLevel(dungeonID);
            int dungeonEndLevel = Game.Dungeon.DungeonInfo.GetDungeonEndLevel(dungeonID);

            for (int i = dungeonStartLevel; i <= dungeonEndLevel; i++)
            {

                //Spawn bonus potions

                int totalPotions = 1 + Game.Random.Next(3);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(100);

                    Item potion;

                    if (randomChance < 50)
                        potion = new Items.PotionSpeedUp();
                    else
                        potion = new Items.PotionSightUp();

                    PlaceItemOnLevel(potion, i, 50);
                }

                //Spawn restore / heal potions

                totalPotions = 1 + Game.Random.Next(3);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(100);

                    Item potion;

                    if (randomChance < 50)
                        potion = new Items.Potion();
                    else
                        potion = new Items.PotionMPRestore();

                    PlaceItemOnLevel(potion, i, 50);
                }
            }
        }
コード例 #3
0
ファイル: DungeonMaker.cs プロジェクト: Sinellil/roguelike-cs
        private void SpawnOrcItems(int budgetScale)
        {
            int dungeonID = 3;

            int dungeonStartLevel = Game.Dungeon.DungeonInfo.GetDungeonStartLevel(dungeonID);
            int dungeonEndLevel = Game.Dungeon.DungeonInfo.GetDungeonEndLevel(dungeonID);

            for (int i = dungeonStartLevel; i <= dungeonEndLevel; i++)
            {
                int totalPotions = Game.Random.Next(3);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(100);

                    Item potion;

                    if (randomChance < 10)
                        potion = new Items.Potion();
                    else if (randomChance < 20)
                        potion = new Items.PotionMPRestore();
                    else if (randomChance < 60)
                        potion = new Items.PotionDamUp();
                    else
                        potion = new Items.PotionToHitUp();

                    PlaceItemOnLevel(potion, i, 50);
                }

                totalPotions = Game.Random.Next(3);

                for (int j = 0; j < totalPotions; j++)
                {
                    int randomChance = Game.Random.Next(2);

                    Item potion;

                        potion = new Items.PotionMPRestore();

                    PlaceItemOnLevel(potion, i, 50);
                }
            }
        }