#“Œ•û’e–‹•—[Plural]
#ScriptVersion[3]
#Title["Shockman - First ph3 Boss"]
#Text["-Cool Graphics and Good Boss Sprite not included :O"]

let bgm = GetCurrentScriptDirectory~"bgm.ogg";
let bgmobj = ObjSound_Create;

@Initialize
{
ObjSound_Load(bgmobj,bgm);			//Load sound
ObjSound_SetSoundDivision(bgmobj,"Sound_Bgm");	//Tells DMF that the sound is a BGM
ObjSound_SetLoopEnable(bgmobj,true);		//Enable loop
ObjSound_SetLoopTime(bgmobj,1.7,137.2);		//Set loop points
ObjSound_Play(bgmobj);				//Play BGM
ObjSound_SetVolumeRate(bgmobj,90);		//Set Volume

SetPlayerAutoItemCollectLine(180);
SetPlayerLife(4);
PluralTask;
Background;
}

@MainLoop{yield;}

@Finalize{}

task PluralTask
{
let csd = GetCurrentScriptDirectory();

let obj = ObjEnemyBossScene_Create();
ObjEnemyBossScene_Add(obj, 0, csd ~ "N1.txt");
ObjEnemyBossScene_Add(obj, 0, csd ~ "S1.txt");
ObjEnemyBossScene_Add(obj, 1, csd ~ "N2.txt");
ObjEnemyBossScene_Add(obj, 1, csd ~ "S2.txt");
ObjEnemyBossScene_Add(obj, 1, csd ~ "N3.txt");
ObjEnemyBossScene_Add(obj, 1, csd ~ "S3.txt");
ObjEnemyBossScene_LoadInThread(obj);
ObjEnemyBossScene_Regist(obj);
while(!Obj_IsDeleted(obj)){yield;}
ObjSound_SetFade (bgmobj,-10);		//Fade out BGM at 10% per second
CloseScript(GetOwnScriptID());		//End script
}
task Background
{
	let csd = GetCurrentScriptDirectory();
	SetCameraFocusX(0);SetCameraFocusY(0);SetCameraFocusZ(0);
	SetCameraRadius(800-350);
	SetCameraAzimuthAngle(90);
	SetCameraElevationAngle(0);
	SetFogEnable(true);
	SetFogParam(1190, 1200, 25, 25, 85);

	let acc1 = 0;

	let floor = ObjPrim_Create(OBJ_SPRITE_3D);
	ObjPrim_SetTexture(floor, csd~"img/NBG1.png");
	ObjSprite3D_SetSourceDestRect(floor, 0, 0, 1200, 1200);
	ObjRender_SetAngleXYZ(floor, 0, 0, -90);
	ObjRender_SetScaleXYZ(floor, 0.45, 0.4, 1);
	ObjRender_SetPosition(floor, 0, 0, -180);
	Obj_SetRenderPriorityI(floor, 20);
	ObjRender_SetZWrite(floor, true);
	ObjRender_SetZTest(floor, true);
	yield;
acc1++;
}

