#TouhouDanmakufu[Single]
#ScriptVersion[3]

#include "./functions.txt"

timer = 0;
let text = GetCommonData("TEXT_ENABLED",true);

@Initialize
{
	Obj_SetValue(GetEnemyBossSceneObjectID,"INIT",true);
	TEnemyWork;
}

@MainLoop
{
	yield;
}

@Event
{
	alternative(GetEventType())
	case(EV_REQUEST_LIFE)
		{
		SetScriptResult(1/(10^10));
		}
	case(EV_REQUEST_TIMER)
		{
		SetScriptResult(timer);
		}
	case(EV_REQUEST_SPELL_SCORE)
		{
		SetScriptResult(0);
		}
}

task TEnemyWork
{
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
	loop(30){yield;}
	if(text == true)
		{
		InitializeEvent(1,1);
		Talking(0,LEFT);
		ObjEvent_SetGraphic(LEFT,0,Nue_Face);
		SetText(LEFT,0,0,"So-rry~ No dialogue this time.");
		Talking(0,RIGHT);
		SetText(RIGHT,0,9,"But instead...");
		}
	objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(objEnemy);
	TXY;
	ObjEnemy_Render; 
	ObjMove_SetPosition(objEnemy,GetStgFrameWidth/2-64,-64);
	ObjMove_SetDestAtWeight(objEnemy,GetStgFrameWidth/2,GetStgFrameHeight/2-110,20,5);
	loop(89){yield;}
	if(text == true)
		{
		loop(31){yield;}
		ObjEvent_SetGraphic(RIGHT,0,Hecatia_Face);
		SetText(RIGHT,0,0,"We won't treat you to the credits.");
		Talking(0,LEFT);	
		SetText(LEFT,0,0,"If I were terrible, I'd make you read all this.");
		SetText(LEFT,0,0,"Since you didn't read the \"How to Play\".");
		SetText(LEFT,0,0,"But...");
		SetText(LEFT,0,0,"If you want to, you can hold ctrl to skip this.");
		SetText(LEFT,0,0,"But you might miss some improtant information!");
		Talking(0,RIGHT);
		SetText(RIGHT,0,0,"Also, just so you remember,");
		SetText(RIGHT,0,0,"Everything I say is absolutely true.");
		Talking(0,LEFT);	
		SetText(LEFT,0,0,"Sagume's sprite was made by Kirbio");
		SetText(LEFT,0,0,"And so was the dialogue system.");
		SetText(LEFT,0,0,"My sprite was made by Fulisha of Light.");
		Talking(0,RIGHT);	
		SetText(RIGHT,0,0,"The graphics did not come from:");
		SetText(RIGHT,0,0,"MPP, RSS, YKK");
		SetText(RIGHT,0,0,"Japanese Traditional Patterns, Ikiya");
		SetText(RIGHT,0,0,"IN, UFO, ISC, or LoLK.");
		Talking(0,LEFT);	
		SetText(LEFT,0,0,"The title theme comes from Higanbana no Saku Yoru Ni");
		SetText(LEFT,0,0,"The boss theme is by Miransu Uwabami");
		SetText(LEFT,0,0,"And Princess Sylvysprit.");
		SetText(LEFT,0,0,"The game over theme is by...");
		SetText(LEFT,0,0,"Well, read the how to play for that.");
		Talking(0,RIGHT);	
		SetText(RIGHT,0,0,"The sound effects do not come from");
		SetText(RIGHT,0,0,"Mystical Power Plant or Len'en.");
		SetText(RIGHT,0,0,"Hm... I guess that's all, then.");	
		Talking(0,LEFT);	
		SetText(LEFT,0,0,"Easyish is for general use");
		SetText(LEFT,0,0,"So it should be about normal difficulty.");
		SetText(LEFT,0,0,"Harder than Normal is enjoyable by Tres");
		SetText(LEFT,0,0,"So it's probably around Lunatic.");
		SetText(LEFT,0,0,"Don't play the last difficulty.");	
		Talking(0,RIGHT);	
		SetText(RIGHT,0,0,"If you are Miransu,");
		SetText(RIGHT,0,0,"you should beat up Tres");
		SetText(RIGHT,0,0,"For using an old version of your song.");
		Talking(0,LEFT);
		SetText(LEFT,0,0,"The meter on the right fills up by grazing.");
		SetText(LEFT,0,0,"When it's full, it will start glowing red.");
		SetText(LEFT,0,0,"At that point you can press C to activate a flash bomb.");
		SetText(LEFT,0,0,"Flash bombing will not make you fail a spell card.");
		Talking(0,RIGHT);	
		SetText(RIGHT,0,0,"If you prefer the Len'en system, go into the options menu");
		SetText(RIGHT,0,0,"And set the \"flash bomb\" button to \"C\".");
		Talking(0,LEFT);	
		Obj_SetValue(objPlayer,"MUSIC",false);
		SetText(LEFT,0,0,"Alright, I guess that's it.");
		SetText(LEFT,0,0,"If you don't want to have to go through this again");
		SetText(LEFT,0,0,"You should turn off the dialogue in the options.");
		ObjEvent_SetGraphic(LEFT,0,"");
		ObjEvent_SetGraphic(RIGHT,0,"");
		Obj_SetValue(objPlayer,"MUSIC",true);
		loop(20){yield;}
		FinalizeEvent;
		}
	else
		{
		Obj_SetValue(objPlayer,"MUSIC",false);
		yield;
		Obj_SetValue(objPlayer,"MUSIC",true);
		}
	ObjEnemy_SetLife(objEnemy,0);
	Obj_Delete(objEnemy);
	yield;
	Obj_SetValue(objPlayer,"MUSIC",false);
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	CloseScript(GetOwnScriptID);
}