#e
#Title[z剃PP]
#Text[]
#BackGround[User(.\img\Sky.png,0,0)]
#BGM[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	let csd		=GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss	=csd ~ "img\Boss\.png";
	let Back	=csd ~ "img\Sky.png";

	@Initialize {
        SetLife(8000);
	SetScore(100000);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	LoadGraphic(Back);
	Load;
	Expert;
        CutIn(YOUMU,"IuaȌzv", NULL, 0, 0, 0, 0);
        Main;
	}

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
        yield;
    }

	@DrawLoop {
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

	@BackGround {
	SetTexture(Back);
	SetGraphicRect(0, 0, 384, 457);
	SetGraphicAngle(0, 0, 0);
	DrawGraphic(224, 240);
	}

    task Main {
	yield;
	Att;
}

task Att{
	CreateEnemyFromScript("CHEN", 448, 60, 0, 0, 0);
	CreateEnemyFromScript("RAN", 0, 120, 0, 0, 0);
	CreateEnemyFromScript("YUKARI", 224, -20, 0, 0, 0);
	CreateEnemyFromScript("SHINKI", 0, 240, 0, 0, 0);
	CreateEnemyFromScript("MIMA", 448, 240, 0, 0, 0);
	CreateEnemyFromScript("YUKA", 224, -20, 0, 0, 0);
	CreateEnemyFromScript("MARISA", 344, -20, 0, 0, 0);
	CreateEnemyFromScript("REIMU", 104, -20, 0, 0, 0);
	wait(1600);
	AddLife(-8000);	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Sakuya.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy CHEN{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_chen.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	Att;	
}

task Att{
	SetAngle(180);
	SetSpeed(2);
	SetAction(ACT_MOVE_L, 600);
	Move;
	shotA;
	shotB;
	shotC;
}

task Move{
	loop{
	let angle=0;
	while(angle<360){
	SetGraphicAngle(0, 0, -angle);
	wait(1);
	angle+=9;
	}
	yield;
	}
}

task shotA{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time)+90, GetY+60*cos(time), 3, angle+time, 82, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}

task shotB{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time+120)+90, GetY+60*cos(time+120), 2, angle-time, 81, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}

task shotC{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX+60*sin(time+240)+90, GetY+60*cos(time+240), 1, -angle-time, 83, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}


	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_ChenRan.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy RAN{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_ran.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	Att;	
}

task Att{
	SetAngle(0);
	SetSpeed(2);
	SetAction(ACT_MOVE_R, 600);
	Move;
	shotA;
	shotB;
	shotC;
}

task Move{
	loop{
	let angle=0;
	while(angle<360){
	SetGraphicAngle(0, 0, angle);
	wait(1);
	angle+=9;
	}
	yield;
	}
}

task shotA{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX-60*sin(time)-90, GetY-60*cos(time), 3, angle+time, 92, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}

task shotB{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX-60*sin(time+120)-90, GetY-60*cos(time+120), 2, angle-time, 94, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}

task shotC{
	loop{
	let time=0;
	while(time<360){
	let angle=0;
	while(angle<360){
	CreateShot01(GetX-60*sin(time+240)-90, GetY-60*cos(time+240), 1, -angle-time, 93, 0);
	angle+=60;
	}
	time+=10;
	wait(6);
	}
	yield;
	}	
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_ChenRan.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy YUKARI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_yukari.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(300);
	standBy;
	Att;	
}

	sub standBy {
		SetMovePosition03(204, 140, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 180);
	shotA;
	shotB;
	wait(60);
	shotA;
	shotB;
	wait(180);
	SetAngle(270);
	SetSpeed(6);
	SetAction(ACT_MOVE, 240);
}

task shotA{
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, rand(1,4), angle+rand(0,8), 0, 0, 1, 105);
	SetShotDataA(1, 60, NULL, NULL, 0, -0.1, 1, 105);
	SetShotDataA(1, 90, NULL, NULL, 1, 0, 1, 105);
	SetShotDataA(1, 180, NULL, NULL, 0.2, 0.1, 2, 105);
	SetShotDataA(1, 240, NULL, NULL, 0, 0, 2, 105);
	FireShot(1);
	angle+=8;
	}
}

task shotB{
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX, GetY, 0);
	SetShotDataA(1, 0, rand(1,4), angle+rand(0,8), 0, 0, 1, 110);
	SetShotDataA(1, 60, NULL, NULL, 0, -0.1, 1, 110);
	SetShotDataA(1, 90, NULL, NULL, -1, 0, 1, 110);
	SetShotDataA(1, 180, NULL, NULL, -0.2, 0.1, 2, 110);
	SetShotDataA(1, 240, NULL, NULL, 0, 0, 2, 110);
	FireShot(1);
	angle+=8;
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Yukari.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy SHINKI{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_shinki.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task Main{
	yield;
	wait(590);
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(144, 120, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 480);
	wait(60);
	shot;
	wait(420);
	SetAngle(-120);
	SetSpeed(6);
	SetAction(ACT_MOVE, 240);
}

task shot{
	shotA(0, 60);
	shotB(10, 90);
	shotC(20, 120);
	shotD(30, 150);
	shotE(40, 180);
	shotF(50, 210);
	shotG(60, 240);
}

task shotA(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 225);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 225);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotB(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 226);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 226);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotC(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 227);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 227);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotD(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 228);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 228);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotE(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 229);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 229);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotF(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 230);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 230);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

task shotG(let B, let time){
	let A=0;
	while(A<40){
	let angle=0;
	while(angle<360){
	CreateShotA(1, GetX+40*cos(angle+A+B), GetY+40*sin(angle+A+B), 0);
	SetShotDataA(1, 0, 0, angle+A+B, 0, 0, 4, 231);
	SetShotDataA(1, time, 0, angle+A+B, 0.3, 0.1, 3, 231);
	FireShot(1);
	angle+=40;
	}
	A+=8;
	wait(5);
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Shinki.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy MIMA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_mima.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(590);
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(304, 120, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_B, 480);
	shot;
	wait(480);
	SetAngle(-60);
	SetSpeed(6);
	SetAction(ACT_MOVE, 240);
}

task shot{
	shotA(60, 1);
	wait(60);
	shotA(110, -1);
	wait(60);
	shotA(50, 1);
	wait(60);
	shotA(170, -1);
	wait(60);
	shotA(90, 1);
	wait(60);
	shotA(140, -1);
	wait(60);
}

task shotA(let angle, let d){
	CreateLaserA(1, GetX+rand(-60,60), GetY+rand(-60,60), 120, 15, GREEN01, 0);
	SetLaserDataA(1, 0, 0, d*2, 0, 2, angle);
	CreateLaserA(2, 0, 0, 120, 15, RED01, 0);
	SetLaserDataA(2, 0, 90, d*2, 0, 2, angle);
	AddShot(0, 1, 2, 0);
	CreateLaserA(3, 0, 0, 120, 15, BLUE01, 0);
	SetLaserDataA(3, 0, 180, d*2, 0, 2, angle);
	AddShot(0, 1, 3, 0);
	CreateLaserA(4, 0, 0, 120, 15, YELLOW01, 0);
	SetLaserDataA(4, 0, 270, d*2, 0, 2, angle);
	AddShot(0, 1, 4, 0);
	FireShot(1);
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Mima.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy YUKA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_yuka.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(590);
	standBy;
	Att;	
}

	sub standBy{
		SetMovePosition03(224, 120, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_B, 480);
	wait(120);
	shot;
	wait(360);
	SetAngle(270);
	SetSpeed(6);
	SetAction(ACT_MOVE, 240);
}

task shot{
	CreateYukaShot(GetX, GetY, 6, 68, 118, 0);
	wait(30);
	CreateYukaShot(GetX, GetY, 6, 79, 118, 0);
	wait(30);
	CreateYukaShot(GetX, GetY, 6, 90, 118, 0);
	wait(30);
	CreateYukaShot(GetX, GetY, 6, 101, 118, 0);
	wait(30);
	CreateYukaShot(GetX, GetY, 6, 112, 118, 0);
}

task CreateYukaShot(let x, let y, let speed, let angle, let graphic, let delay) {
    
    let obj = Obj_Create(OBJ_SHOT);
    
    Obj_SetPosition(obj, x, y);
    Obj_SetSpeed(obj, speed);
    Obj_SetAngle(obj, angle);
    ObjShot_SetGraphic(obj, graphic);
    ObjShot_SetDelay(obj, delay);
    
    loop(delay){ yield; }
    
    while(!Obj_BeDeleted(obj)) {
        if(Obj_GetY(obj)>=GetClipMaxY-5){
   		CreateLaser01(Obj_GetX(obj), Obj_GetY(obj), 6, 270, 600, 40, AQUA01, 0);        
        }
    
        yield;
    }
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Yuka.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy MARISA{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_marisa.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(1170);
	standBy;
	Att;	
}
	sub standBy{
		SetMovePosition03(224, 100, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SHOT_A, 240);
	shotA;
	shotB;
	wait(240);
	SetAngle(-150);
	SetSpeed(7);
	SetAction(ACT_MOVE_L, 600);
}

task shotA{
	wait(60);
	CreateLaser01(GetX, GetY+10, 10, 90, 1600, 80, AQUA01, 0);
	CreateLaser01(GetX, GetY+10, 10, 120, 1600, 80, AQUA01, 0);
	CreateLaser01(GetX, GetY+10, 10, 60, 1600, 80, AQUA01, 0);
	CreateLaser01(GetX+10, GetY-10, 10, -30, 1600, 80, AQUA01, 0);
	CreateLaser01(GetX-10, GetY-10, 10, 210, 1600, 80, AQUA01, 0);

}

task shotB{
	loop(50){
	CreateShot02(GetX, GetY, 9, rand(45,135), 0.1, 3, rand_int(129, 135), 0);
	wait(4);
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Marisa.txt"
	#include_function ".\lib_Functions.txt"
}


script_enemy REIMU{
	let csd     = GetCurrentScriptDirectory;
	let shotData	=csd ~ "img\shot_All.txt";
	let imgBoss  = csd ~ "img\Boss\dot_reimu.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	InitializeAction();
	LoadUserShotData(shotData);
	LoadGraphic(imgBoss);
	Load;
	Main;
	}

	@MainLoop{
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	yield;
	}

	@DrawLoop{
	SetColor(255,255,255);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawBoss(imgBoss);
	}

task	Main{
	yield;
	wait(1170);
	standBy;
	Att;	
}
	sub standBy{
		SetMovePosition03(224, 40, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(60);
}

task Att{
	SetAction(ACT_SPELL, 240);
	shotA;
	shotB;
	wait(240);
	SetAngle(-30);
	SetSpeed(7);
	SetAction(ACT_MOVE_R, 600);
}

task shotA{
	wait(60);
	CreateEnemyFromScript("ON1", GetX+30, GetY, 0, 0, 0);
	CreateEnemyFromScript("ON2", GetX-30, GetY, 0, 0, 0);
}

task shotB{
	let color=89;
	loop(7){
	let angle=0;
	while(angle<360){
	CreateReimuShot(GetX, GetY, 2, angle, color, 0);
	angle+=5;
	}
	color++;
	wait(30);
	}
}

task CreateReimuShot(let x, let y, let speed, let angle, let graphic, let delay) {
    
    let obj = Obj_Create(OBJ_SHOT);
    
    Obj_SetPosition(obj, x, y);
    Obj_SetSpeed(obj, speed);
    Obj_SetAngle(obj, angle);
    ObjShot_SetGraphic(obj, graphic);
    ObjShot_SetDelay(obj, delay);
    
    loop(delay){ yield; }
    
    while(!Obj_BeDeleted(obj)) {
        if(Obj_GetX(obj)<GetClipMinX){
            Obj_SetX(obj, GetClipMaxX);
        }
        if(Obj_GetX(obj)>GetClipMaxX){
            Obj_SetX(obj, GetClipMinX);
        }
    
        yield;
    }
}

	@Finalize{
	DeleteGraphic(imgBoss);
	Delete;
	}

	#include_function ".\lib\lib_anime_Reimu.txt"
	#include_function ".\lib_Functions.txt"
}

script_enemy ON1{
	let csd     = GetCurrentScriptDirectory;
	let imgOn  = csd ~ "img\shot_all.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	LoadGraphic(imgOn);
	Main;
	}

	@MainLoop{
        SetCollisionB(GetX, GetY, 26);
	yield;
	}

	@DrawLoop{
	SetTexture(imgOn);
	SetColor(255,255,255);
	SetGraphicRect(416, 354, 475, 413);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawGraphic(GetX, GetY);
	}

task Main{
	yield;
	Move;
	SetAngle(80);
	SetSpeed(3);	
}

task Move{
	loop{
	let angle=0;
	while(angle<360){
	SetGraphicAngle(0, 0, angle);
	wait(1);
	angle+=3;
	}
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgOn);
	}

	function wait(w) {
		loop(w) { yield; }
	}

}

script_enemy ON2{
	let csd     = GetCurrentScriptDirectory;
	let imgOn  = csd ~ "img\shot_all.png";

	@Initialize{
        SetLife(1);
	SetDamageRate(0, 0);
	LoadGraphic(imgOn);
	Main;
	}

	@MainLoop{
        SetCollisionB(GetX, GetY, 26);
	yield;
	}

	@DrawLoop{
	SetTexture(imgOn);
	SetColor(255,255,255);
	SetGraphicRect(352, 354, 411, 413);
	SetGraphicScale(1,1);
	SetAlpha(255);
	DrawGraphic(GetX, GetY);
	}

task Main{
	yield;
	Move;
	SetAngle(100);
	SetSpeed(3);	
}

task Move{
	loop{
	let angle=0;
	while(angle<360){
	SetGraphicAngle(0, 0, -angle);
	wait(1);
	angle+=3;
	}
	yield;
	}
}

	@Finalize{
	DeleteGraphic(imgOn);
	}

	function wait(w) {
		loop(w) { yield; }
	}

}