

function ShotA1(x,y,spd,dir,graphic,delay){
	let shot = CreateShotA1(x,y,spd,dir,graphic,delay);
	ObjShot_SetIntersectionEnable(shot,false);
	ObjRender_SetAlpha(shot,0);
	ManageShot;
	return shot;
		task ManageShot{
		DelayCloud(x,y,spd,dir,graphic,delay);
		wait(delay);
		ObjShot_SetIntersectionEnable(shot,true);
		ObjRender_SetAlpha(shot,255);
		}
	}
function ShotA2(x,y,spd,dir,acc,maxacc,graphic,delay){
	let shot = CreateShotA2(x,y,spd,dir,acc,maxacc,graphic,delay);
	ObjShot_SetIntersectionEnable(shot,false);
	ObjRender_SetAlpha(shot,0);
	ManageShot;
	return shot;
		task ManageShot{
		DelayCloud(x,y,spd,dir,graphic,delay);
		wait(delay);
		ObjShot_SetIntersectionEnable(shot,true);
		ObjRender_SetAlpha(shot,255);
		}
	
	}

function ShotOA1(obj,spd,dir,graphic,delay){
	let shot = CreateShotOA1(obj,spd,dir,graphic,delay);
	ObjShot_SetIntersectionEnable(shot,false);
	ObjRender_SetAlpha(shot,0);
	ManageShot;
	return shot;
		task ManageShot{
		DelayCloud(ObjMove_GetX(obj),ObjMove_GetY(obj),spd,dir,graphic,delay);
		wait(delay);
		ObjShot_SetIntersectionEnable(shot,true);
		ObjRender_SetAlpha(shot,255);
		}
	}

task DelayCloud(x,y,spd,dir,graphic,delay){
	 let img=GCSD~"shot/ZUNShot.png";
	 let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	 let s = 2;
	 let c = 0;
	 let px = 0;
	 let adc = false;
	 ObjPrim_SetTexture(obj,img);
	 ObjRender_SetBlendType(obj,BLEND_ALPHA);
	 ObjRender_SetAngleXYZ(obj,0,0,dir+90);
	 if(graphic>=33 && graphic <=47){ // ARROW_HEAD
	 px = graphic-33;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,16,16+px*16,34);
	 }
	 if(graphic>=48 && graphic <=62){ // SMALL_OUTER
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-48;
	 ObjSprite2D_SetSourceRect(obj,207+px*19,613,227+px*19,633);
	 }
	 if(graphic>=63 && graphic <=77){ // SMALL_BULLET
	 px = graphic-63;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,47,16+px*16,63);
	 }
	 if(graphic>=78 && graphic <=92){ // PELLET
	 px = graphic-78;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,64,16+px*16,80);
	 }
	 if(graphic>=93 && graphic <=105){ // KUNAIL
	 px = graphic-93;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,81,15+px*16,100);
	 }
	 if(graphic>=106 && graphic <=118){ // ICE_PELLET
	 px = graphic-106;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,101,16+px*16,120);
	 }
	 if(graphic>=119 && graphic <=132){ // AMULET
	 px = graphic-119;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,121,16+px*16,139);
	 }
	 if(graphic>=133 && graphic <=146){ // Suppository half fail
	 px = graphic-133;
	 ObjSprite2D_SetSourceRect(obj,0+px*32,330,16+px*32,349);
	 }
	 if(graphic>=147 && graphic <=161){ // DARK PELLET
	 px = graphic-147;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,140,16+px*16,160);
	 }
	 if(graphic>=162 && graphic <=176){ // SMALL STAR
	 px = graphic-162;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,161,16+px*16,177);
	 }
	 if(graphic>=177 && graphic <=183){ // GLOWING
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-177;
	 ObjSprite2D_SetSourceRect(obj,257+px*32,160,288+px*32,188);
	 }
	 if(graphic>=185 && graphic <=192){ // DOT
	 px = graphic-185;
	 ObjSprite2D_SetSourceRect(obj,1+px*11,245,11+px*11,255);
	 }
	 if(graphic>=193 && graphic <=197){ // LARGE_DOT
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-193;
	 ObjSprite2D_SetSourceRect(obj,90+px*16,241,106+px*16,255);
	 }
	 if(graphic>=198 && graphic <=204){ // RAINBOW_DOT
	 px = graphic-198;
	 ObjSprite2D_SetSourceRect(obj,0+px*8,191,8+px*8,199);
	 }
	 if(graphic>=205 && graphic <=213){ // RAINBOW_DOT
	 px = graphic-205;
	 ObjSprite2D_SetSourceRect(obj,0+px*8,199,8+px*8,207);
	 }
	 if(graphic>=214 && graphic <=228){ // MURASA
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-214;
	 ObjSprite2D_SetSourceRect(obj,0+px*16,310,16+px*16,324);
	 }
	 if(graphic>=229 && graphic <=235){ // LARGE_STAR
	 px = graphic-229;
	 ObjSprite2D_SetSourceRect(obj,257+px*32,0,288+px*32,31);
	 }
	 if(graphic>=236 && graphic <=242){ // LARGE_BULLET
	 px = graphic-236;
	 ObjSprite2D_SetSourceRect(obj,257+px*32,32,289+px*32,62);
	 }
	 if(graphic>=243 && graphic <=250){ // LARGE_BULLET
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-243;
	 ObjSprite2D_SetSourceRect(obj,0+px*32,358,32+px*32,387);
	 }
	 if(graphic>=251 && graphic <=257){ // BUTTERFLIES
	 px = graphic-251;
	 ObjSprite2D_SetSourceRect(obj,257+px*32,64,288+px*32,93);
	 }
	 if(graphic>=258 && graphic <=264){ // KNIFE
	 px = graphic-258;
	 ObjSprite2D_SetSourceRect(obj,256+px*32,93,288+px*32,127);
	 }
	 if(graphic>=265 && graphic <=271){ // OVAL
	 px = graphic-265;
	 ObjSprite2D_SetSourceRect(obj,256+px*32,127,288+px*32,158);
	 }
	 if(graphic>=272 && graphic <=275){ // BUBBLE
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-272;
	 ObjSprite2D_SetSourceRect(obj,256+px*64,190,320+px*64,254);
	 }
	 if(graphic>=276 && graphic <=279){ // BUBBLE
	 adc = true;
	 ObjRender_SetBlendType(obj,BLEND_ADD_RGB);
	 px = graphic-276;
	 ObjSprite2D_SetSourceRect(obj,256+px*64,257,320+px*64,321);
	 }
	 if(graphic>=280 && graphic <=283){ // DARK_BUBBLE
	 px = graphic-280;
	 ObjSprite2D_SetSourceRect(obj,512+px*64,190,576+px*64,254);
	 }
	 if(graphic>=284 && graphic <=287){ // DARK_BUBBLE
	 px = graphic-284;
	 ObjSprite2D_SetSourceRect(obj,512+px*64,257,576+px*64,321);
	 }
	 if(graphic>=300 && graphic <=306){ // HEARTH
	 px = graphic-300;
	 ObjSprite2D_SetSourceRect(obj,1+px*32,208,32+px*32,238);
	 }
	 if(graphic>=323 && graphic <=330){ // FUTO_ARROW
	 px = graphic-323;
	 ObjSprite2D_SetSourceRect(obj,518+px*32,17,542+px*32,57);
	 }
	 ObjSprite2D_SetDestCenter(obj);
	 ObjRender_SetPosition(obj,x,y,0);
	 while(s>=1){
	 ObjRender_SetScaleXYZ(obj,s,s,0);
	 s -= 1/delay;
	 c++;
	 ObjRender_SetAlpha(obj,c*255/(delay*1.25));
	 if(adc==true){ObjRender_SetColor(obj,c*255/(delay*1.25),c*255/(delay*1.25),c*255/(delay*1.25));}
	 yield;
	 }
	 Obj_Delete(obj);
	 }