#e
#Title[Ch֊uŌ̎v]
#Text[ŏIXyAŌ̗]
#PlayLevel[Extra]
#BGM[.\BGM\th06_11.wav]
#Image[]
#Player[FREE]#ScriptVersion[2]

script_enemy_main {
	let imgBoss   = GetCurrentScriptDirectory~".\img\Sakuya.png";
	let frame     =  0;
	let angleBase = 90;
	let count = 0;
	let frame2 = 0;
	let time = 0;
	let shootSE = GetCurrentScriptDirectory~".\SE\shoot13.wav";
	let cutin = GetCurrentScriptDirectory~".\img\cutSakuya.png";
	@Initialize {
		SetLife(1000);
		LastSpell();
		SetDamageRate(0,0);//_[W10%ɐݒ
		SetScore(8000000);//XyJ[h{[iX30000ɐݒ
		SetTimer(60);//Ԑ60bɐݒ
		SetMovePosition02(224,90,60);
		LoadGraphic(imgBoss);
		SetTexture(imgBoss);
		SetDurableSpellCard;
		SetInvincibility(60000);
		SetGraphicRect(0, 0, 44, 86);
		CutIn(KOUMA,"Ch֊uŌ̎v",cutin,0,0,256,256);//XyJ[h\
	}

	@MainLoop {
		SetCollisionA(GetX, GetY, 24);
		SetCollisionB(GetX, GetY, 24);
		frame2++;

		
		count++;
		frame++;
    		time=count/60;
		if(frame==70){
			PlaySE(shootSE);
  	        	loop(8){
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN01,30);
			}	    
		}else if(frame==110){
			PlaySE(shootSE);
			loop(8){
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN01,30);
			}
		}else if(frame==150){
			loop(8){
			PlaySE(shootSE);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW01,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN01,30);
			}
			frame=0;
		}
		
		if(frame==70 && time>25){
			PlaySE(shootSE);
			loop(5){
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED04,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE04,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW04,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN04,30);	
			}
		}
			if(frame==110 && time>35){
			PlaySE(shootSE);
			loop(5){
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED02,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE02,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW02,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN02,30);
			}
		}
			if(frame==150 && time>45){
			PlaySE(shootSE);
			loop(3){
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),RED03,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),BLUE03,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),YELLOW03,30);
			CreateShot02(GetX+rand(-200,200),GetY+rand(-100,100),-4+rand(-1,1),90,0.1,2+rand(-1,3),GREEN03,30);
			}
		}
	}
	@DrawLoop {
		DrawGraphic(GetX, GetY);
	}

	@Finalize {
		Explosion01(GetX,GetY,5,10,120);
 		DeleteGraphic(imgBoss);
		DeleteSE(shootSE);

	}
}

