SetRateScoreSystemEnable(false);
let SetEnemyLife=Norma*500+1000;
let imgBorder =GetCurrentScriptDirectory ~ "..\img/border.png";
let imgSpellName=GetCurrentScriptDirectory ~ "..\img/SpellName.bmp";
let imgSpellBack=GetCurrentScriptDirectory ~ "..\img/フレーム.png";
let imgCircle=GetCurrentScriptDirectory ~ "..\img/Circle.png";

let AutoDeleteClipUp=16;
let AutoDeleteClipLeft=16;
let AutoDeleteClipDown=16;
let AutoDeleteClipRight=16;

let SetBulletColor=["RED","ORANGE","YELLOW","GREEN","CYAN","BLUE","PURPLE","WHITE"];

let SULeng=length(StepUp);
let StepUpNum1=0;
let StepUpNum2=0;
let StepUpNum3=0;
let StepUpNum4=0;
let StepUpNum5=0;
let StepUpNum6=0;
let StepUpNum7=0;
let StepUpNum8=0;
let StepUpNum9=0;
if(SULeng>=1){StepUpNum1=StepUp[0]*500;}
if(SULeng>=2){StepUpNum2=StepUp[1]*500;}
if(SULeng>=3){StepUpNum3=StepUp[2]*500;}
if(SULeng>=4){StepUpNum4=StepUp[3]*500;}
if(SULeng>=5){StepUpNum5=StepUp[4]*500;}
if(SULeng>=6){StepUpNum6=StepUp[5]*500;}
if(SULeng>=7){StepUpNum7=StepUp[6]*500;}
if(SULeng>=8){StepUpNum8=StepUp[7]*500;}
if(SULeng>=9){StepUpNum9=StepUp[8]*500;}

let StepUp1=false;
let StepUp2=false;
let StepUp3=false;
let StepUp4=false;
let StepUp5=false;
let StepUp6=false;
let StepUp7=false;
let StepUp8=false;
let StepUp9=false;

//////////////////////////////////////////////////////////////////////////////////////
function InitializeDoubleSpoiler
{//Intializeで呼ばれる。初期設定、ライフ設定、タイム設定、画像読み込みなどを行う
	SetCommonData("BossExist",true);
	SetCommonData("BunSpell",true);
//	SetCommonData("BunSpellNo",SceneNo);
        LoadGraphic(imgBorder);
        LoadGraphic(imgSpellName);
        LoadGraphic(imgSpellBack);
        LoadGraphic(imgCircle);

        SetLife(SetEnemyLife);
	SetCommonData("EnemyLife",SetEnemyLife-1000);

	BossEnd;
	DrawTimer(SpellTimer);
StepUpJudg;
}

sub FinalizeDoubleSpoiler
{//Finalizeで呼び出す。
	SetCommonData("BossExist",false);
}

task StepUpJudg
{//Lifeが一定以下になったらStepUp系をtrueに更新
loop
{
if(GetLife<=SetEnemyLife-StepUpNum1){StepUp1=true;}
if(GetLife<=SetEnemyLife-StepUpNum2){StepUp2=true;}
if(GetLife<=SetEnemyLife-StepUpNum3){StepUp3=true;}
if(GetLife<=SetEnemyLife-StepUpNum4){StepUp4=true;}
if(GetLife<=SetEnemyLife-StepUpNum5){StepUp5=true;}
if(GetLife<=SetEnemyLife-StepUpNum6){StepUp6=true;}
if(GetLife<=SetEnemyLife-StepUpNum7){StepUp7=true;}
if(GetLife<=SetEnemyLife-StepUpNum8){StepUp8=true;}
if(GetLife<=SetEnemyLife-StepUpNum9){StepUp9=true;}
yield;
}
}

function DistanceToPlayer(X,Y)
{//プレイヤーまでの距離を返す
	return(((X-GetPlayerX)^2+(Y-GetPlayerY)^2)^0.5);
}

function DistanceToBoss(X,Y)
{//敵までの距離を返す。IDが１なので注意
	return(((X-GetEnemyInfo(1,ENEMY_X))^2+(Y-GetEnemyInfo(1,ENEMY_Y))^2)^0.5);
}

function DoubleSpoilerSetShotAutoDeleteClip(left,up,right,down)
{
	AutoDeleteClipUp=up;
	AutoDeleteClipLeft=left;
	AutoDeleteClipDown=down;
	AutoDeleteClipRight=right;
}

////////////////////////////////////////////////////////////////////////////////////////////
function RiskShot(RiskScore)
{//リスクショットを更新。上限２０００
	SetCommonData("RiskPoint",GetCommonDataDefault("RiskPoint",0)+RiskScore);
	if(GetCommonData("RiskPoint")>=2000)
	{
		SetCommonData("RiskPoint",2000);
	}
}
function ClearShot
{//クリアショットを更新。0ならクリアショットになる。
	SetCommonData("ClearShot",GetCommonDataDefault("ClearShot",0)+1);
}

function BasePoint(Base)
{//ベースポイントを更新
	SetCommonData("BasePoint",GetCommonDataDefault("BasePoint",0)+Base);
}

function BulletColor(color)
{//色により共通データを更新
	alternative(color)
	case("RED"){SetCommonData("RedShot",GetCommonDataDefault("RedShot",0)+1);}
	case("BLUE"){SetCommonData("BlueShot",GetCommonDataDefault("BlueShot",0)+1)}
	case("GREEN"){SetCommonData("GreenShot",GetCommonDataDefault("GreenShot",0)+1);}
	case("YELLOW"){SetCommonData("YellowShot",GetCommonDataDefault("YellowShot",0)+1);}
	case("PURPLE"){SetCommonData("PurpleShot",GetCommonDataDefault("PurpleShot",0)+1);}
	case("CYAN"){SetCommonData("CyanShot",GetCommonDataDefault("CyanShot",0)+1);}
	case("ORANGE"){SetCommonData("OrangeShot",GetCommonDataDefault("OrangeShot",0)+1);}
	case("WHITE"){SetCommonData("WhiteShot",GetCommonDataDefault("WhiteShot",0)+1);}
}
////////////////////////////////////////////////////////////////////////////////////////////////
// w フレームだけ待つ,もう使わないけど
function wait2(w) 
{
    loop(w) { yield; }
}

function wait(w)//10Fの時止め対応版
{
    loop(w) {
	if(GetCommonDataDefault("TimeStop",false)==true)
	{
		loop(30){yield;}
	}

	if(GetCommonDataDefault("DefeatBoss",false)==true)
	{
		loop{yield;}
	}

	 yield; 
	}
}

task moveToPlayer(xMove, yAdd, frame, left, top, right, bottom)
{//時止め対応版moveToPlayer
	let x;
	let y;

	if(GetPlayerX < GetX)
	{
		x = GetX - xMove;
		if(x < left)
		{
			x = GetX + xMove;
		}
	}
	else
	{
		x = GetX + xMove;
		if(right < x)
		{
			x = GetX - xMove;
		}
	}

        y = GetY + yAdd;
        if(y < top) {
            y = top;
        } else if(bottom < y) {
            y = bottom;
        }

	let X=GetX;
	let Y=GetY;
	if(X-x<=0)
	{
		SetAction(ACT_MOVE_R,frame);
	}
	else
	{
		SetAction(ACT_MOVE_L,frame);
	}
	loop(frame)
	{
		SetX(GetX+(x-X)/frame);
		SetY(GetY+(y-Y)/frame);
		if(GetCommonDataDefault("DefeatBoss",false)==true)
		{
			break;
		}
		wait(1);
	}
}

///////////////////////////////////////////////////////////////////////////////////////////
task BossEnd//1000以下になったら勝利フラグ、被弾したら負けフラグを更新して消滅。
{
loop
{
	if(OnPlayerMissed)
	{
		wait(30);
		SetCommonData("LoseBoss",true);
		VanishEnemy;
	}
	if(GetHitCount>0)
	{
		SetCommonData("TimeStop",true);
		TimeStop(30,0,1,1);
		loop(30){yield;}
		SetCommonData("TimeStop",false);
	}

	if(GetCommonDataDefault("PlayerPhotoTimeStop",false)==true)
	{
		SetCommonData("PlayerPhotoTimeStop",false);
		SetCommonData("TimeStop",true);
		TimeStop(30,0,1,1);
		loop(30){yield;}
		SetCommonData("TimeStop",false);
	}
	if(GetLife<=1000)
	{
		SetPlayerInvincibility(6000);

		DeleteEnemyShot(ALL);
		SetCommonData("DefeatBoss",true);
	//	Slow(2);
		loop(30){yield;}
	//	Slow(0);
		VanishEnemy;
	}
yield;
}
}

task Escape(time)//時間になったら画面上部に移動し、負けフラグ共通データを更新
{
	wait(time-60);
	SetAction(ACT_MOVE, 60);
	loop(60)
	{
		SetMovePosition02(GetCenterX, GetClipMinY-100, 60);
		wait(1);
	}
	SetCommonData("LoseBoss",true);
	VanishEnemy;

}

task DrawTimer(timeframe)//タイマーを表示する。撮る瞬間には一時的に消える。
{
Escape(timeframe);
let timesecond=timeframe/60;
loop{
if(timeframe>0)
{
timeframe-=1;
}
timesecond=timeframe/60;
let Pnum5=truncate(timesecond%1000/100);
let Pnum4=truncate(timesecond%100/10);
let Pnum3=truncate(timesecond%10/1);
let Pnum2=truncate(timesecond*10%10/1);
let Pnum1=truncate(timesecond*100%10/1);
		let bx1=GetCenterX+60;
		let by1=GetClipMinY+25;
		let scax1=0.8;
		let scay1=0.8;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -7, -8);
		ObjEffect_SetVertexXY(obj, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj, 2, 7, 8);
		ObjEffect_SetVertexXY(obj, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  2+Pnum1*14,  114);
		ObjEffect_SetVertexUV(obj, 1,  14+Pnum1*14, 114);
		ObjEffect_SetVertexUV(obj, 2, 14+Pnum1*14,  131);
		ObjEffect_SetVertexUV(obj, 3, 2+Pnum1*14, 131);
		
		ObjEffect_SetScale(obj, scax1,scay1);
		Obj_SetPosition(obj,bx1,by1);
		ObjEffect_SetLayer(obj,3);

		let bx2=GetCenterX+48;
		let by2=GetClipMinY+25;
		let obj2 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj2, imgBorder);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -7, -8);
		ObjEffect_SetVertexXY(obj2, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj2, 2, 7, 8);
		ObjEffect_SetVertexXY(obj2, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj2, 0,  2+Pnum2*14,  114);
		ObjEffect_SetVertexUV(obj2, 1,  14+Pnum2*14, 114);
		ObjEffect_SetVertexUV(obj2, 2, 14+Pnum2*14,  131);
		ObjEffect_SetVertexUV(obj2, 3, 2+Pnum2*14, 131);
		
		Obj_SetPosition(obj2,bx2,by2);
		ObjEffect_SetLayer(obj2,3);
		ObjEffect_SetScale(obj2, scax1,scay1);

		let bx3=GetCenterX+15;
		let by3=GetClipMinY+20;
		let scax2=1.6;
		let scay2=1.6;
		let obj3 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj3, imgBorder);
		ObjEffect_SetPrimitiveType(obj3, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj3, ADD); 
		ObjEffect_CreateVertex(obj3, 4);
		ObjEffect_SetVertexXY(obj3, 0, -7, -8);
		ObjEffect_SetVertexXY(obj3, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj3, 2, 7, 8);
		ObjEffect_SetVertexXY(obj3, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj3, 0,  2+Pnum3*14,  114);
		ObjEffect_SetVertexUV(obj3, 1,  14+Pnum3*14, 114);
		ObjEffect_SetVertexUV(obj3, 2, 14+Pnum3*14,  131);
		ObjEffect_SetVertexUV(obj3, 3, 2+Pnum3*14, 131);
		
		Obj_SetPosition(obj3,bx3,by3);
		ObjEffect_SetLayer(obj3,3);
		ObjEffect_SetScale(obj3, scax2,scay2);

		let bx5=GetCenterX-7.5;
		let by5=GetClipMinY+20;
		let obj5 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj5, imgBorder);
		ObjEffect_SetPrimitiveType(obj5, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj5, ADD); 
		ObjEffect_CreateVertex(obj5, 4);
		ObjEffect_SetVertexXY(obj5, 0, -7, -8);
		ObjEffect_SetVertexXY(obj5, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj5, 2, 7, 8);
		ObjEffect_SetVertexXY(obj5, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj5, 0,  2+Pnum4*14,  114);
		ObjEffect_SetVertexUV(obj5, 1,  14+Pnum4*14, 114);
		ObjEffect_SetVertexUV(obj5, 2, 14+Pnum4*14,  131);
		ObjEffect_SetVertexUV(obj5, 3, 2+Pnum4*14, 131);
		
		Obj_SetPosition(obj5,bx5,by5);
		ObjEffect_SetLayer(obj5,3);
		ObjEffect_SetScale(obj5, scax2,scay2);


		let bx4=GetCenterX+35;
		let by4=GetClipMinY+25;
		let obj4 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj4, imgBorder);
		ObjEffect_SetPrimitiveType(obj4, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj4, ADD); 
		ObjEffect_CreateVertex(obj4, 4);
		ObjEffect_SetVertexXY(obj4, 0, -7, -8);
		ObjEffect_SetVertexXY(obj4, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj4, 2, 7, 8);
		ObjEffect_SetVertexXY(obj4, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj4, 0,  2+10*14,  114);
		ObjEffect_SetVertexUV(obj4, 1,  14+10*14, 114);
		ObjEffect_SetVertexUV(obj4, 2, 14+10*14,  131);
		ObjEffect_SetVertexUV(obj4, 3, 2+10*14, 131);
		
		Obj_SetPosition(obj4,bx4,by4);
		ObjEffect_SetLayer(obj4,3);
		ObjEffect_SetScale(obj4, 0.8,1.0);

		let bx6=GetCenterX-30;
		let by6=GetClipMinY+20;
		let obj6 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj6, imgBorder);
		ObjEffect_SetPrimitiveType(obj6, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj6, ADD); 
		ObjEffect_CreateVertex(obj6, 4);
		ObjEffect_SetVertexXY(obj6, 0, -7, -8);
		ObjEffect_SetVertexXY(obj6, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj6, 2, 7, 8);
		ObjEffect_SetVertexXY(obj6, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj6, 0,  2+Pnum5*14,  114);
		ObjEffect_SetVertexUV(obj6, 1,  14+Pnum5*14, 114);
		ObjEffect_SetVertexUV(obj6, 2, 14+Pnum5*14,  131);
		ObjEffect_SetVertexUV(obj6, 3, 2+Pnum5*14, 131);
		
		Obj_SetPosition(obj6,bx6,by6);
		ObjEffect_SetLayer(obj6,3);
		ObjEffect_SetScale(obj6, scax2,scay2);

		if(timeframe<=600)
		{
			ascent(let i in 0..4)
			{
				ObjEffect_SetVertexColor(obj,i,250,255,150,150);
				ObjEffect_SetVertexColor(obj2,i,250,255,150,150);
				ObjEffect_SetVertexColor(obj3,i,250,255,150,150);
				ObjEffect_SetVertexColor(obj4,i,250,255,150,150);
				ObjEffect_SetVertexColor(obj5,i,250,255,150,150);
				ObjEffect_SetVertexColor(obj6,i,250,255,150,150);
			}
		}
			if(GetPlayerY<=GetCenterY/3)
			{
				ascent(let i in 0..4)
				{
				ObjEffect_SetVertexColor(obj,i,50,255,255,255);
				ObjEffect_SetVertexColor(obj2,i,50,255,255,255);
				ObjEffect_SetVertexColor(obj3,i,50,255,255,255);
				ObjEffect_SetVertexColor(obj4,i,50,255,255,255);
				ObjEffect_SetVertexColor(obj5,i,50,255,255,255);
				ObjEffect_SetVertexColor(obj6,i,50,255,255,255);
				}
			}
			if(GetCommonDataDefault("Shooting",false)==true)
			{
				ascent(let i in 0..4)
				{
				ObjEffect_SetVertexColor(obj,i,0,255,150,150);
				ObjEffect_SetVertexColor(obj2,i,0,255,150,150);
				ObjEffect_SetVertexColor(obj3,i,0,255,150,150);
				ObjEffect_SetVertexColor(obj4,i,0,255,150,150);
				ObjEffect_SetVertexColor(obj5,i,0,255,150,150);
				ObjEffect_SetVertexColor(obj6,i,0,255,150,150);
				}
			}
		wait(1);
		Obj_Delete(obj);
		Obj_Delete(obj2);
		Obj_Delete(obj3);
		Obj_Delete(obj4);
		Obj_Delete(obj5);
		Obj_Delete(obj6);
}
}

task DrawSpellName(img,left,up,right,down)//スペル名とフレームを表示する。入力座標を左揃えで表示する。
{
		SpellCardFrame(0,0,256,50);
		let bx=GetClipMaxX-8;
		let by=360;
		let sx=1.5;
		let sy=1.5;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgSpellName);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, left-right, -(down-up)/2);
		ObjEffect_SetVertexXY(obj, 1, 0,  -(down-up)/2);
		ObjEffect_SetVertexXY(obj, 2, 0, (down-up)/2);
		ObjEffect_SetVertexXY(obj, 3,  left-right,  (down-up)/2);
		
		ObjEffect_SetVertexUV(obj, 0,  left,  up);
		ObjEffect_SetVertexUV(obj, 1,  right, up);
		ObjEffect_SetVertexUV(obj, 2, right,  down);
		ObjEffect_SetVertexUV(obj, 3, left,down);

		ObjEffect_SetScale(obj, sx,sy);
		Obj_SetPosition(obj,bx,by);
		ObjEffect_SetLayer(obj,3);
		loop(15)
		{
			ObjEffect_SetScale(obj, sx,sy);
			sx-=1/15;
			sy-=1/15;
		yield;
		}
		wait(45);
		loop(44)
		{
		Obj_SetPosition(obj,bx,by);
		by-=7.0;
		yield;
		}
		loop
		{
			if(GetCommonDataDefault("Shooting",false)==true)
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,0,255,255,255);
				}
			}
			else
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,255,255,255,255);
				}
			if(GetPlayerY<=GetCenterY/2)
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,50,255,255,255);
				}
			}
			}
			yield;
		}
}

task SpellCardFrame(left,up,right,down)
{
		let bx=GetClipMaxX-8;
		let by=360;
		let sx=2.7;
		let sy=2.5;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgSpellBack);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);

		ObjEffect_SetVertexXY(obj, 0, left-right, -(down-up)/2);
		ObjEffect_SetVertexXY(obj, 1, 0,  -(down-up)/2);
		ObjEffect_SetVertexXY(obj, 2, 0, (down-up)/2);
		ObjEffect_SetVertexXY(obj, 3,  left-right,  (down-up)/2);
		
		ObjEffect_SetVertexUV(obj, 0,  left,  up);
		ObjEffect_SetVertexUV(obj, 1,  right, up);
		ObjEffect_SetVertexUV(obj, 2, right,  down);
		ObjEffect_SetVertexUV(obj, 3, left,down);

		ObjEffect_SetScale(obj, sx,sy);
		Obj_SetPosition(obj,bx,by);
		ObjEffect_SetLayer(obj,3);

			ObjEffect_SetVertexColor(obj,0,50,255,200,200);
			ObjEffect_SetVertexColor(obj,1,50,255,200,200);
			ObjEffect_SetVertexColor(obj,2,100,255,255,255);
			ObjEffect_SetVertexColor(obj,3,100,255,255,255);

		loop(15)
		{
			ObjEffect_SetScale(obj, sx,sy);
			sx-=0.9/15;
			sy-=1/15;
		yield;
		}
		loop(15)
		{
			ObjEffect_SetScale(obj, sx,sy);
			sx-=1/15;
			sy-=1/15;
		yield;
		}
		wait(30);
		loop(44)
		{
		Obj_SetPosition(obj,bx,by);
		by-=7.0;
		yield;
		}
		loop
		{
			if(GetCommonDataDefault("Shooting",false)==true)
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,0,255,255,255);
				}
			}
			else
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,100,255,255,255);
				}
			}
			if(GetPlayerY<=GetCenterY/2)
			{
				ascent(let i in 0..4)
				{
					ObjEffect_SetVertexColor(obj,i,50,255,255,255);
				}
			}
			yield;
		}
}

task MagicCircleEffectTask//魔方陣を呼ぶ
{
		let Zangle=rand(0,360);
		MagicCircleEffect(1,Zangle);
		MagicCircleEffect(-1,Zangle);
}

task MagicCircleEffect(let dir,let Zangle)//次第に小さくなる魔方陣、loopでNiceshotの倍率変動。
{
		//PlaySE(csd~"se\clock04.wav");
		let scax=1;
		let scay=1;
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetEnemyX,GetEnemyY);
		ObjEffect_SetTexture(obj,imgCircle);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_SetScale(obj, scax,scay);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -128, -128);
		ObjEffect_SetVertexXY(obj, 1,  128, -128);
		ObjEffect_SetVertexXY(obj, 2,  128,  128);
		ObjEffect_SetVertexXY(obj, 3, -128,  128);
		
		ObjEffect_SetVertexUV(obj, 0,  0,  0);
		ObjEffect_SetVertexUV(obj, 1,  256, 0);
		ObjEffect_SetVertexUV(obj, 2, 256,  256);
		ObjEffect_SetVertexUV(obj, 3, 0, 256);

		ObjEffect_SetVertexColor(obj,0,50,255,250,250);
		ObjEffect_SetVertexColor(obj,1,50,255,250,250);
		ObjEffect_SetVertexColor(obj,2,50,255,250,250);
		ObjEffect_SetVertexColor(obj,3,50,255,250,250);
		ObjEffect_SetLayer(obj,4);
		let nice=1.5;
		Obj_SetPosition(obj,GetEnemyX,GetEnemyY);
		ObjEffect_SetScale(obj, scax,scay);
		ObjEffect_SetAngle(obj,0,0,Zangle);
		wait(1);
		SetCommonData("NiceShot",nice);
		loop(15)
		{
			Zangle+=6*dir;
			SetCommonData("NiceShot",nice);
			wait(1);
			scax-=1/15;
			scay-=1/15;
			nice-=0.3/15;
			Obj_SetPosition(obj,GetEnemyX,GetEnemyY);
			ObjEffect_SetScale(obj, scax,scay);
			ObjEffect_SetAngle(obj,0,0,Zangle);
		}
		SetCommonData("NiceShot",0);
		Obj_Delete(obj);
}

#include_function ".\..\txt/CreateShotData.txt"