#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Minoriko Dialog"]

let bossObj;
let bossX;
let bossY;
let damage = 0;
let ex = GetCurrentScriptDirectory ~ "./../Sounds/se_enep02.wav";
let ch = GetCurrentScriptDirectory ~ "./../Sounds/se_ch00.wav";
#include"./../Functions/Effects/Effects.txt"
#include"./../Functions/Dialog.txt"
#include"./DrawBoss.txt"
#include"./LoadGraphics.txt"

@Initialize{
	bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjMove_SetDestAtFrame(bossObj,192,104,5);
	SetCommonData("ForceLifebar",1);
	SetCommonData("Timer",1);
	SetAutoDeleteObject(true);
	ObjEnemy_Regist(bossObj);
	LoadSound(ex);
	LoadSound(ch);
	animateBossM;
	mainTask;
	TEnd;}

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

@MainLoop{
	bossX = ObjMove_GetX(bossObj);
	bossY = ObjMove_GetY(bossObj);
	if(damage == 0){
		Obj_SetVisible(bossObj,false);
		ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,0);}
	if(damage == 1){
		Obj_SetVisible(bossObj,true);
		ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,32);}
	yield;}

@Finalize{}

task mainTask{ damage=0;
	DeleteShotAll(TYPE_ALL,TYPE_FADE);
	wait(120);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);

	CreateTextBox;
	SetLeftImage(reimu06,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("Come on out!",255,50,50);
		TextLeftA("I know it was your doing!",255,50,50);
	TalkRight;
		TextRightA("Hahahahahaha!",255,150,50);PlaySE(ch);//play_enep;
		MakeConcentrationA1(bossObj,"MAPLE",255,0,0,55);
		wait(125);damage=1;PlaySE(ex);
		MakeExplosionA1(bossObj,"MAPLE",255,0,0);
	SetRightImage(minoriko02,0,2,256,256,220,335);
		TextRightA("Oh Really?",255,150,50);
	SetRightImage(minoriko03,0,2,256,256,220,335);
		TextRightA("They remembered me. Useless people.",255,150,50);
	SetLeftImage(reimu06,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("Why do you call them like this? [r] What did they do to you?",255,50,50);
		TextLeftA("Why are you ruining harvests and [r] making droughts?",255,50,50);
	SetRightImage(minoriko03,0,2,256,256,220,335);
	TalkRight;
		TextRightA("Well how should I call it, shrine maiden.",255,150,50);
		TextRightA("Once people have forgotten what is it hunger.",255,150,50);
	SetRightImage(minoriko01,0,2,256,256,240,335);
		TextRightA("They began fress, forgetting that food[r] 
					just doesn't grow on it's own!",255,150,50);
	SetLeftImage(reimu06,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("What do you mean by that?",255,50,50);
	SetRightImage(minoriko01,0,2,256,256,220,335);
	TalkRight;
		TextRightA("They stopped praying to me. To Goddess of [r] 
					harvest! And it made me very weak.",255,150,50);
	SetLeftImage(reimu06,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("I see...",255,50,50);
	SetLeftImage(reimu08,0,2,256,256,240,335);
		TextLeftA("But you don't look weak.",255,50,50);
	SetRightImage(minoriko03,0,2,256,256,220,335);
	TalkRight;
		TextRightA("Naturally. I had no choise but to leave [r]
					Gensokyo and gain strength elsewhere.",255,150,50);
	SetLeftImage(reimu06,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("When you was gone, it was very difficult for [r]
					people to find any food.",255,50,50);
	SetLeftImage(reimu09,0,2,256,256,240,335);
		TextLeftA("I thought this was your punishment for [r]
					forgetting about you.",255,50,50);
		TextLeftA("However, with your arrival everything just [r]
					became worse.",255,50,50);
		TextLeftA("What are you saying?",255,50,50);
	SetRightImage(minoriko03,0,2,256,256,220,335);
	TalkRight;
		TextRightA("You know, shrine maiden, people will never [r]
					 learn to be polite and to honor gods.",255,150,50);
	SetRightImage(minoriko02,0,2,256,256,240,335);
		TextRightA("That's why I will make everyone kneel down [r]
					 and submit to me,",255,150,50);
		TextRightA("who wants to get at least a piece of bread!",255,150,50);
	SetLeftImage(reimu09,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("That's just ridicilous!",255,50,50);
	SetRightImage(minoriko02,0,2,256,256,220,335);
	TalkRight;
		TextRightA("So I will subjugate entire Gensokyo and will [r]
					 recreate it the way it should be.",255,150,50);
	SetLeftImage(reimu09,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("You! As the Goddess you can punish people.",255,50,50);
		TextLeftA("But you just don't have the right to rule [r]Gensokyo!",255,50,50);
	SetRightImage(minoriko01,0,2,256,256,220,335);
	TalkRight;
		TextRightA("Don't tell me what to do, maiden![r]
					 Eat your peace of bread in silence!",255,150,50);
	SetLeftImage(reimu01,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("Sorry. But I will not obey!",255,50,50);
	SetRightImage(minoriko02,0,2,256,256,220,335);
	TalkRight;
		TextRightA("Do you want to starve?",255,150,50);
	SetLeftImage(reimu02,0,2,256,256,220,335);
	TalkLeft;
		TextLeftA("No, I want to rid you off from ruling [r]
				entire Gensokyo.",255,50,50);
	SetRightImage(minoriko02,0,2,256,256,220,335);
	TalkRight;
		TextRightA("Don't you dare.",255,150,50);

	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);

	DeleteLeftImage;
	DeleteRightImage;
	DeleteTextBox;
	wait(60);
	ObjEnemy_SetLife(bossObj,0);}

task play_enep{wait(55);PlaySE(ex);}