#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Nonspell1"]
#Text["Woop"]


let objBoss;

let BossX;
let BossY;

let AttackX;
let AttackY;

let Player = 0;

#include "./Functions/Index.txt"
#include "./Functions/Dialogue.txt"


@Initialize {
	objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	ObjEnemy_Regist(objBoss);
	renderyamame(objBoss);
	BossShotSound(objBoss, 100, 600);
	FlameAura(objBoss,[255,25,25],2);
	DrawName("Yamame Kurodani", [200, 200, 20], 11);
	ObjMove_SetPosition(objBoss, -50,-50);
	DialogueBoss;
	end;

} 

@Event { 
	alternative(GetEventType())
	case(EV_REQUEST_LIFE){
		SetScriptResult(4500);
     	}
	case(EV_REQUEST_TIMER){
		SetScriptResult(80000000);
	}
	case(EV_REQUEST_SPELL_SCORE){
		SetScriptResult(1000000);
	}
} 

@MainLoop {
	BossX = ObjMove_GetX(objBoss);
	BossY = ObjMove_GetY(objBoss);
	
	AttackX = BossX+10;
	AttackY = BossY-20;
	
	ObjEnemy_SetIntersectionCircleToShot(objBoss,BossX,BossY,21);
	ObjEnemy_SetIntersectionCircleToPlayer(objBoss,BossX,BossY,16);
	yield;
} 

@Finalize {

} 

task DialogueBoss{
Player = 0;
if(GetCommonData("Reimu",1)==1){Player = 0}
if(GetCommonData("Marisa",0)==1){Player = 1}
if(GetCommonData("Sakuya",0)==1){Player = 2}
if(GetCommonData("Sanae",0)==1){Player = 3}
if(GetCommonData("Youmu",0)==1){Player = 4}

	if(Player==0){
	DialogueReimu;
	}
	if(Player==1){
	DialogueMarisa;
	}
	if(Player==2){
	DialogueSakuya;
	}
	if(Player==3){
	DialogueSanae;
	}
	if(Player==4){
	DialogueYoumu;
	}
}

function DialogueReimu{
wait(50);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
SetCommonData("PlayerCutin",Characters[Player][0]);
SetCommonData("PlayerTalk",0);
DialogueCutinPlayer;
DialogueBox;
Dialogue(0, ". . .", 0, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Show yourself, I know you're there.", 0, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
ObjMove_SetDestAtWeight(objBoss,GetStgFrameWidth/2,GetStgFrameHeight/4, 5, 4);
Dialogue(1, "Ah, The Shrine Maiden appears at last..", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
DialogueCutinBoss;
Dialogue(1, "I bet you're here to stop my doing, [r]Don't you?", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "It's too late now.[r]The Majority of Gensokyo has been[r]infected by my disease.", 1, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Why?[r]Why do such a thing?", 0, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "The life underground gets boring.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "Sometimes I feel like, Going out there[r] and leave a mark, You know?.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "That's not how you do that..", 0, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "And I need you to stop this at once!", 0, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "I'm afraid that's not possible.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "Predictably, You'll need to defeat me[r]in combat.", 1, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "To save Gensokyo, So be it!", 0, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

	
Dialogue(1, "...Now Human.[r]This disease, that runs through [r]Humans and Youkai.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

SetCommonData("musicswap",1);
MagicRing(objBoss,true);
Dialogue(1, "Let it run through your body[r] and succumb to it!", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	SetCommonData("EndDialogue",1);
mainTask;
}
function DialogueMarisa{
wait(50);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
SetCommonData("PlayerCutin",Characters[Player][0]);
SetCommonData("PlayerTalk",0);
DialogueCutinPlayer;
DialogueBox;
Dialogue(0, "I gotcha' now Spider!", 1, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Get out of your hiding spot,[r] I'm here already!", 1, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
ObjMove_SetDestAtWeight(objBoss,GetStgFrameWidth/2,GetStgFrameHeight/4, 5, 4);
Dialogue(1, "Ah, The Witch appears..", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

DialogueCutinBoss;	
Dialogue(0, "I see you've created quite a mess, [r]It's time to stop!", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "I'm afraid that's not possible.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Nope! It's never too late to kick the [r]butt of someone who's caused an incident!", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Hopefully...", 1, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "A little too eager to start aren't we?[r]Well then...", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

SetCommonData("musicswap",1);
Dialogue(1, "...Now Human.[r]This disease, that runs through [r]Humans and Youkai.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
TimedDialogue(1, "Let it run through your body[r] and succ-", 1, 0,  0,0,0,60);
	wait(70);

TimedDialogue(0, "Fight me already!", 1, 7,  0,0,0,60);
	wait(70);

MagicRing(objBoss,true);
TimedDialogue(1, ". . .", 1, 6,  0,0,0,60);
	wait(70);

	
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	SetCommonData("EndDialogue",1);
mainTask;
}
function DialogueSakuya{
wait(50);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
SetCommonData("PlayerCutin",Characters[Player][0]);
SetCommonData("PlayerTalk",0);
DialogueCutinPlayer;
DialogueBox;
Dialogue(0, "Don't try to hide.", 2, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "I can see you.", 2, 1,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
ObjMove_SetDestAtWeight(objBoss,GetStgFrameWidth/2,GetStgFrameHeight/4, 5, 4);
Dialogue(1, "That's not the greeting I was expecting,[r] but I'll take it.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
DialogueCutinBoss;	
Dialogue(0, "It's time to put a stop to all of this.", 2, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "I'm afraid it's too late.", 1, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "The Majority of Gensokyo has been[r]infected by my disease.", 1, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "It's never too late.", 2, 1,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "It's never too late to realize the pain[r]you're causing to all of Gensokyo!", 2, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "I'm sorry.[r]Soon, The entirety will be infected.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Everyone will succumb...", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Then you leave me no choice.", 2, 1,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "I'll restore Gensokyo back to how it was[r] before!", 2, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

SetCommonData("musicswap",1);	
Dialogue(1, "This disease, that runs through [r]Humans and Youkai.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

MagicRing(objBoss,true);
Dialogue(1, "Let it run through your body[r] and succumb to it!", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	SetCommonData("EndDialogue",1);
mainTask;
}
function DialogueSanae{
wait(50);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
SetCommonData("PlayerCutin",Characters[Player][0]);
SetCommonData("PlayerTalk",0);
DialogueCutinPlayer;
DialogueBox;
Dialogue(0, "I see a spider.",3, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Hi spider!", 3, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
ObjMove_SetDestAtWeight(objBoss,GetStgFrameWidth/2,GetStgFrameHeight/4, 5, 4);
Dialogue(1, "Ah, The Who are you? appears...", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

DialogueCutinBoss;	
Dialogue(1, "No seriously Who are you.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Hey, I knew there was going on[r]and I just had to investigate!", 3, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Then there's the fact that my Goddesses[r] like to pressure me into going out[r] in incident resolving like this!", 3, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "What", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Can you put a stop to this?", 3, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "No.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Please?", 3, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "No.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Are you sure?", 3, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Yes..", 1, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "For reals?", 3, 3,  45,0,15);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Y-Yes..", 1, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "Positiiiive?", 3, 1,  75,0,22.5);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "STOP!", 1, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

SetCommonData("musicswap",1);
MagicRing(objBoss,true);
Dialogue(1, "Just...[r]Just get out of here ;-;", 1, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Yaaaay!", 3, 2,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "................", 3, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "....are you lying?", 3, 5,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

loop(120){
TimedDialogue(1, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA[r]AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA[r]AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA[r]AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 1, 6,  rand(-100,100), rand(-100,100), rand(0,360),1);
SetCommonData("BossAngle",rand(0,360));
yield;
}
	
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	SetCommonData("EndDialogue",1);
mainTask;
}
function DialogueYoumu{
wait(50);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
SetCommonData("PlayerCutin",Characters[Player][0]);
SetCommonData("PlayerTalk",0);
DialogueCutinPlayer;
DialogueBox;

Dialogue(0, "Hmmm...", 4, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Where is she?", 4, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
ObjMove_SetDestAtWeight(objBoss,GetStgFrameWidth/2,GetStgFrameHeight/4, 5, 4);
Dialogue(1, "Oh, Who are you?", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

DialogueCutinBoss;	
Dialogue(0, "Are you the one who's causing all this[r]Ruckus?", 4, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Indeed I am.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(1, "And before you ask No, I'm not[r]stopping just because you asked.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "Then I'll slash you to pieces!", 4, 3,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

Dialogue(0, "That's what Lady Yuyuko said I should do[r]anyway.", 4, 6,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Whatever you say.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
TimedDialogue(1, "...Now Human-", 1, 0,  0,0,0,30);
wait(40);

Dialogue(0, "HALF HUMAN!", 4, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(1, "Now Half-Human. This disease, [r] that runs through Humans and Youkai.", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);

SetCommonData("musicswap",1);
MagicRing(objBoss,true);
Dialogue(1, "Let it run through your body[r] and succumb to it!", 1, 0,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
Dialogue(0, "What's left of it anyway.", 4, 7,  0,0,0);

	wait(5);
	while(GetVirtualKeyState(VK_SHOT)!=KEY_PUSH){yield;}
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/shot.wav", 200);
	wait(5);
	
	SetForbidPlayerShot(false);
	SetForbidPlayerSpell(false);
	SetCommonData("EndDialogue",1);
mainTask;
}

task mainTask { 
BottomEnemyMarker(objBoss, objBoss);
wait(70);
SetCommonData("BossAngle",0);
SetCommonData("EndDialogue",0);
	loop{
	attack = true;
	wait(15);
		ascent(j in 0..60){
			ascent(i in 0..5){
			CreateShotA1(AttackX, AttackY, 1+(j/20), (j*7)+(i*360/5), SMALL_BLUE, 10);
			}
		SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/smbullet.wav", 60);
		wait(1);
		}
	wait(20);
	attack = false;
	wait(40);
	ObjMove_SetDestAtWeight(objBoss,GetPlayerX,GetStgFrameHeight/3+rand(-50,5), 15, 4);
	wait(60);
	attack = true;
	wait(15);
		ascent(j in 0..50){
			ascent(i in 0..3){
			let obj2 = CreateShotA2(AttackX, AttackY, 0.3+(j/18), (j*42)+(i*360/3), 0, 1, SMALL_BLUE, 10);
			let obj = CreateShotA2(AttackX, AttackY, 0.3+(j/18), (j*42)+(i*360/3)+360/6, 0, 1, SMALL_BLUE, 10);
			Redirect(obj, j);
			Accel(obj2, j);
			}
		SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/smbullet.wav", 60);
		wait(1);
		}
	wait(20);
	attack = false;
	wait(40);
	ObjMove_SetDestAtWeight(objBoss,GetPlayerX,GetStgFrameHeight/3+rand(-50,5), 15, 4);
	wait(180);
	}
	
	task Accel(obj, time){
	wait(210-time/2);
	ObjMove_SetAcceleration(obj, 0.02);
	ObjMove_SetMaxSpeed(obj, 200);
	}
	
	task Redirect(obj, time){
	wait(130-time);
	ObjMove_SetAcceleration(obj, -0.005);
	ObjMove_SetMaxSpeed(obj, 0);
	wait(120-time);
	if(!Obj_IsDeleted(obj)){
	CreateShotA2(ObjMove_GetX(obj), ObjMove_GetY(obj), 0, GetAngleToPlayer(objBoss), 0.01, 100, SMALL_RED, 5);
	SE_Play(GetCurrentScriptDirectory ~ "Functions/sfx/spirit.wav", 60);
	}
	Obj_Delete(obj);
	}
}

task end{
    while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
    Obj_Delete(objBoss);
	wait(1);
	SetCommonData("deathsound",1);
    DeleteShotAll(TYPE_ALL, TYPE_ITEM);
    SetAutoDeleteObject(true);
    CloseScript(GetOwnScriptID());
} 
