let path=GetCurrentScriptDirectory~"img/back.png";
let objScene=GetEnemyBossSceneObjectID();
let bSpell=false;

task Darken{
	yield;
	while(1){
	while(bSpell==false){ yield; }
	if(bSpell==true){
		TDrawSpell();
		}
	while(bSpell==true){ yield; }
	yield;
	}
}

task TDrawSpell{
	let path1 = CSD~"./img/main.png";
	let obj1 = ObjPrim_Create(OBJ_SPRITE_2D);
	let alpha = 0;
	ObjRender_SetBlendType(obj1, BLEND_ADD_RGB);
	Obj_SetRenderPriority(obj1, 0.25);
	ObjPrim_SetTexture(obj1, path1);
	ObjSprite2D_SetDestRect(obj1, 0, 0, 384, 448);
	TCheck(obj1,alpha);
	loop(30){
		ObjRender_SetAlpha(obj1,alpha);
		ObjSprite2D_SetSourceRect(obj1, 0, 0, 255, 255);
		alpha+=255/30;
		yield;
	}
	}
	task TCheck(obj,alpha){
		while(bSpell==true){ yield; }
		loop(20){
			ObjRender_SetAlpha(obj,alpha);
			alpha-=255/20;
			yield;
		}
		Obj_Delete(obj);
	}