#TouhouDanmakufu[Stage]
#Title[vs Reimu Hakurei]
#Text[RaNGE contest 10
Made by Gusano2314]
#BGM[]
#Player[.\mima\mimams.txt]
#PlayLevel[Normal]
#ScriptVersion[2]
#BackGround[User(.\system\stage02a.png,1,0)]


script_stage_main{
#include_function ".\FunctionLib.dnh"
let CSD = GetCurrentScriptDirectory;
let bg1 = CSD~"system\stage02a.png";
let en1= CSD ~ "st6e1.txt";
	let c = 0;
let slide = 0;
let spin = 0;
	let cx=GetCenterX;
	let cy=GetCenterY;
	let a = 0;
let trigger=false;
	let pointnorm=50;
	let start=0;
	let partframe=0;
	let NameOff=0;
	let headertime=460;
	let scalex=4;
	let alps=255;
	let scaley=0;
let boss_script = CSD~"2plural.txt";
  @Initialize{
  LoadGraphic(bg1);
LoadGraphic(CSD~".\system\stage02a.png");
  boss;
  }

  @MainLoop{
    yield;
partframe++;
		if(partframe%5==0 && OnEnemySpell==false){
			
		}

		if(trigger==false){c +=0.05;}else if(trigger==true){c-= 0.05}
		if(c >= 80) {trigger=true}
		if(c<= -80){trigger=false}
		
		
		a += 5;					
		if(a >= 512) {				
			a -= 512;				
  }
}
let bgscroll = 0;
let bgalpha = 0;
  @BackGround{
		SetPerspectiveClip(0, 1500);		
		SetFog(900, 1400, 0, 0, 50);		
		SetViewTo(0, c, -100+c);		
		SetViewFrom(450+c*2, c, 90+c/5);	
		SetColor(255,255,255);

		SetAlpha(255);
		SetTexture(CSD~".\system\stage02a.png");
SetColor(255,255,255);
SetRenderState(ALPHA);
DrawGraphic(cx,cy+slide);
		SetGraphicRect(0, 0 - a*1.5, 762*2,512*4 - a*1.5);
//SetGraphicRect(0, 0 - a/4, 762*3, 512*5 - a/4);
		SetGraphicAngle(40, 90, 0);
		SetGraphicScale(1.3,1.2);
		DrawGraphic3D(0, -100, -75);

  }

  @Finalize{

  }

  task boss{
  wait(300);
  CreateEnemyBossFromFile(boss_script, 0, 0, 0, 0, 0);
  WaitForNoEnemy;
  wait(120);
  ClearStage;
  }

}
