//#TouhouDanmakufu[Single]
#ScriptVersion[3]
#System["./../system/NSystem.dnh"]
#Player["./../player/Reimu by plasmaflame22/Reimu_A.txt", "./../../player/Reimu by plasmaflame22/Reimu_C.txt"]
#Title["BG transition"]
#include "./sharedfuncSaul.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", "no");
	
	animNon(objBoss, 1);
	TFinalize(objBoss);
	skip(objBoss);
	
	
    ObjMove_SetDestAtFrame(objBoss, width/2, height/3, 60);
	Main;
}




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


task Main{
    Name(1, objBoss);
    Indicator(objBoss, 1);
    //SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
    ObjEnemy_SetDamageRate(objBoss, 0,0);
	let r= 255; let g= 255; let b = 255;
	wait(60);
	let t=0;
	let text = speak(false, "Dave! Help me!", r, g, b);
	while(t<180){
	    if(GetVirtualKeyState(VK_OK) == KEY_PUSH){t=180;}
		t++; yield;
	}
	Obj_Delete(text);
	ObjMove_SetDestAtFrame(objBoss, -80, -80, 60);
	wait(60);
	ObjEnemy_SetLife(objBoss, 0);
}