#e[Player]	
#ScriptVersion[2]
#Menu[P-38Lightning]
#Text[P-38CgjO]
wPXSR~bhEFCCx
@̃CN

:
[X[EFC]
[VbgK]
[}VK]
[X[p[VF]
[[U[]

\:
[ԂVXe]
[TCht@C^[]
[GlM[]
[KNbV]

#Image[.\P-38Select.png]
#ReplayName[P-38]
//(slow)
//(shot)
//ؑ(User)
//TCht@C^[(Graze)
//KNbV(Bomb)orÔg
script_player_main{
	let current = GetCurrentScriptDirectory;
	let Img = [//摜
			current~".\img\Lightning.png",
			current~".\img\ObjImg.png",
			current~".\img\Thunder.png",
			current~".\img\Wave.png",
			current~".\img\Sfighter.png",
			];
	let SE = [
			current~".\se\SE1.wav",
			current~".\se\SE2.wav",
			current~".\se\SE3.wav",
			current~".\se\SE4.wav",
			current~".\se\SE16.wav",
			current~".\se\SE21.wav",
			current~".\se\SE26.wav",
			];
	let	Life = 80;
	let SideLife =10;
	let GrazePoit=0;
	let Gcount=0;
	let counter = 0;
	let KeyHold = 0;
	
	@Initialize{
		ascent(n in 0..length(Img)){LoadGraphic(Img[n]);}
		ascent(n in 0..length(SE)){LoadSE(SE[n]);}
		SetPlayerLifeImage(Img[0],x[0],y[0],x[1],y[1]);
		
		SetSpeed(5,2.5);
		SetGrazeCircle(80);
		SetAutoEffect(false);
		KeyCheck;
	}
	@MainLoop{
		Clock;
		RollMain;
		GetGcount;
		//else if(ResBomb){}
		if(RapShot){
			if(SideLife>0){SideShot;}
			else{MainShot;}
		}
		if(User){ShotType++;}
		if(Slow){Ft++;PlaySE(SE[5]);}
		if(counter%120==0){Life--;}
		if(SideLife>0){
			SidePain(GetPlayerX+45,GetPlayerY+3);
			SidePain(GetPlayerX-45,GetPlayerY+3);
		}
		counter++;
		yield;
	}
	@Missed{
		MainLoop;
		if(Life==0){Life=80;}
		if(SideLife==0){SideLife=10;}
		GrazeSystem;
	}
	@SpellCard{
		if(RapShot&&Bomb){
			UseSpellCard("Wave",[Img[3]]);
			Life-=10;
			PlaySE(SE[4]);
		}
		else{
			UseSpellCard("Thunder",[Img[2]]);
			PlaySE(SE[4]);
			Life-=20;
		}//KNbV
	}
	@DrawLoop{
		if(Ft>0){Rolling;}//
		else{
			if(Left){//@
				if(KeyHold>30){PlayerImg(x[2],y[1]*m+1.1,x[3],y[1]*m+y[1]);}
				else{PlayerImg(x[1],y[1]*m+1.1,x[2],y[1]*m+y[1]);}
			}
			else if(Right){
				if(KeyHold>30){PlayerImg(x[4]-0.9,y[1]*m+1.1,x[5],y[1]*m+y[1]);}
				else{PlayerImg(x[3],y[1]*m+1.1,x[4],y[1]*m+y[1]);}
			}
			else{
				PlayerImg(x[0],y[1]*m+1.1,x[1],y[1]*m+y[1]);
				KeyHold=0;
			}
			if(SideLife>0){//TCht@C^[
				SideImg(GetPlayerX+45,GetPlayerY+3);
				SideImg(GetPlayerX-45,GetPlayerY+3);
			}
		}
		KeyHold++;
		//if(ResSlow){ObjImg(GetPlayerX,GetPlayerY,x[0],y[0],x[1],y[1]);}//
		LifeDraw(80);//GlM[
		//DrawText(xx,224,300,20,255);
		yield;
	}
	@Finalize{
		ascent(n in 0..length(SE)){DeleteSE(SE[n]);}
		ascent(n in 0..length(Img)){DeleteGraphic(Img[n]);}
	}
#include_function ".\txt\ImageObj.txt"
#include_function ".\txt\KeyObj.txt"
#include_function ".\txt\SystemObj.txt"
#include_function ".\txt\ShotObj.txt"
}
#include_script".\txt\LightningSpell.txt"