#東方弾幕風[Stage]
#Title[六師外道ステージ]
#Text[ver.2.00
弾画像を全部入れ替え
みょんイベント2後アイテムがでなかったので修正(できたかは知らんｗ
恐らくこれでギリギリ550に届くと思われ]
#ScriptVersion[2]

script_stage_main {
	#include_function ".\lib\stageCommon.dnh"

	let bgm0 = CSD ~ "\bgm\bgm0.mp3";
	let bgm1 = CSD ~ "\bgm\bgm1.mp3";
	let bgm2 = CSD ~ "\bgm\bgm2.mp3";
	
	let fairy1 = CSD ~ "妖精1.txt";

	@Initialize {
		TStage;
		TNorm;
	}

	@MainLoop {
		yield;
	}

	@Finalize {
	}

/////////////////////////////////////////////////////////////////////

	task TStage {
		ExpertEx(false, 3, 3);
		LoadMusic(bgm0);
		PlayMusic(bgm0);
		yield;

		wait(180);

		loop(12) {
			CreateEnemyFromFile(fairy1, GetClipMaxX, GetClipMinY, -1, 0, 1);
			CreateEnemyFromFile(fairy1, GetClipMinX, GetClipMinY, -2, 0, 1);
			wait(17);
		}
		loop(3) {
			CreateEnemyFromFile(fairy1, GetClipMaxX, GetClipMinY, -1, 0, 0);
			CreateEnemyFromFile(fairy1, GetClipMinX, GetClipMinY, -2, 0, 0);
			wait(17);
		}
		
		waitFor;
		wait(30);
		
		let vx = (cx - GetClipMinX) / 5;
		CreateEnemyFromFile(fairy1, cx + vx * 4, GetClipMinY, -3, 0, 1);
		CreateEnemyFromFile(fairy1, cx - vx * 4, GetClipMinY, -3, 0, 1);
		wait(60);
		CreateEnemyFromFile(fairy1, cx + vx * 3, GetClipMinY, -3, 0, 0);
		CreateEnemyFromFile(fairy1, cx - vx * 3, GetClipMinY, -3, 0, 0);
		wait(60);
		CreateEnemyFromFile(fairy1, cx + vx * 2, GetClipMinY, -3, 0, 0);
		CreateEnemyFromFile(fairy1, cx - vx * 2, GetClipMinY, -3, 0, 0);
		wait(60);
		CreateEnemyFromFile(fairy1, cx + vx, GetClipMinY, -3, 0, 0);
		CreateEnemyFromFile(fairy1, cx - vx, GetClipMinY, -3, 0, 0);
		wait(60);
		CreateEnemyFromFile(fairy1, cx, GetClipMinY, -3, 0, 0);
		
		waitFor;
		wait(120);
		
		DeleteEnemyShotToItem(ALL);
		CollectItems;

//		CreateEnemyFromFile(CSD ~ "みょんイベント1.txt",cx,0,0,0,0);
		waitFor;

		CreateEnemyBossFromFile(CSD ~ "みょん連続.txt", cx,GetClipMinY + 64, 0, 0, 0);
		waitFor;

//		CreateEnemyFromFile(CSD ~ "みょんイベント2.txt",cx,GetClipMinY + 96,0,0,0);
		waitFor;

		wait(30);
		
		loop(24) {
			CreateEnemyFromFile(CSD ~ "妖精1.txt", 0, 0, -11, 0, 1);
			wait(8);
			CreateEnemyFromFile(CSD ~ "妖精1.txt", 0, 0, -12, 0, 1);
			wait(8);
		}
		loop(7) {
			CreateEnemyFromFile(CSD ~ "妖精1.txt", 0, 0, -11, 0, 0);
			wait(8);
			CreateEnemyFromFile(CSD ~ "妖精1.txt", 0, 0, -12, 0, 0);
			wait(8);
		}
		CreateEnemyFromFile(CSD ~ "妖精1.txt", 0, 0, -13, 0, 2);
		
		waitFor;
		wait(240);
		DeleteEnemyShotToItem(ALL);
		CollectItems;
		wait(60);

//		CreateEnemyFromFile(CSD ~ "ゆゆこイベント1.txt",cx,0,0,0,0);
		waitFor;

		LoadMusic(bgm1);
		PlayMusic(bgm1);
		CreateEnemyBossFromFile(CSD ~ "六師外道-連続-.txt", cx,GetClipMinY + 92, 0, 0, 0);

		waitFor;
		FadeOutMusic(bgm1, 20);
		if(Continued) {
			CreateEnemyFromFile(CSD ~ "lib\stageclear.dnh", 0, 0, 0, 0, 0);
			ClearStage;
		}
		wait(720);
//		CreateEnemyFromFile(CSD ~ "ゆゆこイベント2.txt",cx,0,0,0,0);
		waitFor;

		LoadMusic(bgm2);
		PlayMusic(bgm2);
		CreateEnemyBossFromFile(CSD ~ "四十九日の瞑想.txt", cx, GetCenterY - 16, 0, 0, 0);

		waitFor;
//		CreateEnemyFromFile(CSD ~ "ゆゆこイベント3.txt",cx,GetCenterY - 16,0,0,0);
		CreateEnemyFromFile(CSD ~ "lib\stageclear.dnh", 0, 0, 0, 0, 0);
		ClearStage;
	}

/*
各フェイズでの点アイテムの数一覧
 道中1：126ｺ
妖精(青) * 24 = 24ｺ
妖精(赤) * 13 = 104ｺ

 中ボス：76ｺ
スペカ1 16ｺ
スペカ2 18ｺ
スペカ3 42ｺ

 道中2：160ｺ
妖精(青) * 48 = 48ｺ
妖精(赤) * 14 = 112ｺ

 ボス：198ｺ
スペカ1 24ｺ
スペカ2 32ｺ
スペカ3 24ｺ
スペカ4 92ｺ
スペカ5 26ｺ
スペカ6 0ｺ

 合計：560ｺ
*/

	task TNorm {
		norm(100);
		norm(300);
		norm(550);
		norm(9999);
	}
}
