#ScriptVersion[3]
#Title[""]
#Text[""]
#Background["./BG.txt"]
#include"./Shot/AllStarShot_Const.dnh"
#include"./system/Default_Effect.Txt"
#System["./system/Default_System.txt"]
let dirCurrent = GetCurrentScriptDirectory();
let MainSTG = GetCurrentScriptDirectory();
@Initialize{
	if(GetCommonData("ItemStart",0)==0){StartItemScript(dirCurrent ~"Item.txt");}
	SetCommonData("Fight",0);
	SetCommonData("Effect",2);
	SetCommonData("Scroll",0);
	loop(1){yield;}
	TPlural;
	LoadTexture(dirCurrent~"img/Cutin.png");
	LoadTexture(dirCurrent~"img/effbreak.png");
	LoadTexture(dirCurrent~"img/Marisa1.png");
	LoadTexture(dirCurrent~"img/stg3bg1.png");
	LoadTexture(dirCurrent~"img/boss.png");
	LoadTexture(dirCurrent~"Shot/ZUNShot.png");
	LoadTexture(dirCurrent~"system/img/front01.png");
	LoadTexture(dirCurrent~"system/img/front00.png");
	LoadTexture(dirCurrent~"img/Dot.png");
	LoadTexture(dirCurrent~"img/Cutin.png");
	LoadTexture(dirCurrent~"img/cdbg05a.png");
	LoadTexture(dirCurrent~"img/cdbg05b.png");
}

@Event
{
	alternative(GetEventType())
}

@MainLoop{
	yield;
}

task TPlural
{
	SetStgFrame(0, 0, 640, 480, 0, 200);
	SetPlayerClip( 0, 0, 640, 450 );
	let dir=GetCurrentScriptDirectory();
	let obj=ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj,0,dir~"YukariN0.txt");
	ObjEnemyBossScene_Add(obj,0,dir~"YukariN1.txt");
	ObjEnemyBossScene_Add(obj,0,dir~"YukariS1.txt");
	ObjEnemyBossScene_Add(obj,1,dir~"YukariN2.txt");
	ObjEnemyBossScene_Add(obj,1,dir~"YukariS2.txt");
	ObjEnemyBossScene_Add(obj,2,dir~"YukariN3.txt");
	ObjEnemyBossScene_Add(obj,2,dir~"YukariS3.txt");
	ObjEnemyBossScene_Add(obj,3,dir~"YukariN4.txt");
	ObjEnemyBossScene_Add(obj,3,dir~"YukariS4.txt");
	ObjEnemyBossScene_Add(obj,4,dir~"YukariN5.txt");
	ObjEnemyBossScene_Add(obj,4,dir~"YukariS5.txt");
	ObjEnemyBossScene_Add(obj,5,dir~"YukariN6.txt");
	ObjEnemyBossScene_Add(obj,5,dir~"YukariS6.txt");
	ObjEnemyBossScene_Add(obj,6,dir~"YukariN7.txt");
	ObjEnemyBossScene_Add(obj,6,dir~"YukariS7.txt");
	ObjEnemyBossScene_Add(obj,7,dir~"YukariN8.txt");
	ObjEnemyBossScene_Add(obj,7,dir~"YukariS8.txt");
	ObjEnemyBossScene_Add(obj,8,dir~"YukariS9.txt");
	ObjEnemyBossScene_Add(obj,9,dir~"YukariS10.txt");
	ObjEnemyBossScene_Add(obj,9,dir~"YukariEnd.txt");
	ObjEnemyBossScene_Regist(obj);
	loop(30){yield;}
	while(!Obj_IsDeleted(obj))
	{
		yield;
	}
	CloseScript(GetOwnScriptID());
}
	
task PlaySound(str,v,w){
	let s = ObjSound_Create;
	if(str == "select"){ObjSound_Load(s,MainSTG~"sound/select.wav");}
	if(str == "ok"){ObjSound_Load(s,MainSTG~"sound/ok.wav");}
	loop(w){yield;}
	ObjSound_SetSoundDivision(s,SOUND_SE);
	ObjSound_SetVolumeRate(s,v);
	ObjSound_Play(s);
}

function ReturnColor(type){
	if(type=="RED"){return [255,0,0];}
	if(type=="ORANGE"){return [255,128,0];}
	if(type=="YELLOW"){return [255,255,0];}
	if(type=="GREEN"){return [0,255,0];}
	if(type=="BLUE"){return [0,0,255];}
	if(type=="PURPLE"){return [255,0,255];}
	if(type=="WHITE"){return [255,255,255];}
	}
