-- $Name:Игры с разумом$
-- $Version:1.0$
-- $Author:Oreolek$
require "format";
require "input";
require "para";
require "quotes";
require "dash";
require "xact";
require "hideinv";
instead_version "1.3.3";
game.codepage = 'UTF-8';
game.forcedsc = true;

-- музыкальный плеер - играет всё в папке music, можно класть свои треки
-- ubuntu: sudo apt-get install liblua5.1-filesystem0

music = {}
if pcall(function() require "lfs" end) then
 i = 1
 for name in lfs.dir("./music") do
  music[i] = "music/"..name; -- push
  i = i+1;
 end
 i = i-1;
else
 music = {"music/1. start.ogg","music/2. Night in Detroit.ogg","music/3. Neutron Star.ogg","music/4. Cool rix.ogg"};
 i = 4;
end
mplayer = obj {
 nam = 'плеер',
 life = function(s)
  local n = get_music();
  local v = get_music_loop();
  if not n or not v then set_music(music[1], 1);
  elseif v == -1 then
   local n = get_music();
   while get_music() == n do
    n = music[rnd(i)]
   end
   set_music(n, 1);
  end
 end,
};

dofile ('objects.lua');
dofile ('rooms.lua');
