if (_G.object == nil) then
	_G.object = {}
end

local jump_time = nil

function script_functor_jump()
	--[[
	if (jump_time ~= nil and jump_time + 10000 <= time_global()) or jump_time == nil then
		jump_time = time_global()
		return true
	end
	return false
	]]--
	return true
end

function script_functor_true()
	return true
end

function exit_random(p)
	return math.random(100) <= tonumber(p)
end

descriptions = {
	duplo = {
		loopholes = {
			-- {
				-- id = "loophole_enter",
				-- fov_position = vector():set(1.1, -.65 ,-1.4),
				-- fov_direction = vector():set(-1,0,0),
				-- enter_direction = vector():set(1,0,0),
				-- enter_crouching = false,
				-- enterable = true,
				-- exitable = false,
				-- usable = false,
				-- actions = {
					-- idle = {
						-- "loophole_1_in_front_0",
					-- },
				-- },
			-- },
			{
				id = "loophole_0",
				fov_position = vector():set (1.1,0,-1.4),
				fov_direction = vector():set(-1,0,0),
				enter_direction = vector():set(1,0,0),
--				enterable = false,
--				enterable = true,
--				enter_crouching = true,
--				exitable = true,
				usable = true,
				fov	= 60.0,
				range = 32.0,
				actions = {
					idle = {
						animations = {
							idle = {
								"loophole_1_idle_0",
							},
						},
					},
					lookout = {
						animations = {
							idle = {
								"loophole_1_look_out_0",
							},
						},
					},
					fire = {
						animations = {
							idle = {
								"loophole_1_attack_idle_0",
							},
							shoot = {
								"loophole_1_attack_shoot_0",
							},
						},
					},
					fire_no_lookout = {
						animations = {
							idle = {
								"loophole_1_attack_idle_0",
							},
							shoot = {
								"loophole_1_attack_shoot_0",
							},
						},
					},
					reload = {
						animations = {
							idle = {
								"loophole_1_reload_0",
							},
						},
					},
					exit = {
						movement = true,
						position = vector():set(0,0,2),
						animations = {
							idle = {
								"loophole_1_jump_0",
							},
						},
					},
				},
				transitions = {
					{
						action_from = "idle",
						action_to = "lookout",
						weight = 1.2,
						animations = {
							"loophole_1_look_in_0",
						},
					},
					{
						action_from = "lookout",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_1_look_out_0",
						},
					},
					{
						action_from = "idle",
						action_to = "fire",
						weight = 1.2,
						animations = {
							"loophole_1_attack_in_0",
						},
					},
					{
						action_from = "fire",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_1_attack_out_0",
						},
					},
					{
						action_from = "idle",
						action_to = "fire_no_lookout",
						weight = 1.2,
						animations = {
							"loophole_1_attack_in_0",
						},
					},
					{
						action_from = "fire_no_lookout",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_1_attack_out_0",
						},
					},
				},
			},
			-- {
				-- id = "loophole_1",
				-- position = vector():set(0.5,0,2),
				-- direction = vector():set(0,0,-1),
				-- enterable = false,
				-- usable = true,
				-- fov	= 60.0,
				-- range = 32.0,
				-- actions = {
					-- idle = {
						-- animations = {
							-- idle = {
								-- "loophole_1_idle_0",
							-- },
						-- },
					-- },
					-- lookout = {
						-- animations = {
							-- idle = {
								-- "loophole_1_lookout_0",
							-- },
						-- },
					-- },
					-- fire = {
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
							-- shoot = {
								-- "loophole_1_attack_shoot_0",
							-- },
						-- },
					-- },
					-- fire_no_lookout = {
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
							-- shoot = {
								-- "loophole_1_attack_shoot_0",
							-- },
						-- },
					-- },
					-- reload = {
						-- animations = {
							-- idle = {
								-- "loophole_1_reload_0",
							-- },
						-- },
					-- },
					-- exit = {
						-- movement = true,
						-- position = vector():set(0,0,2),
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
						-- },
					-- },
				-- },
				-- transitions = {
					-- {
						-- action_from = "idle",
						-- action_to = "lookout",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_look_0",
						-- },
					-- },
					-- {
						-- action_from = "lookout",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_look_to_idle_0",
						-- },
					-- },
					-- {
						-- action_from = "idle",
						-- action_to = "fire",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_attack_0",
						-- },
					-- },
					-- {
						-- action_from = "fire",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_attack_to_idle_0",
						-- },
					-- },
					-- {
						-- action_from = "idle",
						-- action_to = "fire_no_lookout",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_attack_0",
						-- },
					-- },
					-- {
						-- action_from = "fire_no_lookout",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_attack_to_idle_0",
						-- },
					-- },
				-- },
			-- },
			{
				id = "loophole_2",
				fov_position = vector():set (1.1,0,1.4),
				fov_direction = vector():set(-1,0,0),
				enter_direction = vector():set(1,0,0),
				enterable = true,
				enter_crouching = true,
				exitable = false,
				usable = true,
				fov	= 60.0,
				range = 32.0,
				actions = {
					idle = {
						animations = {
							idle = {
								"loophole_3_idle_0",
							},
						},
					},
					lookout = {
						animations = {
							idle = {
								"loophole_3_look_out_0",
							},
						},
					},
					fire = {
						animations = {
							idle = {
								"loophole_3_attack_idle_0",
							},
							shoot = {
								"loophole_3_attack_shoot_0",
							},
						},
					},
					fire_no_lookout = {
						animations = {
							idle = {
								"loophole_3_look_idle_0",
							},
							shoot = {
								"loophole_3_look_shoot_0",
							},
						},
					},
					reload = {
						animations = {
							idle = {
								"loophole_3_reload_0",
							},
						},
					},
					exit = {
						movement = true,
						position = vector():set(0,0,2),
						animations = {
							idle = {
								"loophole_3_jump_0",
							},
						},
					},
				},
				transitions = {
					{
						action_from = "idle",
						action_to = "lookout",
						weight = 1.2,
						animations = {
							"loophole_3_look_in_0",
						},
					},
					{
						action_from = "lookout",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_3_look_out_0",
						},
					},
					{
						action_from = "idle",
						action_to = "fire",
						weight = 1.2,
						animations = {
							"loophole_3_attack_in_0",
						},
					},
					{
						action_from = "fire",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_3_attack_out_0",
						},
					},
					{
						action_from = "idle",
						action_to = "fire_no_lookout",
						weight = 1.2,
						animations = {
							"loophole_3_no_look_in_0",
						},
					},
					{
						action_from = "fire_no_lookout",
						action_to = "idle",
						weight = 1.2,
						animations = {
							"loophole_3_no_look_out_0",
						},
					},
				},
			},
			-- {
				-- id = "loophole_3",
				-- position = vector():set (-0.5,0,-2),
				-- direction = vector():set(0,0,1),
				-- enterable = false,
				-- usable = true,
				-- fov	= 60.0,
				-- range = 32.0,
				-- actions = {
					-- idle = {
						-- animations = {
							-- idle = {
								-- "loophole_1_idle_0",
							-- },
						-- },
					-- },
					-- lookout = {
						-- animations = {
							-- idle = {
								-- "loophole_1_lookout_0",
							-- },
						-- },
					-- },
					-- fire = {
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
							-- shoot = {
								-- "loophole_1_attack_shoot_0",
							-- },
						-- },
					-- },
					-- fire_no_lookout = {
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
							-- shoot = {
								-- "loophole_1_attack_shoot_0",
							-- },
						-- },
					-- },
					-- reload = {
						-- animations = {
							-- idle = {
								-- "loophole_1_reload_0",
							-- },
						-- },
					-- },
					-- exit = {
						-- movement = true,
						-- position = vector():set(0,0,2),
						-- animations = {
							-- idle = {
								-- "loophole_1_attack_idle_0",
							-- },
						-- },
					-- },
				-- },
				-- transitions = {
					-- {
						-- action_from = "idle",
						-- action_to = "lookout",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_look_0",
						-- },
					-- },
					-- {
						-- action_from = "lookout",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_look_to_idle_0",
						-- },
					-- },
					-- {
						-- action_from = "idle",
						-- action_to = "fire",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_attack_0",
						-- },
					-- },
					-- {
						-- action_from = "fire",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_attack_to_idle_0",
						-- },
					-- },
					-- {
						-- action_from = "idle",
						-- action_to = "fire_no_lookout",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_idle_to_attack_0",
						-- },
					-- },
					-- {
						-- action_from = "fire_no_lookout",
						-- action_to = "idle",
						-- weight = 1.2,
						-- animations = {
							-- "loophole_1_attack_to_idle_0",
						-- },
					-- },
				-- },
			-- },
		},
		transitions = {
			{
				vertex0 = "",
				vertex1 = "loophole_0",
				weight = 1.0,
				actions = {
					{
						position = vector():set(0, -.67, 1),
						precondition_functor = "smart_covers.script_functor_true",
						precondition_params = "",
						animation = "loophole_1_in_front_0",
					},
				},
			},
			{
				vertex0 = "loophole_0",
				vertex1 = "",
				weight = 1.0,
				actions = {
					{
						position = vector():set(0,0,1),
						precondition_functor = "smart_covers.script_functor_true",
						precondition_params = "",
						--body_state = move.standing, movement_type = move.run,
						--time = 5.0,
						animation = "loophole_1_exit_jump_0",
					},
				},
			},
			{
				vertex0 = "loophole_0",
				vertex1 = "loophole_2",
				weight = 1.0,
				actions = {
					{
						position = vector():set(0,0,1),
						precondition_functor = "smart_covers.script_functor_true",
						precondition_params = "",
						animation = "loophole_transition_1_to_3",
					},
				},
			},
			{
				vertex0 = "loophole_2",
				vertex1 = "loophole_0",
				weight = 1.1,
				actions = {
					{
						position = vector():set(0,0,1),
						precondition_functor = "smart_covers.script_functor_true",
						precondition_params = "",
						animation = "loophole_transition_3_to_1",
					},
				},
			},
		},
	},

	cover_loophole_1 = smart_covers_cover_loophole_1.get_smart_cover_cover_loophole_1(),
	cover_loophole_2 = smart_covers_cover_loophole_2.get_smart_cover_cover_loophole_2(),
	cover_loophole_3 = smart_covers_cover_loophole_3.get_smart_cover_cover_loophole_3(),
	cover_loophole_1_2 = smart_covers_cover_loophole_1_2.get_smart_cover_cover_loophole_1_2(),
	cover_loophole_2_3 = smart_covers_cover_loophole_2_3.get_smart_cover_cover_loophole_2_3(),
	cover_loophole_1_3 = smart_covers_cover_loophole_1_3.get_smart_cover_cover_loophole_1_3(),
	cover_loophole_1_2_3 = smart_covers_cover_loophole_1_2_3.get_smart_cover_cover_loophole_1_2_3(),
	cover_loophole_4 = smart_covers_cover_loophole_4.get_smart_cover_cover_loophole_4(),
	cover_loophole_5 = smart_covers_cover_loophole_5.get_smart_cover_cover_loophole_5(),
	cover_loophole_4_5 = smart_covers_cover_loophole_4_5.get_smart_cover_cover_loophole_4_5(),
	cover_loophole_6 = smart_covers_cover_loophole_6.get_smart_cover_cover_loophole_6(),
	cover_loophole_7 = smart_covers_cover_loophole_7.get_smart_cover_cover_loophole_7(),
	cover_loophole_6_7 = smart_covers_cover_loophole_6_7.get_smart_cover_cover_loophole_6_7(),
	cover_loophole_8 = smart_covers_cover_loophole_8.get_smart_cover_cover_loophole_8(),
	cover_loophole_9 = smart_covers_cover_loophole_9.get_smart_cover_cover_loophole_9(),
	cover_loophole_10 = smart_covers_cover_loophole_10.get_smart_cover_cover_loophole_10(),
	cover_loophole_11 = smart_covers_cover_loophole_11.get_smart_cover_cover_loophole_11(),
	cover_loophole_10_11 = smart_covers_cover_loophole_10_11.get_smart_cover_cover_loophole_10_11(),
	cover_loophole_10_8 = smart_covers_cover_loophole_10_8.get_smart_cover_cover_loophole_10_8(),
	cover_loophole_8_11 = smart_covers_cover_loophole_8_11.get_smart_cover_cover_loophole_8_11(),
	cover_loophole_10_8_11 = smart_covers_cover_loophole_10_8_11.get_smart_cover_cover_loophole_10_8_11(),


	cover_loophole_1_jump = smart_covers_cover_loophole_1_jump.get_smart_cover_cover_loophole_1_jump(),
	cover_loophole_2_jump = smart_covers_cover_loophole_2_jump.get_smart_cover_cover_loophole_2_jump(),
	cover_loophole_3_jump = smart_covers_cover_loophole_3_jump.get_smart_cover_cover_loophole_3_jump(),
	cover_loophole_1_2_jump = smart_covers_cover_loophole_1_2_jump.get_smart_cover_cover_loophole_1_2_jump(),
	cover_loophole_2_3_jump = smart_covers_cover_loophole_2_3_jump.get_smart_cover_cover_loophole_2_3_jump(),
	cover_loophole_1_3_jump = smart_covers_cover_loophole_1_3_jump.get_smart_cover_cover_loophole_1_3_jump(),
	cover_loophole_1_2_3_jump = smart_covers_cover_loophole_1_2_3_jump.get_smart_cover_cover_loophole_1_2_3_jump(),


	cover_loophole_lead_sit_sleep_mechanic = smart_covers_cover_loophole_lead_sit_sleep_mechanic.get_smart_cover_cover_loophole_lead_sit_sleep_mechanic(),
	cover_loophole_lead_sit_sleep_write = smart_covers_cover_loophole_lead_sit_sleep_write.get_smart_cover_cover_loophole_lead_sit_sleep_write(),
	cover_loophole_lead_sit_sleep_write_temp = smart_covers_cover_loophole_lead_sit_sleep_write_temp.get_smart_cover_cover_loophole_lead_sit_sleep_write(),
	cover_loophole_lead_sit_strong = smart_covers_cover_loophole_lead_sit_strong.get_smart_cover_cover_loophole_lead_sit_strong(),
	cover_loophole_lead_stand_hit_tv = smart_covers_cover_loophole_lead_stand_hit_tv.get_smart_cover_cover_loophole_lead_stand_hit_tv(),
	cover_loophole_lead_stand_lean_on_bar = smart_covers_cover_loophole_lead_stand_lean_on_bar.get_smart_cover_cover_loophole_lead_stand_lean_on_bar(),
	cover_loophole_lead_stand_look_at_table = smart_covers_cover_loophole_lead_stand_look_at_table.get_smart_cover_cover_loophole_lead_stand_look_at_table(),
	cover_loophole_lead_stand_look_down_2 = smart_covers_cover_loophole_lead_stand_look_down_2.get_smart_cover_cover_loophole_lead_stand_look_down_2(),
	cover_loophole_lead_stand_look_down_3 = smart_covers_cover_loophole_lead_stand_look_down_3.get_smart_cover_cover_loophole_lead_stand_look_down_3(),
	cover_loophole_lead_stand_look_in_window = smart_covers_cover_loophole_lead_stand_look_in_window.get_smart_cover_cover_loophole_lead_stand_look_in_window(),
	cover_loophole_lead_stand_look_up = smart_covers_cover_loophole_lead_stand_look_up.get_smart_cover_cover_loophole_lead_stand_look_up(),
	cover_loophole_stc_cover_1 = smart_covers_stc_cover_1.get_smart_cover_stc_1(),
	cover_loophole_stc_cover_2 = smart_covers_stc_cover_2.get_smart_cover_stc_2(),
	cover_loophole_stc_cover_3 = smart_covers_stc_cover_3.get_smart_cover_stc_3(),
	cover_loophole_lead_forester_idle_talk = smart_covers_cover_loophole_lead_forester_idle_talk.get_smart_cover_cover_loophole_lead_forester_idle_talk(),

	cover_loophole_1_3_test = smart_covers_cover_loophole_1_3_test.get_smart_cover_cover_loophole_1_3_test(),
	cover_barricade_0 = smart_covers_cover_barricade_0.get_smart_cover_cover_barricade_0(),
	cover_barricade_1 = smart_covers_cover_barricade_1.get_smart_cover_cover_barricade_1(),
	cover_barricade_2 = smart_covers_cover_barricade_2.get_smart_cover_cover_barricade_2(),
	cover_barricade_3 = smart_covers_cover_barricade_3.get_smart_cover_cover_barricade_3(),
	cover_barricade_commander = smart_covers_cover_barricade_commander.get_smart_cover_cover_barricade_commander(),
	cover_loophole_minigunner = smart_covers_cover_loophole_minigunner.get_smart_cover_cover_loophole_minigunner()
}


function main()
	print_table(descriptions)
end
