コード例 #1
0
ファイル: Trees.cs プロジェクト: Xellss/RougyMon
        public static Trees[] DrawRandomTree(MapField[,] forestFields)
        {
            Random spawnCount = new Random();
            Random Rnd = new Random();
            int SpawnCount = spawnCount.Next(35, 70);
            Trees[] tree = new Trees[SpawnCount];

            Random rnd = new Random();
            for (int i = 0; i < SpawnCount; i++)
            {
                treeX = rnd.Next(1, 38);
               treeY = rnd.Next(1, 18);
               if (forestFields[treeX, treeY].Content is BlankSpace)
               {
                   tree[i] = new Trees(new Vector2i(treeX, treeY));

               }

            }
            return tree;
        }
コード例 #2
0
ファイル: Gold.cs プロジェクト: Xellss/RougyMon
        //static Random Rnd = new Random();
        public static Gold[] InitGold(MapField[,] mapFields)
        {
            Random spawnCount = new Random();
            Random rnd = new Random();
            int SpawnCount = spawnCount.Next(3, 8);
            Gold[] gold = new Gold[SpawnCount];
            int goldX = 0;
            int goldY = 0;
            for (int i = 0; i < SpawnCount; i++)
            {
                goldX = rnd.Next(1, 38);
                goldY = rnd.Next(1, 18);
                if (mapFields[goldX, goldY].Content is BlankSpace)
                {
                    gold[i] = new Gold(new Vector2i(goldX, goldY));

                }

            }
            return gold;
        }
コード例 #3
0
ファイル: Water.cs プロジェクト: Xellss/RougyMon
 public static void SpawnWater(MapField[,] forestFields)
 {
     forestFields[1, 1].Content = new Water (new Vector2i(1,1));
     forestFields[1, 2].Content = new Water (new Vector2i(1,2));
     forestFields[1, 3].Content = new Water (new Vector2i(1,3));
     forestFields[1, 4].Content = new Water (new Vector2i(1,4));
     forestFields[1, 5].Content = new Water (new Vector2i(1,5));
     forestFields[1, 6].Content = new Water (new Vector2i(1,6));
     forestFields[2, 1].Content = new Water (new Vector2i(2,1));
     forestFields[2, 2].Content = new Water (new Vector2i(2,2));
     forestFields[2, 3].Content = new Water (new Vector2i(2,3));
     forestFields[2, 4].Content = new Water (new Vector2i(2,4));
     forestFields[2, 5].Content = new Water (new Vector2i(2,5));
     forestFields[3, 1].Content = new Water (new Vector2i(3,1));
     forestFields[3, 2].Content = new Water (new Vector2i(3,2));
     forestFields[3, 3].Content = new Water (new Vector2i(3,3));
     forestFields[3, 4].Content = new Water (new Vector2i(3,4));
     forestFields[4, 1].Content = new Water (new Vector2i(4,1));
     forestFields[4, 2].Content = new Water (new Vector2i(4,2));
     forestFields[4, 3].Content = new Water (new Vector2i(4,3));
     forestFields[5, 1].Content = new Water (new Vector2i(5,1));
     forestFields[5, 2].Content = new Water (new Vector2i(5,2));
     forestFields[6, 1].Content = new Water (new Vector2i(6,1));
 }
コード例 #4
0
ファイル: Gravestone.cs プロジェクト: Xellss/RougyMon
 public static void SpawnGravestone(MapField[,] graveyardFields)
 {
     graveyardFields[3, 5].Content = new Gravestone(new Vector2i(3, 5));
     graveyardFields[3, 10].Content = new Gravestone(new Vector2i(3, 10));
     graveyardFields[3, 15].Content = new Gravestone(new Vector2i(3, 15));
     graveyardFields[8, 5].Content = new Gravestone(new Vector2i(8, 5));
     graveyardFields[8, 10].Content = new Gravestone(new Vector2i(8, 10));
     graveyardFields[8, 15].Content = new Gravestone(new Vector2i(8, 15));
     graveyardFields[13, 5].Content = new Gravestone(new Vector2i(13, 5));
     graveyardFields[13, 10].Content = new Gravestone(new Vector2i(13, 10));
     graveyardFields[13, 15].Content = new Gravestone(new Vector2i(13, 15));
     graveyardFields[18, 5].Content = new Gravestone(new Vector2i(18, 5));
     graveyardFields[18, 10].Content = new Gravestone(new Vector2i(18, 10));
     graveyardFields[18, 15].Content = new Gravestone(new Vector2i(18, 15));
     graveyardFields[23, 5].Content = new Gravestone(new Vector2i(23, 5));
     graveyardFields[23, 10].Content = new Gravestone(new Vector2i(23, 10));
     graveyardFields[23, 15].Content = new Gravestone(new Vector2i(23, 15));
     graveyardFields[28, 5].Content = new Gravestone(new Vector2i(28, 5));
     graveyardFields[28, 10].Content = new Gravestone(new Vector2i(28, 10));
     graveyardFields[28, 15].Content = new Gravestone(new Vector2i(28, 15));
     graveyardFields[33, 5].Content = new Gravestone(new Vector2i(33, 5));
     graveyardFields[33, 10].Content = new Gravestone(new Vector2i(33, 10));
     graveyardFields[33, 15].Content = new Gravestone(new Vector2i(33, 15));
 }
コード例 #5
0
ファイル: SkeletonKing.cs プロジェクト: Xellss/RougyMon
 public static void skeletonKingSpawn(MapField[,] mapFields)
 {
     Random rnd = new Random();
     skeletonKingX = rnd.Next(1, 38);
     skeletonKingY = rnd.Next(1, 5);
 }
コード例 #6
0
ファイル: Player.cs プロジェクト: Xellss/RougyMon
        private void CheckField(MapField nextField)
        {
            if (nextField.Content is PortalToForest)
            {
                Vector2i playerPosition = Position;
                Console.Clear();
                Map.Level = 2;
                playerPosition.X += 37;
                playerPosition.Y += 0;
                MapForest.CreateAfterPort();
                MapForest.DrawMap();
            }
            else if (nextField.Content is PortalToGraveyard && Key.KeyCounter > 0)
            {
                Vector2i playerPosition = Position;
                Console.Clear();
                Map.Level = 3;
                playerPosition.X += 0;
                playerPosition.Y += 17;
                MapGraveyard.CreateAfterPort();
                MapGraveyard.DrawMap();
            }
            else if (nextField.Content is PortalToCity)
            {
                Vector2i playerPosition = Position;
                Console.Clear();
                if (Map.Level == 2)
                {
                    Map.Level = 1;
                    playerPosition.X = 1;
                    playerPosition.Y = 3;
                }
                else if (Map.Level == 3)
                {
                    Map.Level = 1;
                    playerPosition.X = 10;
                    playerPosition.Y = 1;
                }

                MapCity.CreateAfterPort();
                MapCity.DrawMap();

            }
            else if (nextField.Content is Ork)
            {
                Ork Ork = (Ork)nextField.Content;
                nextField.Content = new BlankSpace(new Vector2i(nextField.Position));
                Health--;
            }
            else if (nextField.Content is Skeleton)
            {
                Skeleton Skeleton = (Skeleton)nextField.Content;
                nextField.Content = new BlankSpace(new Vector2i(nextField.Position));
                Health--;
            }
            else if (nextField.Content is SkeletonKing)
            {
                SkeletonKing SkeletonKing = (SkeletonKing)nextField.Content;
                nextField.Content = new Triforce(new Vector2i(nextField.Position));
            }
            else if (nextField.Content is Gold)
            {
                nextField.Content = new BlankSpace(new Vector2i(nextField.Position));
                Gold.GoldCounter += 1;
            }
            else if (nextField.Content is Key)
            {
                nextField.Content = new BlankSpace(new Vector2i(nextField.Position));
                Key.KeyCounter++;
            }
            else if (nextField.Content is Triforce)
            {
                nextField.Content = new BlankSpace(new Vector2i(nextField.Position));
                Triforce.HaveTriforce = true;
            }
        }
コード例 #7
0
ファイル: Skeleton.cs プロジェクト: Xellss/RougyMon
 public static void skeletonSpawn(MapField[,] mapFields)
 {
     Random rnd = new Random();
     skeletonOneX = rnd.Next(1, 38);
     skeletonOneY = rnd.Next(6, 18);
     skeletonTwoX = rnd.Next(1, 38);
     skeletonTwoY = rnd.Next(6, 18);
 }
コード例 #8
0
ファイル: MapCity.cs プロジェクト: Xellss/RougyMon
 public static void InitFields()
 {
     for (int y = 0; y < MaxHeight; y++)
     {
         for (int x = 0; x < MaxWidth; x++)
         {
             cityFields[x, y] = new MapField(new Vector2i(x, y));
         }
     }
 }
コード例 #9
0
ファイル: Ork.cs プロジェクト: Xellss/RougyMon
 public static void OrkSpawn(MapField[,] mapFields)
 {
     Random rnd = new Random();
     orkOneX = rnd.Next(1, 38);
     orkOneY = rnd.Next(1, 18);
     orkTwoX = rnd.Next(1, 38);
     orkTwoY = rnd.Next(1, 18);
 }
コード例 #10
0
ファイル: MapGraveyard.cs プロジェクト: Xellss/RougyMon
 private static void InitFields()
 {
     for (int y = 0; y < MaxHeight; y++)
     {
         for (int x = 0; x < MaxWidth; x++)
         {
             graveyardFields[x, y] = new MapField(new Vector2i(x, y));
         }
     }
 }