script_enemy_main{

let miny=GetClipMinY; let maxy=GetClipMaxY; let minx=GetClipMinX; let maxx=GetClipMaxX;
let cx=GetCenterX; let cy=GetCenterY;
let frame=0;
let time=0;

let size=1;
let alpha=0;
let sprite=(GetCommonData("CutinSprite"));
let type=(GetCommonData("CutinType"));
let OBJcutin=0;

let GRkurumi=("\script\Images\Cutins\Kurumi2.png");
let GRhotaru=("\script\Images\Cutins\Hotaru2.png");
let GRtomoko=("\script\Images\Cutins\Tomoko3.png");
let GRsetsuko=("\script\Images\Cutins\Setsuko2.png");
let GRayano=("\script\Images\Cutins\Ayano2.png");
let GRmidori=("\script\Images\Cutins\Midori2.png");
let GRtomomi=("\script\Images\Cutins\Tomomi2.png");
let GRyouko=("\script\Images\Cutins\Youko2.png");
let GRamaya=("\script\Images\Cutins\Amaya2.png");
let GRsayuri=("\script\Images\Cutins\Sayuri2.png");
let GRmai=("\script\Images\Cutins\Mai2.png");
let GRharuna=("\script\Images\Cutins\Haruna2.png");
let GRtakeo=("\script\Images\Cutins\Takeo2.png");
let GRmasahiro=("\script\Images\Cutins\Masahiro2.png");
let GRryo=("\script\Images\Cutins\Ryo2.png");
let GRshinichi=("\script\Images\Cutins\Shinichi2.png");

@Initialize{
	if(sprite==1){ LoadGraphic(GRkurumi); }
	if(sprite==2){ LoadGraphic(GRhotaru); }
	if(sprite==3){ LoadGraphic(GRtomoko); }
	if(sprite==4){ LoadGraphic(GRsetsuko); }
	if(sprite==5){ LoadGraphic(GRayano); }
	if(sprite==6){ LoadGraphic(GRmidori); }
	if(sprite==7){ LoadGraphic(GRtomomi); }
	if(sprite==8){ LoadGraphic(GRyouko); }
	if(sprite==9){ LoadGraphic(GRamaya); }
	if(sprite==10){ LoadGraphic(GRsayuri); }
	if(sprite==11){ LoadGraphic(GRmai); }
	if(sprite==12){ LoadGraphic(GRharuna); }
	if(sprite==13){ LoadGraphic(GRtakeo); }
	if(sprite==14){ LoadGraphic(GRmasahiro); }
	if(sprite==15){ LoadGraphic(GRryo); }
	if(sprite==16){ LoadGraphic(GRshinichi); }
	SetLife(1);
}
	
@MainLoop{

if(time==0){
let xsize=600;
let ysize=600;
	OBJcutin=(Obj_Create(OBJ_EFFECT));
	ObjEffect_SetLayer(OBJcutin,7); Obj_SetPosition(OBJcutin,cx,cy);
	if(sprite==1){ ObjEffect_SetTexture(OBJcutin,GRkurumi); }
	if(sprite==2){ ObjEffect_SetTexture(OBJcutin,GRhotaru); }
	if(sprite==3){ ObjEffect_SetTexture(OBJcutin,GRtomoko); }
	if(sprite==4){ ObjEffect_SetTexture(OBJcutin,GRsetsuko); }
	if(sprite==5){ ObjEffect_SetTexture(OBJcutin,GRayano); }
	if(sprite==6){ ObjEffect_SetTexture(OBJcutin,GRmidori); }
	if(sprite==7){ ObjEffect_SetTexture(OBJcutin,GRtomomi); }
	if(sprite==8){ ObjEffect_SetTexture(OBJcutin,GRyouko); }
	if(sprite==9){ ObjEffect_SetTexture(OBJcutin,GRamaya); }
	if(sprite==10){ ObjEffect_SetTexture(OBJcutin,GRsayuri); }
	if(sprite==11){ ObjEffect_SetTexture(OBJcutin,GRmai); }
	if(sprite==12){ ObjEffect_SetTexture(OBJcutin,GRharuna); }
	if(sprite==13){ ObjEffect_SetTexture(OBJcutin,GRtakeo); }
	if(sprite==14){ ObjEffect_SetTexture(OBJcutin,GRmasahiro); }
	if(sprite==15){ ObjEffect_SetTexture(OBJcutin,GRryo); }
	if(sprite==16){ ObjEffect_SetTexture(OBJcutin,GRshinichi); }
	ObjEffect_SetRenderState(OBJcutin,ADD); ObjEffect_SetScale(OBJcutin,size,size);
	ObjEffect_SetPrimitiveType(OBJcutin,PRIMITIVE_TRIANGLESTRIP); ObjEffect_CreateVertex(OBJcutin,4);
	ObjEffect_SetVertexXY(OBJcutin,0,-(xsize/2),-(ysize/2)); ObjEffect_SetVertexUV(OBJcutin,0,0,0);
	ObjEffect_SetVertexXY(OBJcutin,1,xsize/2,-(ysize/2)); ObjEffect_SetVertexUV(OBJcutin,1,xsize,0);
	ObjEffect_SetVertexXY(OBJcutin,2,-(xsize/2),ysize/2); ObjEffect_SetVertexUV(OBJcutin,2,0,ysize);
	ObjEffect_SetVertexXY(OBJcutin,3,xsize/2,ysize/2); ObjEffect_SetVertexUV(OBJcutin,3,xsize,ysize);
	ObjEffect_SetVertexColor(OBJcutin,0,alpha,255,255,255); ObjEffect_SetVertexColor(OBJcutin,1,alpha,255,255,255);
	ObjEffect_SetVertexColor(OBJcutin,2,alpha,255,255,255); ObjEffect_SetVertexColor(OBJcutin,3,alpha,255,255,255);

}



if(type==1){
	if(time<50){ alpha+=5; }
	if(alpha>0 && time>=50){ alpha-=2; }
	if(time>=50){
	Obj_SetPosition(OBJcutin,cx,Obj_GetY(OBJcutin)+10);
	size+=0.1;
	}
	ObjEffect_SetVertexColor(OBJcutin,0,alpha,255,255,255); ObjEffect_SetVertexColor(OBJcutin,1,alpha,255,255,255);
	ObjEffect_SetVertexColor(OBJcutin,2,alpha,255,255,255); ObjEffect_SetVertexColor(OBJcutin,3,alpha,255,255,255);
	ObjEffect_SetScale(OBJcutin,size,size);
	if(alpha==0){
	Obj_Delete(OBJcutin);
	VanishEnemy;
	}
}


time++;

}
}