
#ScriptVersion[3]
#Title["Test"]
#Text["By Lushie/Lusushime"]
#include ".\Functions.dnh"
#Background[".\Stage3bg.dnh"]
#System[".\default_system/Default_System.txt"]
#Player[".\player/LoLK Marisa (Lushie)/MarisaH.dnh"]

let objBoss; //global variable, can be used anywhere
let objScene = GetEnemyBossSceneObjectID(); //declares global variable enemy boss scene object


@Event{
	alternative(GetEventType())
    case(EV_REQUEST_LIFE){ //Sets boss's life
		SetScriptResult(spelllife);
    }
    case(EV_REQUEST_TIMER){ //Sets attack time
        SetScriptResult(spelltime);
    }
    case(EV_REQUEST_SPELL_SCORE){ //Spellcard bonus
        SetScriptResult(1000000);
    }
    case(EV_PLAYER_SHOOTDOWN){
    	pdreset(spelltime,spelllife);
    }
}

let spelltime = 99935;
let spelllife = 3000;

@Initialize{
	objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS); //gives the variable a value, object ID that makes it a boss
	ObjEnemy_Regist(objBoss); //registers it as an enemy

 //declares spellcard
 	bossanimation("doremy");
	TDrawLoop; //calls TDrawLoop task
	TFinalize; //calls TFinalize task
	MainTask; //calls MainTask task
}

@MainLoop{
	ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), bosshitbox); 
	ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
	// CircleToShot means any player shoot hitting this will damage the boss, CircleToPlayer kills the player on colission
	yield; //necessary for task functions to work
}

task MainTask{
	startingposition(GetCenterX, 120);
	bmoveto(GetCenterX, 120, 60);
	startattacking;
	ObjEnemy_SetLife(objBoss, 0);
	
}

task startattacking{
	pointdevicepositions;
	yield;
	ObjEnemy_SetDamageRate(objBoss, 80, 34);
}
