


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

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

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



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





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

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

$npc2houkou=96
!if $100x<$122x
$npc2houkou=48
!endif


$npc2act=1
!picarea 122,256,$npc2houkou,64,48
!picarea 22,256,$npc2houkou,64,48
!godown #back
;-------------------------------------攻撃実行
#atcheck
!if $npc2act=1
!godown #atcft
!endif
!if $npc2act=2
$npc2act=3
!picarea 122,320,$npc2houkou,64,48
!picarea 22,320,$npc2houkou,64,48
!godown #back
!endif
!if $npc2act=3
$npc2act=4

!godown #back
!endif

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



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


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

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

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

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

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

!if $122x<$100x
$npc2houkou=96

!godown #mr
!godown #back
!endif
!if $122x>$100x
$npc2houkou=48

!godown #ml
!godown #back
!endif


!godown #back
#xy



!if $122y<$100y
$npc2houkou=0
!godown #md

!godown #back
!endif
!if $122y>$100y
$npc2houkou=144
!godown #mu

!godown #back
!endif

!godown #back


#ml
$122x-8

!godown #movego
#mr
$122x+8

!godown #movego
#mu
$122y-8

!godown #movego
#md
$122y+8

!godown #movego
;----------------------------
#movego
;
$npc2anime+$enpc2sx

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

!if $npc2anime>$rnd
$npc2anime=0
!picarea 122,$npc2anime,$npc2houkou,$enpc2sx,$enpc2sy
!picarea 22,$npc2anime,$npc2houkou,$enpc2sx,$enpc2sy
$npc2houkou=n

!godown #back
!endif
!picarea 122,$npc2anime,$npc2houkou,$enpc2sx,$enpc2sy
!picarea 22,$npc2anime,$npc2houkou,$enpc2sx,$enpc2sy
!picpos 122,$122x,$122y
!picpos 22,$122x,$122y
!picpos 23,$122x,$122y
;--------------------------------------------------------------
#back
!freturn2




































































