コード例 #1
0
        public string WallDoorMonsterCheck(int x, int y, string[,] map, bool key)
        {
            if (map[x, y] == "0")
            {
                return("wall");
            }
            else if (map[x, y] == "D")
            {
                return("door");
            }
            else if (map[x, y] == "M")
            {
                FightClub club = new FightClub();
                club.RandomFight();
                //club.ChoosenCreturesFight();
                key = true;
                Console.WriteLine($"Now you have a key!");
                Console.ReadLine();

                return(" ");
            }
            else
            {
                return(" ");
            }
        }
コード例 #2
0
        public string WallDoorMonsterStairsCheck(int x, int y, string[,] map, Hero hero)
        {
            if (!hero.HeroAlive)
            {
                return("dead");
            }
            if (map[x, y] == "0")
            {
                return("wall");
            }
            else if (map[x, y] == "D")
            {
                if (hero.KeyAvailability == false)
                {
                    return("door");
                }
                else
                {
                    hero.KeyAvailability = false;
                    return(" ");
                }
            }
            else if (map[x, y] == "M")
            {
                FightClub club = new FightClub();
                club.RandomFight();
                hero.KeyAvailability = true;
                Console.WriteLine($"Now you have a key!");
                Console.ReadLine();
                Console.Clear();

                return(" ");
            }
            else if (map[x, y] == "P")
            {
                Win.CloseProgram();
                return(" ");
            }
            else if (map[x, y] == "S")
            {
                return("stairs");
            }
            else
            {
                return(" ");
            }
        }