/*-----重力設定--------------------------*/
speed = 0; /* 動かないし！ */

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

/*-----キャラクタとの情報の取得---------------*/
playerDistance = point_distance(x,y,objPlayerDoll.x,objPlayerDoll.y);
playerDirection = point_direction(x,y,objPlayerDoll.x,objPlayerDoll.y);

/*-----モーション毎の処理--------------------*/
DAMAGE_ACTIVE = 0;
if(!ChangeMotion){
	switch(MotionNum){
		/* =========== 飛び出す向きの決定 =========== */
		case CHECK_DIR :
			move_contact_solid(270,-1);
			if(ARGUMENT[0]!=null) Direction = ARGUMENT[0];
			MotionChange(WAIT,0,1);
			break;
		case WAIT :
			if( collision_line( x-60*Direction,y-32,x-16*Direction,y-32, objPlayerDoll,0,1) ){
				playEnemySound(SOUND_ATTACK);
				MotionChange(ATTACK,0,1);
			}
			break;
		case ATTACK :
			if(KeyFrmNum==1 && KEYFRAME){
				with( collision_line( x-60*Direction,y-32,x-16*Direction,y-32, objPlayerDoll,0,1) ){
					if(!INV){
						DamageVoiceRandom_Mid();
						sound_play(sndHit01);
						if(!BINDED){
							if(Direction==other.Direction)	addDamage(10,FLYING_0, 0, 1, FLYING_0, 0, 2);
		                    else							addDamage(10,FLYING_1, 0, 1, FLYING_1, 0, 2);
							hspeed = 60*other.Direction;
							vspeed = -6;
						}
					}
				}
			}
			if(MOTIONEND) MotionChange(WAIT,0,1);
			break;
	}
}