task DelayCloudBulletA0(x,y,speed,angle,graphic){
	let bullet = CreateShotA1(x,y,speed,angle,graphic,0);
	let saveSpeed = speed;
	let i = 0;
	ObjMove_SetSpeed(bullet, 0);
	while(i<=10){
		i+=1;
		ObjShot_SetIntersectionEnable(bullet, false);
		ObjRender_SetScaleXYZ(bullet, 2 - 1/10*i, 2-1/10*i,0);
		ObjRender_SetAlpha(bullet, 255/10*i);
		yield;
	}
	ObjShot_SetIntersectionEnable(bullet, true);
	ObjMove_SetSpeed(bullet, saveSpeed);
	yield;
}

task DelayCloudBulletA1(x,y,speed,angle,graphic){
	let bullet = CreateShotA1(x,y,speed,angle,graphic,0);
	let saveSpeed = speed;
	let i = 0;
	ObjMove_SetSpeed(bullet, 0);
	while(i<=10){
		i+=1;
		ObjShot_SetIntersectionEnable(bullet, false);
		ObjRender_SetScaleXYZ(bullet, 2 - 1/10*i, 2-1/10*i,0);
		ObjRender_SetAlpha(bullet, 255/10*i);
		yield;
	}
	ObjShot_SetIntersectionEnable(bullet, true);
	ObjMove_SetSpeed(bullet, saveSpeed*2);
	while(ObjMove_GetSpeed(bullet)>speed){ObjMove_SetAcceleration(bullet, -0.2); yield;}
	ObjMove_SetAcceleration(bullet, 0);
}

task DelayCloudBulletA1AngVel(x,y,speed,angle,graphic,angvel,stop){
	let bullet = CreateShotA1(x,y,speed,angle,graphic,0);
	let saveSpeed = speed;
	let i = 0;
	ObjMove_SetSpeed(bullet, 0);
	while(i<=10){
		i+=1;
		ObjShot_SetIntersectionEnable(bullet, false);
		ObjRender_SetScaleXYZ(bullet, 2 - 1/10*i, 2-1/10*i,0);
		ObjRender_SetAlpha(bullet, 255/10*i);
		yield;
	}
	ObjShot_SetIntersectionEnable(bullet, true);
	ObjMove_SetSpeed(bullet, saveSpeed);
	i = 0;
	while(!Obj_IsDeleted(bullet)){
		ObjMove_SetAngularVelocity(bullet, angvel);
		i++;
		if(i>stop){
		ObjMove_SetAngularVelocity(bullet, 0);
		}
		yield;
	}
}

task DelayCloudBulletGravityA1(x,y,xspeed,yspeed,gravity,angle,graphic){
	let bullet = CreateShotA1(x,y,0,angle,graphic,0);
	let i = 0;
	let xvel = xspeed*cos(angle);
	let yvel = yspeed*sin(angle);
	ObjMove_SetSpeed(bullet, 0);
	while(i<=10){
		i+=1;
		ObjShot_SetIntersectionEnable(bullet, false);
		ObjRender_SetScaleXYZ(bullet, 2 - 1/10*i, 2-1/10*i,0);
		ObjRender_SetAlpha(bullet, 255/10*i);
		yield;
	}
	i = 0;
	ObjShot_SetIntersectionEnable(bullet, true);
	while(!Obj_IsDeleted(bullet)){
		ObjMove_SetX(bullet, ObjMove_GetX(bullet)+xvel);
		ObjMove_SetY(bullet, ObjMove_GetY(bullet)+yvel);
		yvel += gravity;
		i++;
		yield;
	}
}

task Laser(x, y, angle, length, width, delt, graphic, del){
	let laser1 = CreateStraightLaserA1(x, y, angle, 0, width, delt, graphic, del);
	let a = 0;
	ObjRender_SetBlendType(laser1, BLEND_ADD_ARGB);
	ObjStLaser_SetSource(laser1, false);
	while(a < 30){
		ObjLaser_SetLength(laser1, length*(a/30));
		a++;
		yield;
	}
	a = 0;
	while(!Obj_IsDeleted(laser1)){
		a++;
		ObjLaser_SetRenderWidth(laser1, width+(width*0.05)*sin(a*64));
		yield;
	}
}

task LooseLaser(x, y, speed, angle, length, width, graphic){
	let laser1 = CreateLooseLaserA1(x, y, speed, angle, length, width, graphic, 0);
	yield;
}

task PlaySound(soundID){

	let dir = GetCurrentScriptDirectory;
	let objSound = ObjSound_Create();
	
	ObjSound_Load(objSound, dir~"sfx/"~soundID~".wav");
	ObjSound_SetVolumeRate(objSound, 45);
	ObjSound_Play(objSound);
	
}

task PlaySoundDelay(soundID, delay){
	loop(delay){yield;}
	
	let dir = GetCurrentScriptDirectory;
	let objSound = ObjSound_Create();
	
	ObjSound_Load(objSound, dir~"sfx/"~soundID~".wav");
	ObjSound_SetVolumeRate(objSound, 45);
	ObjSound_Play(objSound);
	
}

task Circle(object){

	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);
	let texture = GetCurrentScriptDirectory~"img_circle.png";
	let objCircle = ObjPrim_Create(OBJ_SPRITE_2D);
	let ct = 0;
	
	Obj_SetRenderPriority(objCircle, 0.25);
	ObjPrim_SetTexture(objCircle, texture);
	ObjSprite2D_SetSourceRect(objCircle,0,0,256,256);
	ObjSprite2D_SetDestCenter(objCircle);
	
	while(!Obj_IsDeleted(object)){
	
		objx = ObjMove_GetX(object);
		objy = ObjMove_GetY(object);
		
		ObjRender_SetPosition(objCircle, objx, objy, 0);
		ObjRender_SetScaleXYZ(objCircle, 1.75+0.25*sin(ct*2), 1.75+0.25*sin(ct*2), 0);
		ObjRender_SetAngleXYZ(objCircle, 0, 0, ct*6);
		
		ct++;
		
		yield;
		
	}
	
	Obj_Delete(objCircle);
}

task FireBoss(object, hue, saturation){
	yield;
}

task Fire(object, hue, saturation){
	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);
	let texture = GetCurrentScriptDirectory~"img_fire.png";
	let objFire = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriority(objFire, 0.23);
	ObjPrim_SetTexture(objFire, texture);
	ObjSprite2D_SetSourceRect(objFire,0,0,256,256);
	ObjSprite2D_SetDestCenter(objFire);
	ObjRender_SetColorHSV(objFire, hue, saturation, 255);
	ObjRender_SetBlendType(objFire, BLEND_ADD_ARGB);
	let ct = 0;
	while(!Obj_IsDeleted(objFire)){
		objx = ObjMove_GetX(object);
		objy = ObjMove_GetY(object);
		ObjRender_SetPosition(objFire, objx, objy, 0);
		ObjRender_SetScaleXYZ(objFire, 1.25-ct*0.02, 1.25-ct*0.02, 0);
		ObjRender_SetAngleXYZ(objFire, 0, 0, ct*3);
		ObjRender_SetAlpha(objFire, 255*(ct*0.02));
		if(1.25-ct*0.02<=0){Obj_Delete(objFire);}
		ct++;
		yield;
	}
	Obj_Delete(objFire);
}

task Fire2(object, hue, saturation){
	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);
	let angle = rand(225,315);
	let texture = GetCurrentScriptDirectory~"img_fire.png";
	let objFire = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriority(objFire, 0.23);
	ObjPrim_SetTexture(objFire, texture);
	ObjSprite2D_SetSourceRect(objFire,0,0,256,256);
	ObjSprite2D_SetDestCenter(objFire);
	ObjRender_SetColorHSV(objFire, hue, saturation, 255);
	ObjRender_SetBlendType(objFire, BLEND_ADD_ARGB);
	let ct = 0;
	while(!Obj_IsDeleted(objFire)){
		objx = ObjMove_GetX(object)+(5*ct*cos(angle));
		objy = ObjMove_GetY(object)+(5*ct*sin(angle));
		ObjRender_SetPosition(objFire, objx, objy, 0);
		ObjRender_SetScaleXYZ(objFire, 0.35-ct*0.0035, 0.75-ct*0.0075, 0);
		ObjRender_SetAngleXYZ(objFire, 0, 0, angle+90);
		ObjRender_SetAlpha(objFire, 255*(ct*0.04));
		if(1-ct*0.01<=0){Obj_Delete(objFire);}
		ct++;
		yield;
	}
	Obj_Delete(objFire);
}

task Explode(object){
	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);

	loop(20){light1(rand(0,360),rand(2,4),rand(0.6,1.2));}
	boom1(0,3,1);
	yield;

	task light1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;
		let rendang = rand(0,360);
		let count = 0;
		let pos = 0;
		let decel=-0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=1;
			ObjRender_SetAlpha(light, 255-count*5.67);
			ObjRender_SetAngleXYZ(light, rendang+count, rendang-count, rendang-count);
			ObjRender_SetPosition(light,objx+pos*cos(angle),objy+pos*sin(angle),0);
			pos+=speed;
			speed+=decel;
			if(count==45){Obj_Delete(light);}
			yield;
		}
		yield;
	}

	task boom1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;		
		let count = 0;
		let pos = 0;
		let decel=-0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=1;
			ObjRender_SetAlpha(light, 255-count*8.5);
			ObjRender_SetScaleXYZ(light,1.5*scale*sin(count*3),1.5*scale*sin(count*3),1.5*scale*sin(count*3));
			pos+=speed;
			speed+=decel;
			if(count==30){Obj_Delete(light);}
			yield;
		}
		yield;
	}
}

task ExplodeBoss(object){
	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);

	loop(100){light1(rand(0,360),rand(4,8),rand(1.0,1.8));}
	boom1(0,2,10);
	yield;

	task light1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;
		let rendang = rand(0,360);
		let count = 0;
		let pos = 0;
		let decel=-0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjRender_SetBlendType(light, BLEND_ADD_ARGB);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=0.5;
			ObjRender_SetAlpha(light, 255-count*5.67);
			ObjRender_SetAngleXYZ(light, rendang+count, rendang-count, rendang-count);
			ObjRender_SetPosition(light,objx+pos*cos(angle),objy+pos*sin(angle),0);
			pos+=speed;
			speed+=decel;
			if(count==45){Obj_Delete(light);}
			yield;
		}
		yield;
	}

	task boom1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;		
		let count = 0;
		let pos = 0;
		let decel = -0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjRender_SetBlendType(light, BLEND_ADD_ARGB);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=0.25;
			ObjRender_SetAlpha(light, 255-count*8.5);
			ObjRender_SetScaleXYZ(light,1.5*scale*sin(count*3),1.5*scale*sin(count*3),1.5*scale*sin(count*3));
			pos+=speed;
			speed+=decel;
			if(count==30){Obj_Delete(light);}
			yield;
		}
		yield;
	}
}

task ExplodeBoss2(object){
	let objx = ObjMove_GetX(object);
	let objy = ObjMove_GetY(object);

	loop(100){light1(rand(0,360),rand(4,16),rand(1.2,2.4));}
	boom1(0,2,15);
	yield;

	task light1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;
		let rendang = rand(0,360);
		let count = 0;
		let pos = 0;
		let decel=-0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjRender_SetBlendType(light, BLEND_ADD_ARGB);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=0.5;
			ObjRender_SetAlpha(light, 255-count*5.67);
			ObjRender_SetAngleXYZ(light, rendang+count, rendang-count, rendang-count);
			ObjRender_SetPosition(light,objx+pos*cos(angle),objy+pos*sin(angle),0);
			pos+=speed;
			speed+=decel;
			if(count==45){Obj_Delete(light);}
			yield;
		}
		yield;
	}

	task boom1(angle, speed,scale){
		let texture = GetCurrentScriptDirectory~"chg.png";
		let light = ObjPrim_Create(OBJ_SPRITE_2D);
		let alpha = 255;		
		let count = 0;
		let pos = 0;
		let decel=-0.05;
		ObjPrim_SetTexture(light, texture);
		ObjRender_SetScaleXYZ(light,scale,scale,scale);
		ObjSprite2D_SetSourceRect(light,0,0,128,128);
		ObjSprite2D_SetDestCenter(light);
		ObjRender_SetPosition(light, objx, objy, 0);
		ObjRender_SetAngleXYZ(light,0,0,0);
		ObjRender_SetBlendType(light, BLEND_ADD_ARGB);
		ObjMove_SetPosition(light, objx, objy);
		ObjMove_SetAngle(light, angle);
		ObjMove_SetSpeed(light, speed);
		ObjMove_SetAcceleration(light, -0.005);
		while(!Obj_IsDeleted(light)){
			count+=0.25;
			ObjRender_SetAlpha(light, 255-count*8.5);
			ObjRender_SetScaleXYZ(light,1.5*scale*sin(count*3),1.5*scale*sin(count*3),1.5*scale*sin(count*3));
			pos+=speed;
			speed+=decel;
			if(count==30){Obj_Delete(light);}
			yield;
		}
		yield;
	}
}

task glow(x,y,graphic){
	let bullet = CreateShotA1(x,y,0,0,graphic,15);
	loop(14){yield;}
	Obj_Delete(bullet);
}

task charge(object, hue, saturation, value){
	let x = ObjMove_GetX(object);
	let y = ObjMove_GetY(object);
	let angle = rand(0, 360);
	let randRadius = rand(500, 475);
	let randSquare = 0.25+rand(-0.25,0.5);
	let randSpeed = rand(3,8);
	let inc = 0;
	let light = ObjPrim_Create(OBJ_SPRITE_2D);
	let texture = GetCurrentScriptDirectory~"chg.png";
	ObjPrim_SetTexture(light, texture);
	Obj_SetRenderPriority(light, 0.235);
	ObjSprite2D_SetSourceRect(light,0,0,128,128);
	ObjSprite2D_SetDestCenter(light);
	ObjRender_SetScaleXYZ(light, randSquare, randSquare, 0);
	ObjRender_SetColorHSV(light, hue, saturation, value);
	while(!Obj_IsDeleted(object)){
		x = ObjMove_GetX(object);
		y = ObjMove_GetY(object);
		ObjRender_SetAlpha(light, 255*sin(inc));
		ObjRender_SetBlendType(light, BLEND_ALPHA);
		ObjRender_SetPosition(light, x+(randRadius-inc*randSpeed)*cos(angle+inc), y+(randRadius-inc*randSpeed)*sin(angle+inc), 0);
		ObjRender_SetAngleXYZ(light, 0, 0, angle+inc);
		inc++;
		if((randRadius-inc*randSpeed)<=0){Obj_Delete(light);}
		yield;
	}
}

task charge2(object, hue, saturation, value){
	let x = ObjMove_GetX(object);
	let y = ObjMove_GetY(object);
	let angle = rand(0,360);
	let randRadius = rand(500, 475);
	let randSquare = 0.25+rand(-0.25,0.5);
	let randSpeed = rand(3,8);
	let inc = 0;
	let light = ObjPrim_Create(OBJ_SPRITE_2D);
	let texture = GetCurrentScriptDirectory~"chg.png";
	ObjPrim_SetTexture(light, texture);
	Obj_SetRenderPriority(light, 0.235);
	ObjSprite2D_SetSourceRect(light,0,0,128,128);
	ObjSprite2D_SetDestCenter(light);
	ObjRender_SetScaleXYZ(light, randSquare, randSquare, 0);
	ObjRender_SetColorHSV(light, hue, saturation, value);
	while(!Obj_IsDeleted(object)){
		x = ObjMove_GetX(object);
		y = ObjMove_GetY(object);
		ObjRender_SetAlpha(light, 255*sin(inc));
		ObjRender_SetBlendType(light, BLEND_ADD_ARGB);
		ObjRender_SetPosition(light, x+(randRadius-inc*randSpeed)*cos(angle-inc), y+(randRadius-inc*randSpeed)*sin(angle-inc), 0);
		ObjRender_SetAngleXYZ(light, 0, 0, angle-inc);
		inc++;
		if((randRadius-inc*randSpeed)<=0){Obj_Delete(light);}
		yield;
	}
}

task SpellText(String, object, scene){
	let x = GetStgFrameWidth/2;
	let y = GetStgFrameHeight;
	let count = 0;
	let spellName = ObjText_Create();
	ObjText_SetText(spellName, String);
	ObjText_SetFontSize(spellName,20);
	ObjText_SetFontType(spellName,"Impress BT");
	ObjText_SetFontColorTop(spellName,255,255,255);
	ObjText_SetFontColorBottom(spellName,150,150,150);
	ObjText_SetFontBorderWidth(spellName, 2);
	ObjText_SetFontBorderColor(spellName,0,0,0);
	ObjText_SetFontBorderType(spellName,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spellName, ALIGNMENT_RIGHT);
	ObjText_SetMaxWidth(spellName, GetStgFrameWidth);
	Obj_SetRenderPriority(spellName, 0.7);
	x = -10;
	while(count < 90){
		ObjRender_SetPosition(spellName,x,y,0);
		y = 500 - 490*sin(count);
		count +=1 ;
		yield;
	}
	SpellScore(scene);
	SpellScoreBonus(object);
	while(!Obj_IsDeleted(spellName)){
		if(ObjEnemy_GetInfo(object,INFO_LIFE) == 0){Obj_Delete(spellName);}
			yield;
		}
}

task BossName(name, object){
	let x = 0;
	let y = 0;
	let spellName = ObjText_Create();
	
	ObjText_SetText(spellName, name);
	ObjText_SetFontSize(spellName, 15);
	ObjText_SetFontType(spellName,"Impress BT");
	ObjText_SetFontColorTop(spellName,200,255,200);
	ObjText_SetFontColorBottom(spellName,150,200,150);
	ObjText_SetFontBorderWidth(spellName, 1);
	ObjText_SetFontBorderColor(spellName,0,150,0);
	ObjText_SetFontBorderType(spellName,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spellName, ALIGNMENT_LEFT);
	Obj_SetRenderPriority(spellName, 0.7);
	ObjRender_SetPosition(spellName, x, y, 0);
	
	while(!Obj_IsDeleted(spellName)){
		if(ObjEnemy_GetInfo(object,INFO_LIFE) == 0){Obj_Delete(spellName);}
		yield;
	}
}

task SpellScore(object){
	let count = 0;
	let score = "0  ";
	let spellName=ObjText_Create();
	
	ObjText_SetText(spellName, score);
	ObjText_SetFontSize(spellName,16);
	ObjText_SetFontType(spellName,"Courier New");
	ObjText_SetFontColorTop(spellName,255,255,255);
	ObjText_SetFontColorBottom(spellName,255,255,255);
	ObjText_SetFontBorderWidth(spellName,1);
	ObjText_SetFontBorderColor(spellName,0,0,0);
	ObjText_SetFontBorderType(spellName,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spellName, ALIGNMENT_RIGHT);
	ObjText_SetMaxWidth(spellName, GetStgFrameWidth);
	Obj_SetRenderPriority(spellName, 0.7);
	ObjRender_SetPosition(spellName, 0, 27, 0);
	
	score = ToString(ObjEnemyBossScene_GetInfo(object, INFO_SPELL_SCORE));
	let score2 = "";
	
	loop(7){score = erase(score, (length(score)-1));}
	ascent(i in 0..length(score)){
			if((length(score)-i)%3==0&&i!=0){
				score2 = score2 ~ "";
			}
			if(i==0){
				score2=ToString(score[0]);
			}else{
				score2=score2~ToString(score[i]);
			}
	}
	ObjText_SetText(spellName, score2 ~ "  ");
	while(count<=10){
		count++;
		ObjRender_SetAlpha(spellName, (count/10)*255);
		yield;
	}
	while(!Obj_IsDeleted(object)){
		score = ToString(ObjEnemyBossScene_GetInfo(object, INFO_SPELL_SCORE));
		score2 = "";
		loop(7){score = erase(score, (length(score)-1));}
		ascent(i in 0..length(score)){
			if((length(score)-i)%3==0&&i!=0){
				score2 = score2 ~ "";
			}
			if(i==0){
				score2=ToString(score[0]);
			}else{
				score2=score2~ToString(score[i]);
			}
		}
		ObjText_SetText(spellName, score2 ~ "  ");
		if(ObjEnemyBossScene_GetInfo(object, INFO_PLAYER_SHOOTDOWN_COUNT)>0||ObjEnemyBossScene_GetInfo(object, INFO_PLAYER_SPELL_COUNT)>0){ObjText_SetText(spellName, "Failed  ");}
		yield;
	}
	Obj_Delete(spellName);
	yield;
}

task SpellScoreBonus(object){
	let count = 0;
	let spellName=ObjText_Create();
	ObjText_SetText(spellName, "Bonus:                     ");
	ObjText_SetFontSize(spellName,16);
	ObjText_SetFontType(spellName,"Impress BT");
	ObjText_SetFontColorTop(spellName,255,255,255);
	ObjText_SetFontColorBottom(spellName,0,200,255);
	ObjText_SetFontBorderWidth(spellName,1);
	ObjText_SetFontBorderColor(spellName,0,0,0);
	ObjText_SetFontBorderType(spellName,BORDER_FULL);
	ObjText_SetHorizontalAlignment(spellName, ALIGNMENT_RIGHT);
	ObjText_SetMaxWidth(spellName, GetStgFrameWidth);
	Obj_SetRenderPriority(spellName, 0.7);
	ObjRender_SetPosition(spellName, 0, 27, 0);
	ObjRender_SetAlpha(spellName, 255);
	while(count<=10){
		count++;
		ObjRender_SetAlpha(spellName, (count/10)*255);
		yield;
	}
	while(!Obj_IsDeleted(object)){
		yield;
	}
	Obj_Delete(spellName);
}