if(room == Stage5_Boss_Battle3_Demo) exit;

with(objEnemyEdit){ if(Edit_Play) exit; }

with(objBoat){
	if(x < 9600) exit;
}

if(Direction){ (PartsParam(PARTS_EYE)).image_angle =  playerDirection + 180; }
else{          (PartsParam(PARTS_EYE)).image_angle = -playerDirection; }

for(strID=0;strID<strNum;strID+=1)for(i=0;i<strLen;i+=1){ (PartsParam(PARTS_STRING[strID,i])).PartPicture = ( StringAnimation*(0.1*(i+1))*(0.1*(strID+1)) ) mod 11; }
for(strID=0;strID<strNum;strID+=1){ (PartsParam(PARTS_STRING[strID,strLen-1])).PartPicture = 12; }
StringAnimation += random(5.0);

/*------触手オートモーション切り替え-------*/
for(strID=0;strID<strNum;strID+=1){
	if((PartsParam(PARTS_STRING[strID,0])).image_angle == 270){
		if(!STRING_IS_AUTO_ANIME[strID]){
			STRING_IS_AUTO_ANIME[strID] = 1;
			for(i=0;i<strLen;i+=1){
				if(Direction) STRING_ANG[strID,i] = (PartsParam(PARTS_STRING[strID,i])).preAngle;
				else          STRING_ANG[strID,i] =-(PartsParam(PARTS_STRING[strID,i])).preAngle + 180;
				STRING_ANG_SPD[strID,i] = 0;

				STRING_HSPD[strID,i] = 0; STRING_VSPD[strID,i] = 0;
				STRING_HACC[strID,i] = 0; STRING_VACC[strID,i] = 0;

				STRING_PRE_HSPD[strID,i] = STRING_HSPD[strID,i];
				STRING_PRE_VSPD[strID,i] = STRING_VSPD[strID,i];

				STRING_XPOS[strID,i] = (PartsParam(PARTS_STRING[strID,i])).xprevious;
				STRING_YPOS[strID,i] = (PartsParam(PARTS_STRING[strID,i])).yprevious;
				STRING_PRE_XPOS[strID,i] = STRING_XPOS[strID,i];
				STRING_PRE_YPOS[strID,i] = STRING_YPOS[strID,i];
			}
		}
	}else STRING_IS_AUTO_ANIME[strID] = 0;
}

for(strID=0;strID<strNum;strID+=1)for(i=0;i<strLen;i+=1){
	if(!STRING_IS_AUTO_ANIME[strID]) continue;
	STRING_ANG_SPD[strID,i] += (-0.5 + random(1)) * (i+1) * StringActivity;

	STRING_ANG_SPD[strID,i] += (   -STRING_HACC[strID,i] ) * cos(degtorad(STRING_ANG[strID,i]+90));
	STRING_ANG_SPD[strID,i] -= (0.9-STRING_VACC[strID,i] ) * cos(degtorad(STRING_ANG[strID,i]   ));
	if(STRING_ANG_SPD[strID,i] >  5) STRING_ANG_SPD[strID,i] =  5;
	if(STRING_ANG_SPD[strID,i] < -5) STRING_ANG_SPD[strID,i] = -5;

	STRING_ANG[strID,i] += STRING_ANG_SPD[strID,i];
	if(Direction) (PartsParam(PARTS_STRING[strID,i])).image_angle = STRING_ANG[strID,i];
	else          (PartsParam(PARTS_STRING[strID,i])).image_angle =-STRING_ANG[strID,i] + 180;
}

for(strID=0;strID<strNum;strID+=1)for(i=0;i<strLen;i+=1){
	if(!STRING_IS_AUTO_ANIME[strID]) continue;

	with(PartsParam(PARTS_STRING[strID,i])){
		if(other.i==0){
			x = parent.x + lengthdir_x(50,270+parent.image_angle)*Direction;
			y = parent.y + lengthdir_y(50,270+parent.image_angle);
		}else{
			x = parent.x + lengthdir_x(44,parent.image_angle)*Direction;
			y = parent.y + lengthdir_y(44,parent.image_angle);
		}
		tmp_col = 255 - other.strID*15;
		image_blend = make_color_rgb(tmp_col,tmp_col,tmp_col);
	}

	STRING_HSPD[strID,i] = ((PartsParam(PARTS_STRING[strID,i])).x - STRING_PRE_XPOS[strID,i]);
	STRING_VSPD[strID,i] = ((PartsParam(PARTS_STRING[strID,i])).y - STRING_PRE_YPOS[strID,i]);
	STRING_HACC[strID,i] = STRING_HSPD[strID,i]-STRING_PRE_HSPD[strID,i];
	STRING_VACC[strID,i] = STRING_VSPD[strID,i]-STRING_PRE_VSPD[strID,i];

	STRING_PRE_HSPD[strID,i] = STRING_HSPD[strID,i];
	STRING_PRE_VSPD[strID,i] = STRING_VSPD[strID,i];
	STRING_PRE_XPOS[strID,i] = (PartsParam(PARTS_STRING[strID,i])).x;
	STRING_PRE_YPOS[strID,i] = (PartsParam(PARTS_STRING[strID,i])).y;
}

if(AngleBlurOff){
	for(i=0;i<PartsNumber;i+=1) with(ProcessNum[i]){ preAngle = image_angle; }
}
AngleBlurOff = false;