#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Miyako end-dialog (Reimu)"]

#include"./../../Functions/Event_Functions.txt"
#include"./../../Functions/Effects/Effects.txt"
#include"./LoadGraphics.txt"
#include"./LoadSounds.txt"

let bossObj;
let bossX;
let bossY;

@Initialize{
	bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	SetCommonData("ForceLifebar",1);
	SetAutoDeleteObject(true);
	ObjEnemy_Regist(bossObj);
	mainTask;}

@Event{
	alternative(GetEventType())
	case(EV_REQUEST_LIFE){SetScriptResult(1);}}

@MainLoop{
	bossX = ObjMove_GetX(bossObj);
	bossY = ObjMove_GetY(bossObj);
	ObjEnemy_SetDamageRate(bossObj,0,0);
	ObjEnemy_SetIntersectionCircleToShot(bossObj,bossX,bossY,24);
	ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,32);
	yield;}

@Finalize{}

task mainTask{
	MakeExplosionA2(192,224,"SAKURA",255,255,255);
	MakeExplosionA2(192,224,"SAKURA",255,255,255);
	MakeExplosionA2(192,224,"SAKURA",255,255,255);
	DeleteShotAll(TYPE_ALL,TYPE_FADE);
	SE(se_enep2);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
	loop(60){yield;}
	StopSlow(TARGET_ALL);
	loop(30){yield;}

	CreateTextBox;

	SetLeftImage(reimu06,0,0,212,340,212-30,340-40);
	SetRightImage(miyako05,0,0,260,330,230,300);
	TalkRight;
		TextRightA("Aha! That was amazing! You're real strong, [r]pink-- I mean, Reimu.",255,150,64);
	TalkLeft;
		TextLeftA("Yeah, yeah, sure. Alcohol now, chit-chat later.",255,120,120);
	TalkRight;
		TextRightA("You're some kind of pink, that's for sure.",255,150,64);
		TextRightA("Alright, let's get to it. Let's drink all night, yeah?",255,150,64);
	SetRightImage2(tsugumi01,0,0,310,450,240,280);
		TextRight2A("But I have work tomorrow!",255,150,200);
	TalkCorrect;
		TextRightA("Ah, shaddup. You'll have fun.",255,150,64);
	SetLeftImage(reimu05,0,0,212,340,212-30,340-40);
	TalkLeft;
		TextLeftA("I just want the alochol.",255,120,120);
	TalkRight;
		TextRightA("Are you sure you don't wanna wave a sparkler [r]around? Don't worry, we ain't judging.",255,150,64);
	SetLeftImage(reimu04,0,0,212,340,212-30,340-40);
	TalkLeft;
		TextLeftA("...",255,120,120);
		SetLeftImage(reimu01,0,0,212,340,212-10,340-20);
		TextLeftA("Fine. I'll take one.",255,120,120);
	DeleteLeftImage;
	DeleteRightImage;
	DeleteRightImage2;
	loop(60){yield;}
		TextLeftA("(Later on, Tsumugi married Reimu to a firework, [r]and Miyako set it off.)",255,255,255);
		TextLeftA("(Reimu then beat Miyako up again.)",255,255,255);
	DeleteTextBox;

	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);

	loop(60){yield;}
	ObjEnemy_SetLife(bossObj,0);
	loop(1){yield;}
	DeleteShotAll(TYPE_ALL,TYPE_ITEM);
	Obj_Delete(bossObj);
	CloseScript(GetOwnScriptID);}