task TKoiFlash
{
	let spell = GetFlashManageObject;

	let time = 20;
	let spread = [32,5];
	SetPlayerInvincibilityFrame(time+30+spread[0]);
	let counter = 270;
	let xM = GetPlayerX;
	let yM = GetPlayerY;
	ascent(i in 0..ceil(spread[0]))
		{
		TSpam(0,i*720/(spread[0]-1)+270,i,counter);
		loop(1)
			{
			yield;
			counter+=6;
			}
		}
	loop(time){yield;}
	Obj_Delete(spell);

	task TSpam(dist,angle,numb,counter)
		{
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj,GetCurrentScriptDirectory ~ "../system/img/WhiteCircleAlpha.png");
		ObjSprite2D_SetSourceRect(obj,0,0,64,64);
		ObjRender_SetColorHSV(obj,240,255,120);
		Obj_SetRenderPriority(obj,0.34);
		let scalem = 3;
		let scaleM = 38;
		let scale = scalem;
		let delay = 10;
		let count = 0;
		while(floor(count/3) < 80)
			{
			count+=1;
			counter+=6;
			if(cos(counter-angle) >= cos(spread[1]*360/spread[0]))
				{
				if(scale < scaleM)
					{
					scale += (scaleM-scalem)/((360/spread[0])/3);
					}
				else
					{	
					scale = scaleM;
					}
				}
			else
				{
				if(scale > scalem)	
					{
					scale-=(scaleM-scalem)/spread[1];
					}
				else
					{
					scale = scalem;
					}
				}
			dist+=1.25;
			let x = xM+dist*cos(angle);	
			let y = yM+dist*sin(angle);
			ObjRender_SetPosition(obj,x,y,0);
			ObjSprite2D_SetDestRect(obj,-scale*1.125,-scale*1.125,scale*1.125,scale*1.125);
			if(scale > scalem)
				{
				let array = GetShotIdInCircleA2(x,y,scale,TARGET_ENEMY);
				ascent(i in 0..length(array))
					{
					let shot = array[i];
					if(!Obj_IsDeleted(shot) && ObjShot_IsSpellResist(shot) == false)
						{
						Obj_Delete(shot);
						}
					}
				}
			yield;
			}
		Obj_Delete(obj);
		}
}

task TNueFlash
{
	let spell = GetFlashManageObject;
	SetPlayerSpeed(8.5,8.5);

	let time = 50;
	let spread = [32,5];
	SetPlayerInvincibilityFrame(time+15);
	TSpam;
	loop(time){yield;}
	SetPlayerSpeed(PlayerSpeed[0],PlayerSpeed[1]);
	Obj_Delete(spell);

	task TSpam
		{
		let obj = ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj,GetCurrentScriptDirectory ~ "./pl0/Sprite.png");
		ObjSprite2D_SetSourceRect(obj,0,194,94,294);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		Obj_SetRenderPriority(obj,0.6);
		let scaleM = 64;
		let scale = 0;
		let color = 0;
		ascent(t in 0..time)
			{
			color+=3*360/time;
			let x = GetPlayerX;	
			let y = GetPlayerY;
			if(t < 5)
				{
				scale+=scaleM/5;
				}
			else if(t > time-5)
				{
				scale-=(scaleM-12)/5;
				}
			else
				{
				scale-=12/(time-10);
				}
			ObjRender_SetPosition(obj,x,y,0);
			ObjSprite2D_SetDestRect(obj,-scale,-scale,scale,scale);
			ObjRender_SetColorHSV(obj,color,75,255);
			if(scale > 0)
				{
				let array = GetShotIdInCircleA2(x,y,scale,TARGET_ENEMY);
				ascent(i in 0..length(array))
					{
					let shot = array[i];
					if(!Obj_IsDeleted(shot) && ObjShot_IsSpellResist(shot) == false)
						{
						Obj_Delete(shot);
						}
					}
				}
			yield;
			}
		Obj_Delete(obj);
		}
}