[Command]
name="AI0"
command=a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time=0
[Command]
name="AI1"
command=b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time=0
[Command]
name="AI2"
command=c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time=0
[Command]
name="AI3"
command=x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time=0
[Command]
name="AI4"
command=y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time=0
[Command]
name="AI5"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI6"
command=s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time=0
[Command]
name="AI7"
command=F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time=0
[Command]
name="AI8"
command=D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time=0
[Command]
name="AI9"
command=B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time=0
[Command]
name="AI10"
command=U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time=0
[Command]
name="AI11"
command=a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time=0
[Command]
name="AI12"
command=c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time=0
[Command]
name="AI13"
command=x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time=0
[Command]
name="AI14"
command=y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time=0
[Command]
name="AI15"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI16"
command=s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time=0
[Command]
name="AI17"
command=a,B,c,x,y,z,s,B,D,F,U,a,b,c,x,y,z,s,s
time=0
[Command]
name="AI18"
command=a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time=0
[Command]
name="AI19"
command=b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time=0
[Command]
name="AI20"
command=c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time=0
[Command]
name="AI21"
command=x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time=0
[Command]
name="AI22"
command=y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time=0
[Command]
name="AI23"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI24"
command=s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time=0
[Command]
name="AI25"
command=F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time=0
[Command]
name="AI26"
command=D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time=0
[Command]
name="AI27"
command=B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time=0
[Command]
name="AI28"
command=U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time=0
[Command]
name="AI29"
command=a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time=0
[Command]
name="AI30"
command=c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time=0
[Command]
name="AI31"
command=x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time=0
[Command]
name="AI32"
command=y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time=0
[Command]
name="AI33"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI34"
command=s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time=0
[Command]
name="AI35"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI36"
command=z,z,z,z,z,z,a,a,a,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI37"
command=z,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,z,z,z
time=0
[Command]
name="AI38"
command=z,z,z,z,z,a,a,a,z,z,z,z,z,a,a,a,z,z,z
time=0
[Command]
name="AI39"
command=z,z,z,z,z,a,a,a,z,z,z,z,z,z,a,a,z,z,z
time=0
[Command]
name="AI40"
command=z,z,z,z,a,a,a,z,z,z,z,a,z,z,a,a,z,z,z
time=0
[Command]
name="AI41"
command=z,z,z,a,z,z,z,z,z,z,z,z,z,a,a,z,z,z,z
time=0
[Command]
name="AI42"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI43"
command=z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,a,a,z
time=0
[Command]
name="AI44"
command=z,z,a,a,a,a,z,z,z,z,z,z,z,z,z,a,a,a,z
time=0
[Command]
name="AI45"
command=z,z,z,z,z,z,a,a,z,z,z,z,z,a,a,a,a,z,z
time=0
[Command]
name="AI46"
command=z,z,z,z,z,z,z,z,a,a,a,a,a,a,z,z,z,z,z
time=0
[Command]
name="AI47"
command=z,z,z,a,a,a,a,z,z,z,z,z,z,z,z,z,z,z,z
time=0
[Command]
name="AI48"
command=z,z,z,z,z,a,a,a,z,z,z,a,a,a,z,z,a,z,a
time=0
[Command]
name="AI49"
command=z,z,z,z,a,a,a,z,z,z,z,z,a,a,a,z,z,z,z
time=0
[Command]
name="AI50"
command=z,z,z,a,a,z,z,z,z,z,z,z,z,z,a,a,z,z,z
time=0

[Defaults]
command.time=15
command.buffer.time=1

[command]
name="fwd"
command=F
time=1
[command]
name="back"
command=B
time=1
[command]
name="up"
command=U
time=1
[command]
name="start"
command=s
time=1
[command]
name="down"
command=D
time=1

[Command]
name="ShikiEx3-1"
command=~D,DF,F,D,DF,F,c
time=30
[Command]
name="ShikiEx2-1"
command=~D,DF,F,D,DF,F,x+y
time=30
[Command]
name="ShikiEx2-2"
command=~D,DF,F,D,DF,F,a+b
time=30

[Command]
name="ShikiEx-1"
command=~D,DF,F,D,DF,F,x
time=30
[Command]
name="ShikiEx-1"
command=~D,DF,F,D,DF,F,y
time=30
[Command]
name="ShikiEx-2"
command=~D,DF,F,D,DF,F,a
time=30
[Command]
name="ShikiEx-2"
command=~D,DF,F,D,DF,F,b
time=30

[Command]
name="shiki-1"
command=~D,DF,F,x
time=30
[Command]
name="shiki-2"
command=~D,DF,F,y
time=30
[Command]
name="shiki-3"
command=~D,DB,B,x
time=30
[Command]
name="shiki-4"
command=~D,DB,B,y
time=30
[Command]
name="shiki-5"
command=~D,DF,F,b
time=30
[Command]
name="shiki-6"
command=~D,DF,F,a
time=30
[Command]
name="shiki-7"
command=~D,DB,B,b
time=30
[Command]
name="shiki-8"
command=~D,DB,B,a
time=30

[Command]
name="FF"
command=F,F
time=13
[Command]
name="BB"
command=B,B
time=13
[Command]
name="FF"
command=/F,x+a
time=1
[Command]
name="BB"
command=/B,x+a
time=1
[Command]
name="recovery"
command=x+a
[Command]
name="recovery"
command=x
[Command]
name="recovery"
command=a
[Command]
name="recovery"
command=y
[Command]
name="recovery"
command=b
[Command]
name="地上受け身専用"
command=/U
[Command]
name="地上受け身専用"
command=/$F
[Command]
name="地上受け身専用"
command=/$B

[Command]
name="down_a"
command=/$D,a
time=1
[Command]
name="down_b"
command=/$D,b
time=1
[Command]
name="a"
command=a
time=1
[Command]
name="b"
command=b
time=1
[Command]
name="c"
command=c
time=1
[Command]
name="x"
command=x
time=1
[Command]
name="y"
command=y
time=1
[Command]
name="z"
command=z
time=1
[Command]
name="start"
command=s
time=1
[Command]
name="holdfwd"
command=/$F
time=1
[Command]
name="holdback"
command=/$B
time=1
[Command]
name="fwd"
command=$F
time=1
[Command]
name="back"
command=$B
time=1
[Command]
name="hold_x"
command=/x
time=1
[Command]
name="hold_a"
command=/a
time=1
[Command]
name="hold_y"
command=/y
time=1
[Command]
name="hold_b"
command=/b
time=1
[Command]
name="hold_c"
command=/c
time=1
[Command]
name="holdup"
command=/$U
time=1
[Command]
name="holddown"
command=/$D
time=1
[Command]
name="holddown2"
command=$D
time=1
[Command]
name="holddownfwd"
command=/DF
time=1
[Command]
name="1a"
command=/DB,x
time=1
[Command]
name="1b"
command=/DB,a
time=1
[Command]
name="1c"
command=/DB,y
time=1
[Command]
name="3a"
command=/DF,x
time=1
[Command]
name="3b"
command=/DF,a
time=1
[Command]
name="3c"
command=/DF,y
time=1
[Command]
name="up"
command=U
[Command]
name="down"
command=D
[Command]
name="right"
command=F
[Command]
name="left"
command=B

[Statedef -1]

;==================================================
[State -1, AI]
type=varset
triggerall=!Ishelper
triggerall=var(59)<=0 && (roundstate=[1,2])
trigger1 =command="AI0"||command="AI1"||command="AI2"||command="AI3"||command="AI4"
trigger2 =command="AI5"||command="AI6"||command="AI7"||command="AI8"||command="AI9"
trigger3 =command="AI10"||command="AI11"||command="AI12"||command="AI13"||command="AI14"
trigger4 =command="AI15"||command="AI16"||command="AI17"||command="AI18"||command="AI19"
trigger5 =command="AI20"||command="AI21"||command="AI22"||command="AI23"||command="AI24"
trigger6 =command="AI25"||command="AI26"||command="AI27"||command="AI28"||command="AI29"
trigger7 =command="AI30"||command="AI31"||command="AI32"||command="AI33"||command="AI34"
trigger8 =command="AI35"||command="AI36"||command="AI37"||command="AI38"||command="AI39"
trigger9 =command="AI40"||command="AI41"||command="AI42"||command="AI43"||command="AI44"
trigger10=command="AI45"||command="AI46"||command="AI47"||command="AI48"||command="AI49"
trigger11=command="AI50"
trigger12=numhelper(99999)>0
trigger12=helper(99999),var(59)
trigger13=PalNo=[7,12]
var(59)=1
IgnoreHitPause=1

[State -2, AI]
type=changestate
trigger1= ishelper(99999)
trigger1= stateno!=99999
value=99999

[State -1, AI]
type=helper
triggerall=!ishelper
triggerall=name="Ryougi Shiki_MA"
trigger1=!numhelper(99999)
trigger1=roundstate=2
trigger1=alive
trigger1=var(59)<=0
Trigger1=(PrevStateNo=[191,193])||PrevStateNo=5900
Trigger1=ctrl&&stateno=0
helpertype=normal
name="AI"
ID=99999
stateno=99999
pos=9999,9999
keyctrl=1
pausemovetime=2147483647
supermovetime=2147483647
persistent = 0
;==================================================

[State ]
type=ChangeState
value=6000
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="ShikiEx3-1"
triggerall=power>=3000
trigger1=statetype!=A
trigger1=ctrl
[State ]
type=ChangeState
value=3000
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="ShikiEx2-1"
triggerall=power>=2000
trigger1=statetype!=A
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=1002&&movecontact
trigger5=stateno=1071&&movecontact
[State ]
type=ChangeState
value=3100
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="ShikiEx2-2"
triggerall=power>=2000
trigger1=statetype!=A
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=1005&&movecontact
trigger5=stateno=1071&&movecontact
[State ]
type=ChangeState
value=2000
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="ShikiEx-1"
triggerall=power>=1000
trigger1=statetype!=A
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=1005&&movecontact
trigger5=stateno=1071&&movecontact
[State ]
type=ChangeState
value=2100
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="ShikiEx-2"
triggerall=power>=1000
trigger1=statetype!=A
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=230&&movecontact
trigger4=stateno=1005&&movecontact
trigger5=stateno=1071&&movecontact
[State ]
type=ChangeState
value=1000
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-1"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
[State ]
type=ChangeState
value=1010
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-2"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
[State ]
type=ChangeState
value=1020
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-3"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=410&&movecontact
trigger5=stateno=420&&movecontact
trigger6=stateno=1005&&movehit
[State ]
type=ChangeState
value=1030
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-4"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=410&&movecontact
trigger5=stateno=420&&movecontact
trigger6=stateno=1005&&movehit
[State ]
type=ChangeState
value=1040
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-5"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=1012&&movecontact
[State ]
type=ChangeState
value=1050
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-6"
trigger1=ctrl
trigger2=stateno=210&&movecontact
trigger3=stateno=220&&movecontact
trigger4=stateno=1012&&movecontact
[State ]
type=ChangeState
value=1060
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-7"
trigger1=ctrl
[State ]
type=ChangeState
value=1070
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="shiki-8"
trigger1=ctrl
[State ]
type=ChangeState
value=800
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="y"
triggerall=command="holdfwd"||command="holdback"
triggerall=statetype=S
triggerall=stateno!=100
trigger1=p2bodydist X<25
trigger1=p2statetype!=A&&p2movetype!=H
trigger1=ctrl
[State ]
type=ChangeState
value=800
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="b"
triggerall=command="holdfwd"||command="holdback"
triggerall=statetype=S
triggerall=stateno!=100
trigger1=p2bodydist X<25
trigger1=p2statetype!=A&&p2movetype!=H
trigger1=ctrl
[State ]
type=ChangeState
value=200
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="x"
trigger1=ctrl
trigger2=stateno=200&&movecontact
[State ]
type=ChangeState
value=210
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="y"
trigger1=ctrl
trigger2=stateno=200&&movecontact
[State ]
type=ChangeState
value=220
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="a"
trigger1=ctrl
trigger2=stateno=200&&movecontact
trigger3=stateno=210&&movecontact
[State ]
type=ChangeState
value=230
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command!="holddown"
triggerall=command="b"
trigger1=ctrl
trigger2=stateno=200&&movecontact
trigger3=stateno=220&&movecontact
[State ]
type=ChangeState
value=400
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command="holddown"
triggerall=command="x"
trigger1=ctrl
trigger2=stateno=400&&movecontact&&animelemtime(4)>=0
[State ]
type=ChangeState
value=410
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command="holddown"
triggerall=command="y"
trigger1=ctrl
trigger2=stateno=400&&movecontact
[State ]
type=ChangeState
value=420
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command="holddown"
triggerall=command="a"
trigger1=ctrl
trigger2=stateno=400&&movecontact
trigger3=stateno=410&&movecontact
[State ]
type=ChangeState
value=430
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype!=A
triggerall=command="holddown"
triggerall=command="b"
trigger1=ctrl
trigger2=stateno=400&&movecontact
trigger3=stateno=420&&movecontact
[State ]
type=ChangeState
value=600
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype=A
triggerall=command="x"
trigger1=ctrl
trigger2=stateno=600&&movecontact
[State ]
type=ChangeState
value=610
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype=A
triggerall=command="y"
trigger1=ctrl
trigger2=stateno=600&&movecontact
[State ]
type=ChangeState
value=620
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype=A
triggerall=command="a"
trigger1=ctrl
trigger2=stateno=600&&movecontact
trigger3=stateno=610&&movecontact
[State ]
type=ChangeState
value=630
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=statetype=A
triggerall=command="b"
trigger1=ctrl
trigger2=stateno=600&&movecontact
trigger3=stateno=610&&movecontact
trigger4=stateno=620&&movecontact
[State ]
type=ChangeState
value=700
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=!var(6)
triggerall=command="z"
trigger1=statetype!=A
trigger1=ctrl
[State ]
type=ChangeState
value=100
triggerall=!Ishelper
triggerall=var(59)<=0
triggerall=command="FF"
triggerall=statetype!=A
triggerall=stateno!=100
trigger1=ctrl
[State ]
type=ChangeState
value=105
triggerall=!IsHelper
triggerall=var(59)<=0
triggerall=command="BB"
triggerall=statetype!=A
trigger1=ctrl
trigger2=stateno=101

;==================================================
;Var(40) = Enemynear
;Var(59) = AI on/off

[State -1, Debug]
type=DisplayToClipBoard
trigger1=!Ishelper
text= "V59=%d, PbY=%f, PbX=%f, bebd=%d, test=%d"
params=(var(59)),(P2bodydist Y),(P2bodydist X),(BackEdgeBodyDist),(Floor((lifemax-life)*0.3))
IgnoreHitPause=1

[State -1, AI-Intro]
type=varset
triggerall=!Ishelper
triggerall=var(51)=0
triggerall=roundstate>2
trigger1=Lose>0
var(51)=1

[State -1, AI-Intro]
type=varset
triggerall=!Ishelper
triggerall=var(51)=1
trigger1=roundstate=2
var(51)=2

[State -1, AI-E-Recovery]
type=varset
triggerall=!Ishelper
triggerall=var(59)>0
triggerall=roundstate=2
trigger1=MoveType=A
trigger1=EnemyNear(Var(40)),StateNo=[5200,5219]
var(52)=var(52)+1

[State -1, AI-Enemynear]
type=varset
triggerall=!Ishelper
triggerall=var(59)>0
triggerall=roundstate=2
trigger1=NumEnemy>1
var(40)=!(EnemyNear,Alive)

[State -1, AI-PrevStateNo]
type=varset
triggerall=!Ishelper
triggerall=var(59)>0
triggerall=roundstate=2
trigger1=MoveType=A
var(41)=StateNo

;--------------------------------------------------
;;切り返し;;
;--------------------------------------------------
[State -1, AI-6000]
type  = ChangeState
value = 6000
triggerall =!Ishelper
triggerall = power>=3000
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=P2BodyDist X=[-5,50]
triggerall=P2BodyDist Y>=-60
triggerall=Ctrl
triggerall=EnemyNear(Var(40)),MoveType=A
triggerall=Random<=600||PalNo=12
triggerall=EnemyNear(Var(40)),AnimTime<=-2||Random<=4&&PalNo!=12
triggerall=EnemyNear(Var(40)),Time>=30||Random<=120||PalNo=12
trigger1 = EnemyNear(Var(40)),Time>=50||Random<=60||PalNo=12
trigger2 =(PrevStateNo=[5000,5270])
trigger3 =(PrevStateNo=[120,159])

[State -1, AI-1060]
type  = ChangeState
value = 1060
triggerall =!Ishelper
triggerall = Var(41)!=[1060,1079]
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=P2BodyDist X=[-5,50]
triggerall=P2BodyDist Y>=-60
triggerall=Ctrl
triggerall=EnemyNear(Var(40)),MoveType=A
triggerall=Random<=300||PalNo=12
triggerall=EnemyNear(Var(40)),AnimTime<=-2||Random<=4&&PalNo!=12
triggerall=EnemyNear(Var(40)),Time>=30||Random<=80||PalNo=12
trigger1 = EnemyNear(Var(40)),Time>=50||Random<=10||PalNo=12
trigger2 =(PrevStateNo=[5000,5270])
trigger3 =(PrevStateNo=[120,159])

[State -1, AI-1070]
type  = ChangeState
value = 1070
triggerall =!Ishelper
triggerall = Var(41)!=[1060,1079]
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=P2BodyDist X=[-5,50]
triggerall=P2BodyDist Y>=0
triggerall=Ctrl
triggerall=EnemyNear(Var(40)),MoveType=A
triggerall=Random<=300||PalNo=12
triggerall=EnemyNear(Var(40)),AnimTime<=-2||Random<=4&&PalNo!=12
triggerall=EnemyNear(Var(40)),Time>=30||Random<=80||PalNo=12
trigger1 = EnemyNear(Var(40)),Time>=50||Random<=10||PalNo=12
trigger2 =(PrevStateNo=[5000,5270])
trigger3 =(PrevStateNo=[120,159])

[State -1, AI-BackStep]
type  = ChangeState
value = 105
triggerall =!Ishelper
triggerall=var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=Ctrl||StateNo=101
triggerall=(EnemyNear(Var(40)),StateNo=[200,699])||EnemyNear(Var(40)),HitDefAttr=SCA,AT
triggerall=P2BodyDist X=[-5,90]
triggerall=EnemyNear(Var(40)),Vel X<3
triggerall=EnemyNear(Var(40)),MoveType=A
triggerall=Random<=600
triggerall=EnemyNear(Var(40)),Time>=30||Random<=20||PalNo=12
triggerall = PrevStateNo!=[105,106]
triggerall = BackEdgeBodyDist>62
Trigger1 = EnemyNear(Var(40)),Time>=50||Random<=10||PalNo=12
Trigger2 =(PrevStateNo=[5000,5270])
Trigger3 =(PrevStateNo=[120,159])

[State -1, AI-Jump]
type  = ChangeState
value = 40
triggerall =!Ishelper
triggerall=var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
TriggerAll=Ctrl
TriggerAll=EnemyNear(Var(40)),HitDefAttr=SCA,AT
TriggerAll=Random<=600
TriggerAll=EnemyNear(Var(40)),Time>=30||Random<=20||PalNo=12
Trigger1 = EnemyNear(Var(40)),Time>=50||Random<=10||PalNo=12
Trigger2 =(PrevStateNo=[5000,5270])
Trigger3 =(PrevStateNo=[120,159])

;--------------------------------------------------
;;ガード;;
;--------------------------------------------------
[State -1, AI-Guard]
type  = ChangeState
value = 120
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=(StateNo!=[120,155])
triggerall=InGuardDist
triggerall=Ctrl
trigger1 = Random<=600||PalNo=12
trigger2 = P2BodyDist X>90||EnemyNear(Var(40)),Time>50
trigger2 = Random<=900

;--------------------------------------------------
;;起き攻め;;
;--------------------------------------------------

;--------------------------------------------------
;;地上 目押し;;
;--------------------------------------------------
[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,10]
triggerall=P2BodyDist Y>=-20
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),MoveType=H
trigger1 =(EnemyNear(Var(40)),StateNo!=[120,159])
trigger1 = EnemyNear(Var(40)),Vel Y>=0
trigger1 = EnemyNear(Var(40)),StateType!=C
trigger1 = EnemyNear(Var(40)),Const(size.head.pos.y)<=-90
trigger1 = Var(41)!=1054||PalNo=12
trigger1 = Var(41)!=200

[State -1, AI-210]
type  = ChangeState
value = 210
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,40]
triggerall=P2BodyDist Y>=-20
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),MoveType=H
trigger1 =(EnemyNear(Var(40)),StateNo!=[120,159])
trigger1 = EnemyNear(Var(40)),Vel Y>=0
trigger1 = EnemyNear(Var(40)),Const(size.head.pos.y)>-90||P2BodyDist X=[11,40]
trigger1 = Var(41)!=1054||PalNo=12
trigger1 = Var(41)!=210

[State -1, AI-410]
type  = ChangeState
value = 410
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,60]
triggerall=P2BodyDist Y>=0
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),MoveType=H
trigger1 =(EnemyNear(Var(40)),StateNo!=[120,159])
trigger1 =(EnemyNear(Var(40)),StateNo!=[5120,5149])
trigger1 = Var(41)!=[410,430]
trigger1 = Var(41)!=[1020,1039]

[State -1, AI-430]
type  = ChangeState
value = 430
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType=L
triggerall=!InGuardDist
triggerall=P2BodyDist X=[55,90]
triggerall=P2BodyDist Y>=0
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),MoveType=H
trigger1 =(EnemyNear(Var(40)),StateNo!=[120,159])
trigger1 =(EnemyNear(Var(40)),StateNo!=[5120,5149])
trigger1 = Var(41)!=430
trigger1 = Var(41)!=1054||PalNo=12

[State -1, AI-Dash]
type  = ChangeState
value = 100
triggerall =!Ishelper
triggerall = StateNo!=100
triggerall = PrevStateNo!=[100,101]
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=!InGuardDist
triggerall=P2BodyDist X>=40
triggerall=P2BodyDist Y>=-50
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),MoveType=H
trigger1 =(EnemyNear(Var(40)),StateNo!=[120,159])


;--------------------------------------------------
;;地上 隙突き;;
;--------------------------------------------------
[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall = EnemyNear(Var(40)),Const(size.head.pos.y)<=-90
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-3
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,10]
triggerall=P2BodyDist Y>=-20
triggerall=Random<=1000
triggerall=Ctrl
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])
trigger1 = EnemyNear(Var(40)),StateType!=C
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 =!EnemyNear(Var(40)),Ctrl

[State -1, AI-400]
type  = ChangeState
value = 400
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-5
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y>=0
triggerall=Random<=1000
triggerall=Ctrl
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 =!EnemyNear(Var(40)),Ctrl

[State -1, AI-210]
type  = ChangeState
value = 210
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-9
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,70]
triggerall=P2BodyDist Y>=-20
triggerall=Random<=1000
triggerall=Ctrl
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 =!EnemyNear(Var(40)),Ctrl

[State -1, AI-410]
type  = ChangeState
value = 410
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-11
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,80]
triggerall=P2BodyDist Y>=0
triggerall=Random<=1000
triggerall=Ctrl
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 =!EnemyNear(Var(40)),Ctrl

[State -1, AI-1020]
type  = ChangeState
value = IfElse(PalNo=12,1030,1020)
triggerall =!Ishelper
triggerall = StateNo!=100
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-30
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,100]
triggerall=P2BodyDist Y>=0
triggerall=Random<=1000
triggerall=Ctrl
triggerall = BackEdgeBodyDist<80||Random<=500
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 =!EnemyNear(Var(40)),Ctrl

;--------------------------------------------------
;;地上 繋ぎ;;
;--------------------------------------------------
[State -1, AI-3000]
type  = ChangeState
value = 3000
triggerall =!Ishelper
triggerall = power>=2000
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,200]
triggerall=P2BodyDist Y>=-30
triggerall = EnemyNear(Var(40)),Const(size.head.pos.y)<=-90
triggerall = EnemyNear(Var(40)),StateType!=C
triggerall = MoveHit
trigger1 = PalNo=12
trigger1 = StateNo=220
trigger2 = Random<=500
trigger2 = StateNo=1002

[State -1, AI-3100]
type  = ChangeState
value = 3100
triggerall =!Ishelper
triggerall = power>=2000
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,100]
triggerall=P2BodyDist Y>=-30
triggerall = MoveHit
trigger1 = PalNo=12
trigger1 = StateNo=220
trigger2 = StateNo=1005
trigger3 = StateNo=1071

[State -1, AI-2100]
type  = ChangeState
value = 2100
triggerall =!Ishelper
triggerall = power>=1000
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y>=-30
triggerall = EnemyNear(Var(40)),StateType!=L
triggerall = MoveHit
trigger1 = StateNo=230
trigger2 = StateNo=1005

[State -1, AI-2000]
type  = ChangeState
value = 2000
triggerall =!Ishelper
triggerall = power>=1000
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,150]
triggerall=P2BodyDist Y>=0
triggerall = MoveHit
trigger1 = PalNo=12
trigger1 = StateNo=220
trigger2 = StateNo=1005
trigger3 = StateNo=1071

[State -1, AI-400]
type  = ChangeState
value = 400
triggerall =!Ishelper
triggerall = animelemtime(4)>=0
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y>=0
trigger1 = StateNo= 400 && MoveContact

[State -1, AI-410]
type  = ChangeState
value = 410
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[20,80]
triggerall=P2BodyDist Y>=0
trigger1 = StateNo= 400 && MoveContact

[State -1, AI-420]
type  = ChangeState
value = 420
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,130]
triggerall=P2BodyDist Y>=0
trigger1 = StateNo= 410 && MoveHit
trigger2 = StateNo= 410 && MoveGuarded
trigger2 = Random<=500

[State -1, AI-430]
type  = ChangeState
value = 430
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,100]
triggerall=P2BodyDist Y>=0
trigger1 = StateNo= 420 && MoveGuarded

[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,10]
triggerall = EnemyNear(Var(40)),StateType!=A
trigger1 = StateNo=200 && MoveContact

[State -1, AI-210]
type  = ChangeState
value = 210
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist Y>=-20
trigger1 = EnemyNear(Var(40)),StateType!=A
trigger1 = P2BodyDist X=[10,80]
trigger1 = StateNo=200 && MoveContact
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 = P2BodyDist X=[-5,80]
trigger2 = StateNo=200 && MoveContact

[State -1, AI-220]
type  = ChangeState
value = 220
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,80]
triggerall=P2BodyDist Y>=0
trigger1 = StateNo=210 && MoveContact

[State -1, AI-1000&1010]
type  = ChangeState
value = IfElse(Random<500,1000,1010)
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,100]
triggerall=P2BodyDist Y>=-30
trigger1 = StateNo=220 && MoveHit

[State -1, AI-230]
type  = ChangeState
value = 230
triggerall =!IsHelper
triggerall=(Var(59)>0&&Random<=300)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y>=-30
trigger1 = StateNo=220 && MoveContact
trigger1 = Power>=1000

[State -1, AI-1030]
type  = ChangeState
value = 1030
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,150]
triggerall=P2BodyDist Y>=-30
trigger1 = BackEdgeBodyDist<80
trigger1 = StateNo= 220 && MoveGuarded
trigger2 = StateNo=1005 && MoveHit
trigger3 = StateNo= 420 && MoveHit

[State -1, AI-1050]
type  = ChangeState
value = 1050
triggerall =!IsHelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,90]
trigger1 = EnemyNear(Var(40)),StateType=A||EnemyNear(Var(40)),Const(size.head.pos.y)<-100
trigger1 = EnemyNear(Var(40)),Vel Y>=0
trigger1 = P2BodyDist Y>=-35
trigger1 = StateNo= 210 && MoveHit
trigger2 = Var(52)<10
trigger2 = StateNo=1012 && MoveHit

;--------------------------------------------------
;;空中 目押し;;
;--------------------------------------------------
[State -1, AI-600]
type  = ChangeState
value = 600
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,40]
triggerall=Random<=1000
triggerall=Ctrl
triggerall= EnemyNear(Var(40)),MoveType=H
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])
trigger1 = EnemyNear(Var(40)),StateType=A
trigger1 = P2BodyDist Y=[-50,90]
trigger2 = EnemyNear(Var(40)),StateType=S&&Vel Y>0
trigger2 = P2BodyDist Y= [-5,90]
trigger3 = EnemyNear(Var(40)),StateType=C&&Vel Y>0
trigger3 = P2BodyDist Y= [-5,70]

;--------------------------------------------------
;;空中 隙突き;;
;--------------------------------------------------
[State -1, AI-600]
type  = ChangeState
value = 600
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-7
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),StateType=A
trigger1 = P2BodyDist Y=[-50,90]
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])||(!EnemyNear(Var(40)),Ctrl)
trigger2 = EnemyNear(Var(40)),StateType=S
trigger2 = P2BodyDist Y= [-5,90]
trigger2 =(EnemyNear(Var(40)),StateNo=[200,649])&&Vel Y>0
trigger3 = EnemyNear(Var(40)),StateType=C
trigger3 = P2BodyDist Y= [-5,70]
trigger3 =(EnemyNear(Var(40)),StateNo=[200,649])&&Vel Y>0

[State -1, AI-610]
type  = ChangeState
value = 610
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=EnemyNear(Var(40)),AnimTime<=-7
triggerall=!InGuardDist
triggerall=P2BodyDist X=[20,40]
triggerall=Random<=1000
triggerall=Ctrl
trigger1 = EnemyNear(Var(40)),StateType=A
trigger1 = P2BodyDist Y=[-50,90]
trigger1 =(EnemyNear(Var(40)),StateNo=[200,649])||(!EnemyNear(Var(40)),Ctrl)
trigger2 = EnemyNear(Var(40)),StateType=S
trigger2 = P2BodyDist Y= [-5,90]
trigger2 =(EnemyNear(Var(40)),StateNo=[200,649])&&Vel Y>0
trigger3 = EnemyNear(Var(40)),StateType=C
trigger3 = P2BodyDist Y= [-5,70]
trigger3 =(EnemyNear(Var(40)),StateNo=[200,649])&&Vel Y>0

;--------------------------------------------------
;;空中 繋ぎ;;
;--------------------------------------------------
[State -1, AI-600]
type  = ChangeState
value = 600
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,30]
trigger1 = P2BodyDist Y=[-50,90]
trigger1 = MoveGuarded
trigger1 = StateNo=600

[State -1, AI-610]
type  = ChangeState
value = 610
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,40]
trigger1 = P2BodyDist Y=[-50,90]
trigger1 = MoveContact
trigger1 = StateNo=600

[State -1, AI-620]
type  = ChangeState
value = 620
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,60]
trigger1 = P2BodyDist Y=[-50,90]
trigger1 = MoveContact
trigger1 = StateNo=610

[State -1, AI-630]
type  = ChangeState
value = 630
triggerall =!Ishelper
triggerall=(Var(59)>0&&Random<=1000)
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),Alive
triggerall=EnemyNear(Var(40)),MoveType=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,70]
trigger1 = P2BodyDist Y=[-50,90]
trigger1 = MoveContact
trigger1 = StateNo=620

;--------------------------------------------------
;;移動;;
;--------------------------------------------------
[State -1, AI-Stand]
type  = ChangeState
value = 0
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=Ctrl
triggerall=P2BodyDist X<40
triggerall=StateNo!=0
trigger1 = StateNo=20 && P2BodyDist X<10
trigger1 =(EnemyNear(Var(40)),Vel X=0||EnemyNear(Var(40)),Anim=20)
trigger2 = StateNo=40 && EnemyNear(Var(40)),StateType!=A
trigger2 = EnemyNear(Var(40)),MoveType!=A||EnemyNear(Var(40)),StateType=L
trigger3 = StateNo=20 && Anim=21 && Random<70

[State -1, AI-Crouch]
type  = ChangeState
value = 10
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=S
triggerall=Ctrl
triggerall=StateNo!=[10,12]
triggerall=PrevStateNo!=[10,12]
trigger1 = StateNo=0||StateNo=20||StateNo=40
trigger1 = P2BodyDist X<100
trigger1 = EnemyNear(Var(40)),StateType=C
trigger1 = EnemyNear(Var(40)),StateNo!=10
trigger2 = ((StateNo=0||StateNo=20)&&Random<40)||StateNo=40
trigger2 = EnemyNear(Var(40)),Vel X=0
trigger2 = EnemyNear(Var(40)),StateType!=L
trigger2 = EnemyNear(Var(40)),StateType!=A
trigger3 = StateNo=100
trigger3 = P2BodyDist X<20
trigger3 = EnemyNear(Var(40)),MoveType=H
trigger3 = EnemyNear(Var(40)),StateType=L
trigger4 = StateNo=100
trigger4 = P2BodyDist X<20
trigger4 = EnemyNear(Var(40)),MoveType!=H

[State -1, AI-Walk]
type=ChangeState
value=20
triggerall =!Ishelper
triggerall = StateNo!=20
triggerall = StateNo!=100
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=StateNo=0||StateNo=10||StateNo=40
triggerall=Ctrl
triggerall=EnemyNear(Var(40)),StateType!=C
triggerall=EnemyNear(Var(40)),MoveType!=A
triggerall=P2BodyDist X>=20
trigger1 = Random<70||StateNo=40
trigger2 = EnemyNear(Var(40)),Vel X!=0

[State -1, AI-Jump]
type  = ChangeState
value = 40
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=ctrl
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[0,170]
trigger1 = StateNo!=10
trigger1 = Random<70 && P2BodyDist X>60
trigger1 = StateNo!=100
trigger2 = EnemyNear(Var(40)),StateType=A
trigger2 = Random<90

[State -1, AI-Dash]
type  = ChangeState
value = 100
triggerall =!Ishelper
triggerall = StateNo!=[10,12]
triggerall = StateNo!=100
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType=I
triggerall=!InGuardDist
triggerall=Ctrl
trigger1 = Random<=100
trigger1 = P2BodyDist X>=80

[State -1, AI-BackStep]
type  = ChangeState
value = 105
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=EnemyNear(Var(40)),StateNo!=[120,159]
triggerall=Ctrl || StateNo=101
triggerall=BackEdgeBodyDist>62
trigger1 =(P2BodyDist X=[0,60]) && EnemyNear(Var(40)),Vel X>0
trigger1 = Random<=200

;--------------------------------------------------
;;投げ対策;;
;--------------------------------------------------
[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall = EnemyNear(Var(40)),Const(size.head.pos.y)<=-90
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=EnemyNear(Var(40)),Ctrl||EnemyNear(Var(40)),MoveType=A
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,10]
triggerall=P2BodyDist Y=-20
triggerall=EnemyNear(Var(40)),StateType!=A
triggerall=Ctrl
triggerall = Var(41)!=200
trigger1 = Random<=400
trigger1 = EnemyNear(Var(40)),StateType!=C

[State -1, AI-400]
type  = ChangeState
value = 400
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=EnemyNear(Var(40)),Ctrl||EnemyNear(Var(40)),MoveType=A
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y=0
triggerall=EnemyNear(Var(40)),StateType!=A
triggerall=Ctrl
triggerall = Var(41)!=400
trigger1 = Random<=400

;--------------------------------------------------
;;投げ;;
;--------------------------------------------------
[State -1, AI-800]
type  = ChangeState
value = 800
triggerall =!Ishelper
triggerall = StateType=S
triggerall = StateNo!=100
triggerall = P2BodyDist X<25
triggerall = P2StateType!=A&&P2MoveType!=H
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=Ctrl
triggerall = Var(41)!=[800,809]
triggerall = EnemyNear(Var(40)),StateType!=A
triggerall = EnemyNear(Var(40)),Vel Y=0
triggerall = P2BodyDist X>=0
trigger1 = Random<=300
trigger1 = EnemyNear(Var(40)),MoveType!=A
trigger2 =(EnemyNear(Var(40)),StateNo=[120,159])
trigger3 = Random<=100

;--------------------------------------------------
;;対空;;
;--------------------------------------------------
[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,10]
triggerall=P2BodyDist Y>=-20
triggerall=EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
triggerall = Var(41)!=200
trigger1 = Random<=500
trigger1 = EnemyNear(Var(40)),Vel Y>0

[State -1, AI-210]
type  = ChangeState
value = 210
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[10,60]
triggerall=P2BodyDist Y>=-20
triggerall=EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
trigger1 = Random<=300
trigger1 = EnemyNear(Var(40)),Vel Y>0

[State -1, AI-1040]
type  = ChangeState
value = IfElse(PalNo=12,1050,1040)
triggerall =!Ishelper
triggerall = StateNo!=100
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[10,170]
triggerall=P2BodyDist Y<=-20
triggerall=EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
triggerall = Random<=300
trigger1 = EnemyNear(Var(40)),Vel Y<=0
trigger2 = EnemyNear(Var(40)),StateNo=[5200,5219]
trigger2 = P2BodyDist Y<=-80

;--------------------------------------------------
;;下段;;
;--------------------------------------------------
[State -1, AI-400]
type  = ChangeState
value = 400
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=EnemyNear(Var(40)),StateType=S
triggerall=Ctrl
triggerall = Var(41)!=400
trigger1 = Random<=400

[State -1, AI-1020]
type  = ChangeState
value = IfElse(PalNo=12,1030,1020)
triggerall =!Ishelper
triggerall = StateNo!=100
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[70,120]
triggerall=EnemyNear(Var(40)),StateType=S
triggerall=Ctrl
trigger1 = BackEdgeBodyDist<80
trigger1 = Random<=400
trigger2 = BackEdgeBodyDist=[80,150]
trigger2 = Random<=200

;--------------------------------------------------
;;中段;;
;--------------------------------------------------

;--------------------------------------------------
;;牽制;;
;--------------------------------------------------
[State -1, AI-200]
type  = ChangeState
value = 200
triggerall =!Ishelper
triggerall = EnemyNear(Var(40)),Const(size.head.pos.y)<=-90
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,15]
triggerall=P2BodyDist Y>=-20
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
triggerall = Var(41)!=200
trigger1 = Random<=450
trigger1 = EnemyNear(Var(40)),StateType!=C||EnemyNear(Var(40)),StateNo=40

[State -1, AI-400]
type  = ChangeState
value = 400
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,30]
triggerall=P2BodyDist Y>=0
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
triggerall = Var(41)!=400
trigger1 = Random<=400

[State -1, AI-210]
type  = ChangeState
value = 210
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType!=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X=[-5,60]
triggerall=P2BodyDist Y>=-20
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType=A
triggerall=Ctrl
triggerall = Random<=410
triggerall = Var(41)!=210
triggerall =(Anim!=20||StateNo!=100)||P2BodyDist X<=30
trigger1 = EnemyNear(Var(40)),StateType=C||(P2BodyDist X=[14,70])
trigger2 = EnemyNear(Var(40)),Const(size.head.pos.y)>-90

;--------------------------------------------------
;;空中;;
;--------------------------------------------------
[State -1, AI-600]
type  = ChangeState
value = 600
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,30]
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType!=A
triggerall=Ctrl
triggerall = Random<=600
trigger1 = EnemyNear(Var(40)),StateType=A
trigger1 = P2BodyDist Y=[-50,90]

[State -1, AI-610]
type  = ChangeState
value = 610
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [-5,40]
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType!=A
triggerall=Ctrl
triggerall = Random<=600
trigger1 = Vel Y>0
trigger1 = EnemyNear(Var(40)),StateType=S
trigger1 = P2BodyDist Y= [-5,90]
trigger2 = Vel Y>0
trigger2 = EnemyNear(Var(40)),StateType=C
trigger2 = P2BodyDist Y= [-5,90]
trigger3 = EnemyNear(Var(40)),StateType=A
trigger3 = P2BodyDist X= [25,40]
trigger3 = P2BodyDist Y=[-80,90]

[State -1, AI-630]
type  = ChangeState
value = 630
triggerall =!Ishelper
triggerall=Var(59)>0
triggerall=RoundState=2&&Alive
triggerall=StateType=A
triggerall=EnemyNear(Var(40)),StateType!=L
triggerall=EnemyNear(Var(40)),MoveType!=H
triggerall=!InGuardDist
triggerall=P2BodyDist X= [20,70]
triggerall=(EnemyNear(Var(40)),StateNo!=[120,159])||EnemyNear(Var(40)),StateType!=A
triggerall=Ctrl
triggerall = Random<=500
trigger1 = Vel Y>0
trigger1 = EnemyNear(Var(40)),StateType=S
trigger1 = P2BodyDist Y= [-5,90]
trigger2 = Vel Y>0
trigger2 = EnemyNear(Var(40)),StateType=C
trigger2 = P2BodyDist Y= [-5,70]
trigger3 = EnemyNear(Var(40)),StateType=A
trigger3 = P2BodyDist X>40
trigger3 = P2BodyDist Y=[-80,100]

;--------------------------------------------------
