//BombCore
@MainLoop{yield;}
@Finalize{yield;}
let Cut = GetCurrentScriptDirectory;

let Bm = [
	Cut~"B00.png",
	Cut~"B01.png",
	Cut~"B02.png",
	Cut~"B03.png",
	Cut~"B04.png",
	Cut~"B05.png",
	Cut~"B06.png",
	Cut~"B07.png",
	Cut~"B08.png",
	Cut~"B09.png",
	Cut~"B10.png",
	Cut~"B11.png",
	Cut~"B12.png",
	Cut~"B13.png",
	Cut~"B14.png",
	Cut~"B15.png",
	Cut~"B16.png",
	Cut~"B17.png",
	Cut~"B18.png",
	Cut~"B19.png",
	Cut~"B20.png",
	Cut~"B21.png",
	Cut~"B22.png",
	Cut~"B23.png",
	Cut~"B24.png",
	Cut~"B25.png",
	Cut~"B26.png",
	Cut~"B27.png",
	Cut~"B28.png",
	Cut~"B29.png",
	Cut~"B30.png",
	Cut~"B31.png",
	Cut~"B32.png",
	Cut~"B33.png",
	Cut~"B34.png",
	Cut~"B35.png",
	Cut~"B36.png",
	Cut~"B37.png",
	Cut~"B38.png",
	Cut~"B39.png",
	Cut~"B40.png",		
	Cut~"B41.png",
	Cut~"B42.png",
	Cut~"B43.png",
	Cut~"B44.png",
	Cut~"B45.png",
	Cut~"B46.png",
	Cut~"B47.png",
	Cut~"B48.png",
	Cut~"B49.png",
	Cut~"B50.png",
];

let mv=0;
let tm=0;

let counter=0;

sub Clock{
	alternative(tm)
	case(2){mv=0;}
	case(4){mv=1;}
	case(6){tm=0;}
	tm++;
}
function sec(n){
	loop(n){yield;}
}
function Et(n,obj,layer,ag,a,b,c,d){//EffectTask
	ObjEffect_SetTexture(obj,Bm[n]);
	ObjEffect_SetLayer(obj,layer);
	ObjEffect_SetAngle(obj,0,0,ag);//X,Y,Z
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	alternative(n)
	case(0){yield;}
	case(1,2,3,41){//サムライソード//おみくじボム//蘭丸//メガスマッシャー
		Ev(obj,226*a,226*b,226*c,226*d);
		Obj_SetAngle(obj,270);
		ObjEffect_SetScale(obj,2,2);
	}
	case(4,33){//超科学爆弾//スト...2
		Ev(obj,258*a,258*b,258*c,258*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(5){//バルナスバスター
		Ev(obj,226*a,258*b,226*c,258*d);
		ObjEffect_SetScale(obj,3.5,3.5);
	}
	case(6){//1トン爆弾
		Ev(obj,178*a,178*b,178*c,178*d);
	}
	case(7){//ジャスティスアタック
		Ev(obj,66*a,92*b,66*c,92*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(10){//バスターブレード
		Ev(obj,130*a,98*b,130*c,98*d);
		ObjEffect_SetScale(obj,1,1);
	}
	case(12){//ファイヤーブレード
		Ev(obj,a,b,c,d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(14){//A9A10ロケット
		Ev(obj,82*a,194*b,82*c,194*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(15,17,46){//ゼロ式ミサイル//真サムライソード//ヘルスピン
		Ev(obj,130*a,130*b,130*c,130*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(18){//九字の術法
		Ev(obj,162*a,162*b,162*c,162*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(19){//来震電撃
		Ev(obj,34*a,226*b,34*c,226*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(20,40){//忍法 華の舞
		Ev(obj,98*a,130*b,98*c,130*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(21){//サムライフラッシュ
		Ev(obj,118*a,258*b,118*c,258*d);
	}
	case(22){//サ...2
		Ev(obj,226*a,222*b,226*c,222*d);
	}
	case(23){//スウィートカーニバル
		Ev(obj,98*a,130*b,98*c,130*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(24){//ブラッディークロス1
		Ev(obj,130*a,82*b,130*c,82*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(25){//ブX...2
		Ev(obj,178*a,175*b,178*c,175*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(26){//ブX...3
		Ev(obj,450*a,578*b,450*c,578*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(27){//パワーレーザー1
		Ev(obj,130*a,66*b,130*c,66*d);
	}
	case(28){//パワ...2
		Ev(obj,66*a,612*b,66*c,612*d);
	}
	case(30,37){//ダンシングジニー
		Ev(obj,130*a,98*b,130*c,98*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(31){//ダン...2
		Ev(obj,114*a,130*b,114*c,130*d);
	}
	case(32){//スーパートマホーク
		Ev(obj,66*a,82*b,66*c,82*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(34){//スト...3
		Ev(obj,322*a,322*b,322*c,322*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(35){//サンダーボルト
		Ev(obj,98*a,322*b,98*c,322*d);
		ObjEffect_SetScale(obj,1.5,1.5);
	}
	case(36){//クラスターボム
		Ev(obj,66*a,130*b,66*c,130*d);
	}
	case(38){//クラ...3
		Ev(obj,324*a,322*b,324*c,322*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(42){//メガ...2
		Ev(obj,146*a,194*b,146*c,194*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(43){//カオスフレアー
		Ev(obj,82*a,82*b,82*c,82*d);
	}
	case(44){//トライデントラッシュ
		Ev(obj,82*a,210*b,82*c,210*d);
		ObjEffect_SetScale(obj,2,2);
	}
	case(45){//サンダーブレイク
		Ev(obj,146*a,146*b,146*c,146*d);
		ObjEffect_SetScale(obj,2,2);
	}
}
function Ev(obj,a,b,c,d){//EffectVertex
	let GraphicXY=[a,b,c,d];
	let Vx=(GraphicXY[2]-GraphicXY[0])/2;
	let Vy=(GraphicXY[3]-GraphicXY[1])/2;
	ObjEffect_SetVertexUV(obj,0,GraphicXY[0],GraphicXY[1]);
	ObjEffect_SetVertexUV(obj,1,GraphicXY[2],GraphicXY[1]);
	ObjEffect_SetVertexUV(obj,2,GraphicXY[0],GraphicXY[3]);
	ObjEffect_SetVertexUV(obj,3,GraphicXY[2],GraphicXY[3]);
	ObjEffect_SetVertexXY(obj,0,-Vx,-Vy);
	ObjEffect_SetVertexXY(obj,1, Vx,-Vy);
	ObjEffect_SetVertexXY(obj,2,-Vx, Vy);
	ObjEffect_SetVertexXY(obj,3, Vx, Vy);
}