function TCheckHp(obj){
	if(ObjEnemy_GetInfo(obj,INFO_LIFE)<=0){
		break;
	}
}

task TEnemyHitboxStart(obj,n){
	ObjEnemy_SetDamageRate(obj,0,0);
	loop(n){yield;}
	ObjEnemy_SetDamageRate(obj,100,100);
}

function getAtanAngle(obj,obj2){
	let angle=atan2(ObjMove_GetY(obj2)-ObjMove_GetY(obj),ObjMove_GetX(obj2)-ObjMove_GetX(obj));
	return angle;
}

function wait(n){loop(n){yield;}}

function GetClipMinX{
	return 0;
}

function GetClipMinY{
	return 0;
}

function GetClipMaxX{
	return GetStgFrameWidth;
}

function GetClipMaxY{
	return GetStgFrameHeight;
}

function ShootShape(spawnX, spawnY, v, angle, num, bside, graphic, delay) {
	ascent(i in 0..num) {
		let sx = spawnX+cos(angle+i*360/num); let sy = spawnY+sin(angle+i*360/num); let sxN = spawnX+cos(angle+(i+1)*360/num); let syN = spawnY+sin(angle+(i+1)*360/num);
		CreateShotA1(spawnX, spawnY, v*(((sx-spawnX)^2+(sy-spawnY)^2)^0.5), atan2(sy-spawnY,sx-spawnX), graphic, delay);
		ascent(j in 0..bside) {
			let toAngle = atan2(syN-sy,sxN-sx); let toDist = (((sxN-sx)^2+(syN-sy)^2)^0.5); let sx2 = sx+toDist/bside*j*cos(toAngle); let sy2 = sy+toDist/bside*j*sin(toAngle);
			CreateShotA1(spawnX, spawnY, v*(((sx2-spawnX)^2+(sy2-spawnY)^2)^0.5), atan2(sy2-spawnY,sx2-spawnX), graphic, delay);
		}
	}
}

task SetBulletTrailDelay(obj,time,delay,c,c2,shrink){
	let img=GCSD~"img/trail.png";
	loop(delay){ yield; }
	TObj;
	task TObj{
		while(!Obj_IsDeleted(obj)){
			let d=ObjPrim_Create(OBJ_SPRITE_2D);
			ObjRender_SetBlendType(d,BLEND_ADD_RGB);
			ObjPrim_SetTexture(d,img);
			ObjSprite2D_SetSourceRect(d,0,0,32,32);
			ObjSprite2D_SetDestCenter(d);
			ObjRender_SetPosition(d,ObjMove_GetX(obj),ObjMove_GetY(obj),0);
			SetColor(d,c,c2);
			TAction(d);
			yield;
			}
		}
	task TAction(o){
		let scale=1;
		let s=1;
		loop(time){
			if(shrink==true){
			ObjRender_SetScaleXYZ(o,scale,scale,0);
			scale-=(s/time);
				}
			yield;
			}
		Obj_Delete(o);
		}
	}