#東方弾幕風[Player]
#Menu[蒼天　十字　(ｱｵｱﾏ　ｸﾛｽ)]
#Text[Z　バスター
X　特殊武器（エネルギー上限100）
C　武器変更
シフト二連打 ボム

チャージで威力上昇＆雑魚を貫通するバスターと、ボスから手に入れる特殊武器で戦う。
高速低速どちらでもバスターがチャージでき、チャージ中でも特殊武器の発射が可能。
スタンダードで扱いやすい。

]
#Image[.\十字セレクト.PNG]
#ReplayName[X2]


	script_player_main
	{
	let current = GetCurrentScriptDirectory();
	let imgX = current~"十字ドット.PNG";
	let imgXCutIn = current~"十字セレクト.PNG ";
	let gezi = current~"ゲージ.png ";
	let shotCount = -1;
	let bNextShot = false;
	let objlase = NULL;
	let objShot = NULL;
	let objShot2 = NULL;
	let objShot3 = NULL;
        let cha=0;
        let cal=0;
        let we=0;
        let ELK=90;
        let CB=0;
        let CB2=0;
        let ge=0;
        let RC=0;
        let dot=0; 
         let B=100;
let LV=0;	
let po=0;

let gokusi=49;
CreateCommonDataArea("gokusi");
  let buki=GetCurrentScriptDirectory~"\PLAYER\ゼロ\アイテムST.txt";

       let myu=50;
       let ST=51;
       let FA=52;
       let IC=53;
       let BM=54;
       let EL=55;
       let CM=56;
       let OC=57;
       let AM=58;
       let EX=59;
SetCommonDataEx("gokusi",ST,1);
SetCommonDataEx("gokusi",FA,1);
SetCommonDataEx("gokusi",IC,1);
SetCommonDataEx("gokusi",BM,1);
SetCommonDataEx("gokusi",EL,1);
SetCommonDataEx("gokusi",CM,1);
SetCommonDataEx("gokusi",OC,1);
SetCommonDataEx("gokusi",AM,1);
SetCommonDataEx("gokusi",EX,0);
SetCommonDataEx("gokusi",myu,1);
#include_function".\ストームトルネード.txt"
#include_function".\カメレオンスティング.txt"
#include_function".\ショットガンアイス.txt"
#include_function".\エレクトリックスパーク.txt"
#include_function".\ホーミングトーピード.txt"
#include_function".\ブーメランカッター.txt"
#include_function".\ファイアーウェーブ.txt"
        let cen=cal*172;
sub cc{         Obj_SetX(objShot2, GetPlayerX);
		Obj_SetY(objShot2, GetPlayerY);
                 if(cha>=1){
                if(!Obj_BeDeleted(objShot2)){return;}
                objShot2 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot2, GetPlayerX);
		Obj_SetY(objShot2, GetPlayerY);
		Obj_SetSpeed(objShot2, 0);
               Obj_SetAlpha(objShot2,74);
		ObjShot_SetGraphic(objShot2,6 );
		ObjShot_SetDamage(objShot2, 0);
		ObjShot_SetPenetration(objShot2, 500);	
		Obj_SetAngle(objShot2, 270);}

                if(cha<=1){Obj_Delete(objShot2);}
}


sub cas2{
                objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-30);
		Obj_SetSpeed(objShot, 20);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 25*truncate(cha));
		ObjShot_SetPenetration(objShot, 5);	
		Obj_SetAngle(objShot, 270);
             PlaySE("\koukaonn\se03.wav");
			
                    }
task cas{
                objShot = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShot, GetPlayerX);
		Obj_SetY(objShot, GetPlayerY-30);
		Obj_SetSpeed(objShot, 20);
		ObjShot_SetGraphic(objShot, 5);
		ObjShot_SetDamage(objShot, 25*truncate(cha));
		ObjShot_SetPenetration(objShot, 5);	
		Obj_SetAngle(objShot, 270);
ani;
             PlaySE("\koukaonn\se03.wav");
let ccc=Obj_GetX(objShot);
let ccc2=GetPlayerY-30;
task exca{
 PlaySE("\koukaonn\se03.wav");
      PlaySE("\koukaonn\se02.wav");
             let   objShotx1 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShotx1,ccc );
		Obj_SetY(objShotx1, ccc2);
		Obj_SetSpeed(objShotx1, 20);
		ObjShot_SetGraphic(objShotx1, 4);
		ObjShot_SetDamage(objShotx1, 2);
		ObjShot_SetPenetration(objShotx1, 1000);	
		Obj_SetAngle(objShotx1, 270);

CreatePlayerShot01(ccc, ccc2, 20, 270, 3, 1000, 5);
let chax=Obj_GetX(objShotx1);

let schs=0;
loop(5){
		Obj_SetX(objShotx1, chax+schs);

schs=schs-10;
	loop(1){yield;}}
loop(100){
schs=50;
loop(10){
		Obj_SetX(objShotx1, chax+schs);

schs=schs-10;

	loop(1){yield;}}

}	 	

}
task exca2{
 PlaySE("\koukaonn\se03.wav");
      PlaySE("\koukaonn\se02.wav");

              let  objShotx2 = Obj_Create(OBJ_SHOT);
		Obj_SetX(objShotx2, ccc);
		Obj_SetY(objShotx2, ccc2);
		Obj_SetSpeed(objShotx2, 20);
		ObjShot_SetGraphic(objShotx2, 4);
		ObjShot_SetDamage(objShotx2, 2);
		ObjShot_SetPenetration(objShotx2, 1000);	
		Obj_SetAngle(objShotx2, 270);
CreatePlayerShot01(ccc, ccc2, 20, 270, 3, 1000, 5);
let chax2=Obj_GetX(objShotx2);
let schs=0;
loop(5){

		Obj_SetX(objShotx2, chax2-schs);
schs=schs-10;
	loop(1){yield;}}
loop(100){
schs=50;
loop(10){
		Obj_SetX(objShotx2, chax2-schs);
schs=schs-10;

	loop(1){yield;}}

}	 	

}
if(GetCommonDataEx("gokusi",EX)==1){
loop(cha){exca;yield;yield;exca2;yield;yield;}
}
                    }
task bom{
SetTexture(gezi);
LoadGraphic(gezi);
SetGraphicRect(0,0,GetPlayerBomb*2,64);
SetColor(255,255,255);
SetAlpha(120);

DrawGraphic(215+GetPlayerBomb,450);


}
task ani{
loop(20){dot=4;yield;}
dot=0;
}

		@Initialize
		{
		SetPlayerLifeImage(imgX, 520, 1, 584, 86);	
                LoadGraphic(imgX);
		SetSpeed(4.5, 2.5);
                SetInitialBombCount(B);               
		LoadPlayerShotData(current~"ｘショット.txt");
		SetItemCollectLine(160);
                SetRebirthFrame(0);
               LoadSE("\koukaonn\tama1.wav");
               LoadSE("\koukaonn\tama2.wav");
               LoadSE("\koukaonn\se03.wav");
               LoadSE("\koukaonn\se04.wav");
               LoadSE("\koukaonn\reflect.wav");
              LoadSE("\koukaonn\pattern01.wav");
                   LoadSE("\koukaonn\sword2.wav");
               LoadSE("\koukaonn\bigshot1.wav");
           LoadSE("\koukaonn\se012-0088.wav");
		}

		@MainLoop
		{ 

RC=0;
if(OnEvent()==true){SetSpeed(0, 0);break;}else{SetSpeed(4.5, 2.5);
if(cal==5){if(GetKeyState(VK_BOMB)==KEY_HOLD){if(OnBomb==true){SetSpeed(6, 6);}}}
}

LV=GetCommonDataEx("gokusi",ST)+GetCommonDataEx("gokusi",FA)+GetCommonDataEx("gokusi",CM)+GetCommonDataEx("gokusi",OC)+GetCommonDataEx("gokusi",BM)+GetCommonDataEx("gokusi",IC)+GetCommonDataEx("gokusi",EL)+GetCommonDataEx("gokusi",AM);
if(LV>8){LV=8;}		
CB=CB-1;
if(CB<0){CB=0;}
if(GetGraze>4){AddGraze(-1*GetGraze);AddBomb(1);}
if(GetPlayerBomb>40+15*truncate(LV/2)){AddBomb(40+15*truncate(LV/2)-GetPlayerBomb);}	
if(OnBomb==false){po=GetScore;}
else{AddScore(-1*GetScore+po);}
if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH){if(CB==0){CB=15;}else{if(GetPlayerBomb>19){UseSpellCard("hikari",1);AddBomb(-20);}}}	
		//毎フレーム実行される部分です
		//
		if((GetKeyState(VK_SHOT)==KEY_PUSH || GetKeyState(VK_SHOT)==KEY_HOLD || bNextShot==true) && shotCount==-1)
		{      
                        if(cha>=4){cha=4;}
			shotCount = 0;
			bNextShot = false;
		}
		if(GetKeyState(VK_SHOT)==KEY_HOLD && shotCount>0)
		{          
			       
		}


	     
		if(GetKeyState(VK_SHOT)==KEY_PUSH)
			{	ani;
				CreatePlayerShot01(GetPlayerX(), GetPlayerY()-30, 15, 270, 20, 1, 1);
		                 PlaySE("\koukaonn\tama1.wav");
                         cha=0;
                           }
		if(GetKeyState(VK_SHOT)==KEY_HOLD){cha=cha+1/30;}
                if(GetKeyState(VK_SHOT)==KEY_PULL){if(cha>=1){ani;cas;cha=0;}}
		if(GetKeyState(VK_USER)==KEY_PUSH){cal=cal+1;
            PlaySE("\koukaonn\se012-0088.wav");
if(GetCommonDataEx("gokusi",IC)==0){if(cal==1){cal=cal+1;}}
if(GetCommonDataEx("gokusi",CM)==0){if(cal==2){cal=cal+1;}}
if(GetCommonDataEx("gokusi",ST)==0){if(cal==3){cal=cal+1;}}
if(GetCommonDataEx("gokusi",EL)==0){if(cal==4){cal=cal+1;}}
if(GetCommonDataEx("gokusi",AM)==0){if(cal==5){cal=cal+1;}}
if(GetCommonDataEx("gokusi",OC)==0){if(cal==6){cal=cal+1;}}
if(GetCommonDataEx("gokusi",FA)==0){if(cal==7){cal=cal+1;}}
if(GetCommonDataEx("gokusi",BM)==0){if(cal==8){cal=cal+1;}}


if(cal>8){cal=0;}}

if(GetKeyState(VK_DOWN)==KEY_HOLD||GetKeyState(VK_UP)==KEY_HOLD||GetKeyState(VK_SLOWMOVE)==KEY_HOLD){ELK=0;}else{ELK=90;}

              cen=cal*172;

		if(shotCount >= 0)
		{
			shotCount++;
		}
		if(shotCount == 30)
		{    
			shotCount=-1;
		}
		
		SetIntersectionCircle(GetPlayerX, GetPlayerY, 1);
           
                if(cha>=2){ObjShot_SetGraphic(objShot2,7 );}
                if(cha>=3){ObjShot_SetGraphic(objShot2,8 );}
                if(cha>=4){ObjShot_SetGraphic(objShot2,9 );}
                cc;

if(GetKeyState(VK_BOMB)==KEY_HOLD){if(cal==7){if(we==0){  if(GetPlayerBomb>0){ani;FaWe;AddBomb(-1);}}}}
		yield;
		}

		@Missed
		{
                   B=GetPlayerBomb;                   
                 SetInitialBombCount(B); 
           if(RC==0){   AddBomb(10);}
RC=1; 

		}
		@SpellCard
		{	if(OnEvent()==true){break;};   
	if(GetKeyState(VK_BOMB)==KEY_PUSH )
		{   AddBomb(1);if(we==0){    
if(cal==0){}
if(cal==1){if(GetPlayerBomb>0){ani;ShIc;AddBomb(-1);}}	
if(cal==2){if(GetPlayerBomb>0){ani;CaMe;AddBomb(-1);}}	
if(cal==3){if(GetPlayerBomb>9){ani;StTl;AddBomb(-10);}}	
if(cal==4){if(GetPlayerBomb>0){ani;ErSp;AddBomb(-1);}}
if(cal==5){if(GetPlayerBomb>9){ani;UseSpellCard("ZAN",1);AddBomb(-10);}}	
if(cal==6){if(GetPlayerBomb>0){ani;HoTo;AddBomb(-1);}}
if(cal==7){if(GetPlayerBomb>0){ani;FaWe;AddBomb(-1);}}		
if(cal==8){if(GetPlayerBomb>1){ani;BuCa;AddBomb(-2);}}		
  

		}	


                                     }





	
		}
		
		@DrawLoop
		{bom; 
		SetColor(255, 255, 255);
		SetRenderState(ALPHA);
		SetTexture(imgX);
            SetAlpha(255);
              
		if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD)
		{
SetGraphicRect(96+64*dot, 86+cen, 192+64*dot, 172+cen);
	
    if(GetKeyState(VK_SLOWMOVE)==KEY_HOLD){		SetGraphicRect(128+64*dot, 1+cen, 196+64*dot, 86+cen);}
		}
		else if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD)
		{
			SetGraphicRect(0+64*dot, 86+cen, 96+64*dot, 172+cen);
                        if(GetKeyState(VK_SLOWMOVE)==KEY_HOLD){SetGraphicRect(64+64*dot, 1+cen, 128+64*dot, 86+cen);}
		}
		else 
		{
			SetGraphicRect(+64*dot, 1+cen, 64+64*dot, 86+cen);
           if(GetKeyState(VK_UP)==KEY_HOLD||GetKeyState(VK_DOWN)==KEY_HOLD){ SetGraphicRect(192+64*dot, 1+cen, 256+64*dot, 86+cen);}
		}
 
		DrawGraphic(GetPlayerX(), GetPlayerY());	
		}
		
		@Finalize
		{
		DeleteGraphic(imgX);
           
     
		}
	}
	
	script_spell hikari
	{
   	let current = GetCurrentScriptDirectory();

	

let AN=30;

        let angle = 270;
        task run()	{
                metu;
                 PlaySE("\koukaonn\warp2.wav");
               loop(180){yield;}
		End();
	}

		@Initialize
		{
		SetPlayerInvincibility(90);
                run();


		
		}
		@MainLoop
		{   	      	

                   yield;

		}
		@Finalize
		{

		} 

task metu{     loop(1){

loop(4){
               loop(12){
as;
AN=AN+30;

           }
loop(12){yield;}
AN=AN+15;
}
 yield;   
}
task as{
let a = 0;
let objme = Obj_Create(OBJ_SHOT);
		Obj_SetX(objme , GetPlayerX);
		Obj_SetY(objme, GetPlayerY);
		Obj_SetSpeed(objme, a);
		ObjShot_SetGraphic(objme, 5);
		ObjShot_SetDamage(objme, 1);
		ObjShot_SetPenetration(objme, 1000);
	        Obj_SetAngle(objme,AN);
loop(15){a=a+0.5;
Obj_SetSpeed(objme, a);
yield;
}

}
               

}  

 }
script_spell ZAN
	{
   	let current = GetCurrentScriptDirectory();
          let   angle=180;
           let  lee=225;
            let L=10;
            let objShot3=NULL;

        task run()	{
                sai;
               
		
	}

		@Initialize
		{
                run();


		
		}
		@MainLoop
		{      	

                   yield;

		}
		@Finalize
		{

		} 
                    
task sai{let g=0;
		objShot3 = Obj_Create(OBJ_SHOT);
                Obj_SetAngle(objShot3, 270);
		Obj_SetX(objShot3, GetPlayerX);//x座標設定
		Obj_SetY(objShot3, GetPlayerY);//y座標設定
		ObjShot_SetGraphic(objShot3, 58);
		ObjShot_SetDamage(objShot3, 10);
		ObjShot_SetPenetration(objShot3, 100000);
                Obj_SetSpeed(objShot3, 0);
  
loop(150){		
		if(GetKeyState(VK_BOMB)==KEY_HOLD){
		Obj_SetX(objShot3, GetPlayerX);
		Obj_SetY(objShot3, GetPlayerY);
g=g+1;
if(g==35){AddBomb(-1);g=30;}
}
              if(GetKeyState(VK_BOMB)==KEY_PULL){break;}

               yield;

        }    
             Obj_SetSpeed(objShot3, 10); 
loop(120){yield;}
End();
                  }      

}  }    

}  }


  