/*-----重力設定--------------------------*/
speed = 0; /* 動かないし！ */
gravity = 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);

/*-----モーション毎の処理--------------------*/
if(ARGUMENT[0] != null) image_angle = ARGUMENT[0];
Process[ProcessNum[PARTS_WIRE]].PartPicture		= (view_xview+image_angle) mod 9;
Process[ProcessNum[PARTS_WIRE]].image_alpha		= (400-playerDistance)/400;
Process[ProcessNum[PARTS_BLOOD]].image_alpha	= Blood;
DAMAGE_ACTIVE = 0;
if(!ChangeMotion){
	switch(MotionNum){
		/* =========== 飛び出す向きの決定 =========== */
		case WAIT :
			check = false;
			with(objPlayerDoll){
				other.check = (!BINDED && !INV && MotionNum!=WALK && MotionNum!=STAND_0 && MotionNum!=STAND_1);
			}
			if(check && playerDistance < 48){
				Blood = 1;
				playEnemySound(SOUND_FINISH);
				Flash(c_red,0.3,0.05);
				with(objPlayerDoll){
					hspeed = (x - xprevious)/2;
					if(180 < other.playerDirection && other.playerDirection < 359){
						addDamage(200,DAMAGE_0, 0, 1, DOWN_1, 0, 2); 
						Macro_CutHead();
					}else if(45 < other.playerDirection && other.playerDirection < 135){
						CryingVoiceRandom_High();
						tmp_st = global.PlayerST-30;
						addDamage(50,DOWN_1, 0, 1, DOWN_1, 0, 2);
						global.PlayerST = tmp_st;
						global.GameOver = true;
						Macro_CutFoot2_Above();
					}else{
						addDamage(200,DAMAGE_0, 0, 1, DOWN_1, 0, 2);
					}
					Fluid(x,y,COLOR_BLOOD,20,2,10,80,20,0.5);
				}
				MotionChange(FINISH,0,1);
			}
			break;
		case FINISH :
			break;
		case DEAD_MOTION : 
			effect_create_above(ef_ring,x,y,0,c_white);
			instance_destroy();
			break;
	}
}