#include".\shot\AllStarShot_Const.txt"
#include".\Resources.txt"
#include".\selibrary.txt"
#include".\OzzieEffects.txt"

let Nazrin = ID_INVALID;
let NazrinX = 0;
let NazrinY = 0;

@Event{
    SetTimer(999);
    SetLife(1);
    SetScore(1000000);
}
 
@Initialize{
	SetAutoDeleteObject(true);
	Nazrin = ObjEnemy_Create(OBJ_ENEMY_BOSS);	
    ObjEnemy_Regist(Nazrin);	
	DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE); 
	//renderNazrinUFO(Nazrin);
	BossManage;
	MainTask;     
}


@MainLoop{
	yield;
}

task MainTask{	
	ObjEnemy_SetDamageRate(Nazrin,0,0);
	ExplosionB3(Nazrin,"CHERRY",[255,100,255],[255,0,0]);
	wait(120);
	Obj_Delete(Nazrin);
	wait(240);
	ObjEnemyBossScene_SetSpellTimer(GetEnemyBossSceneObjectID,1);
	SetForbidPlayerSpell(false);
	wait(120);
	CloseScript(GetOwnScriptID()); 
}

task BossManage{

	while(ObjEnemy_GetInfo(Nazrin,INFO_LIFE)>0){
        NazrinX = ObjMove_GetX(Nazrin);
        NazrinY = ObjMove_GetY(Nazrin);
		yield;
	}
	
	DeleteShotAll(TYPE_ALL, TYPE_ITEM);
}