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

    @Initialize {
        SetPlayerInvincibility(180);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	PlaySE(SE[0]);
	Huuma;
        loop(150){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(90){

			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
			{
				loop(90)
				{
					ObjSpell_SetIntersecrionLine(obj,Obj_GetX(obj),0,Obj_GetX(obj),500,64,1.0,false);
					ObjSpell_SetIntersecrionLine(obj2,Obj_GetX(obj2),0,Obj_GetX(obj2),500,64,1.0,false);
					ObjSpell_SetIntersecrionLine(obj3,0,Obj_GetY(obj3),500,Obj_GetY(obj3),64,1.0,false);
					ObjSpell_SetIntersecrionLine(obj4,0,Obj_GetY(obj4),500,Obj_GetY(obj4),64,1.0,false);
					ascent(let i in 0..8)
					{
						DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),i*64,64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj2),i*64,64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,i*64,Obj_GetY(obj3),64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,i*64,Obj_GetY(obj4),64);
					}
					yield;
				}
				loop(60)
				{
					ObjSpell_SetIntersecrionLine(obj,Obj_GetX(obj),0,Obj_GetX(obj),500,64,1.5,false);
					ObjSpell_SetIntersecrionLine(obj2,Obj_GetX(obj2),0,Obj_GetX(obj2),500,64,1.5,false);
					ObjSpell_SetIntersecrionLine(obj3,0,Obj_GetY(obj3),500,Obj_GetY(obj3),64,1.5,false);
					ObjSpell_SetIntersecrionLine(obj4,0,Obj_GetY(obj4),500,Obj_GetY(obj4),64,1.5,false);
					ascent(let i in 0..8)
					{
						DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),i*64,64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj2),i*64,64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,i*64,Obj_GetY(obj3),64);
						DeleteEnemyShotImmediatelyInCircle(SHOT,i*64,Obj_GetY(obj4),64);
					}
					yield;
				}
			}
		}

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

}


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

    @Initialize {
        SetPlayerInvincibility(420);
	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,5.0,false);
				ascent(let i in 0..16)
				{
					DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),i*32,60);
				}
					yield;
				}
			}
}


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

}


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

    @Initialize {
        SetPlayerInvincibility(240);
	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);
				/*	ascent(let i in -12..13)
					{
						DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX-i*20,Obj_GetY(obj)-i*GetCenterX*3^0.5/12,20);
					}
				*/	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);
				/*	ascent(let i in -12..13)
					{
						DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX+i*20,Obj_GetY(obj)+i*GetCenterX*3^0.5/12,20);
					}
				*/	yield;
				}
			}
		}


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

}


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

let angle=270;

    @Initialize {
        SetPlayerInvincibility(480);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

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

task SparkInterference
{
SetCommonData("MASTERSPARK",true);
loop(450)
{
	yield;
	if(GetCommonDataDefault("FLOWERSPARK",false)==true)
	{
		break;
	}
}
SetCommonData("MASTERSPARK",false);
}

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,1.0); 
		}
		else
		{
			ObjShot_SetDamage(obj,1.2); 
		}  
		if(GetCommonDataDefault("FLOWERSPARK",false)==true)
		{
			Obj_SetAlpha(obj,0);
			ObjShot_SetDamage(obj,0);
		}
		if(exangle==0)
		{
			if(GetCommonDataDefault("FLOWERSPARK",false)==true)
			{
				Obj_SetAlpha(obj,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;
				}
				if(GetCommonDataDefault("FLOWERSPARK",false)==true)
				{
					Obj_SetAlpha(obj,0);
				}
				else
				{
					Obj_SetAlpha(obj,255);
				}
				loop(10)
				{
					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 Meisyu//珠符「明珠暗投」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\shot_all.png";

    @Initialize {
        SetPlayerInvincibility(240);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	ascent(let i in 0..8)
	{
	gyoku(i*45);
	}
        loop(210){yield;}
        End;
    }

task gyoku(let angle)
{
		let by1=GetClipMaxY-128;
		let scax=1;
		let scay=1;
		let r=0;
		let Zangle=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,  286,  352);
		ObjEffect_SetVertexUV(obj, 1,  318, 352);
		ObjEffect_SetVertexUV(obj, 2, 318,  384);
		ObjEffect_SetVertexUV(obj, 3, 286, 384);
		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,Zangle);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		intersection;
		loop(60)
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,GetPlayerX+r*cos(angle),GetPlayerY+r*sin(angle));
			r+=1.5;
			angle+=5;
			yield;
		}

		loop(30)
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,GetPlayerX+r*cos(angle),GetPlayerY+r*sin(angle));
			angle+=5;
			yield;
		}

		let DX=GetPlayerX;
		let DY=GetPlayerY;

		loop
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,DX+r*cos(angle),DY+r*sin(angle));
			r+=1;
			DY-=5.2;
			angle+=5;
			yield;
		}

		task intersection
			{
				loop(90)
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),20,2,false);
					DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),Obj_GetY(obj),20);
					yield;
				}
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),20,8,false);
					DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),Obj_GetY(obj),20);
					yield;
				}
			}
}


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

}

script_spell Haku//霊符「夢想封印 白」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\shot_all.png";

    @Initialize {
        SetPlayerInvincibility(450);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	ascent(let i in 0..8)
	{
	gyoku(i*45);
	}
        loop(420){yield;}
        End;
    }

task gyoku(let angle)
{
		let by1=GetClipMaxY-128;
		let scax=1;
		let scay=1;
		let r=0;
		let Zangle=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,  286,  352);
		ObjEffect_SetVertexUV(obj, 1,  318, 352);
		ObjEffect_SetVertexUV(obj, 2, 318,  384);
		ObjEffect_SetVertexUV(obj, 3, 286, 384);
		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,Zangle);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
	//	intersection;
		loop(30)
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,GetPlayerX+r*cos(angle),GetPlayerY+r*sin(angle));
			r+=1;
			angle+=5;
			yield;
		}

		let DX=GetPlayerX;
		let DY=GetPlayerY;
		GyokuShot;
		loop(300)
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,DX+r*cos(angle),DY+r*sin(angle));
			if(r<=160)
			{
			r+=1;
			}
			if(GetCenterX<DX)
			{
				DX-=5;
			}
			if(GetCenterX>DX)
			{
				DX+=5;
			}
			if(GetCenterY<DY)
			{
				DY-=5;
			}
			if(GetCenterY>DY)
			{
				DY+=5;
			}
			angle+=5;
			yield;
		}

		loop(60)
		{
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=3;
			Obj_SetPosition(obj,DX+r*cos(angle),DY+r*sin(angle));
			r+=3;
			angle+=5;
			yield;
		}

		task intersection
			{
				loop(60)
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),20,0,true);
					yield;
				}
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),20,1,true);
					yield;
				}
			}

		task GyokuShot
			{
				wait(60);
			intersectiongyoku;
				loop(40)
				{
					RingShot(Obj_GetX(obj),Obj_GetY(obj),5,atan2(GetCenterY-Obj_GetY(obj),GetCenterX-Obj_GetX(obj)));
					wait(5);
				}
			}

		task intersectiongyoku
			{
				let range=0;
				loop(260)
				{
					ObjSpell_SetIntersecrionCircle(obj,GetCenterX,GetCenterY,range,1.0,false);
					DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX,GetCenterY,range);
					range+=5;
					yield;
				}
			}

		task RingShot(x,y,speed,angle)
			{
				let by1=GetClipMaxY-128;
				let scax=0.5;
				let scay=0.5;
				let r=0;
				let Zangle=0;
				let objs = Obj_Create(OBJ_SPELL);
				ObjEffect_SetTexture(objs, imgSpell);
				ObjEffect_SetPrimitiveType(objs, PRIMITIVE_TRIANGLEFAN);
				ObjEffect_SetRenderState(objs, ADD);
				ObjEffect_CreateVertex(objs, 4);
				ObjEffect_SetVertexXY(objs, 0, -16, -16);
				ObjEffect_SetVertexXY(objs, 1, 16,  -16);
				ObjEffect_SetVertexXY(objs, 2, 16, 16);
				ObjEffect_SetVertexXY(objs, 3,  -16,  16);
		
				ObjEffect_SetVertexUV(objs, 0,  286,  352);
				ObjEffect_SetVertexUV(objs, 1,  318, 352);
				ObjEffect_SetVertexUV(objs, 2, 318,  384);
				ObjEffect_SetVertexUV(objs, 3, 286, 384);
				ObjEffect_SetVertexColor(objs,0,150,255,255,255);
				ObjEffect_SetVertexColor(objs,1,150,255,255,255);
				ObjEffect_SetVertexColor(objs,2,150,255,255,255);
				ObjEffect_SetVertexColor(objs,3,150,255,255,255);
		
				ObjEffect_SetAngle(objs, 0,0,Zangle);
				ObjEffect_SetScale(objs, scax,scay);
				Obj_SetPosition(objs,x,y);
				while(!Obj_BeDeleted(obj))
				{
					Obj_SetPosition(objs,x+r*cos(angle),y+r*sin(angle));
					r+=speed;
				//	ObjSpell_SetIntersecrionCircle(objs,Obj_GetX(objs),Obj_GetY(objs),10,1.4,true);
					yield;
				}
			}

}


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

}


script_spell StarStream//魔符「スターストリーム」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";

    @Initialize {
        SetPlayerInvincibility(210);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	stream;
        loop(180){yield;}
        End;
    }


task stream
{
let r=GetCenterY/3;
let angle=0;
loop(70)
{
star((GetCenterX+GetClipMaxX)/2+r*sin(angle));
star(GetCenterX+r*sin(angle));
star((GetCenterX+GetClipMinX)/2+r*sin(angle));
angle+=10;
wait(2);
}
}

task star(let bx1)
{
		let by1=GetClipMaxY+128;
		let scax=1;
		let scay=1;
		let Zangle=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, -10, -10);
		ObjEffect_SetVertexXY(obj, 1, 10,  -10);
		ObjEffect_SetVertexXY(obj, 2, 10, 10);
		ObjEffect_SetVertexXY(obj, 3,  -10,  10);
		
		ObjEffect_SetVertexUV(obj, 0,  60,  271);
		ObjEffect_SetVertexUV(obj, 1,  79, 271);
		ObjEffect_SetVertexUV(obj, 2, 79,  291);
		ObjEffect_SetVertexUV(obj, 3, 60, 291);

		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,Zangle);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,bx1,by1);

		intersection;

		loop(60){

			Obj_SetPosition(obj,bx1,by1);
			by1-=15;
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=5;
			yield;
			}
		Obj_Delete(obj);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),10,0.8,false);
					DeleteEnemyShotImmediatelyInCircle(SHOT,Obj_GetX(obj),Obj_GetY(obj),10);
					yield;
				}
			}
}
function wait(w) {
    loop(w) { yield; }
}
}


script_spell StarBurst//星符「スターバースト」のスクリプト
{
   let imgSpell = GetCurrentScriptDirectory~"..\img\HoshiShot.png";

    @Initialize {
        SetPlayerInvincibility(480);
	TMain;
    }

    @Finalize {
    }

    @MainLoop {
	CollectItems;
        yield;
    }

   task TMain {
	stream;
	starintersection;
        loop(210){yield;}
	burst;
	loop(240){yield;}	
        End;
    }


task stream
{
let r=240;
let angle=0;
loop(10)
{
	ascent(let i in 0..12)
	{
		star(r,angle+i*30);
	}
	angle+=5;
	wait(10);
}
}

	task starintersection
		{
		let scax=1;
		let scay=1;
		let Zangle=0;
		let range=240;
		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, -10, -10);
		ObjEffect_SetVertexXY(obj, 1, 10,  -10);
		ObjEffect_SetVertexXY(obj, 2, 10, 10);
		ObjEffect_SetVertexXY(obj, 3,  -10,  10);
		
		ObjEffect_SetVertexUV(obj, 0,  60,  271);
		ObjEffect_SetVertexUV(obj, 1,  79, 271);
		ObjEffect_SetVertexUV(obj, 2, 79,  291);
		ObjEffect_SetVertexUV(obj, 3, 60, 291);

		ObjEffect_SetVertexColor(obj,0,0,255,255,255);
		ObjEffect_SetVertexColor(obj,1,0,255,255,255);
		ObjEffect_SetVertexColor(obj,2,0,255,255,255);
		ObjEffect_SetVertexColor(obj,3,0,255,255,255);
			loop(120)
			{
				ObjSpell_SetIntersecrionCircle(obj,GetCenterX,GetCenterY,range,2.5,false);
				DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX,GetCenterY,range);
				yield;
			}
			loop(120)
			{
				ObjSpell_SetIntersecrionCircle(obj,GetCenterX,GetCenterY,range,2.5,false);
				DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX,GetCenterY,range);
				range-=2;
				yield;
			}
		}

task star(let r,angle)
{
		let scax=1;
		let scay=1;
		let Zangle=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, -10, -10);
		ObjEffect_SetVertexXY(obj, 1, 10,  -10);
		ObjEffect_SetVertexXY(obj, 2, 10, 10);
		ObjEffect_SetVertexXY(obj, 3,  -10,  10);
		
		ObjEffect_SetVertexUV(obj, 0,  60,  271);
		ObjEffect_SetVertexUV(obj, 1,  79, 271);
		ObjEffect_SetVertexUV(obj, 2, 79,  291);
		ObjEffect_SetVertexUV(obj, 3, 60, 291);

		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,Zangle);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,GetCenterX+r+cos(angle),GetCenterY+r+sin(angle));

//		intersection;

		loop(120){
			Obj_SetPosition(obj,GetCenterX+r*cos(angle),GetCenterY+r*sin(angle));
			r-=2;
			angle+=5;
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=5;
			yield;
			}
		Obj_Delete(obj);

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),10,1,true);
					yield;
				}
			}
}

task burst
{
		let scax=0;
		let scay=0;
		let obj = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj, GetCurrentScriptDirectory~"..\img\burstshot.png");
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		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,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);

		Obj_SetPosition(obj,GetCenterX,GetCenterY);
		ObjEffect_SetScale(obj, scax,scay);


		let obj2 = Obj_Create(OBJ_SPELL);
		ObjEffect_SetTexture(obj2, GetCurrentScriptDirectory~"..\img\burstshot.png");
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -128, -128);
		ObjEffect_SetVertexXY(obj2, 1, 128,  -128);
		ObjEffect_SetVertexXY(obj2, 2, 128, 128);
		ObjEffect_SetVertexXY(obj2, 3,  -128,  128);
		
		ObjEffect_SetVertexUV(obj2, 0,  256,  0);
		ObjEffect_SetVertexUV(obj2, 1,  512, 0);
		ObjEffect_SetVertexUV(obj2, 2, 512,  256);
		ObjEffect_SetVertexUV(obj2, 3, 256, 256);

		ObjEffect_SetVertexColor(obj2,0,150,255,255,255);
		ObjEffect_SetVertexColor(obj2,1,150,255,255,255);
		ObjEffect_SetVertexColor(obj2,2,150,255,255,255);
		ObjEffect_SetVertexColor(obj2,3,150,255,255,255);

		Obj_SetPosition(obj2,GetCenterX,GetCenterY);
		ObjEffect_SetScale(obj2, scax,scay);
	centralstar;
	intersection;
	loop(60)
	{
		ObjEffect_SetScale(obj, scax,scay);
		ObjEffect_SetScale(obj2, scax,scay);
		scax+=0.1;
		scay+=0.1;	
		yield;
	}
	wait(140);
	let alpha=150;
	loop(40)
	{
		ObjEffect_SetVertexColor(obj2,0,alpha,255,255,255);
		ObjEffect_SetVertexColor(obj2,1,alpha,255,255,255);
		ObjEffect_SetVertexColor(obj2,2,alpha,255,255,255);
		ObjEffect_SetVertexColor(obj2,3,alpha,255,255,255);

		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);
		alpha-=150/40;
		yield;
	}

		task intersection
			{
				let scale=0;
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,GetCenterX,GetCenterY,25.6*scale,9,false);
					DeleteEnemyShotImmediatelyInCircle(SHOT,GetCenterX,GetCenterY,25.6*scale);
					scale+=1;
					yield;
				}
			}
}

task centralstar
{
let angle=0;
let angleplus=0;
loop(40)
{
	ascent(let i in 0..12)
	{
		StarShot(i*30+angle);
	}
angle+=angleplus;
angleplus+=1;
wait(5);
}
}

task StarShot(let angle)
{
		let scax=1;
		let scay=1;
		let Zangle=0;
		let r=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, -10, -10);
		ObjEffect_SetVertexXY(obj, 1, 10,  -10);
		ObjEffect_SetVertexXY(obj, 2, 10, 10);
		ObjEffect_SetVertexXY(obj, 3,  -10,  10);
		
		ObjEffect_SetVertexUV(obj, 0,  60,  271);
		ObjEffect_SetVertexUV(obj, 1,  79, 271);
		ObjEffect_SetVertexUV(obj, 2, 79,  291);
		ObjEffect_SetVertexUV(obj, 3, 60, 291);

		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,Zangle);
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,GetCenterX+r+cos(angle),GetCenterY+r+sin(angle));
		intersection;
		loop(60){
			Obj_SetPosition(obj,GetCenterX+r*cos(angle),GetCenterY+r*sin(angle));
			r+=8;
			ObjEffect_SetAngle(obj, 0,0,Zangle);
			Zangle+=5;
			yield;
			}

		task intersection
			{
				while(!Obj_BeDeleted(obj))
				{
					ObjSpell_SetIntersecrionCircle(obj,Obj_GetX(obj),Obj_GetY(obj),10,0.5,true);
					yield;
				}
			}
}


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; }
}

}
