#東方弾幕風[Stage]
#Title[幻想妖洞窟　体験版Ｖｅｒ０．０１]
#Text[]
#Player[FREE]
#Image[]
#BackGround[Default]
#ScriptVersion[2]

script_stage_main{

#include_function ".\Stage function.txt"


let imgboss1 = GetCurrentScriptDirectory~"\Stage\Boss\Img\dot_cirno.png";
let imgboss2 = GetCurrentScriptDirectory~"\Stage\Boss\Img\dot_alice.png";

task StageTask{//ステージタスク
	#include_function ".\StageTask.txt"
	#include_function ".\StageMainA.txt"
	#include_function ".\Config.txt"
	
	ChackMode();

	let E = GetCommonData("EASY_START");
	let N = GetCommonData("NORMAL_START");
	let H = GetCommonData("HARD_START");
	let L = GetCommonData("LUNATIC_START");
	let scorebonus = trunc(GetCommonData("MASICPOINT")/10);
	let spellbonus = GetCommonData("MASICPOINT") * 50000;
	SetCommonData("SCOREBONUS",scorebonus);
	SetCommonData("SPELLBONUS",spellbonus);

	if(E == 1){
	EasyStage1;
	}
	if(E == 2){
	EasyStage1;
	}
	if(E == 3){
	EasyStage2;
	}
	if(N == 1){
	NormalStage1;
	}
	if(N == 2){
	NormalStage1;
	}
	if(N == 3){
	NormalStage2;
	}
	if(H == 1){
	HardStage1;
	}
	if(H == 2){
	HardStage1;
	}
	if(H == 3){
	HardStage2;
	}
	if(L == 1){
	LunaticStage1;
	}
	if(L == 2){
	LunaticStage1;
	}
	if(L == 3){
	LunaticStage2;
	}

	if(E >= 4||N >= 4||H >= 4||L >= 4){
	ClearStage();//未完成なのでステージ終了
	}

	ClearStage();//ステージクリア
	}

	@Initialize(){
	ExpertEx(false,3,3);
	SetRateScoreSystemEnable(false);
	LoadGraphic(imgboss1);//敵画像読みこみ
	LoadGraphic(imgboss2);//敵画像読みこみ
	StageTask();//ステージタスク起動
	PointExtend();
	MasicPointOnStage();
	MusicControl();
	}
		
	@MainLoop(){
	let scorebonus = trunc(GetCommonData("MASICPOINT")/10);
	let spellbonus = GetCommonData("MASICPOINT") * 50000;
	SetCommonData("SCOREBONUS",scorebonus);
	SetCommonData("SPELLBONUS",spellbonus);
	yield;//毎フレームタスク復帰
	}	

	@DrawTopObject{
	MasicPointDrawText();
	}

	@BackGround(){
	BGControl();
	}

	@Finalize(){
	DeleteGraphic(imgboss1);
	DeleteGraphic(imgboss2);
	}

}