//PlayerCore
///[main]
@MainLoop{
	SetIntersectionCircle(GetPlayerX,GetPlayerY, 10);
	Clock;
	alternative(OnBomb)
	case(true){BombShot;}
	case(false){
		alternative(RapSlow)
		case(true){
			WeaponShot;
			WeaponSub;
		}
		case(false){
			MainShot;
			SubShot;
		}
	}
	if(counter>=60){counter=0;}
	alternative(ST)
	case(14,15,16,36){if(shse>=16){shse=0;}}
	case(17,18,23,46){if(shse>=20){shse=0;}}
	case(19,20,21,22){if(shse>=12){shse=0;}}
	alternative(WT)
	case(14,15,16){if(wese>=12){wese=0;}}
	case(17,18,23){if(wese>=16){wese=0;}}
	case(19,20,21,22,45){if(wese>=8){wese=0;}}
	Mv++;counter++;Moct++;shse++;wese++;Mecount++;
}
@Missed{MainLoop;}
@SpellCard{
	alternative(BT)
	case(0,1,2,3,8,10,11,28,30){//無敵状態
		UseSpellCard("Muteki",0);
		alternative(BT)
		case(1){PlaySE(SE[68]);}
		case(3){PlaySE(SE[67]);}
		case(8){PlaySE(SE[32]);}
		case(10){PlaySE(SE[42]);}
		case(2,28){PlaySE(SE[55]);}
	}
	case(4){UseSpellCard("SamuraiSword",0);PlaySE(SE[22]);}//サムライソード
	case(5){//おみくじボム
		if(RapSlow&&KeyBomb){UseSpellCard("Omikuji",1);PlaySE(SE[49]);}
		else{UseSpellCard("Omikuji",0);PlaySE(SE[49]);}
	}	
	case(6){UseSpellCard("Ranmaru",0);PlaySE(SE[14]);}//空爆ロボ援護射撃
	case(9){UseSpellCard("Ssb",SE[38]);PlaySE(SE[37]);}//超科学爆弾
	case(12){UseSpellCard("Vbr",0);PlaySE(SE[47]);}//バルナスバスター
	case(14){UseSpellCard("Kbomb",SE[13]);PlaySE(SE[12]);}//1トン爆弾
	case(15){UseSpellCard("Ja",0);PlaySE(SE[23]);}//ジャスティスアタック
	case(16){//シールド
		let way =0;
		loop(4){
			Guard(0,way,1,90);
			Guard(0,way,-1,-90);
			way+=90;
		}
	}
	case(17){Guard(1,0,GetPlayerX,0);PlaySE(SE[14]);}//B29援護爆撃
	case(18){UseSpellCard("BusterLaser",0);}//バスターブレード
	case(19){Guard(3,0,0,0);}//B-35援護
	case(20){UseSpellCard("FireBlade",0);PlaySE(SE[67]);}//ファイヤーブレード
	case(21){//ロイヤルナパーム
		Soj(GetPlayerX+20, GetPlayerY-10,270,2,106,15,150,27,-1);
		Soj(GetPlayerX-20, GetPlayerY-10,270,2,106,15,150,27, 1);
		PlaySE(SE[12]);
	}
	case(22){Soj(GetPlayerX, GetPlayerY-40,270,0,112,1,300,28,0);}//プラズママイン
	case(23){UseSpellCard("Aggregat",0);}//A9A10ロケット
	case(24){Soj(GetPlayerX, GetPlayerY-40,270,5,122,10,100,30,0);}//ゼロ式ミサイル
	case(25){Guard(7,0,0,0);}//富嶽援護射撃
	case(26){UseSpellCard("ShinSamuraiSword",0);PlaySE(SE[22]);}//真サムライソード
	case(27){UseSpellCard("NineSpell",SE[51]);}//九字の術法
	case(29){UseSpellCard("ShockT",0);PlaySE(SE[59]);}//来震電撃
	case(31){UseSpellCard("HanaD",0);PlaySE(SE[68]);}//忍法 華の舞
	case(32){UseSpellCard("SamuraiFlash",SE[72]);PlaySE(SE[71]);}//サムライフラッシュ
	case(33){UseSpellCard("SweetCarnival",0);PlaySE(SE[75]);}//スウィートカーニバル
	case(34){UseSpellCard("BloodyX",0);PlaySE(SE[55]);}//ブラッディークロス
	case(35){UseSpellCard("PowerL",SE[81]);PlaySE(SE[80]);}//パワーレーザー
	case(36){Guard(12,0,0,0);PlaySE(SE[14]);}//メカアッシュボンバー
	case(37){UseSpellCard("DancingGenie",SE[84]);}//ダンシングジニー
	case(38){UseSpellCard("STomahawk",[SE[89],SE[13]]);PlaySE(SE[88]);}//スーパートマホーク
	case(39){UseSpellCard("TVolt",0);PlaySE(SE[94]);}//サンダーボルト
	case(40){Guard(13,0,0,0);PlaySE(SE[14]);}//クラスターボム
	case(41){Guard(15,0,GetPlayerX,0);PlaySE(SE[100]);}//B52爆撃
	case(42){UseSpellCard("SamuF",0);PlaySE(SE[22]);}//サムライソード99
	case(43){UseSpellCard("MegaSmasher",[SE[101],SE[110],SE[111]]);PlaySE(SE[109]);}//メガスマッシャー
	case(45){Guard(20,0,GetPlayerX,GetPlayerY);}//アイアンペッカー
	case(46){//キラーエイプ
		Soj(GetPlayerX-10, GetPlayerY-30,265,0,65,500,300,48,0);
		Soj(GetPlayerX+10, GetPlayerY-30,275,0,65,500,300,48,0);
		Soj(GetPlayerX-30, GetPlayerY-10,255,0,65,500,300,48,0);
		Soj(GetPlayerX+30, GetPlayerY-10,285,0,65,500,300,48,0);
		Soj(GetPlayerX-50, GetPlayerY+10,245,0,65,500,300,48,0);
		Soj(GetPlayerX+50, GetPlayerY+10,295,0,65,500,300,48,0);
	}
	case(47){//ハウンドクラスター
		Guard(22,0,50,0);
		Guard(22,0,100,0);
		Guard(22,0,150,0);
	}
	case(48){UseSpellCard("ChaosFlare",0);}//カオスフレアー
	case(49){UseSpellCard("TridentRush",0);}//トライデントラッシュ
	case(50){UseSpellCard("ThunderBreak",SE[59]);}//サンダーブレイク
	case(51){UseSpellCard("HellSpin",0);PlaySE(SE[25]);}//ヘルスピン
	case(52){}
	case(53){}
	case(54){}
	case(55){}
	case(56){}
	case(57){}
	case(58){}
	case(59){}
	case(60){}
}

@DrawLoop{if(RapSlow){HI;}PI;SPI;yield;}
@Finalize{
	DeleteGraphic(Img[PT]);
	ascent(n in 0..length(SE)){DeleteSE(SE[n]);}
}
///[main]
let Mv=0;
let tm=0;

let Hold =0;
let im =0;

let shse =0;//ShotSec
let wese =0;//WeaponSec

let Mecount = 0;

let Mev = [0,0];
let Mn =[0,0];

let sag =0;//ShotAngle
let Sgld =0;//AngleHold

let Stpv = 0;
let stpm = 0;

let Opv = 0;
let opm = 0;
///
///
sub Clock{
	alternative(PT)
	case(2){		
		alternative(Mv)
		case(2){tm=0;}
		case(4){tm=1;}
		case(6){tm=2;}
		case(8){tm=3;}
		case(10){tm=4;}
		case(12){Mv=0;}
	}
	case(8,10,11,32){		
		alternative(Mv)
		case(1){tm=0;}
		case(2){tm=1;}
		case(3){tm=2;}
		case(4){tm=3;}
		case(5){Mv=0;}
	}
	case(33){		
		alternative(Mv)
		case(2){tm=0;}
		case(4){tm=1;}
		case(6){tm=2;}
		case(8){tm=3;}
		case(10){tm=4;}
		case(12){tm=5;}
		case(14){Mv=0;}
	}
	case(34,35){		
		alternative(Mv)
		case(0){tm=0;}
		case(1){tm=1;}
		case(2){tm=2;}
		case(3){Mv=0;}
	}
	case(36){		
		alternative(Mv)
		case(2){tm=0;}
		case(4){tm=1;}
		case(6){tm=2;}
		case(8){tm=3;}
		case(10){tm=4;}
		case(12){tm=5;}
		case(14){tm=6;}
		case(16){tm=7;}
		case(18){Mv=0;}
	}
	case(48,49,50,51){		
		alternative(Mv)
		case(0){tm=0;}
		case(2){tm=1;}
		case(4){tm=2;}
		case(6){tm=3;}
		case(8){Mv=0;}
	}
	others{
		alternative(Mv)
		case(1){tm=0;}
		case(2){tm=1;}
		case(3){Mv=0;}
	}
	
	alternative(Stpv)
	case(0){stpm=0;}
	case(2){stpm=1;}
	case(4){stpm=2;}
	case(6){stpm=3;}
	case(8){stpm=4;}
	case(10){stpm=5;}
	case(12){stpm=6;}
	case(14){stpm=7;}
	case(16){Stpv=0;}
	Stpv++;
	
	alternative(Opv)
	case(0){opm=0;}
	case(3){opm=1;}
	case(6){opm=2;}
	case(9){opm=3;}
	case(12){Opv=0;}
	Opv++;
	
	if(Right){
		if(Hold>30){im = 2;}
		else{im = 1;}
	}
	else if(Left){			
		if(Hold>30){im = -2;}
		else{im = -1;}
	}
	else{
		im =0;Hold =0;
	}
	Hold++;
	
	if(Right){
		if(Sgld>30){sag = 10;}
		else{sag = 5;}
	}
	else if(Left){			
		if(Sgld>30){sag = -10;}
		else{sag = -5;}
	}
	else{
		sag =0;Sgld =0;
	}
	Sgld++;
	alternative(UT)
	case(49){//フリーズアロー
		alternative(counter)
		case(0){Mev=[0,0];}
		case(1){Mev=[0,1];}
		case(2){Mev=[0,2];}
		case(3){Mev=[0,3];}
		case(4){Mev=[0,4];}
		case(5){Mev=[0,5];}
		case(6){Mev=[0,6];}
		case(7){Mev=[0,7];}
	}
	
	alternative(WT)
	case(10,27){//如意棒地獄突き//槍曼荼羅
		alternative(counter)
		case(5){Mev=[0,0];}
		case(10){Mev=[1,0];}
		case(15){Mev=[2,0];}
		case(20){Mev=[3,0];}
		case(25){Mev=[4,0];}
		case(30){Mev=[5,0];}
		case(35){Mev=[6,0];}
		case(40){Mev=[7,0];}
		case(45){Mev=[8,0];}
		case(50){Mev=[9,0];}
		case(55){Mev=[10,0];}
	}
	case(12){//ロケットパンチ
		alternative(counter)
		case(4){Mev=[0,0];}
		case(8){Mev=[2,0];}
		case(12){Mev=[4,0];}
		case(16){Mev=[6,0];}
		case(20){Mev=[8,0];}
		case(24){Mev=[10,0];}
		case(28){Mev=[0,4];}
		case(32){Mev=[2,4];}
		case(36){Mev=[4,4];}
		case(40){Mev=[6,4];}
		case(44){Mev=[8,4];}
		case(48){Mev=[10,4];}
	}
	case(32){//ラビットヨーヨー
		alternative(Mecount)
		case(3){Mev=[0,0];}
		case(6){Mev=[1,0];}
		case(9){Mev=[2,0];}
		case(12){Mev=[3,0];}
		case(15){Mev=[4,0];}
		case(18){Mev=[5,0];}
		case(21){Mev=[0,1];}
		case(24){Mev=[1,1];}
		case(27){Mev=[2,1];}
		case(30){Mev=[3,1];}
		case(33){Mev=[4,1];}
		case(36){Mev=[5,1];}
		case(39){Mev=[0,2];}
		case(42){Mev=[1,2];}
		case(45){Mev=[2,2];}
		case(48){Mev=[3,2];}
		case(51){Mev=[4,2];}
		case(54){Mev=[5,2];}
		case(57){Mev=[0,3];}
		case(60){Mev=[1,3];}
		case(63){Mev=[2,3];}
		case(66){Mev=[3,3];}
		case(69){Mev=[4,3];}
		case(72){Mev=[5,3];}
		case(75){Mecount=0;}
	}
	case(34){//バルピロパンチ
		alternative(Mecount)
		case(3){Mev=[0,0];}
		case(6){Mev=[1,0];}
		case(9){Mev=[2,0];}
		case(12){Mev=[3,0];}
		case(15,39){Mev=[4,0];}
		case(18,44){Mev=[0,1];}
		case(21,45){Mev=[1,1];}
		case(24,48){Mev=[2,1];}
		case(27,51){Mev=[3,1];}
		case(30,54){Mev=[4,1];}
		case(33,57){Mev=[0,2];}
		case(36,60){Mev=[1,2];}
		case(63){Mev=[2,2];}
		case(66){Mev=[3,2];}
		case(69){Mev=[4,2];}
		case(72){Mecount=0;}
	}
	case(35){//ビームサーベル
		alternative(Mecount)
		case(4){Mev=[0,0];}
		case(8){Mev=[1,0];}
		case(12){Mev=[2,0];}
		case(16){Mev=[3,0];}
		case(20){Mev=[4,0];}
		case(24){Mev=[5,0];}
		case(28){Mev=[6,0];}
		case(32){Mev=[7,0];}
		case(36){Mev=[8,0];}
		case(40){Mev=[9,0];}
		case(44){Mev=[10,0];}
		case(48){Mev=[0,1];}
		case(52){Mev=[1,1];}
		case(56){Mev=[2,1];}
		case(60){Mev=[3,1];}
		case(64){Mev=[4,1];}
		case(68){Mev=[5,1];}
		case(72){Mev=[6,1];}
		case(76){Mev=[7,1];}
		case(80){Mev=[8,1];}
		case(84){Mev=[9,1];}
		case(88){Mev=[10,1];}
		case(92){Mecount=0;}
	}
	case(43){//スパイラルレーザー
		alternative(counter)
		case( 0){Mev=[0,0];}
		case( 5){Mev=[0,1];}
		case(10){Mev=[0,2];}
		case(15){Mev=[0,3];}
		case(20){Mev=[0,4];}
		case(25){Mev=[0,5];}
		case(30){Mev=[1,0];}
		case(35){Mev=[1,1];}
		case(40){Mev=[1,2];}
		case(45){Mev=[1,3];}
		case(50){Mev=[1,4];}
		case(55){Mev=[1,5];}
	}	
	case(49){//ダイヤモンドダスト
		alternative(counter)
		case( 0){Mev=[0,0];}
		case( 5){Mev=[0,1];}
		case(10){Mev=[0,2];}
		case(15){Mev=[0,0];}
		case(20){Mev=[0,1];}
		case(25){Mev=[0,2];}
		case(30){Mev=[1,0];}
		case(35){Mev=[1,1];}
		case(40){Mev=[1,2];}
		case(45){Mev=[1,0];}
		case(50){Mev=[1,1];}
		case(55){Mev=[1,2];}
	}
	
	alternative(WU)
	case(48){//ファイアーブレス
		alternative(Mecount)
		case( 5){Mev=[0,0];}
		case(10){Mev=[0,1];}
		case(15){Mev=[0,2];}
		case(20){Mev=[0,3];}
		case(25){Mev=[0,4];}
		case(30){Mev=[0,5];}
		case(35){Mev=[0,6];}
		case(40){Mev=[0,7];}
		case(45){Mev=[0,8];}
		case(50){Mecount=0;}
	}
	
	alternative(BT)
	case(22){//プラズママイン
		alternative(counter)
		case( 0){Mn=[0,0];}
		case( 5){Mn=[1,0];}
		case(10){Mn=[2,0];}
		case(15){Mn=[3,0];}
		case(20){Mn=[0,1];}
		case(25){Mn=[1,1];}
		case(30){Mn=[2,1];}
		case(35){Mn=[3,1];}
		case(40){Mn=[0,2];}
		case(45){Mn=[1,2];}
		case(50){Mn=[2,2];}
		case(55){Mn=[3,2];}
	}
}
///[sys]
function PI{//PlayerImg
	alternative(PT)
	case(0){Ie(GetPlayerX,GetPlayerY,4,0,2+im,0+tm,3+im,1+tm);}
	case(1,7,13,53,54){Ie(GetPlayerX,GetPlayerY,4,0,2+im,0,3+im,1);}
	case(10){
		alternative(RapSlow)
		case(true){
			alternative(RapShot)
			case(true){
				alternative(counter)
				case(0,1,2,3,48,49,50,51,52,53,54,55,56,57,58,59){Ie(GetPlayerX,GetPlayerY+7,4,0,5+tm,1,6+tm,2);}
			}
			case(false){Ie(GetPlayerX,GetPlayerY+7,4,0,5+tm,1,6+tm,2);}
		}
		case(false){
			Ie(GetPlayerX,GetPlayerY+13,4,0,2+im,0+tm,3+im,1+tm);
			Ie(GetPlayerX,GetPlayerY,4,0,2+im,4,3+im,5);
		}
		Ie(GetPlayerX,GetPlayerY+20,3,0,0+stpm,5,1+stpm,7);
	}
	case(11){
		alternative(RapSlow)
		case(true){
			Ie(GetPlayerX,GetPlayerY+6,3,0,8+tm,1,9+tm,3);
			Ie(GetPlayerX,GetPlayerY,3,0,7,3+tm,8,4+tm);
		}
		case(false){
			Ie2(GetPlayerX,GetPlayerY+6,3,0,(2+im)*n,(0+tm)*132,(3+im)*n,(1+tm)*132);
			Ie(GetPlayerX,GetPlayerY,3,0,7+im,3+tm,8+im,4+tm);
		}
	}
	case(12){
		alternative(RapSlow)
		case(true){
			alternative(RapShot)
			case(true){
				alternative(counter)
				case(0,1,2,3,4,56,57,58,59){Ie(GetPlayerX,GetPlayerY-32,4,0,7+tm,1,8+tm,2);}
			}
			case(false){Ie(GetPlayerX,GetPlayerY-32,4,0,7+tm,1,8+tm,2);}
			Ie(GetPlayerX,GetPlayerY,4,0,5+tm,1,6+tm,2);
		}
		case(false){
			Ie(GetPlayerX,GetPlayerY,4,0,2+im,0+tm,3+im,1+tm);
		}
	}
	case(25,26,27,28,29,31,55,56,57){Ie(GetPlayerX,GetPlayerY,4,sag,2,0,3,1);}
	case(32,34,35){
		alternative(RapSlow)
		case(true){
			alternative(RapShot)
			case(false){
				Ie(GetPlayerX,GetPlayerY,3,0,2+im,0+tm,3+im,1+tm);
			}
		}
		case(false){
			Ie(GetPlayerX,GetPlayerY,3,0,2+im,0+tm,3+im,1+tm);
		}
		alternative(PT)
		case(32){
			alternative(counter%5)
			case(0){Blast(GetPlayerX,GetPlayerY+40,4,-3);}
		}
	}
	case(43){
		alternative(RapSlow)
		case(true){
			Ie2(GetPlayerX,GetPlayerY,4,0,(2+im)*132,(1+tm)*132,(3+im)*132,(2+tm)*132);
		}
		case(false){
			Ie(GetPlayerX,GetPlayerY,4,0,2+im,0+tm,3+im,1+tm);
		}
	}
	case(45,47){if(RapSlow){Ie(GetPlayerX,GetPlayerY,4,0,7,0,8,1);}}
	case(46){if(RapSlow){Ie(GetEnemyX,GetEnemyY,4,0,7,0,8,1);}}
	case(48,50,51){
		alternative(RapSlow)
		case(true){
			Ie(GetPlayerX,GetPlayerY,4,0,2+im,4+tm,3+im,5+tm);
			alternative(PT)
			case(48){Ie(GetPlayerX,GetPlayerY-30,4,0,2+im,8,3+im,9);}
			case(50){Guard(30,0,0,0);}
			case(51){
				Ie(GetPlayerX,GetPlayerY+16,4,0,2+im,8,3+im,9);
				alternative(counter%3)
				case(0){Guard(28,0,0,0);}
			}
		}
		case(false){
			Ie(GetPlayerX,GetPlayerY-16,4,0,2+im,0+tm,3+im,1+tm);
		}
	}
	others{
		Ie(GetPlayerX,GetPlayerY,4,0,2+im,0+tm,3+im,1+tm);
		alternative(PT)
		case(8){
			Ie(GetPlayerX,GetPlayerY+10,4,0,5,1,6,2);
			alternative(counter%5)
			case(0){Blast(GetPlayerX,GetPlayerY+50,4,-3);}
		}
		case(49){
			alternative(counter%5)
			case(0){Guard(28,0,0,0);}
		}
		
	}
}
function HI{Ie(GetPlayerX,GetPlayerY,5,0,7,0,8,1);}//HoldImg
function SPI{//SetPlayerImage
	let Li=0;
	loop(GetPlayerLife){
		Ie(450+Li,GetCenterY-50,8,0,5,0,6,1);
		Li+=45;
	}
	let Bo=0;
	loop(GetPlayerBomb){
		Ie(450+Bo,GetCenterY-10,8,0,6,0,7,1);
		Bo+=45;
	}
}
function Fload{
	alternative(PT)
	case(52){LoadGraphic(Op[19]);Guard(32,0,0,0);}
	alternative(ST)
	case(34){LoadGraphic(Op[6]);}
	case(49){LoadGraphic(Op[13]);}
	alternative(UT)
	case(22){LoadGraphic(Op[2]);}
	case(27){//機銃槍
		LoadGraphic(Op[3]);
		Guard(8,0,0,0);
	}
	case(28){
		LoadGraphic(Op[4]);
		Guard(9,0,-40,60);
		Guard(9,0, 40,60);
		Guard(9,0,-80,40);
		Guard(9,0, 80,40);
	}
	case(49){LoadGraphic(Op[14]);}
	alternative(WT)//メイレイファイル
	case(10){LoadGraphic(Me[1]);}
	case(12){LoadGraphic(Me[2]);}
	case(22){LoadGraphic(Op[2]);}
	case(27){LoadGraphic(Me[3]);}
	case(28){
		LoadGraphic(Op[4]);
		Guard(9,0,-40,60);
		Guard(9,0, 40,60);
		Guard(9,0,-80,40);
		Guard(9,0, 80,40);
	}
	case(32){LoadGraphic(Me[4]);}
	case(34){LoadGraphic(Me[5]);}
	case(35){LoadGraphic(Me[6]);}
	case(41){LoadGraphic(Op[7]);}
	case(43){LoadGraphic(Op[8]);}
	case(45){Guard(17,0,0,0);}
	case(46){Guard(18,0,0,0);}
	case(47){Guard(19,0,0,0);}
	case(49){LoadGraphic(Op[15]);}
	alternative(WU)
	case(15){LoadGraphic(Op[1]);}
	case(22){LoadGraphic(Op[2]);}
	case(33){LoadGraphic(Op[5]);}
	case(48){
		LoadGraphic(Op[10]);
		LoadGraphic(Op[11]);
		Guard(23,0,0,0);
	}
	case(49){
		LoadGraphic(Op[12]);
		LoadGraphic(Op[13]);
		Guard(24,0,0,0);
		Guard(25,0,-40,0);
		Guard(25,0,40,0);
	}
	case(50){
		LoadGraphic(Op[16]);
		LoadGraphic(Op[17]);
		Guard(29,0,0,0);
	}
	case(51){
		LoadGraphic(Op[18]);
		Guard(31,0,0,0);
	}
	alternative(BT)//ボムファイル
	case(4){LoadGraphic(Bm[1]);}
	case(5){LoadGraphic(Bm[2]);}
	case(6){LoadGraphic(Bm[3]);}
	case(9){LoadGraphic(Bm[4]);}
	case(12){LoadGraphic(Bm[5]);}
	case(14){LoadGraphic(Bm[6]);}
	case(15){LoadGraphic(Bm[7]);}
	case(16){LoadGraphic(Bm[8]);}
	case(17){LoadGraphic(Bm[9]);}
	case(18){LoadGraphic(Bm[10]);}
	case(19){LoadGraphic(Bm[11]);}
	case(20){LoadGraphic(Bm[12]);}
	case(22){LoadGraphic(Bm[13]);}
	case(23){LoadGraphic(Bm[14]);}
	case(24){LoadGraphic(Bm[15]);}
	case(25){LoadGraphic(Bm[16]);}
	case(26){LoadGraphic(Bm[17]);}
	case(27){LoadGraphic(Bm[18]);}
	case(29){LoadGraphic(Bm[19]);}
	case(31){LoadGraphic(Bm[20]);}
	case(32){
		LoadGraphic(Bm[21]);
		LoadGraphic(Bm[22]);
	}
	case(33){LoadGraphic(Bm[23]);}
	case(34){
		LoadGraphic(Bm[24]);
		LoadGraphic(Bm[25]);
		LoadGraphic(Bm[26]);
	}
	case(35){
		LoadGraphic(Bm[27]);
		LoadGraphic(Bm[28]);
	}
	case(36){LoadGraphic(Bm[29]);}
	case(37){
		LoadGraphic(Bm[30]);
		LoadGraphic(Bm[31]);
	}
	case(38){
		LoadGraphic(Bm[32]);
		LoadGraphic(Bm[33]);
		LoadGraphic(Bm[34]);
	}
	case(39){LoadGraphic(Bm[35]);}
	case(40){
		LoadGraphic(Bm[36]);
		LoadGraphic(Bm[37]);
		LoadGraphic(Bm[38]);
	}
	case(41){LoadGraphic(Bm[39]);}
	case(42){LoadGraphic(Bm[40]);}
	case(43){
		LoadGraphic(Bm[41]);
		LoadGraphic(Bm[42]);
	}
	case(45,46,47){LoadGraphic(Op[9]);}
	case(48){LoadGraphic(Bm[43]);}
	case(49){LoadGraphic(Bm[44]);}
	case(50){LoadGraphic(Bm[45]);}
	case(51){LoadGraphic(Bm[46]);}
}
///[sys]

///[img]
task Guard(Id,ag,r1,r2){
	let Gua=Obj_Create(OBJ_EFFECT);
	alternative(Id)
	case(0){//シールド
		let life = 20;
		loop{
			if(life>0){
				Gt(Gua,Bm[8],ag+Moct*10*r1+r2,0*n,0*n,1*n,1*n);
				Obj_SetPosition(Gua,GetPlayerX+n*sin(ag+10*Moct*r1),GetPlayerY-n*cos(ag+10*Moct*r1));
			}
			if(life>0&&GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),30,ALL)>=1){
				life=life-GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),20,ALL);
				DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			}
			if(life<=0){Obj_Delete(Gua);return;}
		yield;
		}	
	}
	case(1){//B29援護爆撃
		ForbidBomb(true);
		Gt(Gua,Bm[9],0,0,0,260,180);
		Obj_SetPosition(Gua,r1,500);
		Obj_SetSpeed(Gua,5);
		Obj_SetAngle(Gua,270);
		loop(100){
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),100);
			alternative(counter%10)
			case(0){Soj(Obj_GetX(Gua)+60*cos(counter*45),Obj_GetY(Gua),90,0,90,50,50,23,12);}
			yield;
		}
		times(80){yield;}
		ForbidBomb(false);
		Obj_Delete(Gua);
	}
	case(2){//ムスタング援護
		Obj_SetPosition(Gua,r1,500);
		Obj_SetSpeed(Gua,2);
		Obj_SetAngle(Gua,270);
		loop(260){
			Gt(Gua,Op[1],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),60);
			alternative(counter%10)
			case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,30,92,2,2,0,0);PlaySE(SE[2]);}
			yield;
		}
		times(240){yield;}
		Obj_Delete(Gua);
	}
	case(3){//B-35援護
		let life = 100;
		loop{
			let Eg =atan2(GetEnemyY-Obj_GetY(Gua),GetEnemyX-Obj_GetX(Gua));
			let Hg =atan2(GetPlayerY-Obj_GetY(Gua)+50,GetPlayerX-Obj_GetX(Gua));
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			if(Twl>60){
				Obj_SetPosition(Gua,GetPlayerX-60*cos(Hg),GetPlayerY-60*sin(Hg));
			}
			if(life>0){
				ForbidBomb(true);
				Gt(Gua,Bm[11],0,0*n,(0+tm)*106,4*n,(1+tm)*106);
				alternative(counter%10)
				case(0){
					Soj(Obj_GetX(Gua)-75,Obj_GetY(Gua)+20,Eg,20,97,1,10,0,0);
					Soj(Obj_GetX(Gua)+75,Obj_GetY(Gua)+20,Eg,20,97,1,10,0,0);
					Soj(   Obj_GetX(Gua),Obj_GetY(Gua)-10,Eg,20,97,1,10,0,0);
					PlaySE(SE[2]);
				}
			}
			if(life>0&&GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),40,ALL)>=1){
				life=life-GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),30,ALL);
				DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),30);
			}
			if(life<=0){Obj_Delete(Gua);ForbidBomb(false);return;}
		yield;
		}	
	}
	case(4){//プラズママイン
		Obj_SetPosition(Gua,r1,r2);
		Obj_SetSpeed(Gua,1);
		Obj_SetAngle(Gua,270);
		loop(600){
			Gt(Gua,Bm[13],0,Mn[0]*162,Mn[1]*162,(Mn[0]+1)*162,(Mn[1]+1)*162);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),70);
			alternative(counter%20)
			case(0){PlaySE(SE[25]);}
			yield;
		}
		times(600){yield;}
		Obj_Delete(Gua);
	}
	case(5){//秋水強行突撃
		Obj_SetPosition(Gua,GetEnemyX,500);
		Obj_SetSpeed(Gua,6);
		loop(200){
			let Hg =atan2(GetEnemyY-Obj_GetY(Gua)+100,GetEnemyX-Obj_GetX(Gua));
			Obj_SetAngle(Gua,Hg);
			Gt(Gua,Op[2],0,1*n,(0+tm)*n,2*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			alternative(counter%5)
			case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,30,123,1,10,0,0);}
			yield;
		}
		Obj_SetAngle(Gua,270);
		times(200){yield;}
		Obj_Delete(Gua);
	}
	case(6){//秋水集中砲火
		Obj_SetPosition(Gua,r1,r2);
		loop(200){
			Obj_SetX(Gua,Obj_GetX(Gua)+sin(Moct*10));
			Gt(Gua,Op[2],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			alternative(counter%10)
			case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,30,124,2,10,0,0);}
			yield;
		}
		Obj_Delete(Gua);
	}
	case(7){//富嶽援護射撃
		let life = 200;
		loop{
			let Hg =atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			if(Twl>60){
				Obj_SetPosition(Gua,GetPlayerX-60*cos(Hg),GetPlayerY-60*sin(Hg));
			}
			if(life>0){
				ForbidBomb(true);
				Gt(Gua,Bm[16],0,0*194,(0+tm)*145,1*194,(1+tm)*145);
				ObjEffect_SetScale(Gua,2,2);
				alternative(counter%5)
				case(0){
					Soj(Obj_GetX(Gua),Obj_GetY(Gua)-150,270,25,125,8,10,0,0);
					Soj(Obj_GetX(Gua)-45,Obj_GetY(Gua)-70,270,25,125,5,10,0,0);
					Soj(Obj_GetX(Gua)+45,Obj_GetY(Gua)-70,270,25,125,5,10,0,0);
					Soj(Obj_GetX(Gua)-70,Obj_GetY(Gua)-70,270,25,125,5,10,0,0);
					Soj(Obj_GetX(Gua)+70,Obj_GetY(Gua)-70,270,25,125,5,10,0,0);
					Soj(Obj_GetX(Gua)-20,Obj_GetY(Gua)-80,210,25,125,6,10,0,0);
					Soj(Obj_GetX(Gua)+20,Obj_GetY(Gua)-80,330,25,125,6,10,0,0);
					Soj(Obj_GetX(Gua)-20,Obj_GetY(Gua),210,25,125,6,10,0,0);
					Soj(Obj_GetX(Gua)+20,Obj_GetY(Gua),330,25,125,6,10,0,0);
					Soj(Obj_GetX(Gua)-20,Obj_GetY(Gua)+60,210,25,125,6,10,0,0);
					Soj(Obj_GetX(Gua)+20,Obj_GetY(Gua)+60,330,25,125,6,10,0,0);
					PlaySE(SE[2]);
				}
			}
			if(life>0&&GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),40,ALL)>=1){
				life=life-GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),30,ALL);
				DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),30);
			}
			if(life<=0){Obj_Delete(Gua);ForbidBomb(false);return;}
		yield;
		}	
	}
	case(8){//機銃槍
		loop{
			let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));//b追a
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			if(Twl>50){
				Obj_SetPosition(Gua,GetPlayerX-50*cos(Hg),GetPlayerY-50*sin(Hg));
			}
			if(RapShot){
				alternative(counter%5)
				case(0){PlaySE(SE[57]);Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,20,140,1,10,0,0);}
			}
			Gt(Gua,Op[3],0,(0+opm)*34,0,(1+opm)*34,66);
			yield;
		}
	}
	case(9){//菱花鏡//蒼羅霊
		loop{
			if(RapSlow){//蒼羅霊
				Obj_SetPosition(Gua,Obj_GetX(Gua),Obj_GetY(Gua));
				if(RapShot&&WT==28){
				alternative(counter)
				case( 0,30){Soj(Obj_GetX(Gua),Obj_GetY(Gua)-40,270,30,143,2,6,0,0);PlaySE(SE[61]);}
				case(10,40){Soj(Obj_GetX(Gua),Obj_GetY(Gua)-40,270,30,144,2,6,0,0);PlaySE(SE[61]);}
				case(20,50){Soj(Obj_GetX(Gua),Obj_GetY(Gua)-40,270,30,145,2,6,0,0);PlaySE(SE[61]);}
				}
			}
			else{Obj_SetPosition(Gua,GetPlayerX+r1,GetPlayerY+r2);}//菱花鏡
			Gt(Gua,Op[4],0,(0+opm)*34,0,(1+opm)*34,34);
			yield;
		}
	}
	case(10){//バットミサイル
		Obj_SetPosition(Gua,GetPlayerX,GetPlayerY+40);
		loop(100){
			Gt(Gua,Op[5],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			alternative(counter)
			case(10,40){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,5,169,1,50,22,17);PlaySE(SE[76]);}
			case(20,50){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,5,170,1,50,22,17);PlaySE(SE[76]);}
			case(30,60){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,5,171,1,50,22,17);PlaySE(SE[76]);}
			yield;
		}
		Obj_Delete(Gua);
	}
	case(11){//アトミックパンチ
		Obj_SetPosition(Gua,r1,GetPlayerY-40);
		Obj_SetSpeed(Gua,2);
		Obj_SetAngle(Gua,270);
		loop(200){
			Gt(Gua,Op[6],0,(0+stpm)*n,0,(1+stpm)*n,78);
			alternative(counter%20)
			case(0){
				Soj(Obj_GetX(Gua),Obj_GetY(Gua)-20,240,20,61,1,30,0,0);
				Soj(Obj_GetX(Gua),Obj_GetY(Gua)-20,260,20,61,1,30,0,0);
				Soj(Obj_GetX(Gua),Obj_GetY(Gua)-20,280,20,61,1,30,0,0);
				Soj(Obj_GetX(Gua),Obj_GetY(Gua)-20,300,20,61,1,30,0,0);
				PlaySE(SE[79]);
			}
			yield;
		}
		Obj_Delete(Gua);
	}
	case(12){//メカアッシュボンバー
		let life = 120;
		loop{
			let Eg =atan2(GetEnemyY-Obj_GetY(Gua),GetEnemyX-Obj_GetX(Gua));
			let Hg =atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			if(Twl>100){
				Obj_SetPosition(Gua,GetPlayerX-100*cos(Hg),GetPlayerY-100*sin(Hg));
			}
			if(life>0){
				ForbidBomb(true);
				Gt(Gua,Bm[29],0,(2+im)*98,(0+tm)*132,(3+im)*98,(1+tm)*132);
				ObjEffect_SetScale(Gua,2,2);
				alternative(counter%15)
				case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua)-100,270,55,56,8,10,0,0);PlaySE(SE[33]);}
				alternative(counter%30)
				case(0){
					Soj(Obj_GetX(Gua)-70,Obj_GetY(Gua)-100,270,10, 57,3,2,15,58);
					Soj(Obj_GetX(Gua)+70,Obj_GetY(Gua)-100,270,10, 57,3,2,15,58);
					PlaySE(SE[34]);
				}
			}
			if(life>0&&GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),40,ALL)>=1){
				life=life-GetEnemyShotCountEx(Obj_GetX(Gua),Obj_GetY(Gua),30,ALL);
				DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),30);
			}
			if(life<=0){Obj_Delete(Gua);ForbidBomb(false);return;}
		yield;
		}	
	}
	case(13){//クラスターボム
		ForbidBomb(true);
		Obj_SetPosition(Gua,GetPlayerX,GetPlayerY-100);
		UseSpellCard("ClusterB",[Obj_GetX(Gua),Obj_GetY(Gua)]);
		loop(30){yield;}
		loop(100){
			alternative(counter%1)
			case(0){Soj(Obj_GetX(Gua)+rand(-5,5)*30*cos(counter*20),Obj_GetY(Gua)-rand(-5,5)*30*sin(counter*20),270,0,202,1,50,43,12);}
			yield;
		}
		ForbidBomb(false);
	}
	case(14){//ハンターホーミング
		Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);
		loop(200){
			Gt(Gua,Op[7],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			alternative(counter%5)
			case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,30,205,1/2,10,44,0);PlaySE(SE[99]);}
			alternative(r1)
			case(0){
				let Hg =atan2(GetEnemyY-Obj_GetY(Gua)+100,GetEnemyX-Obj_GetX(Gua));
				Obj_SetAngle(Gua,Hg);
				Obj_SetSpeed(Gua,6);
			}
			case(1){
				Obj_SetX(Gua,Obj_GetX(Gua)+sin(Moct*10));
			}
			yield;
		}
		Obj_SetAngle(Gua,270);
		times(200){yield;}
		Obj_Delete(Gua);
	}
	case(15){//B52援護爆撃
		ForbidBomb(true);
		Gt(Gua,Bm[39],0,0,0,288,288);
		Obj_SetPosition(Gua,r1,500);
		Obj_SetSpeed(Gua,20);
		Obj_SetAngle(Gua,270);
		PlaySE(SE[101]);
		loop(60){
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),100);
			alternative(counter%1)
			case(0){
				Soj(Obj_GetX(Gua)+rand(-5,5)*n*cos(counter*30),Obj_GetY(Gua),90,0,206,8,50,43,12);
				PlaySE(SE[102]);
				}
			yield;
		}
		times(60){yield;}
		ForbidBomb(false);
		Obj_Delete(Gua);
	}
	case(16){//WT
		alternative(WT)
		case(43){//スパイラルレーザー
			Obj_SetPosition(Gua,GetPlayerX,GetPlayerY-60);
			Gt(Gua,Op[8],0,(0+Mev[0])*200,(0+Mev[1])*76,(1+Mev[0])*200,(1+Mev[1])*76);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),50);
			ObjEffect_SetLayer(Gua,5);
		}
		case(49){//ダイヤモンドダスト
			Obj_SetPosition(Gua,GetPlayerX,GetPlayerY-20);
			Gt(Gua,Op[15],0,0,(0+Mev[1])*66,98,(1+Mev[1])*66);
		}
		times(3){yield;}
		Obj_Delete(Gua);
	}
	case(17){//ターンマーカー
		loop{
			let Thg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			alternative(RapSlow)
			case(true){
				if(Twl>30){Obj_SetPosition(Gua,GetPlayerX-30*cos(Thg),GetPlayerY-30*sin(Thg));}
				Gt(Gua,Img[45],Thg+90,2*n,0*n,3*n,1*n);
				if(RapShot){
					alternative(counter%5)
					case(0){
						PlaySE(SE[57]);
						Soj(Obj_GetX(Gua)+30*cos(Thg-40),Obj_GetY(Gua)+30*sin(Thg-40),Thg,20,139,1,10,0,0);
						Soj(Obj_GetX(Gua)+30*cos(Thg+40),Obj_GetY(Gua)+30*sin(Thg+40),Thg,20,139,1,10,0,0);
					}
					alternative(counter)
					case(1){Soj(Obj_GetX(Gua)-30*cos(Thg-180),Obj_GetY(Gua)-30*sin(Thg-180),Thg,0,74,2,200,47,0);}
					case(6){
						Soj(Obj_GetX(Gua)-379*cos(Thg-165),Obj_GetY(Gua)-379*sin(Thg-165),Thg,0,75,4,100,47,0);
						Soj(Obj_GetX(Gua)-379*cos(Thg+165),Obj_GetY(Gua)-379*sin(Thg+165),Thg,0,75,4,100,47,0);
						Soj(Obj_GetX(Gua)-355*cos(Thg-170),Obj_GetY(Gua)-355*sin(Thg-170),Thg,0,75,4,100,47,0);
						Soj(Obj_GetX(Gua)-355*cos(Thg+170),Obj_GetY(Gua)-355*sin(Thg+170),Thg,0,75,4,100,47,0);
						PlaySE(SE[46]);
					}
				}
			}
			case(false){
				Gt(Gua,Img[45],0,2*n,0*n,3*n,1*n);
				Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);
			}
			Ie2(Obj_GetX(Gua),Obj_GetY(Gua),4,Moct*20,0,0,67,67);
			yield;
		}
	}
	case(18){//ターンマーカー(ホーミング)
		loop{
			let Thg = atan2(GetEnemyY-Obj_GetY(Gua),GetEnemyX-Obj_GetX(Gua));
			alternative(RapSlow)
			case(true){
				Gt(Gua,Img[46],Thg+90,2*n,0*n,3*n,1*n);
				if(RapShot){
					alternative(counter%5)
					case(0){
						Soj(Obj_GetX(Gua)+30*cos(Thg),Obj_GetY(Gua)+30*sin(Thg),Thg,40,76,5,4,0,0);
						PlaySE(SE[3]);
					}
					alternative(counter)
					case(10,20,30,40){
						Soj(Obj_GetX(Gua)+30*cos(Thg-120),Obj_GetY(Gua)+30*sin(Thg-120),Thg,20,89,1,50,2,10);
						Soj(Obj_GetX(Gua)+30*cos(Thg+120),Obj_GetY(Gua)+30*sin(Thg+120),Thg,20,89,1,50,2,10);
					}
					
				}
			}
			case(false){
				Gt(Gua,Img[46],0,2*n,0*n,3*n,1*n);
			}
			Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);
			Ie2(Obj_GetX(Gua),Obj_GetY(Gua),4,Moct*20,0,0,67,67);
			yield;
		}
	}
	case(19){//ターンマーカー(照準)
		loop{
			let Thg = atan2(Obj_GetY(Gua)-GetPlayerY,Obj_GetX(Gua)-GetPlayerX);
			let Twl=((GetPlayerY-Obj_GetY(Gua))^2+(GetPlayerX-Obj_GetX(Gua))^2)^0.5;
			alternative(RapSlow)
			case(true){
				if(Twl>70){Obj_SetPosition(Gua,Obj_GetX(Gua)-70*cos(Thg),Obj_GetY(Gua)-70*sin(Thg));}
				Gt(Gua,Img[47],Thg+90,2*n,0*n,3*n,1*n);
				if(RapShot){
					alternative(counter%5)
					case(0){//ワイド14
						Soj(Obj_GetX(Gua)+30*cos(Thg),Obj_GetY(Gua)+30*sin(Thg),Thg,30,211,4,2,0,0);
						Soj(Obj_GetX(Gua)+70*cos(Thg+20),Obj_GetY(Gua)+70*sin(Thg+20),Thg+10,30,211,4,2,0,0);
						Soj(Obj_GetX(Gua)+70*cos(Thg-20),Obj_GetY(Gua)+70*sin(Thg-20),Thg-10,30,211,4,2,0,0);
						PlaySE(SE[107]);
					}
					alternative(counter%20)
					case(0){
						Soj(Obj_GetX(Gua)+30*cos(Thg+90),Obj_GetY(Gua)+30*sin(Thg+90),Thg,15,186,1/3,1,22,10);
						Soj(Obj_GetX(Gua)+30*cos(Thg-90),Obj_GetY(Gua)+30*sin(Thg-90),Thg,15,186,1/3,1,22,10);
						PlaySE(SE[86]);
					}
				}
			}
			case(false){
				Gt(Gua,Img[47],0,2*n,0*n,3*n,1*n);
				Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);
			}
			Ie2(Obj_GetX(Gua),Obj_GetY(Gua),4,Moct*20,0,0,67,67);
			yield;
		}
	}
	case(20){//アイアンペッカー
		Obj_SetPosition(Gua,r1,r2);
		loop(200){
			Obj_SetX(Gua,Obj_GetX(Gua)+sin(Moct*10));
			Gt(Gua,Op[9],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			alternative(wese)
			case(2){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,35,116,20,3,0,0);}
			case(4){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,35,117,20,3,0,0);}
			case(6){Soj(Obj_GetX(Gua),Obj_GetY(Gua),270,35,118,20,3,0,0);}
			yield;
		}
		Obj_Delete(Gua);
	}
	case(21){//キラーエイプ
		Obj_SetPosition(Gua,r1,r2);
		loop(1){
			Gt(Gua,Op[9],ag+90,0*n,(0+tm)*n,1*n,(1+tm)*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),20);
			yield;
		}
		times(1){yield;}
		Obj_Delete(Gua);
	}
	case(22){//ハウンドクラスター
		loop(200){
			let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));//b追a
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			if(Twl>r1){
				Obj_SetPosition(Gua,GetPlayerX-r1*cos(Hg),GetPlayerY);
			}
			alternative(counter%5)
			case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua)-30,270,30,211,30,2,0,0);PlaySE(SE[107]);}
			Gt(Gua,Op[9],0,0*n,(0+tm)*n,1*n,(1+tm)*n);
			yield;
		}
		Obj_Delete(Gua);
	}
	case(23){//ファイアードラゴン
		alternative(PT)
		case(48){
			loop{
				let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));//b追a
				let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
				alternative(RapSlow)
				case(true){
					if(Twl>80){Obj_SetPosition(Gua,GetPlayerX-80*cos(Hg),GetPlayerY-80*sin(Hg));}
				}
				case(false){Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);}
				Gt(Gua,Op[11],0,(2+im)*98,(0+tm)*98,(3+im)*98,(1+tm)*98);
				ObjEffect_SetLayer(Gua,4);
				if(RapSlow&&RapShot){//ファイアーブレス
					Guard(27,0,Obj_GetX(Gua),Obj_GetY(Gua));
				}
				yield;
			}
		}
	}
	case(24){//アクアドラゴン
		alternative(PT)
		case(49){
			loop{
				let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));//b追a
				let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
				alternative(RapSlow)
				case(true){
					if(Twl>60){Obj_SetPosition(Gua,GetPlayerX-60*cos(Hg),420);}
					Guard(27,0,Obj_GetX(Gua),Obj_GetY(Gua));
				}
				case(false){Obj_SetPosition(Gua,GetPlayerX,GetPlayerY-12);}
				Gt(Gua,Op[12],0,(2+im)*98,(0+tm)*98,(3+im)*98,(1+tm)*98);
				ObjEffect_SetLayer(Gua,4);
				yield;
			}
		}
	}
	case(25){//アクアドラゴン
		alternative(PT)
		case(49){
			loop{
				alternative(RapSlow)
				case(true){
					let Hg =atan2(GetEnemyY-Obj_GetY(Gua)+100,GetEnemyX-Obj_GetX(Gua)+r1);
					Obj_SetAngle(Gua,Hg);
					Obj_SetSpeed(Gua,6);
					if(RapShot){//アクアブラスト
						alternative(counter%3)
						case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),260+(tm*4),60,225,1/2,2,0,0);}
					}
				}
				case(false){
					Obj_SetPosition(Gua,GetPlayerX+r1,GetPlayerY-60);
					if(RapShot){//バブル
						alternative(counter%6)
						case(0){Soj(Obj_GetX(Gua),Obj_GetY(Gua),260+(tm*4),20,221,1,2,0,0);}
					}
				}
				Gt(Gua,Op[13],0,(2+im)*n,(0+tm)*n,(3+im)*n,(1+tm)*n);
				ObjEffect_SetLayer(Gua,4);
				yield;
			}
		}
	}
	case(26){//UT
		alternative(UT)
		case(49){//フリーズアロー
			Obj_SetPosition(Gua,r1,GetPlayerY-10);
			Gt(Gua,Op[14],0,(0+Mev[1])*34,0,(1+Mev[1])*34,130);
			if(counter>=9){Obj_Delete(Gua);}
		}
		times(3){yield;}
		Obj_Delete(Gua);
	}
	case(27){//WU
		alternative(WU)
		case(48){//ファイアーブレス
			Obj_SetPosition(Gua,r1,r2-50);
			Gt(Gua,Op[10],0,0,(0+Mev[1])*66,98,(1+Mev[1])*66);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Gua),Obj_GetY(Gua),50);
			ObjEffect_SetLayer(Gua,3);
			alternative(counter%5)
			case(0){
				Soj(r1-40*cos(counter*5),r2-70,270,4,218,1/8,50,50,0);
				Soj(r1+40*cos(counter*5),r2-70,270,4,219,1/8,50,50,0);
			}
			alternative(counter%30)
			case(0){PlaySE(SE[67]);}
		}
		case(49){//アクアブラスト
			alternative(counter%3)
			case(0){PlaySE(SE[103]);Soj(r1,r2-20,270,75,224,1,5,0,0);}
		}
		case(50){//ギガウェイヴ
			alternative(counter)
			case(1){Soj(r1,r2,270,0,232,2,500,52,0);}
		}
		case(51){					
			alternative(counter%8)
			case(0){PlaySE(SE[60]);Soj(r1,r2,270,23,233,3,6,0,0);}
		}
		times(3){yield;}
		Obj_Delete(Gua);
	}
	case(28){//アクア
		Obj_SetAngle(Gua,270);
		alternative(RapSlow)
		case(true){
			alternative(PT)
			case(49){
				Gt(Gua,Img[49],0,(0+stpm)*n,4*n,(1+stpm)*n,5*n);
				Obj_SetPosition(Gua,GetPlayerX,GetPlayerY+30);
			}
			case(51){
				Gt(Gua,Img[51],0,(0+stpm)*n,9*n,(1+stpm)*n,10*n);
				Obj_SetPosition(Gua,GetPlayerX,GetPlayerY+50);
			}
			Obj_SetSpeed(Gua,-4);
		}
		times(10){yield;}
		Obj_Delete(Gua);
	}
	case(29){//サンダードラゴン
		alternative(PT)
		case(50){
			loop{
				let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));//b追a
				let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
				alternative(RapSlow)
				case(true){
					if(Twl>60){Obj_SetPosition(Gua,224,GetPlayerY+80*sin(Hg));}
					Guard(27,0,Obj_GetX(Gua),Obj_GetY(Gua));
				}
				case(false){Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);}
				Gt(Gua,Op[16],0,(2+im)*98,(0+tm)*98,(3+im)*98,(1+tm)*98);
				ObjEffect_SetLayer(Gua,4);
				yield;
			}
		}
	}
	case(30){//ハンマー
		alternative(PT)
		case(50){
			alternative(RapSlow)
			case(true){
				Obj_SetPosition(Gua,GetPlayerX,GetPlayerY-16);
				Gt(Gua,Op[17],0,(2+im)*98,(0+tm)*98,(3+im)*98,(1+tm)*98);
				ObjEffect_SetLayer(Gua,5);
			}
		}	
		times(2){yield;}
		Obj_Delete(Gua);
	}
	case(31){//スカルドラゴン
		alternative(PT)
		case(51){
			loop{
				alternative(RapSlow)
				case(true){
					let Hg =atan2(GetEnemyY-Obj_GetY(Gua)+100,GetEnemyX-Obj_GetX(Gua)+r1);
					Obj_SetAngle(Gua,Hg);
					Obj_SetSpeed(Gua,6);
					Guard(27,0,Obj_GetX(Gua)+15*cos(counter*30),Obj_GetY(Gua)-60);
				}
				case(false){Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);}
				Gt(Gua,Op[18],0,(2+im)*98,(0+tm)*98,(3+im)*98,(1+tm)*98);
				ObjEffect_SetLayer(Gua,4);
				yield;
			}
		}
	}
	case(32){//ミステル
		loop{
			let Hg = atan2(GetPlayerY-Obj_GetY(Gua),GetPlayerX-Obj_GetX(Gua));
			let Twl=((Obj_GetY(Gua)-GetPlayerY)^2+(Obj_GetX(Gua)-GetPlayerX)^2)^0.5;
			alternative(RapSlow)
			case(true){
				if(Twl>80){Obj_SetPosition(Gua,GetPlayerX-80*cos(Hg),GetPlayerY-80*sin(Hg));}
				if(RapSlow&&RapShot){Guard(27,0,Obj_GetX(Gua),Obj_GetY(Gua)-20);}
			}
			case(false){Obj_SetPosition(Gua,GetPlayerX,GetPlayerY);}
			Gt(Gua,Op[19],0,(2+im)*66,(0+tm)*66,(3+im)*66,(1+tm)*66);
			ObjEffect_SetLayer(Gua,4);
			yield;
		}
	}
}
function Gt(obj,img,Angle,a,b,c,d){//GuardEffectTask
	ObjEffect_SetTexture(obj,img);
	ObjEffect_SetLayer(obj,3);
	ObjEffect_SetAngle(obj,0,0,Angle);//X,Y,Z
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	Ev(obj,a,b,c,d);
}
task Ie(ImgX,ImgY,Layer,Angle,a,b,c,d){
	let Io=Obj_Create(OBJ_EFFECT);
	loop(2){
		Et(Io,Layer,Angle,a*n,b*n,c*n,d*n);
		Obj_SetPosition(Io,ImgX,ImgY);
		yield;
	}
	Obj_Delete(Io);
}
task Ie2(ImgX,ImgY,Layer,Angle,a,b,c,d){
	let Io=Obj_Create(OBJ_EFFECT);
	alternative(PT)
	case(11,43,45,46,47){
		loop(2){Et(Io,Layer,Angle,a,b,c,d);Obj_SetPosition(Io,ImgX,ImgY);yield;}
		Obj_Delete(Io);
	}
}
function Et(obj,layer,Angle,a,b,c,d){//EffectTask
	ObjEffect_SetTexture(obj,Img[PT]);
	ObjEffect_SetLayer(obj,layer);
	ObjEffect_SetAngle(obj,0,0,Angle);//X,Y,Z
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	Ev(obj,a,b,c,d);
}
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);
}
///[img]

///[shot]
function Asj(n,x,y,ag,sp,id,po,pe,t1,t2){
	alternative(counter%n)
	case(0){
		Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);
		alternative(ST)
		case(1){PlaySE(SE[2]);}
		case(8){PlaySE(SE[28]);}
		case(9){PlaySE(SE[33]);}
		case(10){PlaySE(SE[39]);}
		case(11){PlaySE(SE[43]);}
		case(12){PlaySE(SE[45]);}
		case(17,18,50){PlaySE(SE[3]);}
		case(5,25){PlaySE(SE[48]);}
		case(2,26,33){PlaySE(SE[52]);}
		case(6,27){PlaySE(SE[56]);}
		case(3,28,51){PlaySE(SE[60]);}
		case(29){PlaySE(SE[65]);}
		case(4,30){PlaySE(SE[69]);}
		case(32){PlaySE(SE[30]);}
		case(38){PlaySE(SE[85]);}
		case(39){PlaySE(SE[90]);}
		case(40){PlaySE(SE[95]);}
		case(41){PlaySE(SE[98]);}
		case(42){PlaySE(SE[103]);}
		case(43){PlaySE(SE[106]);}
		case(48){PlaySE(SE[3]);}
		case(49){PlaySE(SE[34]);}
	}
}
function Asj2(x,y,ag,sp,id,po,pe,t1,t2){//AirShotObj
	alternative(ST)
	case(14,15,16,36){//P-38,P-51,F5U,Heicob
		alternative(shse)
		case(4){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(8){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(12){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}	
	case(17,18,23,46){//SpitFire,SDh98,J7
		alternative(shse)
		case(5){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(10){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(15){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}
	case(19,20,21,22){//Zero,K84,Bf-109,Ta152
		alternative(shse)
		case(3){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(6){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(9){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}
	alternative(ST)
	case(14){Ase(4,3);}
	case(15,16){Ase(4,4);}
	case(17,18){Ase(5,4);}
	case(19,20){Ase(3,3);}
	case(21,22){Ase(3,4);}
	case(23,46){Ase(5,3);}
	case(36){Ase(4,39);}
}
function Wsj2(x,y,ag,sp,id,po,pe,t1,t2){//WeaponShotObj
	alternative(WT)
	case(14,15,16){//P-38,P-51,F5U
		alternative(wese)
		case(3){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(6){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(9){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}	
	case(17,18,23){//SpitFire,SDh98,J7
		alternative(wese)
		case(4){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(8){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(12){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}
	case(19,20,21,22){//Zero,K84,Bf-109,Ta152
		alternative(wese)
		case(2){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id,po,pe,t1,t2);}
		case(4){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+1,po,pe,t1,t2);}
		case(6){Soj(GetPlayerX+x,GetPlayerY+y,ag,sp,id+2,po,pe,t1,t2);}
	}
	alternative(WT)
	case(14){Wse(3,3)}
	case(15,16){Wse(3,4)}
	case(17,18){Wse(4,4)}
	case(19,20){Wse(2,3)}
	case(21,22){Wse(2,4)}
	case(23){Wse(4,3)}
}
function Ase(n,id){
	alternative(shse%n)
	case(0){PlaySE(SE[id]);}
}
function Wse(n,id){
	alternative(wese%n)
	case(0){PlaySE(SE[id]);}
}
task Soj(X,Y,Ag,Sp,Id,Pow,Penetra,Type,Type2){//ShotObj
	let Shot = Obj_Create(OBJ_SHOT);
		St(Shot,X,Y,Ag,Id,Pow,Penetra);
		Obj_SetSpeed(Shot,Sp);
		
		alternative(Type)
		case(0){loop{yield;}}
		case(1){
			loop(10){yield;}
		}
		case(2){//爆風
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),Type2,0);
					break;
				}
				yield;
			}
		}
		case(3){//大天竜
			loop(50){
			DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),60);
			yield;
			}
		}
		case(4){//花の舞
			loop(120){
			DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),20);
			yield;
			}
		}
		case(5){//マラ
			loop(8){yield;}
			ObjShot_SetGraphic(Shot,11);
			loop(8){yield;}
			ObjShot_SetGraphic(Shot,12);
			loop(8){yield;}
			ObjShot_SetGraphic(Shot,13);
			loop(60){yield;}
		}		
		case(6){//数珠光輪
			let Rag = 0;
			while(!Obj_BeDeleted(Shot)){
				Obj_SetX(Shot,Obj_GetX(Shot)+Type2*10*cos(Rag));
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),60);
				Rag+=5;
				yield;
			}
		}
		case(7){//坊主念仏地獄
			loop(60){
				Obj_SetX(Shot,GetPlayerX);
				Obj_SetY(Shot,GetPlayerY);
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),60);
				Obj_SetAngle(Shot,counter*30);
				yield;
			}
		}
		case(8){//カラー
			loop(10){yield;}
			loop(1){
				Obj_SetAngle(Shot,270+Type2);
				yield;
			}
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),3,0);
					break;
				}
				yield;
			}
		}
		case(9){//首輪バリア
			loop(20){yield;}
			Obj_SetSpeed(Shot,0);
			loop(60){
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),40);
				yield;
			}
			ObjShot_SetGraphic(Shot,32);
			loop(20){yield;}
		}
		case(10){//御守
			let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
			loop(15){yield;}
			Obj_SetAngle(Shot,Type2*90+45);
			ObjShot_SetGraphic(Shot,39);
			Obj_SetSpeed(Shot,15);
			loop(5){yield;}
			loop(120){
				Obj_SetAngle(Shot,Hg);
				yield;
			}
		}
		case(11){//エレキ弾
			loop(10){
				alternative(Type2)
				case(0){
					Obj_SetX(Shot,GetPlayerX-50);
					Obj_SetY(Shot,GetPlayerY-10);
				}
				case(1){
					Obj_SetX(Shot,GetPlayerX+50);
					Obj_SetY(Shot,GetPlayerY-10);
				}
				yield;
			}
		}
		case(12){//スーパーエレキテル
			while(!Obj_BeDeleted(Shot)){
				if(Obj_GetX(Shot)<GetClipMinX){
					Obj_SetX(Shot,GetClipMinX*2-Obj_GetX(Shot));
					Obj_SetAngle(Shot,180-Obj_GetAngle(Shot));
					ObjShot_SetGraphic(Shot,47);
				}
				if(Obj_GetX(Shot)>GetClipMaxX){
					Obj_SetX(Shot,GetClipMaxX*2-Obj_GetX(Shot));
					Obj_SetAngle(Shot,180-Obj_GetAngle(Shot));
					ObjShot_SetGraphic(Shot,47);
				}
				yield;
			}
		}
		case(13){//シューティングスター
			let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
			loop(10){yield;}
			Obj_SetSpeed(Shot,8);
			loop(120){
				Obj_SetAngle(Shot,Hg);
				yield;
				while(!Obj_BeDeleted(Shot)){
					alternative(counter%5)
					case(0){
						Blast(Obj_GetX(Shot),Obj_GetY(Shot),4,-3);
					}
					yield;
				}
			}
		}
		case(14){//ウインドシェイバー
			loop(6){yield;}
			ObjShot_SetGraphic(Shot,54);
			loop(6){yield;}
			ObjShot_SetGraphic(Shot,55);
			loop(58){yield;}
		}
		case(15){//光線銃X1
			loop(20){yield;}
			ObjShot_SetGraphic(Shot,Type2);
			loop(60){yield;}
		}
		case(16){//レイソウ剣
			loop(20){
				Obj_SetX(Shot,GetPlayerX+Type2);
				Obj_SetY(Shot,GetPlayerY);
				yield;
			}			
			Obj_SetSpeed(Shot,15);
			ObjShot_SetGraphic(Shot,64);
			loop(60){yield;}
		}
		case(17){//メイレイ
			Melee(Type2);
			loop(60){
				Obj_SetAlpha(Shot,0);
				Obj_SetX(Shot,GetPlayerX);
				alternative(Type2)
				case(1){//如意棒地獄突き
					Obj_SetY(Shot,Obj_GetY(Shot)-4*sin(counter*5));
					DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),60);
				}
				case(2){Obj_SetY(Shot,Obj_GetY(Shot)-4*sin(counter*4));}//ロケットパンチ
				case(3){Obj_SetY(Shot,Obj_GetY(Shot)-5*sin(counter*5));}//槍曼荼羅
				case(4){Obj_SetY(Shot,Obj_GetY(Shot)-2*sin(Mecount*3));}//ラビットヨーヨー
				case(5){Obj_SetY(Shot,Obj_GetY(Shot)-3*sin(Mecount*2));}//バルピロパンチ
				case(6){loop(1){yield;}Obj_SetY(Shot,GetPlayerY-125);}//ビームサーベル
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot)-90,7,0);
					break;
				}
				yield;
			}
		}
		case(18){//分身突撃隊//ヒートミサイル(赤)(青)
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Obj_SetSpeed(Shot,4);
					loop(60){yield;}
					break;
				}
				yield;
			}
		}		
		case(19){//大江戸大火災
			loop(15){yield;}
			ObjShot_SetGraphic(Shot,72);
			Obj_SetAngle(Shot,270);
			Obj_SetSpeed(Shot,5);
			while(!Obj_BeDeleted(Shot)){
				alternative(counter%10)
				case(0){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),9,0);
				}
				yield;
			}
			loop(165){yield;}
		}
		case(20){//バルナスレーザー
			loop(18){
				Obj_SetX(Shot,GetPlayerX);
				Obj_SetY(Shot,GetPlayerY-40);
				yield;
			}
		}
		case(21){//バル...2
			loop(12){
				alternative(Type2)
				case(1){
					Obj_SetX(Shot,GetPlayerX+120);
					Obj_SetY(Shot,GetPlayerY-387);
				}
				case(2){
					Obj_SetX(Shot,GetPlayerX+88);
					Obj_SetY(Shot,GetPlayerY-352);
				}
				case(3){
					Obj_SetX(Shot,GetPlayerX-120);
					Obj_SetY(Shot,GetPlayerY-387);
				}
				case(4){
					Obj_SetX(Shot,GetPlayerX-88);
					Obj_SetY(Shot,GetPlayerY-352);
				}
				case(5){
					Obj_SetX(Shot,GetPlayerX+95);
					Obj_SetY(Shot,GetPlayerY-387);
				}
				case(6){
					Obj_SetX(Shot,GetPlayerX+62);
					Obj_SetY(Shot,GetPlayerY-353);
				}
				case(7){
					Obj_SetX(Shot,GetPlayerX-95);
					Obj_SetY(Shot,GetPlayerY-387);
				}
				case(8){
					Obj_SetX(Shot,GetPlayerX-62);
					Obj_SetY(Shot,GetPlayerY-353);
				}
				yield;
			}
		}
		case(22){//ホーミングミサイル
			loop(10){yield;}
			loop(90){
				let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
				if(sin(Hg - Obj_GetAngle(Shot))>0){
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)+10);
				}
				else{
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)-10);
				}
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),Type2,0);
					break;
				}
				yield;
			}
		}
		case(23){//援護爆撃//投下式小型爆弾
			loop(20){yield;}
			loop(1){
				Blast(Obj_GetX(Shot),Obj_GetY(Shot),Type2,0);
				break;
			}
		}
		case(24){//サーチレーザー//サーチバルカン
			let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
			loop(1){
				Obj_SetAngle(Shot,Hg);
				yield;
			}
			loop(60){yield;}
		}		
		case(25){//バスターレーザー
			loop(60){
				Obj_SetX(Shot,GetPlayerX+Type2);
				Obj_SetY(Shot,GetPlayerY-10);
				yield;
			}
		}
		case(26){//バス...2
			loop(60){
				Obj_SetX(Shot,GetPlayerX+Type2);
				Obj_SetY(Shot,GetPlayerY-345);
				yield;
			}
		}
		case(27){//ロイヤルナパーム
			let Rag = 0;
			while(!Obj_BeDeleted(Shot)){
				loop(20){yield;}
				ObjShot_SetGraphic(Shot,82);
				Obj_SetX(Shot,Obj_GetX(Shot)+Type2*30*cos(Rag));
				alternative(counter%1)
				case(0){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),11,0);
				}
				Rag+=30;
				yield;
			}
		}
		case(28){//プラズママイン
			Guard(4,0,Obj_GetX(Shot),Obj_GetY(Shot));
			Obj_SetSpeed(Shot,1);
			loop(400){yield;}
		}
		case(29){//ロケットランチャー
			loop(30){yield;}
			if(Obj_IsIntersected(Shot)){
				Blast(Obj_GetX(Shot),Obj_GetY(Shot)-20,11,0);
				break;
			}
			yield;
			loop(30){yield;}
		}
		case(30){//ゼロ式ミサイル
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					PlaySE(SE[26]);
					UseSpellCard("ZM",[Obj_GetX(Shot),Obj_GetY(Shot)]);
					break;
				}
				yield;
			}
		}
		case(31){//炎の善次郎
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Obj_SetSpeed(Shot,4);
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),15,4);
					loop(360){yield;}
					break;
				}
				yield;
			}
		}
		case(32){//那由他裂斬
			alternative(Id)
			case(146,147){loop(10){yield;}ObjShot_SetGraphic(Shot,148);Obj_SetSpeed(Shot,15);loop(60){yield;}}
			case(149,150){loop(10){yield;}ObjShot_SetGraphic(Shot,151);Obj_SetSpeed(Shot,15);loop(60){yield;}}
		}
		case(33){//火猿の術
			loop(60){
				Obj_SetX(Shot,GetPlayerX);
				Obj_SetY(Shot,GetPlayerY-190);
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),40);
				yield;
			}
		}
		case(34){//ストレート18
			loop(90){
				Obj_SetAngle(Shot,Obj_GetAngle(Shot)+sag/3);
				yield;
			}
		}
		case(35){//フレイムアロー(G)
			loop(4){yield;}
			ObjShot_SetGraphic(Shot,161);
			loop(8){yield;}
			Obj_SetSpeed(Shot,5);
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),17,0);
					break;
				}
				yield;
			}
			loop(60){yield;}
		}
		case(36){//キャロットミサイル
			loop(10){yield;}
			loop(90){
				let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
				if(sin(Hg - Obj_GetAngle(Shot))>0){
					Obj_SetX(Shot,Obj_GetX(Shot)+1);
				}
				else{
					Obj_SetX(Shot,Obj_GetX(Shot)-1);
				}
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),Type2,0);
					break;
				}
				yield;
			}
		}
		case(37){//スウィートカーニバル
			while(!Obj_BeDeleted(Shot)){
				Obj_SetAngle(Shot,Obj_GetAngle(Shot)+Moct%6);
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),20);
				alternative(counter%5)
				case(0){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),4,-3);
				}
				yield;
			}
		}
		case(38){//バルピロカッター
			loop(2){yield;}
			loop(60){
				let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
				if(sin(Hg - Obj_GetAngle(Shot))>0){
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)+20);
				}
				else{
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)-20);
				}
				if(Obj_IsIntersected(Shot)){
					Obj_SetSpeed(Shot,2);
					PlaySE(SE[78]);
					loop(60){yield;}
					break;
				}
				yield;
			}
		}
		case(39){//ランドセルミサイル
			let Rag = Obj_GetAngle(Shot);
			while(!Obj_BeDeleted(Shot)){
				Obj_SetX(Shot,Obj_GetX(Shot)+Type2*5*cos(Rag));
				DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(Shot),Obj_GetY(Shot),60);
				Rag+=20;
					alternative(counter%5)
					case(0){
						Blast(Obj_GetX(Shot),Obj_GetY(Shot),19,-3);
					}
					yield;
					if(Obj_IsIntersected(Shot)){
						Blast(Obj_GetX(Shot),Obj_GetY(Shot),11,0);
						break;
					}
				}
			yield;
		}
		case(40){//バリオンレーザー
			loop(40){
				Obj_SetX(Shot,GetPlayerX);
				Obj_SetY(Shot,GetPlayerY-60);
				yield;
			}
		}
		case(41){//バリ...2
			loop(30){
				alternative(Type2)
				case(1){
					Obj_SetX(Shot,GetPlayerX-68);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				case(2){
					Obj_SetX(Shot,GetPlayerX-50);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				case(3){
					Obj_SetX(Shot,GetPlayerX-32);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				case(4){
					Obj_SetX(Shot,GetPlayerX+32);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				case(5){
					Obj_SetX(Shot,GetPlayerX+50);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				case(6){
					Obj_SetX(Shot,GetPlayerX+68);
					Obj_SetY(Shot,GetPlayerY-362);
				}
				yield;
			}
		}
		case(42){//ツインスティンガー
			loop(60){
				alternative(Type2)
				case(1){
					Obj_SetX(Shot,GetPlayerX-40);
					Obj_SetY(Shot,GetPlayerY-30);
				}
				case(2){
					Obj_SetX(Shot,GetPlayerX+40);
					Obj_SetY(Shot,GetPlayerY-30);
				}
				case(3){
					Obj_SetX(Shot,GetPlayerX-40);
					Obj_SetY(Shot,GetPlayerY-141);
				}
				case(4){
					Obj_SetX(Shot,GetPlayerX+40);
					Obj_SetY(Shot,GetPlayerY-141);
				}
				case(5){
					Obj_SetX(Shot,GetPlayerX-40);
					Obj_SetY(Shot,GetPlayerY-268);
				}
				case(6){
					Obj_SetX(Shot,GetPlayerX+40);
					Obj_SetY(Shot,GetPlayerY-268);
				}
				case(7){
					Obj_SetX(Shot,GetPlayerX-40);
					Obj_SetY(Shot,GetPlayerY-395);
				}
				case(8){
					Obj_SetX(Shot,GetPlayerX+40);
					Obj_SetY(Shot,GetPlayerY-395);
				}
				yield;
			}
		}
		case(43){//クラスターボム
			loop(90){yield;}
			loop(1){
				Blast(Obj_GetX(Shot),Obj_GetY(Shot),Type2,0);
				break;
			}
		}
		case(44){//ハンターホーミング
			loop(60){
				let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
				if(sin(Hg - Obj_GetAngle(Shot))>0){
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)+10);
				}
				else{
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)-10);
				}
				yield;
			}
		}
		case(45){//ロールナパーム
			loop(10){yield;}
			loop(35){
				alternative(counter%8)
				case(0){Blast(Obj_GetX(Shot),Obj_GetY(Shot),11,0);}
				yield;
			}
			loop(15){yield;}
		}
		case(46){//クロスナパーム
			let Rag = Obj_GetAngle(Shot);
			while(!Obj_BeDeleted(Shot)){
				Obj_SetX(Shot,Obj_GetX(Shot)+Type2*10*cos(Rag));
				Rag+=12;
					alternative(counter%4)
					case(0){Blast(Obj_GetX(Shot),Obj_GetY(Shot),11,0);}
					yield;
				}
			yield;
		}
		case(47){//パーティクルレーザー
			loop(18){	
				let Hg =atan2(Y-Obj_GetY(Shot),X-Obj_GetX(Shot));
				Obj_SetX(Shot,X);
				Obj_SetY(Shot,Y);	
				Obj_SetAngle(Shot,Obj_GetAngle(Shot)+Hg);
				yield;
			}
		}
		case(48){//キラーエイプ
			loop(90){
				let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
				Guard(21,Hg,Obj_GetX(Shot),Obj_GetY(Shot));
				Obj_SetSpeed(Shot,5);
				Obj_SetAlpha(Shot,0);
				if(sin(Hg - Obj_GetAngle(Shot))>0){
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)+10);
				}
				else{
					Obj_SetAngle(Shot,Obj_GetAngle(Shot)-10);
				}
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),12,0);
					break;
				}
				yield;
			}
		}
		case(49){//バーストランス
			while(!Obj_BeDeleted(Shot)){
				if(Obj_IsIntersected(Shot)){
					Blast(Obj_GetX(Shot),Obj_GetY(Shot),22,4);
					break;
				}
				yield;
			}
		}
		case(50){//ファイアーブレス
			loop(50){yield;}
		}
		case(51){//フリーズアロー
			loop(20){yield;}
		}
		case(52){//ギガウェイヴ
			loop(60){
				Obj_SetX(Shot,224);
				Obj_SetY(Shot,GetPlayerY);
				yield;
			}
		}
		case(53){//マジックソード
			let Hg =atan2(GetEnemyY-Obj_GetY(Shot),GetEnemyX-Obj_GetX(Shot));
			loop(5){yield;}
			loop(60){
				Obj_SetAngle(Shot,counter*50);
				Obj_SetSpeed(Shot,0);
				yield;
			}
			loop(120){
				Obj_SetAngle(Shot,Hg);
				Obj_SetSpeed(Shot,15);
				yield;
			}
		}
		case(54){//デスクラッシュ
			loop(60){
				Obj_SetX(Shot,GetPlayerX);
				Obj_SetY(Shot,GetPlayerY-300);
				yield;
			}
		}
		//others{loop{yield;}}
		Obj_Delete(Shot);
	yield;
}
task Blast(X,Y,id,sp){//爆風
	let fl = Obj_Create(OBJ_SHOT);//flame
		alternative(id)
		case(1){//爆風(SR)
			PlaySE(SE[5]);
			St(fl,X,Y,270,3,5,50);
			Obj_SetSpeed(fl,sp);
			loop(15){yield;}
		}
		case(2){//坊主念仏地獄
			St(fl,X,Y,-90,24,2,100);
			Obj_SetSpeed(fl,sp);
			DeleteEnemyShotToItemInCircle(SHOT,Obj_GetX(fl),Obj_GetY(fl),60);
			loop(20){yield;}
			CreatePlayerShot01(Obj_GetX(fl),Obj_GetY(fl),15,rand_int(0,11)*30,10,10,[25,26,27][rand_int(0,2)]);
			PlaySE(SE[52]);
		}
		case(3){//カラー
			PlaySE(SE[78]);
			St(fl,X,Y,270,30,5,100);
			Obj_SetSpeed(fl,1);
			loop(10){yield;}
		}
		case(4){//シューティングスター
			St(fl,X,Y,270,50,2,10);
			Obj_SetSpeed(fl,sp);
			loop(10){yield;}
		}
		case(5){//ファイヤーラビット
			PlaySE(SE[31]);
			St(fl,X,Y-20,270,52,8,100);
			Obj_SetSpeed(fl,0);
			loop(30){yield;}
		}
		case(6){//波動弾
			St(fl,X,Y,270,60,10,50);
			PlaySE(SE[16]);
			Obj_SetSpeed(fl,0);
			loop(1){
				let way =191;
				loop(9){
					CreatePlayerShot01(Obj_GetX(fl),Obj_GetY(fl),10,way,3,5,61);
					way+=20;
				}
			}
			loop(20){yield;}
		}
		case(7){//メイレイ
			St(fl,X,Y,270,66,10,100);
			PlaySE(SE[16]);
			Obj_SetSpeed(fl,sp);
			loop(60){yield;}
		}
		case(8){//爆風(GB)
			St(fl,X,Y,270,70,1,50);
			PlaySE(SE[5]);
			Obj_SetSpeed(fl,sp);
			loop(20){yield;}
		}
		case(9){//大江戸大火災
			PlaySE(SE[44]);
			St(fl,X,Y,270,72,1,50);
			Obj_SetSpeed(fl,sp);
			loop(120){yield;}
		}
		case(10){//爆風(ST)
			PlaySE(SE[5]);
			St(fl,X,Y,270,80,1,50);
			Obj_SetSpeed(fl,sp);
			loop(40){yield;}
		}
		case(11){//爆風2(ST)
			PlaySE(SE[105]);
			St(fl,X,Y,270,82,2/3,50);
			Obj_SetSpeed(fl,sp);
			loop(60){yield;}
		}
		case(12){//爆風3(ST)
			PlaySE(SE[44]);
			St(fl,X,Y,270,91,2,50);
			Obj_SetSpeed(fl,sp);
			loop(60){yield;}
		}
		case(13){//バサロホーミング
			PlaySE(SE[5]);
			St(fl,X,Y,270,132,1/3,50);
			Obj_SetSpeed(fl,sp);
			loop(80){yield;}
		}
		case(14){//使役の術法
			PlaySE(SE[50]);
			St(fl,X,Y,270,134,1,200);
			Obj_SetSpeed(fl,4);
			loop(200){yield;}
		}
		case(15){//炎の善次郎
			PlaySE(SE[72]);
			St(fl,X,Y,270,137,4,100);
			Obj_SetSpeed(fl,sp);
			loop(120){yield;}
		}
		case(16){//坊主念仏地獄(B)
			PlaySE(SE[52]);
			St(fl,X,Y-80,270,138,10,100);
			Obj_SetSpeed(fl,0);
			loop(30){yield;}
		}
		case(17){//爆風(GB2)
			PlaySE(SE[44]);
			St(fl,X,Y,270,162,1/2,100);
			Obj_SetSpeed(fl,sp);
			loop(60){yield;}
		}
		case(18){//ファイヤーバット
			PlaySE(SE[31]);
			St(fl,X,Y-20,270,168,8,100);
			Obj_SetSpeed(fl,0);
			loop(30){yield;}
		}
		case(19){//ランドセルミサイル
			St(fl,X,Y,270,177,2,10);
			loop(60){yield;}
		}
		case(20){//ヒートマイン
			PlaySE(SE[92]);
			St(fl,X,Y,270,193,1/2,50);
			Obj_SetSpeed(fl,sp);
			loop(70){yield;}
		}
		case(21){//ソニックウェイブ
			PlaySE(SE[93]);
			St(fl,X,Y,270,194,10,50);
			Obj_SetSpeed(fl,sp);
			loop(90){yield;}
		}
		case(22){//バーストランス
			St(fl,X,Y,270,217,5,100);
			Obj_SetSpeed(fl,sp);
			loop(60){yield;}
		}
		case(23){//爆風(DB)
			PlaySE(SE[105]);
			St(fl,X,Y,270,230,1/10,500);
			Obj_SetSpeed(fl,sp);
			loop(160){yield;}
		}
		Obj_Delete(fl);
	yield;
}
task Melee(id){//メイレイ(img)
	let Mel=Obj_Create(OBJ_EFFECT);
	ObjEffect_SetTexture(Mel,Me[id]);
	ObjEffect_SetLayer(Mel,5);
	ObjEffect_SetPrimitiveType(Mel,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(Mel,4);
	alternative(id)
	case(1){//如意棒地獄突き
		loop(90){
			Ev(Mel,(0+Mev[0])*n,0*n,(1+Mev[0])*n,4*n);
			DeleteEnemyShotInCircle(SHOT,Obj_GetX(Mel),Obj_GetY(Mel),70);
			Obj_SetPosition(Mel,GetPlayerX,GetPlayerY-62);
			yield;
		}
	}
	case(2){//ロケットパンチ
		loop(70){
			Ev(Mel,(0+Mev[0])*n,(0+Mev[1])*n,(2+Mev[0])*n,(4+Mev[1])*n);
			Obj_SetPosition(Mel,GetPlayerX-14,GetPlayerY-100);
			yield;
		}
	}
	case(3){//槍曼荼羅
		loop(90){
			Ev(Mel,(0+Mev[0])*164,0,(1+Mev[0])*164,292);
			Obj_SetPosition(Mel,GetPlayerX,GetPlayerY-160);
			yield;
		}
	}
	case(4){//ラビットヨーヨー
		loop(120){
			Ev(Mel,(0+Mev[0])*118,(0+Mev[1])*196,(1+Mev[0])*118,(1+Mev[1])*196);
			Obj_SetPosition(Mel,GetPlayerX+16,GetPlayerY-66);
			yield;
		}
	}
	case(5){//バルピロパンチ
		loop(100){
			Ev(Mel,(0+Mev[0])*98,(0+Mev[1])*194,(1+Mev[0])*98,(1+Mev[1])*194);
			Obj_SetPosition(Mel,GetPlayerX,GetPlayerY-66);
			yield;
		}
	}
	case(6){//ビームサーベル
		loop(110){
			Ev(Mel,(0+Mev[0])*66,(0+Mev[1])*226,(1+Mev[0])*66,(1+Mev[1])*226);
			Obj_SetPosition(Mel,GetPlayerX,GetPlayerY-50);
			yield;
		}
	}
	Obj_Delete(Mel);
}
task St(Obj,X,Y,Angle,Bullet,Damage,Penetration){//ShotTask
	Obj_SetX(Obj,X);
	Obj_SetY(Obj,Y);
	Obj_SetAngle(Obj,Angle);
	ObjShot_SetGraphic(Obj,Bullet);
	ObjShot_SetDamage(Obj,Damage);
	ObjShot_SetPenetration(Obj,Penetration);
	yield;
}
///[shot]
