//SETTING UP ZE EVENTS
let EV_SPRITES = EV_USER + EV_RANGE_START + 0;
let EV_CONCETRATION = EV_USER + EV_RANGE_START + 1;
let EV_EXPLOSION = EV_USER + EV_RANGE_START + 2;

function ConcentrationExplosion(x,y,duration,radius,density,turn,scale,blend,R,G,B,graphic) {
	NotifyEventAll(EV_EXPLOSION, [x, y], [duration, radius], [density, turn, scale], blend, [R, G, B, graphic]);
}

function Concentration(x,y,duration,radius,density,turn,ap,blend,R,G,B,graphic){
	NotifyEventAll(EV_CONCETRATION, [x, y], [duration, radius], [density, turn, ap], blend, [R, G, B, graphic]);
}

task ObjShot_SetDeleteFrameA1(objID, frames){
	wait(frames[0]); 
	if(Obj_IsDeleted(objID)){return;}
	
	let color = GetShotDataInfoA1(ObjShot_GetImageID(objID), TARGET_ENEMY, INFO_DELAY_COLOR);
	let path = GetCurrentScriptDirectory() ~ "../img/light.png";
	ObjRender_SetAlpha(objID, 0);
	
	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(obj, path);
	ObjSprite2D_SetSourceRect(obj, 0, 0, 63, 63);
	ObjSprite2D_SetDestCenter(obj); 
	ObjRender_SetColor(obj, color[0], color[1], color[2]);
	ObjRender_SetAlpha(obj, 190);
	ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
	ObjRender_SetPosition(obj, getx(objID), gety(objID), 0); 
	
	let sc; Obj_Delete(objID);
	ascent(i in 0..frames[1]+1){
		sc = Interpolate_Accelerate(1.0, 0, i/frames[1]);
		ObjRender_SetScaleXYZ(obj, sc, sc, 0);
		yield;
	}

	Obj_Delete(obj);
}