//データへのパス
	let csd		= GetCurrentScriptDirectory;
	let imgShot	= csd ~ "img\shot_all.png";
	let imgEffect	= csd ~ "img\effect.png";
	let imgHouou	= csd ~ "img\houou.png";

	let shotData	= csd ~ ".\shot.txt";

	let seShot	= csd ~ "se\arrow01.wav";
	let seShot2	= csd ~ "se\shoot13.wav";
	let seShot3	= csd ~ "se\gun10.wav";
	let seShot4	= csd ~ "se\shot02.wav";
	let seShot5	= csd ~ "se\sha00.wav";
	let seLaser1	= csd ~ "se\byoro07.wav";
	let seCharge1	= csd ~ "se\eco00.wav";
	let seCharge2	= csd ~ "se\power32.wav";
	let seExplo1	= csd ~ "se\don05.wav";
	let seDown1	= csd ~ "se\eco02_b.wav";
	let seTimer	= csd ~ "se\cursor37.wav";
	let seFire	= csd ~ "se\fire02.wav";

	let cenX	=GetCenterX;
	let cenY	=GetCenterY;
	let minX	=GetClipMinX;
	let maxX	=GetClipMaxX;
	let minY	=GetClipMinY;
	let maxY	=GetClipMaxY;
	let counter	=0;
	let rect	=0;
	let iru		=0;
	let rectz	=0;
	let hououz	=0;
	let drawcount	=0;
	let drawriza	=0;


//ロード
	sub Load {
		LoadGraphic(imgShot);
		LoadGraphic(imgEffect);
		LoadGraphic(imgHouou);

		LoadSE(seShot);
		LoadSE(seShot2);
		LoadSE(seShot3);
		LoadSE(seShot4);
		LoadSE(seShot5);
		LoadSE(seLaser1);
		LoadSE(seCharge1);
		LoadSE(seCharge2);
		LoadSE(seExplo1);
		LoadSE(seDown1);
		LoadSE(seTimer);
		LoadSE(seFire);
	}


//破棄
	sub Delete {
		DeleteGraphic(imgShot);
		DeleteGraphic(imgEffect);
		DeleteGraphic(imgHouou);
	}


//ボムバリア
	task BombBarrier {
		loop{
			while(OnBomb == true) {
				SetAlpha(192);
				SetDamageRate(0, 0);
				yield;
			}

			SetCollisionA(GetX, GetY, 32);
			SetCollisionB(GetX, GetY, 16);
			SetColor(255, 255, 255);
			SetAlpha(255);
			SetDamageRate(20, 0);
			yield;
		}
	}


//演出用ディレイ弾
	task DelayEff(x, y, color, scale, deltime, waittime) {
		if(OnPlayerMissed == true) { return; }

		let Obj  = Obj_Create(OBJ_SHOT);
		if(scale < 3){scale = 3;}
		if(scale <= deltime){deltime = scale-1;}

		wait(waittime);

		Obj_SetPosition(Obj, x, y);
		ObjShot_SetGraphic(Obj, color);
		ObjShot_SetDelay(Obj, scale);
		ObjShot_SetBombResist(Obj, true);
		ObjShot_ToItem(Obj, false);
		Obj_SetCollisionToPlayer(Obj, false);

		wait(deltime);
		Obj_Delete(Obj);
	}


//リザレクション用A
	task RizalectionA{
		DeathExplosion;
		DeleteGraphic(imgBoss);
		wait(30);
		PlaySE(seExplo1);
	}


//リザレクション用B
	task RizalectionB{
		Charge;
		PlaySE(seCharge1);
        	CutIn(YOUMU,"「リザレクション」", NULL, 0, 0, 0, 0);
		wait(30);
		drawriza++;
	}


//チャージ
	task Charge{
		Concentration01(90);
		loop(600){
		let angle=rand(0,360);
		ChargeEffect(GetX+rand(100,300)*sin(angle),GetY+rand(100,300)*cos(angle));
		}
	}


//撃破演出
	task Finish{
		Slow(2);
		DeathExplosion;
		DeleteGraphic(imgBoss);
		PlaySE(seShot4);
		wait(20);
		DeathExplosion;
		PlaySE(seShot4);
		wait(20);
		PlaySE(seShot4);
		wait(20);
		PlaySE(seExplo1);			
		Slow(0);
	}


//撃破爆発
	task DeathExplosion{
		loop(40) {
			DeathEffect(0, 255, 150, 150);
			DeathEffect(1, 150, 150, 255);
			DeathEffect(2, 150, 255, 150);
			DeathEffect(3, 255, 255, 150);
			wait(2);
		}
	}


//撃破時弾消し
	task EraseShot {
		let radius = 0;
		let radMax = ( ((GetClipMaxY-GetY)^2 + (GetClipMaxX-GetX)^2)^0.5 ) +50;

		loop(60) {
			radius += radMax/60;
			DeleteEnemyShotToItemInCircle(ALL, GetX, GetY, radius);

			yield;
		}
	}


//待機
	function wait(w) {
		loop(w) { yield; }
	}


//タイマー音
	task Timer{	
		loop(11){
		PlaySE(seTimer);
		loop(60){
		wait(1);
		}
		}
	}

//スペル
	function Spell{
		if(GotSpellCardBonus){
			SetCommonDataEx("EIYA", "LastSpell", GetCommonDataEx("EIYA", "LastSpell")+1);
		}
	}