
let MainSTG = GetMainStgScriptDirectory;
let img_effect = MainSTG~"cirno_system/img/effect.png"; // Effect Sheet




task StarOnBoss(objID, com1X, com2Y){ 
	
	//ObjMove_GetX(SnowSceneObject)
	//ObjMove_GetY(SnowSceneObject)
	
	let StarX = -400;
	let StarY = -400;
	
	let objxpos=StarX;
	let objypos=StarY;
	let object_time = 30;
	let obj_angle = 330;
	let osize = 0;
	let obj_sizeset = 0;
	let sizeinc = 5;
	let angleinc = 5;
	let fullsize = 0;

	ObjRender_SetBlendType(objID, BLEND_ALPHA);
	Obj_SetRenderPriority(objID, 0.39);
	ObjPrim_SetTexture(objID, img_effect);
	ObjSprite2D_SetSourceRect(objID, 128, 80, 256, 208);
	ObjSprite2D_SetDestRect(objID, -64, -64, 64, 64);
	
	
	ObjRender_SetAlpha(objID, 205);
	
	while(!Obj_IsDeleted(objID)){
		// 0 = Bigger; 1 = Smaller

		objxpos = GetCommonData(com1X, -400);
		objypos = GetCommonData(com2Y, -400);

		
		StarSize;
		ObjRender_SetX(objID, objxpos);
		ObjRender_SetY(objID, objypos);
		ObjRender_SetScaleXYZ(objID, osize/95, osize/95, 1);
		ObjRender_SetAngleZ(objID, obj_angle);
		//if(BossDead==1){Obj_Delete(obj);}
		yield;
	}
	
	task StarSize{
		let ax2 = 0.04;
		let bx2 = 1.35;
		if(fullsize==2){
			if(obj_sizeset==0){sizeinc+=ax2}
			if(obj_sizeset==1){sizeinc-=ax2}
			
			if(sizeinc<-bx2){obj_sizeset=0}
			if(sizeinc>bx2){obj_sizeset=1}
			
			obj_angle-=angleinc;
			
			if(angleinc<5){angleinc+=0.5}else{angleinc=5;}
			
			osize+=sizeinc;
		}
		if(fullsize!=2){obj_angle-=angleinc;angleinc-=0.06;}
		if(osize<145&&fullsize==0){osize+=5;}
		if(osize>144&&fullsize==0){
			fullsize=1;
			loop(55){yield;}
			sizeinc=0;
			angleinc=0;
			fullsize=2;
		}			
	}	
}