task ShotA1{
	let r = 270; let n = 7;
	while(!Obj_IsDeleted(objPlayer)){
		let S = GetVirtualKeyState(VK_SHOT);
		if(S == KEY_PUSH || S == KEY_HOLD && GetPlayerState() == STATE_NORMAL && IsPermitPlayerShot() && !IsPlayerSpellActive){
			CreatePlayerShotA1(GetPlayerX - 9, GetPlayerY, 13, r, 1, 1, 1);
			CreatePlayerShotA1(GetPlayerX + 5, GetPlayerY, 13, r, 1, 1, 1);
		}
		holdup(2);
	}
}

task Unfuckous{
	let r = 270; let H = []; let v = 0.8;
	
	//PolygonPShot(x, y, speed, angle, nSide, bpSide, special, graphic, dmg, pen)
	while(!Obj_IsDeleted(objPlayer)){
		H = [];
	
		let S = GetVirtualKeyState(VK_SHOT); 
		if(S == KEY_PUSH || S == KEY_HOLD && GetPlayerState() == STATE_NORMAL && !isFocus && IsPermitPlayerShot() && !IsPlayerSpellActive){
			H = PolygonPShot(GetPlayerX, GetPlayerY, 7, r, 4, 8, 1, 2, 1.5, 5);
			ascent(i in 0..length(H)){
				if(!Obj_IsDeleted(H[i])){
					ObjMove_SetAngularVelocity(H[i], v);
				}
			}
			
			v *= -1;
		}
		
		r = rand(0,360);
		holdup(10);
	}
}

task Needles(o){
	while(!Obj_IsDeleted(objPlayer)){
		let S = GetVirtualKeyState(VK_SHOT);
		if(S == KEY_PUSH || S == KEY_HOLD && GetPlayerState() == STATE_NORMAL && IsPermitPlayerShot() && isFocus && !IsPlayerSpellActive){
			let x = ObjRender_GetX(o);
			let y = ObjRender_GetY(o);
			
			CreatePlayerShotA1(x, y+8, 18, 270, 1.5, 1/2, 3);
		}
		holdup(2);
	}
}

//---------------------------------------------------------------------------------------------------------------------------
task squared(n){
	SetForbidPlayerSpell(true);
	SetPlayerInvincibilityFrame(210); SpellBlink();
	SetPlayerSpeed(1, 1);
	
	let hip = 0; let d = 40 + cos(hip)*40;
	
	let a; let r = 90; let s = 0; let m = GetAllEnemyID(); let v = 6;
	while(GetPlayerInvincibilityFrame() > 0){
		let A = []; let ok = 0;
		ascent(j in 0..2){
			ascent(i in 0..2){
				a = r + 360/2*i;
				
				A = A ~ [CreatePlayerShotA1(GetPlayerX + d*cos(a), GetPlayerY + d*sin(a), -1, a, 0, 28, 3)];
				ObjMove_AddPatternA2(A[ok], 15, -1, NO_CHANGE, 1/pi, v, 10); 
				ObjMove_AddPatternA2(A[ok], 55, 0, s, 1, 0, 20); void(A[ok], 55);
				ok++;
			} 
				
			s += 360/2 + 8;
		}
		
		r += (n + rand(-10, 10)); 
		holdup(60*1/60);
	}
	v *= -1; 
	
	task void(eu, n){
		ObjShot_SetGraphic(eu, 2); ObjShot_SetIntersectionEnable(eu, false);
		holdup(n); 
		ObjShot_SetGraphic(eu, 3); ObjShot_SetIntersectionEnable(eu, true); ObjShot_SetDamage(eu, 0.75);
	}
}

task SpellBlink{
	while(GetPlayerInvincibilityFrame() > 0){
		DeleteShotInCircle(TYPE_ALL, TYPE_ITEM, GetPlayerX, GetPlayerY, 160);
		
		ObjRender_SetColor(objPlayer, 236, 179, 255);
		holdup(5);
		ObjRender_SetColor(objPlayer, 204, 51, 255);
		holdup(5);
	}
	ObjRender_SetColor(objPlayer, 255, 255, 255);
	//Clearing Spell
	
	SetForbidPlayerShot(false); SetForbidPlayerSpell(false); 
	SetPlayerSpeed(4, 1.75); Obj_Delete(GetSpellManageObject());
	
	SetPlayerInvincibilityFrame(45);
}