コード例 #1
0
        //When player enters a room
        public static Player CurrentRoom(Player player, Room room)
        {
            var temp_player = (Player)player.Clone();

            room.GetRoomStats();

            if (room.Enemy != null && room.Enemy.Health > 0)
            {
                Battle.Battleground(temp_player, room.Enemy);
                if (temp_player.Health > 0)
                {
                    Console.WriteLine("Enemy has fallen");
                }
                Text.Continue();
            }
            else
            {
                Console.WriteLine("Room seems to be empty...");
            }

            Stats.ResetStats(player, temp_player);

            if (room.HasItem())
            {
                Stats.AddNewItemFromRoom(player, room);
            }
            if (room.Stars != 0)
            {
                player.SecretMessage.CollectStar(room.Stars);
            }


            if (!player.SecretMessage.CollectedAllStars())
            {
                player.NextRoom = Choices.ChooseDoor(room);
                room.Stars      = 0;
            }


            return(player);
        }