function TCharge01(x,y,size,frame,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,0);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetColor(obj,r,g,b);
	TAlpha;
	TShrink;
	return obj;
	task TAlpha{
		let l=10;
		let alpha=255/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=255/(l*2);
			yield;
			}
		}
	task TShrink{
		let l=frame;
		let a = size*2/l/l;
		ascent(i in 0..l){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			size = size-i*a;
			yield;
			}
		Obj_Delete(obj);
		
	}
}

function TCharge02(x,y,size,frame,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,0);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetColor(obj,r,g,b);
	TAlpha;
	TShrink;
	return obj;
	task TAlpha{
		let l=10;
		let alpha=255/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=255/(l*2);
			yield;
			}
		}
	task TShrink{
			let a = size/frame;
			loop(frame){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			size = size-a;
			yield;
			}
		Obj_Delete(obj);
		
	}
}

task etama(r,a){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/eff.png";
	r = round(r);
	let angle = [0,0,0];
	let dir = rand(0,359);
	let c = [0,0,rand(0,359)];
	let v = [-7.5,-5,-2.5,2.5,5,7.5];
	let size = r/120+1;
	let m = -10;
	let vr = rand(0,5.4);
	vr = round(vr);
	angle[2] = v[vr];
	let s = r;
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,32,226,64,254);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetAngleXYZ(obj,0,0,c[2]);
	while(r>0){
	if(r>0){ObjRender_SetPosition(obj,GetEnemyX+r*cos(dir),GetEnemyY+r*sin(dir),0);}
	ObjRender_SetAngleXYZ(obj,c[0],c[1],c[2]);
	ObjRender_SetScaleXYZ(obj,size,size,0);
	ObjRender_SetAlpha(obj,100+m*(40-a*2));
	size -= 3/s*5;
	r -= (12-a/5);
	m++;
	ascent(i in 0..3){c[i] = c[i] + angle[i];}
	yield;
	}
	Obj_Delete(obj);
}

task wingset{
	wing(120,20,20);
	wing(-120,20,160);
	}

task wing(x,y,dir){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/wing.png";
	let m = 0;
	let s = 0;
	let c = 0;
	let angle = 0;
	let px = 0;
	let co = [0,0,0];
	if(x>0){co = [160,0,160];}
	if(x<0){co = [160,160,0];}
	ObjPrim_SetTexture(obj,img);
	ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjSprite2D_SetSourceRect(obj,0,0,256,256);
	ObjSprite2D_SetDestCenter(obj);
	ObjPrim_SetVertexCount(obj,4);
	ObjPrim_SetVertexPosition(obj,0,-128,-128,0);
	ObjPrim_SetVertexPosition(obj,1,-128,128,0);
	ObjPrim_SetVertexPosition(obj,2,64,-128,0);
	ObjPrim_SetVertexPosition(obj,3,64,128,0);
	ObjPrim_SetVertexUVT(obj,0,0,0);
	ObjPrim_SetVertexUVT(obj,1,0,256);
	ObjPrim_SetVertexUVT(obj,2,256,0);
	ObjPrim_SetVertexUVT(obj,3,256,256);
	ObjRender_SetScaleXYZ(obj,0,0,0);
	ObjRender_SetAngleXYZ(obj,0,0,dir);
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	ObjRender_SetColor(obj,co[0],co[1],co[2]);
	while(!Obj_IsDeleted(objBoss)){
	if(s<1){
	if(x>0){px += 12/9;}
	if(x<0){px -= 12/9;}
	s = sin(c);
	c++;
	}
	ObjRender_SetScaleXYZ(obj,s,s,0);
	ObjRender_SetPosition(obj,GetEnemyX+px,GetEnemyY+y,0);
	ObjRender_SetAngleXYZ(obj,0,0,dir+angle);
	if(s>=1){
	ObjPrim_SetVertexPosition(obj,2,64+48*sin(m),-128,0);
	ObjPrim_SetVertexPosition(obj,3,64+48*sin(m),128,0);
	ObjRender_SetColor(obj,co[0]+96*sin(m),co[1]+96*sin(m),co[2]+96*sin(m));
	m+=2;
	}
	yield;
	}
}