let csd = GetCurrentScriptDirectory;
let imgCircle = csd~"img/Circle.png";
let imgReimu = csd~"img/Reimu.png";
let imgSpell = csd~"img/Spell.png";
let imgBarrier = csd~"img/player00.png";
let sound = [];
let shotData = csd~"ReimuShot.txt";
let shotcount = -1;
let optionShot = false;
let circleID = [];

#include "./default_system/Default_ShotConst.txt"

function GetDist(x1,y1,x2,y2){
	return ((x2-x1)^2+(y2-y1)^2)^0.5;
}

function GetAngle(x1,y1,x2,y2){
	return atan2(y2-y1,x2-x1);
}

function Load{
	LoadTexture(imgCircle);
	LoadTexture(imgReimu);
	LoadTexture(imgSpell);
	LoadTexture(imgBarrier);
	LoadPlayerShotData(shotData);

	//0 - shot
	//1 - bomb
	//2 - bomb2
	//3 - graze
	//4 - hit
	//5 - item

	let sndShot = ObjSound_Create;
	ObjSound_SetSoundDivision(sndShot,SOUND_SE);
	ObjSound_Load(sndShot,csd~"snd/se_plst00.wav");
	sound = sound ~ [sndShot];

	let sndBomb = ObjSound_Create;
	ObjSound_SetSoundDivision(sndBomb,SOUND_SE);
	ObjSound_Load(sndBomb,csd~"snd/se_slash.wav");
	sound = sound ~ [sndBomb];

	let sndBomb2 = ObjSound_Create;
	ObjSound_SetSoundDivision(sndBomb2,SOUND_SE);
	ObjSound_Load(sndBomb2,csd~"snd/se_power1.wav");
	sound = sound ~ [sndBomb2];

	let sndGraze = ObjSound_Create;
	ObjSound_SetSoundDivision(sndGraze,SOUND_SE);
	ObjSound_Load(sndGraze,csd~"snd/se_graze.wav");
	sound = sound ~ [sndGraze];

	let sndHit = ObjSound_Create;
	ObjSound_SetSoundDivision(sndHit,SOUND_SE);
	ObjSound_Load(sndHit,csd~"snd/se_pldead00.wav");
	sound = sound ~ [sndHit];

	let sndItem = ObjSound_Create;
	ObjSound_SetSoundDivision(sndItem,SOUND_SE);
	ObjSound_Load(sndItem,csd~"snd/se_item00.wav");
	sound = sound ~ [sndItem];
}

function PlaySound(sndID,volume){
	ObjSound_SetVolumeRate(sound[sndID],volume);
	ObjSound_Play(sound[sndID]);
}

task TShotFade(x,y){
	let fadeCount = 0;
	let fadeAlpha = 100;
	let fadeAngle = 0;
	let objShotfade = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjRender_SetBlendType(objShotfade,BLEND_ADD_RGB);
	ObjPrim_SetTexture(objShotfade,imgReimu);
	ObjSprite2D_SetSourceRect(objShotfade,20,278,36,290);
	ObjSprite2D_SetDestRect(objShotfade,-8,-6,8,6);
	loop(20){
		fadeAngle += 4.5;
		ObjRender_SetColor(objShotfade,fadeAlpha,fadeAlpha,fadeAlpha);
		ObjRender_SetPosition(objShotfade,x,y,0);
		ObjRender_SetAngleZ(objShotfade,fadeAngle-90);
		y -= 2;
		fadeAlpha -= 5;
		yield;
	}
	Obj_Delete(objShotfade);
}

task TShot(x,y,speed,graphic,damage){
	let objShot = ObjShot_Create(OBJ_SHOT);
	Obj_SetVisible(objShot,true);
	ObjMove_SetX(objShot,x);
	ObjMove_SetY(objShot,y);
	ObjMove_SetSpeed(objShot,speed);
	ObjMove_SetAngle(objShot,270+GetCommonData("ReimuAngle",0));
	ObjRender_SetAlpha(objShot,120);
	ObjShot_SetGraphic(objShot,graphic);
	ObjShot_SetDamage(objShot,damage);
	ObjShot_SetPenetration(objShot,1);
	ObjShot_Regist(objShot);
	while(!Obj_IsDeleted(objShot)){
		x = ObjMove_GetX(objShot);
		y = ObjMove_GetY(objShot);
		if (ObjMove_GetY(objShot) < -64){Obj_Delete(objShot);}
		yield;
	}
	TShotFade(x,y);
}
task TShot2(x,y,speed,graphic,damage){
	let objShot = ObjShot_Create(OBJ_SHOT);
	Obj_SetVisible(objShot,true);
	ObjMove_SetX(objShot,x);
	ObjMove_SetY(objShot,y);
	ObjMove_SetSpeed(objShot,speed);
	ObjMove_SetAngle(objShot,265+GetCommonData("ReimuAngle",0));
	ObjRender_SetAlpha(objShot,120);
	ObjShot_SetGraphic(objShot,graphic);
	ObjShot_SetDamage(objShot,damage);
	ObjShot_SetPenetration(objShot,1);
	ObjShot_Regist(objShot);
	while(!Obj_IsDeleted(objShot)){
		x = ObjMove_GetX(objShot);
		y = ObjMove_GetY(objShot);
		if (ObjMove_GetY(objShot) < -64){Obj_Delete(objShot);}
		yield;
	}
	TShotFade(x,y);
}
task TShot3(x,y,speed,graphic,damage){
	let objShot = ObjShot_Create(OBJ_SHOT);
	Obj_SetVisible(objShot,true);
	ObjMove_SetX(objShot,x);
	ObjMove_SetY(objShot,y);
	ObjMove_SetSpeed(objShot,speed);
	ObjMove_SetAngle(objShot,275+GetCommonData("ReimuAngle",0));
	ObjRender_SetAlpha(objShot,120);
	ObjShot_SetGraphic(objShot,graphic);
	ObjShot_SetDamage(objShot,damage);
	ObjShot_SetPenetration(objShot,1);
	ObjShot_Regist(objShot);
	while(!Obj_IsDeleted(objShot)){
		x = ObjMove_GetX(objShot);
		y = ObjMove_GetY(objShot);
		if (ObjMove_GetY(objShot) < -64){Obj_Delete(objShot);}
		yield;
	}
	TShotFade(x,y);
}

task TNeedle(x,y,angle,graphic){	//Old damage: 1.25
	let objNeedle = ObjShot_Create(OBJ_SHOT);
	ObjMove_SetPosition(objNeedle,x,y);
	ObjMove_SetSpeed(objNeedle,20);
	ObjMove_SetAngle(objNeedle,angle);
	ObjRender_SetAlpha(objNeedle,0);
	ObjShot_SetGraphic(objNeedle,graphic);
	ObjShot_SetDamage(objNeedle,1);
	ObjShot_SetPenetration(objNeedle,1);
	ObjShot_Regist(objNeedle);
	while(!Obj_IsDeleted(objNeedle)){
		x = ObjMove_GetX(objNeedle);
		y = ObjMove_GetY(objNeedle);
		yield;
	}
	TFadeNeedle(x,y,angle,graphic+2);
}

task TFadeNeedle(x,y,angle,graphic){
	let fadeAlpha = 255;
	let fadeAngle = rand(-10,10);
	let objFadeNeedle = ObjShot_Create(OBJ_SHOT);
	ObjMove_SetPosition(objFadeNeedle,x,y);
	ObjMove_SetSpeed(objFadeNeedle,2);
	ObjMove_SetAngle(objFadeNeedle,angle);
	ObjRender_SetAngleZ(objFadeNeedle,fadeAngle);
	ObjShot_SetGraphic(objFadeNeedle,graphic);
	ObjShot_SetDamage(objFadeNeedle,0);
	ObjShot_SetPenetration(objFadeNeedle,9999);
	ObjShot_Regist(objFadeNeedle);
	loop(10){
		ObjRender_SetColor(objFadeNeedle,fadeAlpha,fadeAlpha,fadeAlpha);
		fadeAlpha -= 25.5;
		yield;
	}
	Obj_Delete(objFadeNeedle);
}

task OptionShot{
	optionShot = true;
	yield;
	optionShot = false;
}

task TShoot{
	loop{
		if (GetVirtualKeyState(VK_SHOT) == KEY_PUSH || GetVirtualKeyState(VK_SHOT) == KEY_HOLD && shotcount == -1 && alive){
			shotcount = 0;
		}
		if (shotcount == 0){
			if (IsPermitPlayerShot){
				if(GetCommonData("ReimuAngle",0)==0 && GetCommonData("ReimuSplit",false)==false){
					TShot(GetPlayerX-10,GetPlayerY,20,1,3.5);
					TShot(GetPlayerX+10,GetPlayerY,20,1,3.5);
					TShot2(GetPlayerX-14,GetPlayerY,20,1,3.5);
					TShot3(GetPlayerX+14,GetPlayerY,20,1,3.5);
				}
				if(GetCommonData("ReimuAngle",0)==180){
					TShot(GetPlayerX-10,GetPlayerY,20,1,3.5);
					TShot(GetPlayerX+10,GetPlayerY,20,1,3.5);
					TShot2(GetPlayerX+14,GetPlayerY,20,1,3.5);
					TShot3(GetPlayerX-14,GetPlayerY,20,1,3.5);
				}
				if(GetCommonData("ReimuAngle",0)==-90){
					TShot(GetPlayerX,GetPlayerY-10,20,1,3.5);
					TShot(GetPlayerX,GetPlayerY+10,20,1,3.5);
					TShot2(GetPlayerX,GetPlayerY+14,20,1,3.5);
					TShot3(GetPlayerX,GetPlayerY-14,20,1,3.5);
				}
				if(GetCommonData("ReimuAngle",0)==90){
					TShot(GetPlayerX,GetPlayerY-10,20,1,3.5);
					TShot(GetPlayerX,GetPlayerY+10,20,1,3.5);
					TShot2(GetPlayerX,GetPlayerY-14,20,1,3.5);
					TShot3(GetPlayerX,GetPlayerY+14,20,1,3.5);
				}
				
				if(GetCommonData("ReimuSplit",false)==true){
					TShot(GetPlayerX-10,GetPlayerY,20,1,3.5);
					TShot(GetPlayerX+10,GetPlayerY,20,1,3.5);
					
					TShot(GetPlayerX-10+270,GetPlayerY,20,1,3.5);
					TShot(GetPlayerX+10+270,GetPlayerY,20,1,3.5);
				}
				
				//OptionShot;
				PlaySound(0,20);
			}
		}
		if (shotcount >= 0){
			shotcount ++;
		}
		if (shotcount >= 3){
			shotcount = -1;
		}
		yield;
	}
}

task TOptionBack(x1,y1,x2,y2){
	let px = GetPlayerX;
	let py = GetPlayerY;
	let opAngle = 0;
	let destx;
	let desty;
	let dist;
	let dir;
	let opCount = 0;
	let objOption2 = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriorityI(objOption2,29);
	ObjRender_SetBlendType(objOption2,BLEND_ADD_RGB);
	ObjRender_SetColor(objOption2,128,128,128);
	ObjPrim_SetTexture(objOption2,imgReimu);
	ObjSprite2D_SetSourceRect(objOption2,176,278,191,293);
	ObjSprite2D_SetDestRect(objOption2,-7,-7,8,8);
	ObjRender_SetScaleXYZ(objOption2,1.5,1.5,1);
	ObjRender_SetPosition(objOption2,px,py,0);
	ObjRender_SetAlpha(objOption2,0);
	while(!Obj_IsDeleted(objOption2)){
		px = GetPlayerX;
		py = GetPlayerY;
		if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD){
			destx = px+x2;
			desty = py+y2;
		}
		else{
			destx = px+x1;
			desty = py+y1;
		}
		ObjRender_SetAngleZ(objOption2,opAngle);
		let x = ObjRender_GetX(objOption2);
		let y = ObjRender_GetY(objOption2);
		dist = GetDist(x,y,destx,desty);
		dir = GetAngle(x,y,destx,desty);
		x += 0.25*dist*cos(dir);
		y += 0.25*dist*sin(dir);
		opAngle -= 5;
		ObjRender_SetPosition(objOption2,x,y,0);
		yield;
	}
}

task TOption(x1,y1,x2,y2,dir1,dir2){
	let px = GetPlayerX;
	let py = GetPlayerY;
	let opAngle = 0;
	let destx;
	let desty;
	let dist;
	let dir;
	let opCount = 0;
	let objOption = ObjPrim_Create(OBJ_SPRITE_2D);
	Obj_SetRenderPriorityI(objOption,30);
	ObjRender_SetBlendType(objOption,BLEND_ALPHA);
	ObjPrim_SetTexture(objOption,imgReimu);
	ObjSprite2D_SetSourceRect(objOption,97,145,112,160);
	ObjSprite2D_SetDestRect(objOption,-7,-7,8,8);
	ObjRender_SetPosition(objOption,px,py,0);
	ObjRender_SetAlpha(objOption,0);
	TOptionBack(x1,y1,x2,y2);
	while(!Obj_IsDeleted(objOption)){
		px = GetPlayerX;
		py = GetPlayerY;
		if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD){
			destx = px+x2;
			desty = py+y2;
		}
		else{
			destx = px+x1;
			desty = py+y1;
		}
		ObjRender_SetAngleZ(objOption,opAngle);
		let x = ObjRender_GetX(objOption);
		let y = ObjRender_GetY(objOption);
		dist = GetDist(x,y,destx,desty);
		dir = GetAngle(x,y,destx,desty);
		x += 0.25*dist*cos(dir);
		y += 0.25*dist*sin(dir);
		opAngle += 5;
		ObjRender_SetPosition(objOption,x,y,0);
		if (optionShot){
			if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD){
				TNeedle(ObjRender_GetX(objOption)-4,ObjRender_GetY(objOption),270,2);
				TNeedle(ObjRender_GetX(objOption)+4,ObjRender_GetY(objOption),270,2);
			}
			else{
				TNeedle(ObjRender_GetX(objOption)-4,ObjRender_GetY(objOption),dir1,3);
				TNeedle(ObjRender_GetX(objOption)+4,ObjRender_GetY(objOption),dir2,3);
			}
		}
		yield;
	}
}

task TBlink{
	let duration = GetPlayerInvincibilityFrame;
	let frame = GetPlayerInvincibilityFrame;
	let blinkFrame = 0;
	loop(duration){
		if (frame != GetPlayerInvincibilityFrame){break;}
		frame --;
		alternative(blinkFrame)
		case(0,1){
			ObjRender_SetColor(objPlayer,0,0,255);
		}
		case(2,3){
			ObjRender_SetColor(objPlayer,255,255,255);
		}
		blinkFrame ++;
		blinkFrame %= 4;
		yield;
	}
	ObjRender_SetColor(objPlayer,255,255,255);
}

task TCircle{
	let radius = 1;
	let red = 255;
	let green = 128;
	let blue = 128;
	let duration = GetPlayerInvincibilityFrame;
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);

	ascent(i in 0..length(circleID)){
		Obj_Delete(circleID[i]);
	}
	circleID = circleID ~ [obj];

	Obj_SetRenderPriority(obj,0.6);
	ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjPrim_SetVertexCount(obj,130);
	ObjPrim_SetTexture(obj,imgCircle);
	ascent(i in 0..65){
		ObjPrim_SetVertexUVT(obj,(i*2),i*4*(403/64),0);
		ObjPrim_SetVertexUVT(obj,(i*2)+1,i*4*(403/64),65);
	}
	TAlpha;
	TRotate;
	loop(duration){
		ascent(i in 0..65){
			ObjPrim_SetVertexPosition(obj,(i*2),radius*150*cos(i*360/64),radius*150*sin(i*360/64),0);
			ObjPrim_SetVertexPosition(obj,(i*2)+1,radius*110*cos(i*360/64),radius*110*sin(i*360/64),0);
		}
		ObjRender_SetPosition(obj,GetPlayerX,GetPlayerY,0);
		radius -= (1/duration);
		yield;
	}
	Obj_Delete(obj);

	task TAlpha{
		let cAlpha = 0;
		loop(80){
			cAlpha += 2.8;
			ascent(i in 0..130){
				ObjPrim_SetVertexColor(obj,i,(cAlpha/255)*red,(cAlpha/255)*green,(cAlpha/255)*blue);
			}
			yield;
		}
	}
	task TRotate{
		let cAngle = 0;
		while(!Obj_IsDeleted(obj)){
			ObjRender_SetAngleZ(obj,cAngle);
			cAngle -= 2;
			if (cAngle < 0){cAngle += 360;}
			yield;
		}
	}
}

task TDraw{
	let phase = 0;
	let frame0 = 0;
	let frame1 = 0;
	let frame2 = 0;
	let left = false;
	ObjPrim_SetTexture(objPlayer,imgReimu);
	loop{
		if (GetVirtualKeyState(VK_LEFT) == KEY_PUSH ||
		GetVirtualKeyState(VK_LEFT) == KEY_HOLD ||
		GetVirtualKeyState(VK_RIGHT) == KEY_PUSH ||
		GetVirtualKeyState(VK_RIGHT) == KEY_HOLD){
			phase = 1;
		}
		else{
			if (phase == 1 || phase == 2){
				phase = 2;
			}
			else{
				phase = 0;
			}
		}
		alternative(phase)
		case(0){phase0;}
		case(1){phase1;}
		case(2){phase2;}
		ObjSprite2D_SetDestRect(objPlayer,-16,-24,16,24);
		//ObjSprite2D_SetDestCenter(objPlayer);
		ObjRender_SetAngleZ(objPlayer,GetCommonData("ReimuAngle",0));
		yield;
	}
	function phase0{
		frame1 = 0;
		frame2 = 0;
		alternative(frame0)
		case(0,1,2,3,4){ObjSprite2D_SetSourceRect(objPlayer,0,0,32,48);}
		case(5,6,7,8,9){ObjSprite2D_SetSourceRect(objPlayer,32,0,64,48);}
		case(10,11,12,13,14){ObjSprite2D_SetSourceRect(objPlayer,64,0,96,48);}
		case(15,16,17,18,19){ObjSprite2D_SetSourceRect(objPlayer,96,0,128,48);}
		case(20,21,22,23,24){ObjSprite2D_SetSourceRect(objPlayer,128,0,160,48);}
		case(25,26,27,28,29){ObjSprite2D_SetSourceRect(objPlayer,160,0,192,48);}
		case(30,31,32,33,34){ObjSprite2D_SetSourceRect(objPlayer,192,0,224,48);}
		case(35,36,37,38,39){ObjSprite2D_SetSourceRect(objPlayer,224,0,256,48);}
		frame0 ++;
		if (frame0 >= 40){frame0 = 0;}
	}
	function phase1{
		frame0 = 0;
		frame2 = 0;
		if (GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD){
			alternative(frame1)
			case(0){ObjSprite2D_SetSourceRect(objPlayer,32,96,64,144);}
			case(1){ObjSprite2D_SetSourceRect(objPlayer,64,96,96,144);}
			case(2){ObjSprite2D_SetSourceRect(objPlayer,96,96,128,144);}
			case(3,4,5,6,7){ObjSprite2D_SetSourceRect(objPlayer,128,96,160,144);}
			case(8,9,10,11,12){ObjSprite2D_SetSourceRect(objPlayer,160,96,192,144);}
			case(13,14,15,16,17){ObjSprite2D_SetSourceRect(objPlayer,192,96,224,144);}
			case(18,19,20,21,22){ObjSprite2D_SetSourceRect(objPlayer,224,96,256,144);}
			left = false;
		}
		else if (GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD){
			alternative(frame1)
			case(0){ObjSprite2D_SetSourceRect(objPlayer,32,48,64,96);}
			case(1){ObjSprite2D_SetSourceRect(objPlayer,64,48,96,96);}
			case(2){ObjSprite2D_SetSourceRect(objPlayer,96,48,128,96);}
			case(3,4,5,6,7){ObjSprite2D_SetSourceRect(objPlayer,128,48,160,96);}
			case(8,9,10,11,12){ObjSprite2D_SetSourceRect(objPlayer,160,48,192,96);}
			case(13,14,15,16,17){ObjSprite2D_SetSourceRect(objPlayer,192,48,224,96);}
			case(18,19,20,21,22){ObjSprite2D_SetSourceRect(objPlayer,224,48,256,96);}
			left = true;
		}
		frame1 ++;
		if (frame1 >= 23){frame1 = 3;}
	}
	function phase2{
		frame0 = 0;
		frame1 = 0;
		if (left){
			alternative(frame2)
			case(0){ObjSprite2D_SetSourceRect(objPlayer,96,48,128,96);}
			case(1){ObjSprite2D_SetSourceRect(objPlayer,64,48,96,96);}
			case(2){ObjSprite2D_SetSourceRect(objPlayer,32,48,64,96);}
			case(3){
				phase = 0;
				phase0;
			}
		}
		else{
			alternative(frame2)
			case(0){ObjSprite2D_SetSourceRect(objPlayer,96,96,128,144);}
			case(1){ObjSprite2D_SetSourceRect(objPlayer,64,96,96,144);}
			case(2){ObjSprite2D_SetSourceRect(objPlayer,32,96,64,144);}
			case(3){
				phase = 0;
				phase0;
			}
		}
		frame2 ++;
	}
}

task TGrazeEffect{
	let px = GetPlayerX;
	let py = GetPlayerY;
	let x = px;
	let y = py;
	let scale = 1;
	let direction = rand(0,360);

	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(obj,imgReimu);
	ObjRender_SetBlendType(obj,BLEND_ALPHA);
	ObjSprite2D_SetSourceRect(obj,138,351,146,359);
	ObjSprite2D_SetDestRect(obj,-4,-4,4,4);
	ObjRender_SetAngleZ(obj,rand(0,360));
	ObjRender_SetAlpha(obj,192);
	ObjRender_SetPosition(obj,px,py,0);
	loop(15){
		x += 5*cos(direction);
		y += 5*sin(direction);
		ObjRender_SetPosition(obj,x,y,0);

		scale -= 0.0667;
		ObjRender_SetScaleXYZ(obj,scale,scale,1);

		yield;
	}

	Obj_Delete(obj);
}

task TDeathEffect{	//10,322,74,386
	let px = GetPlayerX;
	let py = GetPlayerY;
	let scale = 1;
	let alpha = 255;
	let frame = 0;

	let obj = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(obj,imgReimu);
	ObjRender_SetBlendType(obj,BLEND_ALPHA);
	ObjSprite2D_SetSourceRect(obj,10,322,74,386);
	ObjSprite2D_SetDestRect(obj,-32,-32,32,32);
	ObjRender_SetPosition(obj,px,py,0);
	loop(25){
		frame ++;
		scale += 0.16;
		ObjRender_SetScaleXYZ(obj,scale,scale,1);
		ObjRender_SetAlpha(obj,alpha);
		alpha -= 10.2;

		yield;
	}
	Obj_Delete(obj);
}

task THitbox{
	let hbAngle = 0;
	let hbScale = 0;
	let objHitbox = ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(objHitbox,imgReimu);
	ObjRender_SetBlendType(objHitbox,BLEND_ALPHA);
	ObjSprite2D_SetSourceRect(objHitbox,192,192,255,255);
	ObjSprite2D_SetDestRect(objHitbox,-32,-32,32,32);
	loop{
		if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH){
			hbScale = 0;
			hbAngle = 0;
		}
		if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD && hbScale < 100){
			hbScale += 10;
		}
		if (GetVirtualKeyState(VK_SLOWMOVE) == KEY_PULL || GetVirtualKeyState(VK_SLOWMOVE) == KEY_FREE && hbScale > 0){
			hbScale -= 10;
		}
		if(GetCommonData("HideHitbox",false)==true){ObjRender_SetAlpha(objHitbox,0);}
		if(GetCommonData("HideHitbox",false)==false){ObjRender_SetAlpha(objHitbox,255);}
		ObjRender_SetPosition(objHitbox,GetPlayerX,GetPlayerY,0);
		ObjRender_SetAngleZ(objHitbox,hbAngle);
		ObjRender_SetScaleXYZ(objHitbox,hbScale*0.01,hbScale*0.01,1);
		hbAngle += 2;
		yield;
	}
}