//#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["BackgroundChange"]
#include "./../ZUNShot/ZUNShot_Const.txt"
#include "./sharedFuncDave.dnh"



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


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


@Initialize{
    objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
    ObjEnemy_Regist(objBoss);
	
	SetCommonData("change", "yes");
	SetCommonData("non1", "no");
	
	
	animNon(objBoss);
	TFinalize(objBoss);
	
	
    ObjMove_SetDestAtFrame(objBoss, width/2, 2*height/5, 60);
	Main;
}

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


task Main{
    Name(1, objBoss);
    NotifyEventAll(EV_USER_STAGE+2, 0);
	ObjEnemy_SetDamageRate(objBoss, 0,0);
    Indicator(objBoss, 1);
	wait(500);
	ObjEnemy_SetLife(objBoss, 0);
}