#TouhouDanmakufu[Stage]
#Title[Marisa stage]
#Text[My Second!]
#Image[./Moon.png]

#Player[FREE]
#ScriptVersion[2]
#PlayLevel[Hard]

script_stage_main{
let bgmstage2 = GetCurrentScriptDirectory~"bgm5.mp3";
let bgmstage1 = GetCurrentScriptDirectory~"bgm1.mp3";
let secanttheme = GetCurrentScriptDirectory~"bgm3.mp3";
let maritheme = GetCurrentScriptDirectory~"bgm2.mp3";
let background = GetCurrentScriptDirectory~"moon.png";
let blah = 2;
let background2 = GetCurrentScriptDirectory~"sunset.png";

 function Wait(let frames){
   loop(frames){yield;}
 }
 function WaitForZeroEnemy{
  while(GetEnemyNum != 0){yield;}
 }

 function WaitForEventEnd{
while(OnEvent){yield;}
}

task RunMyCrappyGame{stage1; }


function stage2{
	DeleteSE("se\seEnemyExplode01.wav");
	DeleteSE("se\seUseSpellCard.wav");
	blah = 1;
	Wait(20);
	PlayMusic(bgmstage2);
	CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyAH.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyBH.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyC.txt");
  
  Wait(180);
  
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX, 0, 0, 0, 0);
  WaitForZeroEnemy;
	Wait(120);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-30, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+30, 0, 0, 0, 0);
  WaitForZeroEnemy;
	Wait(120);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+30, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-30, 0, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+90, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-90, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+150, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-150, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+180, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-180, 0, 0, 0, 0);
	 

  WaitForZeroEnemy;
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	 CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+20, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-20, 0, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+40, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-40, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+80, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-80, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+100, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-100, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+140, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-140, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+160, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-160, 0, 0, 0, 0);
  WaitForZeroEnemy;
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyC.txt", GetCenterX, GetClipMinY+10, 0, 0, 0);
	WaitForZeroEnemy;
	Wait(120);
	CreateEnemyBossFromFile(GetCurrentScriptDirectory~"secplural.txt", 0, 0, 0, 0, 0);
	Wait(10);
	WaitForEventEnd;
	WaitForZeroEnemy;
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(315);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(315);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-60, 0, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+80, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-80, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+100, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-100, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-120, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+140, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-140, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX+160, 0, 0, 0, 0);
  CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt", GetCenterX-160, 0, 0, 0, 0);
  WaitForZeroEnemy;
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyAH.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyBH.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyC.txt", GetCenterX, GetClipMinY+10, 0, 0, 0);
	WaitForZeroEnemy;
	FadeOutMusic(bgmstage2, 4);
	Wait(360);
	 CreateEnemyBossFromFile(GetCurrentScriptDirectory~"secbossplural.txt", 0, 0, 0, 0, 0);
  WaitForZeroEnemy;
	CreateEventFromScript("asdf");
	Wait(60);
	WaitForEventEnd;
 
  Clear;
	
 }

 function stage1{
	blah=2;
	DeleteSE("se\seEnemyExplode01.wav");
	DeleteSE("se\seUseSpellCard.wav");
	PlayMusic(bgmstage1);
	CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy1.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt");
  CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt");
	CompileEnemyFromFile(GetCurrentScriptDirectory~"marifam.txt");
		CompileEnemyFromFile(GetCurrentScriptDirectory~"EnemyD.txt");
  Wait(300);
  
  

 
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX, GetClipMinY+10, 0, 0, 0);
	Wait(180);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX+140, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX-140, GetClipMinY+10, 0, 0, 0);
	Wait(420);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX+80, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX-80, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX+160, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy4.txt", GetCenterX-160, GetClipMinY+10, 0, 0, 0);
	Wait(180);
	WaitForZeroEnemy;
	WaitForZeroEnemy;
	Wait(180);
	CreateEnemyBossFromFile(GetCurrentScriptDirectory~"MariPlural.txt", 0, 0, 0, 0, 0);
	WaitForZeroEnemy;
	CreateEventFromScript("ma");
	WaitForEventEnd;
	WaitForZeroEnemy;
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyA.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyB.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	Wait(120);
	Wait(60);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy2.txt", GetClipMinX, GetClipMinY+10, 0, 0, 0);
	CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy3.txt", GetClipMaxX, GetClipMinY+10, 0, 0, 0);
	Wait(30);
	WaitForZeroEnemy;
	
	Wait(30);
	Wait(30);
	WaitForZeroEnemy;
	CreateEnemyFromFile(GetCurrentScriptDirectory~"EnemyD.txt", GetCenterX, GetClipMinY+20, 0, 0, 0);
	WaitForZeroEnemy;
	
	FadeOutMusic(bgmstage1, 4);
	Wait(360);
	WaitForEventEnd;
	 CreateEnemyBossFromFile(GetCurrentScriptDirectory~"MariBossPlural.txt", 0, 0, 0, 0, 0);
  	WaitForZeroEnemy;
	FadeOutMusic(maritheme, 4);
	CreateEventFromScript("mar");
	Wait(60);
	WaitForEventEnd;
 	Clear;
	
 }

  @Initialize{
RunMyCrappyGame;
LoadGraphic(background);
LoadGraphic(background2);
LoadMusic(bgmstage2);
LoadMusic(bgmstage1);
 
  }
 @MainLoop{

   yield;
  }
  
@BackGround{
if(blah==1){
   SetTexture(background);
   SetGraphicRect(0, 0, 512, 512);
   DrawGraphic(GetCenterX, GetCenterY);
   }

if(blah==2){
   SetTexture(background2);
   SetGraphicRect(0, 100, 512, 612);
   DrawGraphic(GetCenterX, GetCenterY);
   }

}


  @Finalize{

  }
}

script_event ma{
let reimu = GetCurrentScriptDirectory ~ ("reimu.png");
let marisa=GetCurrentScriptDirectory ~ ("marisa.png");
let marisasweat = GetCurrentScriptDirectory ~ ("MariSweatdrop.png");
let secant =GetCurrentScriptDirectory~ ("\cutin2.png");

@Initialize{
  LoadGraphic(reimu);
  LoadGraphic(secant);
	LoadGraphic(marisa);
	LoadGraphic(marisasweat);
 }

@MainLoop{
SetChar(LEFT, reimu);                 
SetGraphicRect(LEFT, 128, 0, 256, 256);           
MoveChar(LEFT, FRONT);                                      
MoveChar(RIGHT, BACK);
TextOutA("\c[RED] You ARE ordinary.");
SetChar(RIGHT, marisasweat); 
SetGraphicRect(RIGHT, 0, 0, 128, 257);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);                          
TextOutA("\c[WHITE] I'll get revenge!");           
End;           //This ends the event. REMEMBER ME!
SetStep(1);
}

 @Finalize{
  
 }
}



script_event asdf{
let reimu =GetCurrentScriptDirectory ~ ("\reimu.png");
let secant =GetCurrentScriptDirectory~ ("\cutin2.png");

@Initialize{
  LoadGraphic(reimu);
  LoadGraphic(secant);
	
 }

@MainLoop{
SetChar(LEFT, reimu);                 
SetGraphicRect(LEFT, 128, 0, 256, 256);           
MoveChar(LEFT, FRONT);                                      
MoveChar(RIGHT, BACK);
SetChar(RIGHT, secant); 
SetGraphicRect(RIGHT, 0, 0, 240, 290);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);                          
TextOutA("\c[WHITE] ERROR: Secant.exe has encountered a \n problem and needs to close.");           
MoveChar(RIGHT, BACK);                           
MoveChar(LEFT, FRONT);
SetGraphicRect(LEFT, 1, 1, 128, 270);                           
TextOutA("\c[RED] I TOLD YOU, they aren't good at \n danmaku. \n Now he's crashed! \n What was your name again?");                   
MoveChar(RIGHT, FRONT);                           
MoveChar(LEFT, BACK);                           
SetNameFromText(RIGHT,TEXT_WHITE,"Kyuu","Person Who Can't Be Remembered");
TextOutA("\c[WHITE] Well, I seem to have pushed him too \n hard. \n I think we'll go back home and rest.");
MoveChar(RIGHT, BACK);                          
MoveChar(LEFT, FRONT);
TextOutA("\c[RED] Well, that was a rather pointless \n battle.");
MoveChar(RIGHT, FRONT);                           
MoveChar(LEFT, BACK);
DeleteName(RIGHT);
TextOutA("\c[WHITE] Oh, before we go... \n Here's a word of advice. \n Beware the...");
MoveChar(RIGHT, BACK);                          
MoveChar(LEFT, BACK);
TextOutA("\c[PURPLE] PLAYER 1! DEEEEEEFEEEEEEATTTEDDDDDDDD! *GAP*");
MoveChar(RIGHT, BACK);                           
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] DAMNIT YUKARI!");
End;           //This ends the event. REMEMBER ME!
SetStep(1);
}

 @Finalize{
  
 }
}

script_event mar{
let reimu = GetCurrentScriptDirectory ~ ("reimu.png");
let marisa=GetCurrentScriptDirectory ~ ("MariDefeated.png");
let marisaangry = GetCurrentScriptDirectory ~ ("MariAngry.png");
let secant =GetCurrentScriptDirectory~ ("\cutin2.png");
let marisasmug = GetCurrentScriptDirectory~ ("MariSmug.png");


@Initialize{
  LoadGraphic(reimu);
	LoadGraphic(marisa);
	LoadGraphic(marisasmug);
	LoadGraphic(marisaangry);
 }

@MainLoop{
SetChar(LEFT, reimu);                 
SetGraphicRect(LEFT, 128, 0, 256, 256);           
MoveChar(LEFT, FRONT);                                      
MoveChar(RIGHT, BACK);
TextOutA("\c[RED] Ordinary.");
SetChar(RIGHT, marisa); 
SetGraphicRect(RIGHT, 0, 0, 128, 257);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);                          
TextOutA("\c[WHITE] Oh, damnit. I ran out of cards \n that quickly?"); 
SetChar(RIGHT, marisasmug);
TextOutA("\c[WHITE] You'll regret this! Reimu will get ya!"); 
SetStep(2);
End;           //This ends the event. REMEMBER ME!
SetStep(1);
}

 @Finalize{
  
 }
}

