let ang = 0;
	
task SetBoss(tspell){
	SetShotAutoDeleteClip(64,64,64,64);
	LoadTexture(GCSD~"Shot/Default_Shot.png");
	LoadTexture(GCSD~"system/img/front01.png");
	LoadTexture(GCSD~"system/img/front00.png");
	objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(objBoss);
	ObjEnemy_SetDamageRate(objBoss,0,0);
	mainTask;
	TRender;
	TEnd;
	DrawAll;
	if(tspell==true){DrawScore;}
	loop(60){
		StopSlow(TARGET_ALL);
		yield;
	}
	}

task EndBoss(type){
		let dis = 0;
		let px = GetEnemyX;
		let py = GetEnemyY;
		Obj_Delete(objBoss);
		SetAutoDeleteObject(true);
		if(type==1){
		if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT) +ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0)
		{AddScore(ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE));}
		}
		loop(60){
		let arr = GetShotIdInCircleA2(stgx,stgy,1000,TARGET_ENEMY);
		ascent(i in 0..length(arr)){
			if(!Obj_IsDeleted(arr[i]) && GetDistance(ObjMove_GetX(arr[i]),ObjMove_GetY(arr[i]),px,py) <dis && IsPlayerSpellActive == false){
			let grr = GetShotDataInfoA1(ObjShot_GetImageID(arr[i]),TARGET_ENEMY,INFO_DELAY_COLOR);
			effbreak(arr[i],0,10);
			Obj_Delete(arr[i]);
			}
		}
		if(type==0){dis += 20;}
		else{dis += 500;}
		yield;
			}
		}
		
task ClearBullet(type){
		let dis = 0;
		let px = GetEnemyX;
		let py = GetEnemyY;
		loop(60){
		let arr = GetShotIdInCircleA2(stgx,stgy,1000,TARGET_ENEMY);
		ascent(i in 0..length(arr)){
			if(!Obj_IsDeleted(arr[i]) && GetDistance(ObjMove_GetX(arr[i]),ObjMove_GetY(arr[i]),px,py) <dis && IsPlayerSpellActive == false){
			let grr = GetShotDataInfoA1(ObjShot_GetImageID(arr[i]),TARGET_ENEMY,INFO_DELAY_COLOR);
			effbreak(arr[i],0,10);
			Obj_Delete(arr[i]);
			}
		}
		if(type==0){dis += 20;}
		else{dis += 500;}
		yield;
			}
	}

task DrawBoss{
	let imgMiko = GetCurrentScriptDirectory~"img/boss.png";
	let f = 0;
	let t = 0;
	let px = 64;
	let py = 96;
	let c = 0;
	ObjPrim_SetTexture(objBoss, imgMiko);
	ObjRender_SetScaleXYZ(objBoss,1.1,1.1,1);
	while(!Obj_IsDeleted(objBoss))
	{
		let angle = ObjMove_GetAngle(objBoss);
		let speed = ObjMove_GetSpeed(objBoss);
		if(speed>0 && idle == true){MarisaTail(objBoss,0,0,128,128,ang);}
		if(speed <= 0 && idle == true && atk == false){
		ObjRender_SetAngleY(objBoss,180);
		if(f<12){SetImageAndTail(objBoss, 0, 0, 128, 128,ang);
		}
		if(f>=12 && f<24){SetImageAndTail(objBoss, 0, 128, 128, 256,ang);
		}
		if(f>=24 && f<36){SetImageAndTail(objBoss, 0,256, 128, 384,ang);
		}
		if(f>=36){f=0;}
		f++;
		c++;
		ObjRender_SetY(objBoss,ObjMove_GetY(objBoss)+0.1*sin(c*5));
		t = 0;
		}
		else if(cos(angle) > 0 || cos(angle) < 0 && t == 0){
		idle = false;
		if(cos(angle)<0){ang=180;}
		else{ang=0;}
		manageSprite;
		t = 1;
		}
		ObjSprite2D_SetDestCenter(objBoss);
		if(ang==180){ObjRender_SetAngleY(objBoss,180);}
		if(ang==0){ObjRender_SetAngleY(objBoss,0);}
		yield;
	}
}