#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
{	
	yield;
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
	TShake;
	yield;
	PlaySound("se_Die3",200);
	if(text == true)
		{
		loop(15){yield;}
		InitializeEvent(1,1);

		Talking(0,LEFT);
		ObjEvent_SetGraphic(LEFT,0,Nue_Face);
		ObjEvent_SetGraphic(RIGHT,0,Hecatia_Face);
		SetText(LEFT,0,0,"Hm...");
		SetText(LEFT,0,0,"That wasn't as scary as I thought it would be.");
		SetText(LEFT,0,0,"I guess Hell can't be that bad after all.");
		Talking(0,RIGHT);
		SetText(RIGHT,0,0,"Oh!");
		SetText(RIGHT,0,0,"You've defeated me!!");
		SetText(RIGHT,0,0,"How can this be,[r]you were stronger than I thought,[r]etc.");
		Talking(0,LEFT);
		SetText(LEFT,0,0,"Um... well, anyway...");
		SetText(LEFT,0,0,"This holiday isn't working for me.");
		SetText(LEFT,0,0,"If people are expecting to be scared,[r]it ruins the effect.");
		SetText(LEFT,0,0,"I think I'll just sleep this one off.");
		ObjEvent_SetGraphic(LEFT,0,"");
		Talking(0,RIGHT);
		SetText(RIGHT,0,0,"Heh...");
		SetText(RIGHT,0,0,"Hehehe...");
		SetText(RIGHT,0,0,"Little does she realize...");
		SetText(RIGHT,0,0,"I stole her candy during that last card...");
		SetText(RIGHT,0,0,"So who's the real winner here?");
		ObjEvent_SetGraphic(RIGHT,0,"");
		loop(20){yield;}
		FinalizeEvent;	
		}
	else
		{
		loop(150){yield;}
		}
	yield;
	Obj_Delete(GetEnemyBossSceneObjectID);
	CloseScript(GetOwnScriptID);
}