require("data/map/common")

-- ============================================================================
-- 設置スクリプト
-- ============================================================================
-- 設置
function InitEnemyList()
--[[--]]
	local waitTime = 0.0
	local lifeMaxFact = 1.5
	local aptime = 0.0
	local aptime2 = 0.0
	SetAptimeRelation(false)

	-- 毛玉沢山
	aptime = 0.0
	lifeMaxFact = 1.0
	for i=1, 200, 1 do
		local xpos = 3000.0 * (GetRandReal() - 0.5)
		local ypos = 150.0 + 600.0 * (GetRandReal() - 0.5)
		local zpos = 1200.0 + 300.0 * GetRandReal()
		SetKetama(aptime, {{x=xpos, y=ypos, z=zpos}}, lifeMaxFact)
		aptime = aptime + 0.07 - (i / 200.0 * 0.06)
	end

	aptime2 = aptime
	
	-- 左右から
	aptime = aptime2 + 5.0
	lifeMaxFact = 0.5
	for i=1, 3, 1 do
		for j=1, 4, 1 do
			for k=1, 5, 1 do
				local xpos = -500.0 + j * 30.0
				local ypos = 100.0 - j * 2.0
				local xpos2 = -300.0 + j * 30.0
				local ypos2 = 20.0 - j * 2.0
				if j % 2 > 0 then
					xpos = xpos * -1
					xpos2 = xpos2 * -1
				end
				if j / 2 > 1 then
					ypos = ypos * -1
					ypos2 = ypos2 * -1
				end
				SetDoll(aptime, {{x=xpos, y=ypos, z=1200.0}, {x=xpos2, y=ypos2, z=-50.0}}, 800.0, 51, lifeMaxFact, 0)
				aptime = aptime + 0.2
			end
			aptime = aptime - 0.5
		end
	end

	-- 前方からレーザー多数
	aptime = aptime2 + 6.0
	lifeMaxFact = 1.0
	for i=1, 30, 1 do
		local xpos_offset = (GetRandReal() - 0.5) * 200.0
		for j=1, 1, 1 do
			local xpos1 = xpos_offset + j * 100.0
			local xpos2 = xpos1
			local ypos = (GetRandReal() - 0.5) * 50.0
			SetDoll(aptime, {{x=xpos1, y=ypos, z=2000.0}, {x=xpos2, y=ypos, z=-50.0}}, 500.0, 12, lifeMaxFact, 1)
		end
		aptime = aptime + 0.25
	end
	
	-- 玉
	SetTama(aptime, {{x=-50.0, y=100.0, z=2000.0}}, lifeMaxFact)

	-- 早回し大型機
	lifeMaxFact = 1.0
	aptime = aptime + 1.5
	SetBigNext(aptime, {{x=500.0, y=0.0, z=-10.0}, {x=300.0, y=0.0, z= 400.0}, {x=-100.0, y=0.0, z= 800.0}}, 600.0, 26, lifeMaxFact)
 

--[[
	-- 偵察
	aptime = 0.0
	for i=1, 3, 1 do
		for j=1, 3, 1 do
			local xpos = -50.0 * j + 300.0
			local ypos = 25.0 * j
			SetDoll(aptime, {{x=xpos, y=ypos+200.0, z=2000.0}, {x=xpos, y=ypos+150.0, z=750.0}, {x=xpos, y=ypos+200.0, z=-50.0}}, 600.0, 51, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		aptime = aptime + 0.6
	end
	aptime = aptime + 2.5
	for i=1, 3, 1 do
		for j=1, 3, 1 do
			local xpos = 50.0 * j - 300.0
			local ypos = 25.0 * j
			SetDoll(aptime, {{x=xpos, y=ypos+200.0, z=1500.0}, {x=xpos, y=ypos+150.0, z=750.0}, {x=xpos, y=ypos+200.0, z=-50.0}}, 500.0, 51, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		aptime = aptime + 0.6
	end

	-- 扇型
	aptime = aptime + 3.0
	for i=-3, 3, 1 do
		local xpos = 100.0 * i
		local ypos = 20.0 * -math.abs(i) + 100.0
		SetDoll(aptime, {{x=xpos, y=ypos, z=2000.0}, {x=xpos, y=ypos-100.0, z=750.0}, {x=xpos, y=ypos+100.0, z=-50.0}}, 400.0, 41, lifeMaxFact, 0)
	end

	-- ビッグx2
	aptime = aptime + 1.5
	SetBig(aptime, {{x=100.0, y=200.0, z=-0.0}, {x=0.0, y=0.0, z= 800.0}}, 250.0, 26, lifeMaxFact)

	-- 後ろから
	aptime = aptime + 4.0
	for j=1, 3, 1 do
		for i=1, 3, 1 do
			local xpos = (100.0 * i + 500.0)
			local ypos = 50.0 * i
			local zpos = 100.0 * i
			SetDoll(aptime, {{x=xpos, y=ypos-50.0, z=zpos-150.0}, {x=xpos, y=ypos+100.0, z=2500.0}, {x=-xpos, y=ypos+50.0, z=-50.0}}, 700.0, 2, lifeMaxFact, 0)
			aptime = aptime + 0.0
		end
		for i=1, 3, 1 do
			local xpos = -(100.0 * i + 500.0)
			local ypos = 50.0 * i
			local zpos = 100.0 * i
			SetDoll(aptime, {{x=xpos, y=ypos-50.0, z=zpos-150.0}, {x=xpos, y=ypos+100.0, z=2500.0}, {x=-xpos, y=ypos+50.0, z=-50.0}}, 700.0, 2, lifeMaxFact, 0)
			aptime = aptime + 0.0
		end
		aptime = aptime + 0.5
	end

	-- レーザー
	lifeMaxFact = 3.0
	aptime = aptime + 4.0
	for i=1, 3, 1 do
		for j=-1, 1, 1 do
			local xpos1 = 50.0 * j - 500.0
			local xpos2 = 50.0 * j + 500.0
			local ypos = 75.0 * j
			SetDoll(aptime, {{x=xpos1, y=ypos+0.0, z=2000.0}, {x=xpos1, y=ypos+0.0, z=1000.0}, {x=xpos2, y=ypos+0.0, z=-50.0}}, 500.0, 12, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		for j=-1, 1, 1 do
			local xpos1 = -(50.0 * j - 500.0)
			local xpos2 = -(50.0 * j + 500.0)
			local ypos = 75.0 * j
			SetDoll(aptime, {{x=xpos1, y=ypos+0.0, z=2000.0}, {x=xpos1, y=ypos+0.0, z=1000.0}, {x=xpos2, y=ypos+0.0, z=-50.0}}, 500.0, 12, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		aptime = aptime + 1.0
	end

	-- インベーダー
	lifeMaxFact = 0.1
	aptime2 = aptime
	aptime = aptime + 1.0
	for i=1, 10, 1 do
		for j=-5, 5, 1 do
			local xpos1 = 400.0 * j - 0.0
			local xpos2 = 400.0 * j + 2000.0
			local ypos = -25.0 * j + 200.0
			SetDoll(aptime, {{x=xpos1, y=ypos, z=3000.0}, {x=xpos2, y=ypos, z=-50.0}}, 500.0, 51, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		aptime = aptime + 1.0
		
		for j=-5, 5, 1 do
			local xpos1 = -400.0 * j + 0.0
			local xpos2 = -400.0 * j - 2000.0
			local ypos = -25.0 * j + 200.0
			SetDoll(aptime, {{x=xpos1, y=ypos, z=3000.0}, {x=xpos2, y=ypos, z=-50.0}}, 500.0, 51, lifeMaxFact, 0)
			aptime = aptime + 0.1
		end
		aptime = aptime + 1.0
	end
	aptime = aptime2	-- 時間を戻す

	-- 扇型x3
	lifeMaxFact = 2.0
	aptime = aptime + 2.0
	for j=-1, 1, 1 do
		for i=-3, 3, 1 do
			local xpos = 100.0 * i + (j * 300.0)
			local ypos = 20.0 * -math.abs(i) + 0.0 + (math.abs(j) * 100.0)
			SetDoll(aptime, {{x=xpos, y=ypos, z=2000.0}, {x=xpos, y=ypos-100.0, z=750.0}, {x=xpos, y=ypos+100.0, z=-50.0}}, 400.0, 30, lifeMaxFact, 0)
		end
		aptime = aptime + 1.0
	end

	-- 後ろから前へ
	lifeMaxFact = 2.0
	aptime = aptime + 2.0
	for mir=-1, 1, 2 do
		for j=1, 3, 1 do
			for i=1, 3, 1 do
				local xpos1 = (100.0 * i + 500.0) * (mir)
				local xpos2 = (xpos1 - 400.0) * (mir)
				local xpos3 = (xpos1) * (mir)
				local ypos = 50.0 * i - 50.0
				local zpos = 100.0 * i
				SetDoll(aptime, {{x=xpos1, y=ypos-50.0, z=zpos-150.0}, {x=xpos2, y=ypos+100.0, z=1000.0}, {x=xpos3, y=ypos+50.0, z=2500.0}}, 400.0, 22, lifeMaxFact, 0)
				aptime = aptime + 0.0
			end
			aptime = aptime + 1.0
		end
	end

	-- ビッグx2
	lifeMaxFact = 1.0
	aptime = aptime + 1.5
	SetBig(aptime, {{x=-50.0, y=-100.0, z=-0.0}, {x=-150.0, y=0.0, z= 800.0}}, 250.0, 26, lifeMaxFact)
	SetBig(aptime, {{x= 50.0, y=-100.0, z=-0.0}, {x= 150.0, y=0.0, z= 800.0}}, 250.0, 26, lifeMaxFact)
	
	-- 横から斜め
	lifeMaxFact = 2.0
	aptime = aptime + 3.0
	for j=1, 3, 1 do
		for i=1, 3, 1 do
			for mir=-1, 1, 2 do
				local xpos1 = (100.0 * i + 700.0) * (mir)
				local xpos2 = (xpos1 - 200.0) * (mir)
				local xpos3 = (xpos1 - 700.0) * (mir)
				local ypos = 50.0 * i
				local zpos = 100.0 * i
				SetDoll(aptime, {{x=xpos1, y=ypos-50.0, z=zpos-150.0}, {x=xpos2, y=ypos+100.0, z=2500.0}, {x=xpos3, y=ypos+50.0, z=-50.0}}, 700.0, 51, lifeMaxFact, 0)
				aptime = aptime + 0.0
			end
			aptime = aptime + 1.0
		end
	end

	-- 玉
	lifeMaxFact = 1.0
	aptime = aptime + 3.5
	SetTama(aptime, {{x=-50.0, y=100.0, z=2000.0}}, lifeMaxFact)

	-- 斜め四方
	lifeMaxFact = 1.0
	aptime = aptime + 2.0
	for j=1, 2, 1 do
		for i=1, 3, 1 do
			SetFighter2(aptime, {{x=-500.0, y=100.0, z=1200.0}, {x=-200.0, y=50.0, z= 600.0}, {x=-500.0, y=100.0, z=-100.0}}, 250.0, 41, lifeMaxFact)
			SetFighter2(aptime, {{x=-500.0, y=-100.0, z=1200.0}, {x=-200.0, y=-50.0, z= 600.0}, {x=-500.0, y=-100.0, z=-100.0}}, 250.0, 41, lifeMaxFact)
			SetFighter2(aptime, {{x= 500.0, y=100.0, z=1200.0}, {x= 200.0, y=50.0, z= 600.0}, {x= 500.0, y=100.0, z=-100.0}}, 250.0, 41, lifeMaxFact)
			SetFighter2(aptime, {{x= 500.0, y=-100.0, z=1200.0}, {x= 200.0, y=-50.0, z= 600.0}, {x= 500.0, y=-100.0, z=-100.0}}, 250.0, 41, lifeMaxFact)
			aptime = aptime + 0.5
		end
		aptime = aptime + 2.0
	end
--]]
end
