--[[
Copyright: © Real Wolf, Èðáèñ
]]

local dest_x,dest_y,dest_z
function start_guide(x,y,z)
	level.add_cam_effector("camera_effects\\empty.anm", 160608, false,"lwc_guide.teleport")
	level.add_pp_effector("peace_fade.ppe", 160608, false)
	db.actor:give_info_portion("hide_hud")
 	dest_x = x
 	dest_y = y
 	dest_z = z
end

function teleport()
 	level.add_cam_effector("camera_effects\\empty.anm", 160608, false,"lwc_guide.enable_hud")
 	level.add_pp_effector("peace_unfade.ppe", 160608, false)
 	db.actor:set_actor_position(vector():set(dest_x, dest_y, dest_z))
	dest_x = nil
	dest_y = nil
	dest_z = nil
end

function enable_hud()
    	level.show_indicators()
    	level.enable_input()
    	db.actor:disable_info_portion("hide_hud")

	if has_alife_info("info_af") and not has_alife_info("pred_proriv_complete") then
		db.actor:give_info_portion("pred_proriv_complete")
		lwc.PlaySound([[music\first]])
	end
end

local dest_p
function start_guide_camp(p)
	level.add_cam_effector("camera_effects\\empty.anm", 160608, false,"lwc_guide.teleport_camp")
	level.add_pp_effector("peace_fade.ppe", 160608, false)
	db.actor:give_info_portion("hide_hud")
 	dest_p = p
end

function teleport_camp()
 	level.add_cam_effector("camera_effects\\empty.anm", 160608, false,"lwc_guide.enable_hud")
 	level.add_pp_effector("peace_unfade.ppe", 160608, false)	
    	db.actor:set_actor_position(dest_p)
    	local dir = dest_p:sub(dest_p)
    	db.actor:set_actor_direction(-dir:getH())
	dest_p = nil 
end