import api_game as api_game
import game_1 as quest_game

str_path_img="data\\img\\"
str_img_menu=str_path_img+"menu\\game\\object_select.jpg"

music_location="data\\sound\\lost-day.ogg"

def on_create():
	global music_location
	api_game.load_stream(music_location,1)
	api_game.fade_music(music_location,0,3)

	str_path_icon=str_path_img+"lev\\"+__name__+"\\objects_icon\\"
	str_path_m_icon=str_path_img+"lev\\"+__name__+"\\items\\"
	quest_game.set_path_small_icon(str_path_img+"lev\\"+__name__+"\\icons\\")

	api_game.load_stream("data\\sound\\quest\\amb_wind_low.ogg",0)
	api_game.set_local_vol("data\\sound\\quest\\amb_wind_low.ogg",0.7)
	api_game.play_sound("data\\sound\\quest\\amb_wind_low.ogg",1)

	api_game.enable_visibility(0,"three_object", 0)
	api_game.enable_visibility(0,"fifth_object", 0)
	api_game.enable_visibility(0,"fourth_object", 0)
	api_game.enable_visibility(0,"structure", 0)
	api_game.enable_visibility(0,"z3", 0)
	api_game.enable_visibility(0,"net_empty", 0)
	api_game.enable_visibility(0,"net_low", 0)	
	api_game.enable_visibility(0,"verevka", 0)		
	api_game.enable_visibility(0,"vkl_1", 0)
	api_game.enable_visibility(0,"vkl_2", 0)
	api_game.enable_update(0,"vkl_1", 0)
	api_game.enable_update(0,"vkl_2", 0)

	str_icons_menu=[str_path_icon+"item5_1.gif",str_path_icon+"item5_2.gif",str_path_icon+"item5_3.gif",str_path_icon+"item5_4.gif",str_path_icon+"item5_5.gif","","",""]
	str_icon_mouse=[str_path_m_icon+"item5_1m.jpg",str_path_m_icon+"item5_2m.jpg",str_path_m_icon+"item5_3m.jpg",str_path_m_icon+"item5_4m.jpg",str_path_m_icon+"item5_5m.jpg","","",""]
	str_objects_on_loc=["item5_1","item5_2","item5_3","item5_4","item5_5","","",""]
	quest_game.add_of("ustup_1", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 1.41,0,0)

	str_icons_menu=[str_path_icon+"machete_icon.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif",str_path_icon+"item2_1.gif"]
	str_icon_mouse=[str_path_m_icon+"machete_big.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg",str_path_m_icon+"item2_1m.jpg"]
	str_objects_on_loc=["three_object","item2_2","item2_3","item2_4","item2_5","item2_6","item2_7","item2_8"]
	quest_game.add_of("hook_2", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 3.14,-10,-27)

	str_icons_menu=[str_path_icon+"item1_1.gif",str_path_icon+"item1_2.gif",str_path_icon+"item1_3.gif",str_path_icon+"item1_4.gif",str_path_icon+"item1_5.gif","","",""]
	str_icon_mouse=[str_path_m_icon+"item1_1m.jpg",str_path_m_icon+"item1_2m.jpg",str_path_m_icon+"item1_3m.jpg",str_path_m_icon+"item1_4m.jpg",str_path_m_icon+"item1_5m.jpg","","",""]
	str_objects_on_loc=["item1_1","item1_2","item1_3","item1_4","item1_5","","",""]
	quest_game.add_of("first_object", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 3.14,0,0)

	str_icons_menu=[str_path_icon+"item3_1.gif",str_path_icon+"item3_2.gif",str_path_icon+"item3_3.gif",str_path_icon+"item3_4.gif",str_path_icon+"item3_5.gif","","",""]
	str_icon_mouse=[str_path_m_icon+"item3_1m.jpg",str_path_m_icon+"item3_2m.jpg",str_path_m_icon+"item3_3m.jpg",str_path_m_icon+"item3_4m.jpg",str_path_m_icon+"item3_5m.jpg","","",""]
	str_objects_on_loc=["item3_1","item3_2","item3_3","item3_4","item3_5","","",""]
	quest_game.add_of("net_empty", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 3.14,0,0)

	str_icons_menu=[str_path_icon+"item4_1.gif",str_path_icon+"item4_2.gif",str_path_icon+"item4_3.gif",str_path_icon+"item4_4.gif",str_path_icon+"item4_5.gif","","",""]
	str_icon_mouse=[str_path_m_icon+"item4_1m.jpg",str_path_m_icon+"item4_2m.jpg",str_path_m_icon+"item4_3m.jpg",str_path_m_icon+"item4_4m.jpg",str_path_m_icon+"item4_5m.jpg","","",""]
	str_objects_on_loc=["item4_1","item4_2","item4_3","item4_4","item4_5","item4_6","item4_7","item4_8"]
	quest_game.add_of("net_low", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 3.14,0,0)

	str_icons_menu=[str_path_icon+"laundry_icon.gif","","","","","","",""]
	str_icon_mouse=[str_path_m_icon+"laundry_big.jpg","","","","","","",""]
	str_objects_on_loc=["fifth_object","","","","","","",""]
	quest_game.add_of("structure", str_img_menu, str_icons_menu, str_icon_mouse, str_objects_on_loc, 3.14,0,0)

	quest_game.set_collect_sound("first_object","data\\sound\\quest\\q_molotok.ogg")
	quest_game.set_collect_sound("fourth_object","data\\sound\\quest\\q_molotok.ogg")

	quest_game.add_oc("secret_1", "data\\img\\lev\\loc_12_1\\mini\\secret_1.gif", "vkl_1")	
	quest_game.set_state_of("ustup_1", 2)

	api_game.set_goal("goal_12_1")

def on_mouse_down_of(object_name, p_object, state):
	if object_name == "ustup_1" and state == 3:
		api_game.set_goal("goal_12_2")
		api_game.play_anim(0,"structure","quest_anim",0.5,0)	
		quest_game.set_state_of("hook_2", 2)
		quest_game.set_state_of("first_object", 2)
	elif object_name == "hook_2" and state == 3:
		api_game.set_goal("goal_12_3")
		api_game.play_anim(0,"net_empty","quest_anim",0.5,0)
		quest_game.set_state_of("net_empty", 2)			
	elif object_name == "first_object" and state == 3:
		api_game.play_anim(0,"first_object","quest_anim",0.5,1)
		quest_game.show_object("three_object","quest_anim",0.5,0,0)
		quest_game.set_state_of("second_object", 2)
	elif object_name == "net_empty" and state == 3:
		api_game.set_goal("goal_12_5")
		api_game.play_anim(0,"net_empty","quest_anim",0.5,1)
		quest_game.show_object("net_low","quest_anim",0.5,0,0)
		quest_game.add_oc("secret_2", "data\\img\\lev\\loc_12_1\\mini\\secret_2.gif", "vkl_2")
		quest_game.set_state_of("net_low", 2)
	elif object_name == "net_low" and state == 3:		
		api_game.set_goal("goal_12_6")
		quest_game.show_object("fifth_object","quest_anim",0.5,0,0)
		quest_game.set_state_of("structure", 2)
	elif object_name == "structure" and state == 3:
		api_game.play_anim(0,"net_low","quest_anim",0.5,1)
		quest_game.show_object("verevka","quest_anim",0.5,0,0)
				

				 
def on_stop_anim(object_name, anim_name, p_object, i_track):	
	if object_name == "z3":
		quest_game.add_oc("z3", "data\\img\\lev\\loc_12_1\\mini\\struct_glow.gif", "")
	if object_name == "verevka":
		api_game.game_win()

def on_mouse_down_oc(object_name, p_object):
	if object_name == "z3":
		quest_game.remove_oc("z3")
		api_game.game_win()
