#東方弾幕風[Stage]
#Title[会話イベント]
#Text[独自の会話イベントを作成して
会話→敵登場→会話→弾幕
を東方弾幕風で本家風に再現
超級者向け（ぇ
by東方試作品の人]
#Player[FREE]
#BackGround[User()]
#ScriptVersion[2]

script_stage_main{

	//	このスクリプトにボスは一切出てきません
	//	ボスっぽく見えてるだけの雑魚です

	let Current = GetCurrentScriptDirectory;
	SetCommonData("SPELL_SCORE", 0);
	SetCommonData("X", 0);
	SetCommonData("Y", 0);
	PlayMusic(Current~"BGM\BGM.mp3");
	let BG_IMG = Current ~ "IMG\BG.png";
	let Add_Y = 0;

	@Initialize{
		LoadGraphic(BG_IMG);
		CompileEnemyFromFile(Current ~ "ENEMY\会話.txt");
		CompileEnemyFromFile(Current ~ "ENEMY\End.txt");
		TMain;
	}

	@MainLoop{
		yield;
	}

	@BackGround{
		SetPerspectiveClip(0, 10000);
		SetViewTo(0, 0, 0);
		SetViewFrom(600, 90, 65);
		SetFog(300, 1500, 0, 0, 0);

		SetTexture(BG_IMG);
		SetGraphicRect(0, 0 + Add_Y, 1024, 1024 + Add_Y);
		SetGraphicAngle(-90, 0, 0);
		DrawGraphic3D(0, 0, 0);

	}

	@Finalize{
		FadeOutMusic(Current~"BGM\BGM.mp3", 25);
	}

	task TMain{
		BG_Work;
		loop(120){ yield; }
		CreateEnemyFromFile(Current ~ "ENEMY\会話.txt", -100, -100, 0, 0, 0);
		while(GetEnemyNum){ yield; }
		CreateEnemyFromFile(Current ~ "ENEMY\End.txt", -100, -100, 0, 0, 0);
		STI;
		loop(120){ yield; }
		Draw_Spell_Score;
		while(GetEnemyNum){ yield; }
		loop(120){ yield; }
		ClearStage;
	}

	task BG_Work{
		loop{
			Add_Y += 1.5;if(Add_Y >= 512){ Add_Y -= 512; }
			yield;
		}
	}

	#include_function ".\STAGE_INCLUDE\Stage_INI.dms"

}