script_shot shot1{//CreateShot01と同等の弾
       let out=false;
       let gr=GetArgument;

       @Initialize{
	//SetDefault(GetArgument);
	Tmain;
       }
       @MainLoop {

		yield;
          }
       @DrawLoop {
     //     DrawGraphicDefault();
       }
       @Finalize{

	}

task Tmain
{
//	move;
//	shot;
	eraze;
}


task move
{
SetSpeed(GetSpeed);
SetAngle(GetAngle);
}

task shot
{
	CreateShot01(GetX, GetY,GetSpeed,GetAngle,GetArgument,GetDelayTime);
/*	let obj = Obj_Create(OBJ_SHOT);
	Obj_SetPosition(obj, GetX, GetY);
	Obj_SetSpeed(obj, GetSpeed);
	Obj_SetAngle(obj, GetAngle);
	ObjShot_SetGraphic(obj, GetArgument);
	ObjShot_SetDelay(obj, GetDelayTime);
	ObjShot_ToItem(obj,false);
*/
}

task eraze
{
	loop(1){yield;}
	if(GetEnemyLife>0)
	{
		FinalizeItemSet(1);
	}
	End;
loop
{
	if(GetX<GetClipMinX-64 || GetX>GetClipMaxX+64 || GetY<GetClipMinY-64 || GetY>GetClipMaxY+64)
	{
	out=true;
	End;
	}
	if(GetCommonDataDefault("Playermissed",false)==true)
	{
		End;
	}
	yield;
}
}

function GetDistanceToPlayer
{
	let dis=((GetX-GetPlayerX)^2+(GetY-GetPlayerY)^2)^0.5;
	return(dis);
}

function FinalizeItemSet(num)
{
let type;
alternative(GetCommonData("BURSTLEVEL"))
case(0)
{
	type=3;
}
case(1)
{
	type=4;
}
case(2)
{
	type=4;
}
case(3)
{
	type=4;
}
		loop(num)
		{
			ItemSet(GetX,GetY,type);
			if(type>=3){break;}
			if(GetDistanceToPlayer<=60)
			{
				ItemSet(GetX,GetY,type);
			}
			if(GetDistanceToPlayer<=120)
			{
				ItemSet(GetX,GetY,type);
			}
		}
}

function ItemSet(x,y,type)//アイテム生成関数
{
	let XY=GetCommonDataDefault("ItemXY",[]);//共通データ内容を変数に渡す
	XY=XY~[x,y,type];//
	SetCommonData("ItemXY",XY);//共通データに変更後の配列を渡す
}

    }   


script_shot laser1{//CreateLaser01と同等の弾
       let out=false;
       let gr=GetArgument;

       @Initialize{
	//SetDefault(GetArgument);
	SetLaser(6,200,GetArgument);
	Tmain;
       }
       @MainLoop {

		yield;
          }
       @DrawLoop {
     //     DrawGraphicDefault();
       }
       @Finalize{
	if(out==false)
	{
		if(OnBomb)
		{
			ItemSet(GetX,GetY,13);
		}
		else if(	GetCommonDataDefault("BarrirShrinkRemoveBullet",false)==true)
		{
			ItemSet(GetX,GetY,13);
		}
		else if(	GetCommonDataDefault("BarrirBreakRemoveBullet",false)==true)
		{
			ItemSet(GetX,GetY,11);
		}
		else if(GetCommonDataDefault("BarrirBreakRemoveBulletNoShot",false)==true)
		{
			ItemSet(GetX,GetY,12);
		}
	}
	}

task Tmain
{
	move;
	shot;
	eraze;
}


task move
{
SetSpeed(GetSpeed);
SetAngle(GetAngle);
}

task shot
{
	CreateLaser01(GetX,GetY,4,GetAngle,200,6,GetArgument,0);
/*	let obj = Obj_Create(OBJ_SHOT);
	Obj_SetPosition(obj, GetX, GetY);
	Obj_SetSpeed(obj, GetSpeed);
	Obj_SetAngle(obj, GetAngle);
	ObjShot_SetGraphic(obj, GetArgument);
	ObjShot_SetDelay(obj, GetDelayTime);
	ObjShot_ToItem(obj,false);
*/
}

task eraze
{
loop
{
	if(GetX<GetClipMinX-64 || GetX>GetClipMaxX+64 || GetY<GetClipMinY-64 || GetY>GetClipMaxY+64)
	{
	out=true;
	End;
	}
	if(GetCommonDataDefault("Playermissed",false)==true)
	{
		End;
	}
	yield;
}
}

function ItemSet(x,y,type)//アイテム生成関数
{
	let XY=GetCommonDataDefault("ItemXY",[]);//共通データ内容を変数に渡す
	XY=XY~[x,y,type];//
	SetCommonData("ItemXY",XY);//共通データに変更後の配列を渡す
}

    }   

script_shot shot2{//幽香通常２の加速弾
       let out=false;
       let gr=GetArgument;

       @Initialize{
	//SetDefault(GetArgument);
	Tmain;
       }
       @MainLoop {

		yield;
          }
       @DrawLoop {
     //     DrawGraphicDefault();
       }
       @Finalize{
	if(out==false)
	{
		if(OnBomb)
		{
			ItemSet(GetX,GetY,13);
		}
		else if(	GetCommonDataDefault("BarrirShrinkRemoveBullet",false)==true)
		{
			ItemSet(GetX,GetY,13);
		}
		else if(	GetCommonDataDefault("BarrirBreakRemoveBullet",false)==true)
		{
			ItemSet(GetX,GetY,11);
		}
		else if(GetCommonDataDefault("BarrirBreakRemoveBulletNoShot",false)==true)
		{
			ItemSet(GetX,GetY,12);
		}
	}
	}

task Tmain
{
	move;
	shot;
	eraze;
}


task move
{
let speed=0;
SetSpeed(0);
SetAngle(GetAngle);
loop(30){yield;}
loop(200)
{
	SetSpeed(speed);
	speed+=0.01;
	yield;
}

}

task shot
{
	let speed=0;
	let obj = Obj_Create(OBJ_SHOT);
	Obj_SetPosition(obj, GetX, GetY);
	Obj_SetSpeed(obj, GetSpeed);
	Obj_SetAngle(obj, GetAngle);
	ObjShot_SetGraphic(obj, GetArgument);
	ObjShot_SetDelay(obj, GetDelayTime);
	ObjShot_ToItem(obj,false);
	loop(200)
	{
	Obj_SetSpeed(obj, speed);
		speed+=0.01;
		yield;
	}

}
 
task eraze
{
loop
{
	if(GetX<GetClipMinX || GetX>GetClipMaxX || GetY<GetClipMinY || GetY>GetClipMaxY)
	{
	out=true;
	End;
	}
	if(GetCommonDataDefault("Playermissed",false)==true)
	{
		End;
	}
	yield;
}
}

function ItemSet(x,y,type)//アイテム生成関数
{
	let XY=GetCommonDataDefault("ItemXY",[]);//共通データ内容を変数に渡す
	XY=XY~[x,y,type];//
	SetCommonData("ItemXY",XY);//共通データに変更後の配列を渡す
}

    }  