//鳳凰
	task DrawHouou(let A, let R, let G, let B){
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1,1.1);
		SetAlpha(A);
		SetGraphicAngle(0,0,0); 
		DrawGraphic(GetX,GetY);
	}


//鳳凰イリュージョン
	task DrawIrusion(let x, let y, let A, let R, let G, let B){
		DrawIrusion1(x, y, A, R, G, B);
		DrawIrusion2(x, y, A, R, G, B);
		DrawIrusion3(x, y, A, R, G, B);
		DrawIrusion4(x, y, A, R, G, B);
		DrawIrusion5(x, y, A, R, G, B);	
	}

	task DrawIrusion1(let x, let y, let A, let R, let G, let B){
		if(iru==60){rect=0;iru=0;}
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1+rect*0.004,1.1+rect*0.004);
		SetAlpha(A);
		SetGraphicAngle(0,0,0);
		DrawGraphic(x,y);
		iru++;
		if(iru<=30){rect++;}
		if(iru>30){rect--;}	
	}

	task DrawIrusion2(let x, let y, let A, let R, let G, let B){
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1+rect*0.003,1.1+rect*0.003);
		SetAlpha(A);
		SetGraphicAngle(0,0,0);
		DrawGraphic(x,y);
	}

	task DrawIrusion3(let x, let y, let A, let R, let G, let B){
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1+rect*0.002,1.1+rect*0.002);
		SetAlpha(A);
		SetGraphicAngle(0,0,0);
		DrawGraphic(x,y);	
	}

	task DrawIrusion4(let x, let y, let A, let R, let G, let B){
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1+rect*0.001,1.1+rect*0.001);
		SetAlpha(A);
		SetGraphicAngle(0,0,0);
		DrawGraphic(x,y);
	}

	task DrawIrusion5(let x, let y, let A, let R, let G, let B){
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(1.1+rect*0.005,1.1+rect*0.005);
		SetAlpha(A);
		SetGraphicAngle(0,0,0);
		DrawGraphic(x,y);	
	}



	task DrawHououZ(let A, let R, let G, let B){
		if(hououz==180){rectz=0;hououz=0;}
		SetTexture(imgHouou);
		SetColor(R,G,B);
		SetGraphicRect(0,0,181,156);
		SetGraphicScale(2.9-rectz*0.06,2.9-rectz*0.06);
		SetAlpha(A);
		SetGraphicAngle(0,0,0); 
		DrawGraphic(GetX,GetY);
		hououz++;
		if(hououz<=30){rectz++;}
	}


//チャージエフェクト
	task ChargeEffect(let x,let y){
		let Obj	    = Obj_Create(OBJ_EFFECT);
		let scale   = 0.7;
		let speed   = rand(3,5);
		let alpha   = 200;
		let angle   = atan2(GetY-y, GetX-x);

		Obj_SetPosition(Obj, x, y);
		ObjEffect_SetTexture(Obj, imgEffect);
		ObjEffect_SetRenderState(Obj, ALPHA);
		ObjEffect_SetPrimitiveType(Obj, PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_SetScale(Obj, scale, scale);
		ObjEffect_SetAngle(Obj,0,0,rand(0,360));
		Obj_SetSpeed(Obj, speed);
		Obj_SetAngle(Obj, angle);
		ObjEffect_SetLayer(Obj, 2);

		ObjEffect_CreateVertex(Obj, 4);
		ObjEffect_SetVertexXY(Obj, 0, -15, -15);
		ObjEffect_SetVertexXY(Obj, 1, -15,  15);
		ObjEffect_SetVertexXY(Obj, 2,  15, -15);
		ObjEffect_SetVertexXY(Obj, 3,  15, 15);

		ObjEffect_SetVertexUV(Obj, 0, 120, 0);
		ObjEffect_SetVertexUV(Obj, 1, 120, 30);
		ObjEffect_SetVertexUV(Obj, 2, 150, 0);
		ObjEffect_SetVertexUV(Obj, 3, 150, 30);

		ObjEffect_SetVertexColor(Obj, 0, alpha, 255, 255, 255);
		ObjEffect_SetVertexColor(Obj, 1, alpha, 255, 255, 255);
		ObjEffect_SetVertexColor(Obj, 2, alpha, 255, 255, 255);
		ObjEffect_SetVertexColor(Obj, 3, alpha, 255, 255, 255);

		while(!Obj_BeDeleted(Obj)) {
		if(((GetEnemyX-Obj_GetX(Obj))^2+(GetEnemyY-Obj_GetY(Obj))^2)^0.5<10){
			break;
		}
		yield;
		}		

		Obj_Delete(Obj);
	}


//撃破時エフェクト
	task DeathEffect(type, r, g, b){
		let Obj	    = Obj_Create(OBJ_EFFECT);
		let x       = GetX;
		let y       = GetY;
		let z       = 0;
		let scale   = 2;
		let speed   = rand(1, 4);
		let alpha   = 255;
		let chscale = 0;
		let angle   = rand(0,360);

		Obj_SetPosition(Obj, x, y);
		ObjEffect_SetTexture(Obj, imgEffect);
		ObjEffect_SetRenderState(Obj, ADD);
		ObjEffect_SetPrimitiveType(Obj, PRIMITIVE_TRIANGLESTRIP);
		ObjEffect_SetScale(Obj, scale, scale);
		ObjEffect_SetAngle(Obj,0,0,angle+90);
		Obj_SetSpeed(Obj, speed);
		Obj_SetAngle(Obj, angle);
		ObjEffect_SetLayer(Obj, 2);

		ObjEffect_CreateVertex(Obj, 4);
		ObjEffect_SetVertexXY(Obj, 0, -15, -15);
		ObjEffect_SetVertexXY(Obj, 1, -15,  15);
		ObjEffect_SetVertexXY(Obj, 2,  15, -15);
		ObjEffect_SetVertexXY(Obj, 3,  15, 15);

		ObjEffect_SetVertexUV(Obj, 0, 30*type, 0);
		ObjEffect_SetVertexUV(Obj, 1, 30*type, 30);
		ObjEffect_SetVertexUV(Obj, 2, 30+30*type, 0);
		ObjEffect_SetVertexUV(Obj, 3, 30+30*type, 30);

		ObjEffect_SetVertexColor(Obj, 0, alpha, r, g, b);
		ObjEffect_SetVertexColor(Obj, 1, alpha, r, g, b);
		ObjEffect_SetVertexColor(Obj, 2, alpha, r, g, b);
		ObjEffect_SetVertexColor(Obj, 3, alpha, r, g, b);

		loop(40){
		ObjEffect_SetAngle(Obj,0,0,angle+90+z);
		wait(1);
		z+=2;
		}

		loop(20){
		chscale+=scale/20;
		ObjEffect_SetScale(Obj, scale-chscale, scale-chscale);
		wait(1);
		}	

		Obj_Delete(Obj);
	}