task ChoosePattern(obj,num)
	{
	if(IsEvent("EVE_DRUNK") == 1)
		{
		num = trunc(rand(1,1));
		}
	alternative(num)
		case(1)
			{
			CreatePattern1(obj);
			}
	}

task CreatePattern1(obj)
	{	
	let count = [35,35,30,25,25,20,20,15,10,10][rank];
	let spread = floor(1+rank*1/9);
	let speed = 1.25+floor(rank/9);
	let counter = floor(rand(0,count));
	while(!Obj_IsDeleted(obj))
		{
		counter+=1;
		if(counter%count == 0)
			{
			ascent(i0 in 0..spread)
				{
				i0 = i0-spread*0.5+0.5;
				let angle = 90+i0*50;
				ascent(i1 in 0..2)	
					{
					i1 = i1*2-1;
					CreateBulletA2(ObjMove_GetX(obj)+i1*6*cos(angle+90),ObjMove_GetY(obj)+i1*6*sin(angle+90),speed+2.5,90,-2.5/30,0,speed,PELLET,8,1.125,GenCol);
					}
				}
			}
		yield;
		}
	}

function GenCol
	{
	return min(SHOT_GRAY,SHOT_BLUE+Dif*2+trunc(rand(0,3))+IsEvent("EVE_POWER"));
	}