


!if $npc4houkou=dead
!godown #back
!endif
;

;---------------------------------
!if $npc4act>0
!godown #atcheck
!endif
;-----------------------------------

;
!if $npc4houkou=48
!godown #ml
!endif
!if $npc4houkou=96
!godown #mr
!endif
!if $npc4houkou=144
!godown #mu
!endif
!if $npc4houkou=0
!godown #md
!endif
;
;



;---------------------------------攻撃待機





;!getpiccolorset 160
$rnd=$127x
$rnd2=$127y
$rnd+16
$rnd2+24
!getpiccolorr $rnd,$rnd2
!if $rval<100
!godown #emukic
!endif
!godown #movec

;-------------------------------------------
#emukic

$npc4houkou=96
!if $100x<$127x
$npc4houkou=48
!endif


$npc4act=1
!picarea 127,256,$npc4houkou,64,48
!picarea 27,256,$npc4houkou,64,48
!godown #back
;-------------------------------------攻撃実行
#atcheck
!if $npc4act=1
!godown #atcft
!endif
!if $npc4act=2
$npc4act=3
!picarea 127,320,$npc4houkou,64,48
!picarea 27,320,$npc4houkou,64,48
!godown #back
!endif
!if $npc4act=3
$npc4act=4

!godown #back
!endif

$rnd=$127x
$rnd2=$127y
$rnd+16
$rnd2+24
!getpiccolorr $rnd,$rnd2
!if $rval<100
!picoff 27
!picoff 127
!file gameover.asdf,#ushi
!stop
!endif
$npc4act=0
!godown #back
;
;-----------------------------------------------
#atcft
$npc4act=2
!rnd $rnd,3
!if $rnd=0
!wavset 34,ushiat1.wav
!endif
!if $rnd=1
!wavset 34,ushiat2.wav
!endif
!if $rnd=2
!wavset 34,ushiat3.wav
!endif
!wav 34,0
!godown #back
;---------------------------------------
;
;------------------------
#movec
;!if $npc4xy=0
;$npc4xy=1
;!godown #xy
;!endif
;$npc4xy=0



!if $127x=$100x
!if $127y<$100y
$npc4houkou=0
!godown #md
!godown #back
!endif
!if $127x=$100x
!if $127y>$100y
$npc4houkou=144
!godown #mu
!godown #back
!endif


!if $127y=$100y
!if $127x<$100x
$npc4houkou=96
!godown #mr
!godown #back
!endif
!if $127y=$100y
!if $127x>$100x
$npc4houkou=48
!godown #ml
!godown #back
!endif

;-------------------------------距離計測
!if $127x<$100x
$rnd=$100x
$rnd-$127x
!godown #xgo
!endif
!if $127x>$100x
$rnd=$127x
$rnd-$100x
!godown #xgo
!endif

#xgo
!if $127y<$100y
$rnd2=$100y
$rnd2-$127y
!godown #ygo
!endif
!if $127y>$100y
$rnd2=$127y
$rnd2-$100y
!godown #ygo
!endif

#ygo
!if $rnd>$rnd2
!godown #yx
!endif
!if $rnd<$rnd2
!godown #xy
!endif

;!godown #back
;------------------------------------
#yx

!if $127x<$100x
$npc4houkou=96

!godown #mr
!godown #back
!endif
!if $127x>$100x
$npc4houkou=48

!godown #ml
!godown #back
!endif


!godown #back
#xy



!if $127y<$100y
$npc4houkou=0
!godown #md

!godown #back
!endif
!if $127y>$100y
$npc4houkou=144
!godown #mu

!godown #back
!endif

!godown #back

#ml
$127x-8

!godown #movego
#mr
$127x+8

!godown #movego
#mu
$127y-8

!godown #movego
#md
$127y+8

!godown #movego
;----------------------------
#movego
;
$npc4anime+$enpc4sx

$rnd=$enpc4sx
$rnd*3
;$rnd-1

!if $npc4anime>$rnd
$npc4anime=0
!picarea 127,$npc4anime,$npc4houkou,$enpc4sx,$enpc4sy
!picarea 27,$npc4anime,$npc4houkou,$enpc4sx,$enpc4sy
$npc4houkou=n

!godown #back
!endif
!picarea 127,$npc4anime,$npc4houkou,$enpc4sx,$enpc4sy
!picarea 27,$npc4anime,$npc4houkou,$enpc4sx,$enpc4sy
!picpos 127,$127x,$127y
!picpos 27,$127x,$127y
!picpos 28,$127x,$127y
;--------------------------------------------------------------
#back
!freturn2




































































