task DoubleSpoilerCreateShot01(let x,let y,let speed,let angle, let graphic,let delay,let setgraphic,let basepoint, let ItemCount)
{
	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);
	let X=Obj_GetX(obj);
	let Y=Obj_GetY(obj);
	loop(delay)
	{
		if(Obj_BeDeleted(obj)){break};
		yield;
	}
	while(!Obj_BeDeleted(obj))
	{
		X=Obj_GetX(obj);
		Y=Obj_GetY(obj);
		yield;
	}
	if(GetCommonDataDefault("Shooting",false))
	{
		if(X<GetClipMaxX && X>GetClipMinX && Y<GetClipMaxY && Y>GetClipMinY)
		{
		BasePoint(basepoint);
		BulletColor(setgraphic);
		loop(ItemCount)
		{
			EffectSet(X,Y,setgraphic);
		}
		}
	}
	if(GetCommonDataDefault("EndDefeatBullet",false))
	{
		loop(ItemCount)
		{
			EffectSet(X,Y,setgraphic);
		}
	}
}

task DoubleSpoilerCreateShot02(let x,let y,let speed,let angle,let aspeed,let maxspeed,let graphic,let delay,let setgraphic,let basepoint,let ItemCount)
{
	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);
	let X=Obj_GetX(obj);
	let Y=Obj_GetY(obj);
	loop(delay)
	{
		if(Obj_BeDeleted(obj)){break};
		yield;
	}
	while(!Obj_BeDeleted(obj))
	{
		X=Obj_GetX(obj);
		Y=Obj_GetY(obj);
		Obj_SetSpeed(obj, speed);
		if(speed<maxspeed)
		{
			speed+=aspeed;
		}
		yield;
	}
	if(GetCommonDataDefault("Shooting",false))
	{
		if(X<GetClipMaxX && X>GetClipMinX && Y<GetClipMaxY && Y>GetClipMinY)
		{
		BasePoint(basepoint);
		BulletColor(setgraphic);
		loop(ItemCount)
		{
			EffectSet(X,Y,setgraphic);
		}
		}
	}
	if(GetCommonDataDefault("EndDefeatBullet",false))
	{
		loop(ItemCount)
		{
			EffectSet(X,Y,setgraphic);
		}
	}
}

function EffectSet(x,y,graphic)//アイテム生成関数
{
	let XY=GetCommonDataDefault("ItemXY",[]);//共通データ内容を変数に渡す
	let color;
	if(graphic=="RED"){color=0;}
	if(graphic=="ORANGE"){color=1;}
	if(graphic=="YELLOW"){color=2;}
	if(graphic=="GREEN"){color=3;}
	if(graphic=="CYAN"){color=4;}
	if(graphic=="BLUE"){color=5;}
	if(graphic=="PURPLE"){color=6;}
	if(graphic=="WHITE"){color=7;}
	XY=XY~[x,y,color];

	SetCommonData("ItemXY",XY);//共通データに変更後の配列を渡す
}
/*
task DeleteShotEffect(X,Y,color)//紅葉の設定
{
		let R;let G;let B;
		if(color=="RED"){R=255;G=0;B=0;}
		if(color=="ORANGE"){R=255;G=165;B=0;}
		if(color=="YELLOW"){R=255;G=255;B=0;}
		if(color=="GREEN"){R=0;G=255;B=0;}
		if(color=="CYAN"){R=0;G=255;B=255;}
		if(color=="BLUE"){R=0;G=0;B=255;}
		if(color=="PURPLE"){R=160;G=32;B=240;}
		if(color=="WHITE"){R=255;G=255;B=255;}
		let Angle=rand(0,360);
		let Speed=rand(0.5,1.5);
		let RotateAngle=rand(2,10);
		let Zangle=rand(0,360);
		let dir=rand_int(0,1)*2-1;
		let Scale=0.5;
		let Alpha=200;

		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgMenuEffect);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		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,  2,  24);
		ObjEffect_SetVertexUV(obj, 1,  32, 24);
		ObjEffect_SetVertexUV(obj, 2, 32,  55);
		ObjEffect_SetVertexUV(obj, 3, 2, 55);
		ObjEffect_SetLayer(obj,4);
		ObjEffect_SetScale(obj, Scale,Scale);
		
		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);

		Obj_SetPosition(obj,X,Y);
		Obj_SetAngle(obj,Angle);
		Obj_SetSpeed(obj,Speed);

		loop(30)
		{
			ObjEffect_SetAngle(obj,0,0,Zangle);
			ObjEffect_SetScale(obj, Scale,Scale);
			Zangle+=RotateAngle*dir;
			Scale-=0.01;
			wait(1);
		}
		Obj_Delete(obj);
}
*/