task TCirFlash
{
	let spell = GetFlashManageObject;

	let time = 45;
	let counterM = 0;
	SetPlayerInvincibilityFrame(time);
	TSpam(GetPlayerX,GetPlayerY,0,64);	
	loop(time)
		{
		counterM+=1;
		yield;
		}
	Obj_Delete(spell);

	task TSpam(x,y,count,scaleM)
		{
		if(IsPermitPlayerShot == false || scaleM <= 0){return;}
		let obj = CreatePlayerShotA1(x,y,0,0,0,10^10,LARGE_GRAY);
		ObjRender_SetBlendType(obj,BLEND_ADD_ARGB);
		ObjShot_SetIceBreak(obj,true);
		ObjRender_SetColorHSV(obj,195,125,255);
		Obj_SetRenderPriority(obj,0.34);
		let counter = 0;
		let scalem = 0;
		let scale = scalem;
		let switchA = [true];
		ascent(i in 0..8)
			{
			switchA = switchA ~ [false];
			}
		while(counter < 14)
			{
			counter+=1;
			if(counter > 12 && scale > scalem)
				{	
				scale -= scaleM/2;
				scale = max(0,scale);
				}
			else if(scale < scaleM)
				{
				scale += scaleM/7;
				scale = min(scaleM,scale);
				}
			ObjMove_SetPosition(obj,x,y);
			ObjShot_SetScale(obj,scale/32);
			yield;
			if(Obj_IsDeleted(obj)){return;}
			if(count < 1)
				{
				let array = GetShotIdInCircleA2(x,y,scale,TARGET_ENEMY);
				ascent(i in 0..length(array))
					{
					let shot = array[i];
					let xM = x;
					let yM = y;
					if(!Obj_IsDeleted(shot))
						{
						let x = ObjMove_GetX(shot);
						let y = ObjMove_GetY(shot);
						if(ObjShot_GetIceBreak(shot))
							{
							if(ObjShot_IsSpellResist(shot) == false)	
								{
								NotifyEventAll(EV_ICE_BREAK,[x,y]);
								Obj_Delete(obj);
								break;
								}
							}
						else if(ObjShot_IsSpellResist(shot) == false)
							{
							let switch = true;
							let countA = 0;
							ascent(i in 1..length(switchA))
								{
								if(switchA[i] == true && switch == true)
									{
									switch = false;
									}
								let angle = atan2(y-yM,x-xM)+180;
								if(floor(angle/45) == i-1)
									{
									countA = i;
									}
								}
							if(switch == true)
								{
								PlaySound("se_Flashbomb",75);
								}
							if(switchA[countA] == false && GetDistance(x,y,xM,yM) > scaleM*0.75)
								{
								let scaleB = floor(scaleM*0.75);
								let countB = 0;
								if(scaleB < 24)	
									{
									scaleB = 24;
									countB = 10;
									}
								TSpam(x,y,countB,scaleB);
								switchA[countA] = true;
								}
							if(Effect < 1)
								{
								TDel(shot);
								}
							else
								{
								Obj_Delete(shot);
								}
							}
						}
					}
				}
			}
		Obj_Delete(obj);
		}

	task TDel(shot)
		{
		ObjShot_SetSpellResist(shot,true);
		ObjRender_SetColorHSV(shot,195,125,255);
		ObjRender_SetBlendType(shot,BLEND_ADD_ARGB);
		Obj_SetRenderPriority(shot,0.34);	
		let angle = ObjMove_GetAngle(shot);
		loop(15){TMove;yield;}
		ObjShot_FadeDelete(shot);
		TMove;
		task TMove
			{
			ObjMove_SetSpeed(shot,0.125);
			ObjMove_SetAngle(shot,angle);
			ObjMove_SetAcceleration(shot,0);
			ObjMove_SetAngularVelocity(shot,0);
			ObjShot_SetIntersection(shot,false);
			}
		}
}
