//#TouhouDanmakufu[Single]
#ScriptVersion[3]
#System["./../system/NSystem.dnh"]
#Player["./../player/Reimu by plasmaflame22/Reimu_A.txt", "./../../player/Reimu by plasmaflame22/Reimu_C.txt"]
#Title["IntroSamir"]
#include "./sharedfuncSamir.dnh"



let objBoss;
let width = 444;
let height = 448;
let life = 1;
let scene = GetEnemyBossSceneObjectID();

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


@Initialize{
    objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
    ObjEnemy_Regist(objBoss);
	SetCommonData("non1", "yes");
	
	animNon(objBoss, 1);
	TFinalize(objBoss);
	
	Name(1, objBoss);
    Indicator(objBoss, 1);
	
	
    ObjMove_SetDestAtFrame(objBoss, width/2, height/2, 60);
	skip(objBoss);
	Main;
}




@MainLoop{
    ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32); 
    yield;
}


task Main{
    ObjEnemy_SetDamageRate(objBoss, 0,0);
	let time = 180; let r= 255; let g= 255; let b = 255;
	wait(90);
	let t=0;
	let text = speak(false, "It's you.[r]You have come for me..", r, g, b);
	while(t<time){
	    if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){t=time;}
		t++; yield;
	}
	Obj_Delete(text);
	t=0;
	text = speak(false, "Well then, I think[r]that at this point,", r, g, b);
	while(t<time){
	    if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){t=time;}
		t++; yield;
	}
	Obj_Delete(text);
	t=0;
	text = speak(false, "the others have done[r]all the necessary talking.", r, g, b);
	while(t<time){
	    if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){t=time;}
		t++; yield;
	}
	Obj_Delete(text);
	t=0;
	text = speak(false, "You leave me no choice.[r]Goodbye, player...", r, g, b);
	while(t<time){
	    if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){t=time;}
		t++; yield;
	}
	Obj_Delete(text);
	
	wait(80);
	ObjEnemy_SetLife(objBoss, 0);
}