----------------------------------VERGAS------------------------------------
function s_play(path,vol)
	local snd_obj = xr_sound.get_safe_sound_object(path)
	snd_obj:play_at_pos(db.actor, vector ():set (0, 0, 0), 0, sound_object.s2d)
	snd_obj.volume = vol
end
function spawn_item_in_inv(spawn_item,npc) 
	if npc==nil then 
		npc=db.actor 
	end
	alife():create(spawn_item, 
	npc:position(),
	npc:level_vertex_id(),  
	npc:game_vertex_id(),
	npc:id())
end
function vergas_spawner()
	--spawn_item_in_inv("timer",npc)	
end
function save_variable(variable_name, value)
  if value==nil then
    del_variable(variable_name)
  else
    xr_logic.pstor_store(db.actor, variable_name, value)
  end
end

function load_variable(variable_name, value_if_not_found)
  return xr_logic.pstor_retrieve(db.actor, variable_name, value_if_not_found)
end

function del_variable(variable_name)
  if db.storage[db.actor:id()].pstor[variable_name] then
    db.storage[db.actor:id()].pstor[variable_name] = nil
  end
end
function return_time(param)
	local y,m,d,h,min,sec,ms = game.get_game_time():get()
	if param == 1 then
		return y					--Год
	elseif param == 2 then
		return m					--Месяц
	elseif param == 3 then
		return d					--День
	elseif param == 4 then
		return h					--Час
	elseif param == 5 then
		return min					--Минуты
	elseif param == 6 then
		return sec					--Секунды
	elseif param == 7 then
		return ms					--Милесекунды
	end
	return sec
end
function set_pr_from_config(section,pr)
	local ltx = system_ini()
	local pr_s
	if ltx:line_exist(section,pr) then
		pr_s = ltx:r_float(section,pr)
	else
		pr_s = 0
	end
	
	return pr_s
	
end
function used_item()
	timer_v.used_item()
	medkit_use.used_item()
	timer_v.show_time_in_inv()
end
function lose_item(obj)
	medkit_use.lose_item(obj)
	timer_v.lose_item(obj)
end
function medkit_zapret(remove_item)
	medkit_use.medik_zapret(remove_item)
end
function game_load()
	medkit_use.load()
	timer_v.load()
	vergas_spawner()
end
function game_save()
	medkit_use.save()
	timer_v.save()
end
function show_time()
	timer_v.show_time_timer()
end


