
script_spell Huumajin //夢符「封魔陣」スクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";
let SE=["seBomb_ReimuB.wav"];

    @Initialize {
        SetPlayerInvincibility(120);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	PlaySE(SE[0]);
	Huuma;
        loop(120){yield;}
        End;
    }

	task Huuma{
		let bx1=GetPlayerX+16;
		let by1=GetPlayerY;
		let scax=12;
		let scay=40;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -8, -14);
		ObjEffect_SetVertexXY(obj, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj, 2, 8, 14);
		ObjEffect_SetVertexXY(obj, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj, 0,  58,  3);
		ObjEffect_SetVertexUV(obj, 1,  74, 3);
		ObjEffect_SetVertexUV(obj, 2, 74,  31);
		ObjEffect_SetVertexUV(obj, 3, 58, 31);

		ObjEffect_SetVertexColor(obj,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj,2,150,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,0);
		ObjEffect_SetScale(obj, scax,scay);

		let bx2=GetPlayerX-16;
		let by2=GetPlayerY;
		let obj2 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj2, imgSpell);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD);
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -8, -14);
		ObjEffect_SetVertexXY(obj2, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj2, 2, 8, 14);
		ObjEffect_SetVertexXY(obj2, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj2, 0,  58,  3);
		ObjEffect_SetVertexUV(obj2, 1,  74, 3);
		ObjEffect_SetVertexUV(obj2, 2, 74,  31);
		ObjEffect_SetVertexUV(obj2, 3, 58, 31);

		ObjEffect_SetVertexColor(obj2,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj2,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj2,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj2,2,150,255,255,255);
		
		ObjEffect_SetAngle(obj2, 0,0,180);
		ObjEffect_SetScale(obj2, scax,scay);

		let bx3=GetPlayerX;
		let by3=GetPlayerY+16;
		let obj3 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj3, imgSpell);
		ObjEffect_SetPrimitiveType(obj3, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj3, ADD);
		ObjEffect_CreateVertex(obj3, 4);
		ObjEffect_SetVertexXY(obj3, 0, -8, -14);
		ObjEffect_SetVertexXY(obj3, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj3, 2, 8, 14);
		ObjEffect_SetVertexXY(obj3, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj3, 0,  82,  3);
		ObjEffect_SetVertexUV(obj3, 1,  98, 3);
		ObjEffect_SetVertexUV(obj3, 2, 98,  31);
		ObjEffect_SetVertexUV(obj3, 3, 82, 31);

		ObjEffect_SetVertexColor(obj3,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj3,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj3,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj3,2,150,255,255,255);
		
		ObjEffect_SetAngle(obj3, 0,0,90);
		ObjEffect_SetScale(obj3, scax,scay);

		let bx4=GetPlayerX;
		let by4=GetPlayerY-16;
		let obj4 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj4, imgSpell);
		ObjEffect_SetPrimitiveType(obj4, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj4, ADD);
		ObjEffect_CreateVertex(obj4, 4);
		ObjEffect_SetVertexXY(obj4, 0, -8, -14);
		ObjEffect_SetVertexXY(obj4, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj4, 2, 8, 14);
		ObjEffect_SetVertexXY(obj4, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj4, 0,  82,  3);
		ObjEffect_SetVertexUV(obj4, 1,  98, 3);
		ObjEffect_SetVertexUV(obj4, 2, 98,  31);
		ObjEffect_SetVertexUV(obj4, 3, 82, 31);

		ObjEffect_SetVertexColor(obj4,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj4,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj4,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj4,2,150,255,255,255);
		
		ObjEffect_SetAngle(obj4, 0,0,270);
		ObjEffect_SetScale(obj4, scax,scay);

		Obj_SetPosition(obj,bx1,by1);
		Obj_SetPosition(obj2,bx2,by2);
		Obj_SetPosition(obj3,bx3,by3);
		Obj_SetPosition(obj4,bx4,by4);

		intersection;

		let a =3;
		loop(60){

			Obj_SetPosition(obj,bx1+a,by1);
			Obj_SetPosition(obj2,bx2+a,by2);
			Obj_SetPosition(obj3,bx3,by3+a);
			Obj_SetPosition(obj4,bx4,by4+a);
			a=a*(-1);
			
			yield;
			}
		a=1;
		ascent(let i in 0..60){
			Obj_SetPosition(obj,bx1+(90-i)/30*a,by1);
			bx1+=(75-i)/12;
			Obj_SetPosition(obj2,bx2+(90-i)/30*a,by2);
			bx2-=(75-i)/12;
			Obj_SetPosition(obj3,bx3,by3+(90-i)/30*a);
			by3+=(75-i)/12;
			Obj_SetPosition(obj4,bx4,by4+(90-i)/30*a);
			by4-=(75-i)/12;
			a=a*(-1);
			yield;
			}
		Obj_Delete(obj);
		Obj_Delete(obj2);
		Obj_Delete(obj3);
		Obj_Delete(obj4);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionLine(obj,Obj_GetX(obj),0,Obj_GetX(obj),500,64,1,true);
					ObjSpell_SetIntersecrionLine(obj2,Obj_GetX(obj2),0,Obj_GetX(obj2),500,64,1,true);
					ObjSpell_SetIntersecrionLine(obj3,0,Obj_GetY(obj3),500,Obj_GetY(obj3),64,1,true);
					ObjSpell_SetIntersecrionLine(obj4,0,Obj_GetY(obj4),500,Obj_GetY(obj4),64,1,true);
					yield;
				}
			}
		}

function wait(w) {
    loop(w) { yield; }
}

}


script_spell TaimahuRanbu//夢符「退魔符乱舞」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\shot_reimu.png";

    @Initialize {
        SetPlayerInvincibility(390);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	Taimahu;
        loop(390){yield;}
        End;
    }


task Taimahu
{
SetSpeed(2.25,1);
loop(25)
{
Ranbu(GetPlayerX);
wait(15);
}
SetSpeed(4.5,2);
}

task Ranbu(let bx1)
{
		let by1=GetClipMaxY+128;
		let scax=1;
		let scay=1.5;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -55, -220);
		ObjEffect_SetVertexXY(obj, 1, 55,  -220);
		ObjEffect_SetVertexXY(obj, 2, 55, 220);
		ObjEffect_SetVertexXY(obj, 3,  -55,  220);
		
		ObjEffect_SetVertexUV(obj, 0,  376,  12);
		ObjEffect_SetVertexUV(obj, 1,  487, 12);
		ObjEffect_SetVertexUV(obj, 2, 487,  453);
		ObjEffect_SetVertexUV(obj, 3, 376, 453);

		ObjEffect_SetVertexColor(obj,0,150,255,255,255);
		ObjEffect_SetVertexColor(obj,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj,2,150,255,255,255);
		ObjEffect_SetVertexColor(obj,3,150,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,0);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,bx1,by1);

		intersection;

		loop(60){

			Obj_SetPosition(obj,bx1,by1);
			by1-=25;
			
			yield;
			}
		Obj_Delete(obj);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionLine(obj,Obj_GetX(obj),Obj_GetY(obj)-180,Obj_GetX(obj),Obj_GetY(obj)+180,20,4.0,true);
					yield;
				}
			}
}


function wait(w) {
    loop(w) { yield; }
}

}


script_spell Ultimate //魔符「アルティメットショートウェーブ」スクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";
let SE=["seBomb_ReimuB.wav"];

    @Initialize {
        SetPlayerInvincibility(210);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	PlaySE(SE[0]);
loop(10)
{
	Wave1;
	Wave2;
	wait(15);
}
        loop(60){yield;}
        End;
    }

	task Wave1{
		let bx1=GetCenterX;
		let by1=GetClipMaxY+270;
		let scax=3;
		let scay=80;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -8, -14);
		ObjEffect_SetVertexXY(obj, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj, 2, 8,14);
		ObjEffect_SetVertexXY(obj, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj, 0,  58,  3);
		ObjEffect_SetVertexUV(obj, 1,  74, 3);
		ObjEffect_SetVertexUV(obj, 2, 74,  31);
		ObjEffect_SetVertexUV(obj, 3, 58, 31);

		ObjEffect_SetVertexColor(obj,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj,1,250,255,255,255);
		ObjEffect_SetVertexColor(obj,2,250,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,60);
		ObjEffect_SetScale(obj, scax,scay);

		let bx2=GetCenterX;
		let by2=GetClipMaxY+270+54;
		let scax=3;
		let scay=80;
		let obj2 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj2, imgSpell);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -8, -14);
		ObjEffect_SetVertexXY(obj2, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj2, 2, 8,14);
		ObjEffect_SetVertexXY(obj2, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj2, 0,  58,  3);
		ObjEffect_SetVertexUV(obj2, 1,  74, 3);
		ObjEffect_SetVertexUV(obj2, 2, 74,  31);
		ObjEffect_SetVertexUV(obj2, 3, 58, 31);

		ObjEffect_SetVertexColor(obj2,0,250,255,255,255);
		ObjEffect_SetVertexColor(obj2,3,250,255,255,255);
		ObjEffect_SetVertexColor(obj2,1,0,255,255,255);
		ObjEffect_SetVertexColor(obj2,2,0,255,255,255);
		
		ObjEffect_SetAngle(obj2, 0,0,60);
		ObjEffect_SetScale(obj2, scax,scay);


		intersection;

		let a =8;
		let b =0;
		loop(600){

			Obj_SetPosition(obj,bx1,by1+a);
			Obj_SetPosition(obj2,bx2,by2+a);
			a-=b;
			b+=0.3;
			yield;
			}
		Obj_Delete(obj);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionLine(obj,GetClipMinX,Obj_GetY(obj)+GetCenterX*3^0.5,GetClipMaxX,Obj_GetY(obj)-GetCenterX*3^0.5,10,1,true);
					ObjSpell_SetIntersecrionLine(obj2,GetClipMinX,Obj_GetY(obj)+GetCenterX*3^0.5,GetClipMaxX,Obj_GetY(obj)-GetCenterX*3^0.5,10,1,true);
					yield;
				}
			}
		}

	task Wave2{
		let bx1=GetCenterX;
		let by1=GetClipMaxY+180;
		let scax=3;
		let scay=80;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -8, -14);
		ObjEffect_SetVertexXY(obj, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj, 2, 8, 14);
		ObjEffect_SetVertexXY(obj, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj, 0,  82,  3);
		ObjEffect_SetVertexUV(obj, 1,  98, 3);
		ObjEffect_SetVertexUV(obj, 2, 98,  31);
		ObjEffect_SetVertexUV(obj, 3, 82, 31);
		ObjEffect_SetVertexColor(obj,0,150,255,255,255);
		ObjEffect_SetVertexColor(obj,3,150,255,255,255);
		ObjEffect_SetVertexColor(obj,1,0,255,255,255);
		ObjEffect_SetVertexColor(obj,2,0,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,-60);
		ObjEffect_SetScale(obj, scax,scay);


		let bx2=GetCenterX;
		let by2=GetClipMaxY+180+54;
		let scax=3;
		let scay=80;
		let obj2 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj2, imgSpell);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -8, -14);
		ObjEffect_SetVertexXY(obj2, 1, 8,  -14);
		ObjEffect_SetVertexXY(obj2, 2, 8, 14);
		ObjEffect_SetVertexXY(obj2, 3,  -8,  14);
		
		ObjEffect_SetVertexUV(obj2, 0,  82,  3);
		ObjEffect_SetVertexUV(obj2, 1,  98, 3);
		ObjEffect_SetVertexUV(obj2, 2, 98,  31);
		ObjEffect_SetVertexUV(obj2, 3, 82, 31);
		ObjEffect_SetVertexColor(obj2,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj2,3,0,255,255,255);
		ObjEffect_SetVertexColor(obj2,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj2,2,150,255,255,255);
		
		ObjEffect_SetAngle(obj2, 0,0,-60);
		ObjEffect_SetScale(obj2, scax,scay);


		intersection;

		let a =8;
		let b =0;
		loop(600){

			Obj_SetPosition(obj,bx1,by1+a);
			Obj_SetPosition(obj2,bx2,by2+a);
			a-=b;
			b+=0.3;
			yield;
			}
		Obj_Delete(obj);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionLine(obj,GetClipMinX,Obj_GetY(obj)-GetCenterX*3^0.5,GetClipMaxX,Obj_GetY(obj)+GetCenterX*3^0.5,10,1,true);
					ObjSpell_SetIntersecrionLine(obj2,GetClipMinX,Obj_GetY(obj)-GetCenterX*3^0.5,GetClipMaxX,Obj_GetY(obj)+GetCenterX*3^0.5,10,1,true);
					yield;
				}
			}
		}


function wait(w) {
    loop(w) { yield; }
}

}


script_spell HarvestMSP //邪恋「実りやすいマスタースパーク」スクリプト
{

let angle=270;

    @Initialize {
        SetPlayerInvincibility(450);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
        yield;
	SetSpeed(0,0);
	HMSP;
	Angle;
        loop(450){yield;}
	SetSpeed(5.0,2);
        End;
    }

task HMSP
{
	let x=GetPlayerX;
	let y=GetPlayerY;
loop(4)
{
	LASER(x,y,10,15,0);
	wait(5);
	LASER(x,y,10,14,0);
	wait(5);
	LASER(x,y,10,12,0);
	wait(5);
	LASER(x,y,10,11,0);
	wait(5);
	LASER(x,y,10,10,0);
	wait(5);
	LASER(x,y,10,9,0);
	wait(5);
}

loop(10)
{
	LASER(x,y,120,15,0);
	LASER(x,y,110,15,8);
	LASER(x,y,110,15,-8);
	wait(5);
	LASER(x,y,120,14,0);
	LASER(x,y,110,14,8);
	LASER(x,y,110,14,-8);
	wait(5);
	LASER(x,y,120,12,0);
	LASER(x,y,110,12,8);
	LASER(x,y,110,12,-8);
	wait(5);
	LASER(x,y,120,11,0);
	LASER(x,y,110,11,8);
	LASER(x,y,110,11,-8);
	wait(5);
	LASER(x,y,120,10,0);
	LASER(x,y,110,10,8);
	LASER(x,y,110,10,-8);
	wait(5);
	LASER(x,y,120,9,0);
	LASER(x,y,110,9,8);
	LASER(x,y,110,9,-8);
	wait(5);
}
}




task Angle
{
loop(120)
{
		if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD)
		{
			angle-=15/120;
		}
		if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD)
		{
			angle+=15/120;
		}
yield;
}

}
	task LASER(let x,let y,let wid,let color,let exangle){
		let obj= Obj_Create(OBJ_LASER);
		Obj_SetX(obj,x-50*cos(angle));
		Obj_SetY(obj,y-50*sin(angle));
		ObjLaser_SetWidth(obj,wid);
		ObjLaser_SetLength(obj,800);
		ObjLaser_SetSource(obj,false);
        	ObjShot_SetGraphic(obj,color);   
		Obj_SetAngle(obj, angle+exangle);
		ObjShot_SetDelay(obj,0);
		ObjShot_SetPenetration(obj,256);
		Obj_SetAutoDelete(obj,false);
		if(wid==10)
		{
		ObjShot_SetDamage(obj,2.0); 
		}
		else
		{
		ObjShot_SetDamage(obj,1.5); 
		}  

		if(exangle==0)
		{
				loop(15)
				{
					if(wid==10)
					{
					Obj_SetAngle(obj, angle+exangle);
					}
					Obj_SetX(obj,GetPlayerX-50*cos(angle));
					Obj_SetY(obj,GetPlayerY-50*sin(angle));
					yield;
				}
		}
		else
		{
				loop(5)
				{
					Obj_SetX(obj,GetPlayerX-50*cos(angle));
					Obj_SetY(obj,GetPlayerY-50*sin(angle));
					Obj_SetAlpha(obj,0);
					yield;
				}
			
				loop(10)
				{
					Obj_SetAlpha(obj,255);
					Obj_SetX(obj,GetPlayerX-50*cos(angle));
					Obj_SetY(obj,GetPlayerY-50*sin(angle));
					yield;
				}
		}

		Obj_Delete(obj);
}

function wait(w) {
    loop(w) { yield; }
}

}


script_spell Mikaze//秘術「御風の儀式」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";

    @Initialize {
        SetPlayerInvincibility(300);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	SetSpeed(9.0,4.5);
	kaze;
        loop(240){yield;}
	SetSpeed(4.5,2);
        End;
    }


task kaze
{
		let by1=GetClipMaxY-128;
		let scax=0;
		let scay=0;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -16, -16);
		ObjEffect_SetVertexXY(obj, 1, 16,  -16);
		ObjEffect_SetVertexXY(obj, 2, 16, 16);
		ObjEffect_SetVertexXY(obj, 3,  -16,  16);
		
		ObjEffect_SetVertexUV(obj, 0,  123,  42);
		ObjEffect_SetVertexUV(obj, 1,  155, 42);
		ObjEffect_SetVertexUV(obj, 2, 155,  74);
		ObjEffect_SetVertexUV(obj, 3, 123, 74);
		ObjEffect_SetVertexColor(obj,0,150,255,255,255);
		ObjEffect_SetVertexColor(obj,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj,2,150,255,255,255);
		ObjEffect_SetVertexColor(obj,3,150,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,0);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);

		intersection;
		loop(45)
		{
			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			ObjEffect_SetScale(obj, scax,scay);
			scax+=0.1;
			scay+=0.1;
			yield;
		}

		loop(150){

			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			yield;
			}

		loop(45)
		{
			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			ObjEffect_SetScale(obj, scax,scay);
			scax-=0.1;
			scay-=0.1;
			yield;
		}

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),80,0,false);
					yield;
				}
			}
}


function wait(w) {
    loop(w) { yield; }
}

}

script_spell Gama//蛙符「手管の蝦蟇」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";

    @Initialize {
        SetPlayerInvincibility(310);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
let r=10;
	kaze(GetPlayerX+r*cos(30),GetPlayerY+r*sin(30));
	kaze(GetPlayerX+r*cos(150),GetPlayerY+r*sin(150));
	kaze(GetPlayerX+r*cos(270),GetPlayerY+r*sin(270));
        loop(310){yield;}
        End;
    }


task kaze(x,y)
{
		let by1=GetClipMaxY-128;
		let scax=0;
		let scay=0;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, imgSpell);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -16, -16);
		ObjEffect_SetVertexXY(obj, 1, 16,  -16);
		ObjEffect_SetVertexXY(obj, 2, 16, 16);
		ObjEffect_SetVertexXY(obj, 3,  -16,  16);
		
		ObjEffect_SetVertexUV(obj, 0,  123,  42);
		ObjEffect_SetVertexUV(obj, 1,  155, 42);
		ObjEffect_SetVertexUV(obj, 2, 155,  74);
		ObjEffect_SetVertexUV(obj, 3, 123, 74);
		ObjEffect_SetVertexColor(obj,0,150,255,255,255);
		ObjEffect_SetVertexColor(obj,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj,2,150,255,255,255);
		ObjEffect_SetVertexColor(obj,3,150,255,255,255);
		
		ObjEffect_SetAngle(obj, 0,0,0);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,x,y);

		intersection;
		loop(30)
		{
			ObjEffect_SetScale(obj, scax,scay);
			scax+=0.002;
			scay+=0.002;
			yield;
		}
		loop(150)
		{
			ObjEffect_SetScale(obj, scax,scay);
			scax+=0.01;
			scay+=0.01;
			yield;
		}


		loop(10)
		{
			ObjEffect_SetScale(obj, scax,scay);
			scax+=1.0;
			scay+=1.0;
			yield;
		}
		loop(90)
		{
			yield;
		}
		let a=150;
		loop(30)
		{
		ObjEffect_SetVertexColor(obj,0,a,255,255,255);
		ObjEffect_SetVertexColor(obj,1,a,255,255,255);
		ObjEffect_SetVertexColor(obj,2,a,255,255,255);
		ObjEffect_SetVertexColor(obj,3,a,255,255,255);
		a-=5;
		yield;
		}

		task intersection
			{
				let range=0;
				loop(180)
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),range,2,true);
					range+=0.2;
					yield;
				}
				loop(10)
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),range,10.5,true);
					range+=3.0;
					yield;
				}
				range=180;
				loop(120)
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),range,10.5,true);
					yield;
				}
			}
}


function wait(w) {
    loop(w) { yield; }
}

}
