#TouhouDanmakufu[Stage]
#Title[MotK Halloween Event [Normal] (Helepolis)]
#Text[Boo~ Happy Halloween (even though we dutchies do not celebrate it. . . Uuuu =( Atleast enjoy my boss.]
#Player[REIMU]
#ScriptVersion[2]

script_stage_main
{
    let CSD = GetCurrentScriptDirectory;
    let m = 0;
    let bg = GetCurrentScriptDirectory ~ "system\stagebg.png";

    @Initialize
    {
	LoadGraphic(bg);
	LoadSE(CSD ~"SFX\se_cat00.wav");
	LoadSE(CSD ~"SFX\se_nep00.wav");
	BeginSuprise;
    }

    @MainLoop
    {

	yield;
    }

    @DrawLoop
    {
	DrawText("...",35,30,12,255);
    }

    @BackGround
    {
	SetTexture(bg);
	SetGraphicRect(0,0,470,470);
	SetGraphicScale(1,1);
	SetGraphicAngle(0,0,0);	
	SetAlpha(255);
	DrawGraphic(GetCenterX, GetCenterY);
    }

    @Finalize
    {
      DeleteGraphic(bg);
    }

    task BeginSuprise{  
  	function scanner{
		while(GetEnemyNum != 0){yield;}	
		
   	}
	loop(60){yield;}
	CreateEnemyBossFromFile(GetCurrentScriptDirectory ~ "HwBossN.txt",GetCenterX,0,-5,90,NULL);
	scanner;
	CreateEventFromScript("Einde");
	yield;
    }
}

script_event Einde{
	let CSD = GetCurrentScriptDirectory;

	let ReiNorm = CSD ~ "system\ReiNorm.png";
	let ReiBoos = CSD ~ "system\ReiBoos.png";
	let ReiOk = CSD ~ "system\ReiOk.png";
	let ReiTel = CSD ~ "system\ReiTel.png";
	let ReiOpm = CSD ~ "system\ReiOpm.png";

	let KogaNorm = CSD ~ "system\KogaNorm.png";
	let KogaHa = CSD ~ "system\KogaHa.png";
	let KogaHe = CSD ~ "system\KogaHe.png";
	let KogaHey = CSD ~ "system\KogaHey.png";
	let KogaAuw = CSD ~ "system\KogaAuw.png";

	let nue = CSD ~ "system\nue.png";
	let nueblij = CSD ~ "system\nueblij.png";

	@Initialize{
		LoadGraphic(ReiNorm);
		LoadGraphic(ReiBoos);
		LoadGraphic(ReiOk);
		LoadGraphic(ReiTel);
		LoadGraphic(ReiOpm);

		LoadGraphic(KogaNorm);
		LoadGraphic(KogaHe);
		LoadGraphic(KogaHa);
		LoadGraphic(KogaHey);
		LoadGraphic(KogaAuw);

		LoadGraphic(nue);
		LoadGraphic(nueblij);
	}
	@MainLoop{
		if(GetPlayerType==REIMU_A || GetPlayerType==REIMU_B){
			SetChar(RIGHT,KogaAuw);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]Owowowowo ! That hurts!");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiBoos);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]I should have known it. Kogasa!!!");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,KogaAuw);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]UUU~ Please don't hurt me Reimu-san!");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiTel);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[PURPLE]**cry**");
			MoveChar(LEFT,FRONT);
			SetChar(LEFT,ReiOpm);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED]Wait, what was that?");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,nue);SetGraphicRect(RIGHT,0,0,220,270);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[PURPLE]Uuuuu. . .");
			SetChar(RIGHT,KogaAuw);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]Nue-chan! Are you allright?");
			SetChar(RIGHT,nue);SetGraphicRect(RIGHT,0,0,220,270);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[PURPLE]*snob* She is too strong.");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiBoos);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]You two!! What the hell are you doing!!");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,KogaAuw);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]Suprising people. It is Halloween.");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiTel);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]Didn't I made myself clear last time?");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,nue);SetGraphicRect(RIGHT,0,0,220,270);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[PURPLE]But Reimu-san! We are not hurting \nany humans! Honest!");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiBoos);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]...");
			SetChar(LEFT,ReiTel);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED]hmmmmmm.");
			SetChar(LEFT,ReiNorm);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED]Allright, as long as you \ndon't cause trouble.");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,KogaAuw);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]Really? Can we continue \nto suprise people?");
			MoveChar(RIGHT,BACK);
			SetChar(LEFT,ReiBoos);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]Yes..");
			MoveChar(LEFT,BACK);
			SetChar(RIGHT,nueblij);SetGraphicRect(RIGHT,0,0,220,270);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[PURPLE]Yay! Let's go Koga-chan");
			SetChar(RIGHT,KogaHey);SetGraphicRect(RIGHT,0,0,256,292);
			MoveChar(RIGHT,FRONT);
			TextOutA("\c[BLUE]Yay! Wait for me Nue-chaaaa *fade*");
			SetChar(RIGHT,KogaHey);SetGraphicRect(RIGHT,0,0,0,0);
			SetChar(LEFT,ReiBoos);SetGraphicRect(LEFT,0,0,192,240);
			MoveChar(LEFT,FRONT);
			TextOutA("\c[RED]Those girls *sigh*");
			TextOutA("\c[BLUE]Oh look Nue-chan, that witch is coming.");
			TextOutA("\c[PURPLE]Allright, let's transform.");
			SetChar(LEFT,ReiOpm);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED].. what are they up to now.");
			PlayMusic(CSD~"fake.mp3");
			TextOutA("\c[BLUE]BOO!!!~ \n\c[PURPLE]BOO!!!~");
			PlaySE(CSD ~"SFX\se_cat00.wav");
			PlaySE(CSD ~"SFX\se_nep00.wav");
			TextOutA("\c[YELLOW]WHOA, what the hell da ze! \nTake this, MASTER SPARK!!!!");
			TextOutA("\c[BLUE]KYAAA!!!~ \n\c[PURPLE]KYAAA!!!~");
			SetChar(LEFT,ReiTel);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED]..I told them not to cause trouble.");
			SetChar(LEFT,ReiOk);SetGraphicRect(LEFT,0,0,192,240);
			TextOutA("\c[RED]Happy Halloween player!");
			StageClear;
		}
	}
	@Finalize{
		DeleteGraphic(ReiNorm);
		DeleteGraphic(ReiBoos);
		DeleteGraphic(ReiOk);
		DeleteGraphic(ReiTel);
		DeleteGraphic(ReiOpm);

		DeleteGraphic(KogaNorm);
		DeleteGraphic(KogaHe);
		DeleteGraphic(KogaHa);
		DeleteGraphic(KogaHey);
	}
}
