[statedef -3]

;===========================================================================


[State -2,12]
type = varset
triggerall = !ishelper
triggerall = movetype !=H
trigger1 = command = "CPU_1"
trigger2 = command = "CPU_2"
trigger3 = command = "CPU_3"
trigger4 = command = "CPU_4"
trigger5 = command = "CPU_5"
trigger6 = command = "CPU_6"
trigger7 = command = "CPU_7"
trigger8 = command = "CPU_8"
trigger9 = command = "CPU_9"
trigger10 = command = "CPU_10"
trigger11 = command = "CPU_11"
trigger12 = command = "CPU_12"
trigger13 = command = "CPU_13"
trigger14 = command = "CPU_14"
trigger15 = command = "CPU_15"
trigger16 = command = "CPU_16"
trigger17 = command = "CPU_17"
trigger18 = command = "CPU_18"
trigger19 = command = "CPU_19"
trigger20 = command = "CPU_20"
trigger21 = command = "CPU_21"
trigger22 = command = "CPU_22"
;trigger23 = 1
persistent = 1
v = 59
value = 10



---------------------------------------------------------------------------

;--------------------------------------------------------------------
[State -3,AI-off]
type = VarSet
trigger1 = !alive
trigger2 = win || lose
var(59) = 0
;===================================================================

;===========================================================================
[State -3, Guard(AI)]
Type = ChangeState
Value = 120
triggerall = var(59)=1 && roundstate = 2
TriggerAll = Ctrl||(StateNo=[20,22])||(StateNo=100&&Time>12)
TriggerAll = StateNo!=[120,155]
Trigger1 = P2StateType!=A
Trigger1 = P2Dist X>=0
Trigger1 = InGuardDist
Trigger1 = !EnemyNear,hitdefattr=SCA,NT,ST,HT
Trigger2 = !EnemyNear,hitdefattr=SCA,NT,ST,HT
Trigger2 = P2MoveType=A
Trigger2 = P2Dist X<0
Trigger3 = Enemy,NumHelper>0||Enemy,NumProj>0
Trigger3 = InGuardDist


[state -1,MAX発動]
type=changestate
value=950
triggerall=var(59)&&alive&&roundstate=2
triggerall=power>=4000
triggerall=statetype!=a
triggerall=!var(1)
triggerall=ctrl
triggerall=p2bodydist x>120
trigger1=p2life>=500
;---------------------------------------------------------------------------
;シールド
[State -1,]
type = ChangeState
value = 900
triggerall = random < var(59)*25
triggerall = P2BodyDist X < 40
triggerall=var(59)&&alive&&roundstate=2

trigger1 = statetype = S
trigger1 = enemy,statetype != C
trigger1 = enemy,movetype = A
trigger1 = ctrl

;シールド
[State -1,]
type = ChangeState
value = 900
triggerall = random < var(59)*500
triggerall=var(1)
triggerall=var(59)&&alive&&roundstate=2
trigger1 = statetype = S
trigger1 = enemy,statetype != C
trigger1 = enemy,movetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
;シールド
[State -1,]
type = ChangeState
value = 910
triggerall = random < var(59)*25
triggerall = P2BodyDist X < 40
triggerall=var(59)&&alive&&roundstate=2

trigger1 = statetype = C
trigger1 = enemy,statetype = C
trigger1 = enemy,movetype = A
trigger1 = ctrl
;------------------------------------------------------------------------
;------------------------------------------------




[state -1,獄鎖斬陣]
type=changestate
value=2000
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=1000||var(1)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=p2bodydist x=[-5,40]
triggerall=p2bodydist y>-60
triggerall=enemynear,movetype=a
triggerall=enemynear,animtime<=-16||random<((5-var(59))*250)
triggerall=random<(var(59)*power/350)||var(1)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]

[state -1,斬風燕破 鳳牙・弱]
type=changestate
value=ifelse(p2bodydist x<30,1110,1100)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=p2bodydist x=[-5,60]
triggerall=p2bodydist y>-60
triggerall=enemynear,movetype=a
triggerall=enemynear,animtime<=-20||random<((5-var(59))*250)
triggerall=random<(var(59)*143)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]

;---------------------------------------------------------------------------
;回避行動
[state -1,斬風燕破 殺魔]
type=changestate
value=1000
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=ctrl
triggerall=random<(var(59)*100)
trigger1=enemynear,numproj
trigger2=enemynear,hitdefattr=sca,ap
;trigger3=p2bodydist x>160
;trigger3=enemynear,movetype=a

[state -1,バックステップ]
type=changestate
value=705
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=(enemynear,stateno=[200,699])||enemynear,hitdefattr=sca,at
triggerall=p2bodydist x=[-5,90]
triggerall=enemynear,vel x<3
triggerall=enemynear,movetype=a
triggerall=random<(var(59)*100)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]

[state -1,垂直小ジャンプ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=enemynear,hitdefattr=sca,at
triggerall=random<(var(59)*50)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]
var(58)=11

[state -1,後ろ中ジャンプ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=enemynear,hitdefattr=sca,at
triggerall=random<(var(59)*100)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]
var(58)=-22

[state -1,回り込み]
type=changestate
value=ifelse(p2bodydist x>90,900,905)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,movetype=a
triggerall=!(enemynear,hitdefattr=sca,at)
triggerall=random<(var(59)*25)
trigger1=enemynear,time>((7-var(59))*6)
trigger2=prevstateno=[5000,5270]
trigger3=prevstateno=[120,159]

;===========================================================================
;ガード
[state -1,立ちガ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=random<(var(59)*143)
trigger1=enemynear,movetype=a
trigger2=enemynear,numproj
trigger3=inguarddist
var(58)=50

[state -1,しゃがみガ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=random<(var(59)*143)
triggerall=enemynear,statetype=c||(enemynear,statetype!=a&&random%2)
trigger1=enemynear,movetype=a
trigger2=enemynear,numproj
trigger3=inguarddist
var(58)=51

[state -1,ガーキャンふっとばし]
type=changestate
value=351
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=power>=1000
triggerall=stateno=[150,155]
triggerall=p2bodydist x=[-5,20]
triggerall=p2bodydist y>-65
triggerall=enemynear,animtime<=-3||random<((5-var(59))*250)
trigger1=random<(var(59)*power/100)

[state -1,ガーキャン回り込み]
type=changestate
value=ifelse(backedgebodydist>90,906,901)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=power>=1000
triggerall=stateno=[150,155]
triggerall=random<(var(59)*power/500)
trigger1=p2bodydist x!=[-5,90]
trigger2=p2bodydist y<=-55
trigger3=enemynear,animtime>-4


;ディバインアロー　エア
[State -1]
type = ChangeState
value = 1200
triggerall= !var(7)
triggerall = var(59)
triggerall = random <= 30
triggerall = p2statetype != L
trigger1 = P2BodyDist X > 20
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = movecontact
trigger5 = stateno = 410
trigger5 = movecontact
trigger6 = P2BodyDist X > 20
trigger6 = P2movetype = A
trigger6 = ctrl && statetype != A
trigger6 = Enemy, Numproj = 1 && P2MoveType = A
trigger6 = p2movetype != H

;===========================================================================
;起き攻め
[state -1,紫紀]
type=changestate
value=2300
triggerall=!var(1)
triggerall= (power >= 4000) || var(1)
triggerall=var(59)&&alive&&roundstate=2
triggerall=p2bodydist x>120 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=!numhelper(1400)
triggerall=ctrl
triggerall=random<((var(59)-3)*100)
trigger1=enemynear,statetype=l
trigger2=numtarget
trigger2=target,stateno=[5400,5401]
trigger2=target,stateno=5400||target,time=1


;起き攻め
[state -1,big]
type=changestate
value=1500
triggerall=!var(1)
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(7)
triggerall=statetype!=a
triggerall=numhelper(1300)
triggerall=!numhelper(1500)
;triggerall=ctrl
triggerall=random<((var(59))*100)
;trigger1 = Stateno = 1300
;trigger1 = AnimTime = 0
;trigger1 = AnimElemtime(2)>0
trigger1 = Stateno = 1300
trigger1 = AnimTime = 0
trigger1 = AnimElemtime(2)>0

;起き攻め
[state -1,big]
type=changestate
value=1510
triggerall=!var(1)
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(7)
triggerall=statetype!=a
triggerall=numhelper(1400)
triggerall=!numhelper(1500)
;triggerall=ctrl
triggerall=random<((var(59))*100)
;trigger1 = Stateno = 1300
;trigger1 = AnimTime = 0
;trigger1 = AnimElemtime(2)>0
trigger1 = Stateno = 1400
trigger1 = AnimTime = 0
trigger1 = AnimElemtime(2)>0

;---------------------------------------------------------------------------
;詐欺飛び
[state -1,Jふっとばし]
type=changestate
value=650
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype=a
triggerall=ctrl
triggerall=enemynear,statetype=l
triggerall=enemynear,stateno=5120
triggerall=p2bodydist x<50
triggerall=vel y>0
triggerall=p2bodydist y=[-30,90]
trigger1=random<((var(59)-3)*100)

;===========================================================================
;コンボ

;地上目押し


[state -1,立C]
type=changestate
value=220
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x=[-5,25]
triggerall=p2bodydist y>-60
triggerall=random<(var(59)*50)
trigger1=enemynear,movetype=h
trigger1=enemynear,stateno!=[120,159]

;---------------------------------------------------------------------------
;地上繋ぎ




[state -1,クイックMAX発動]
type=changestate
value=951
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=power>=2000
triggerall=statetype!=a
triggerall=!var(1)
triggerall=stateno=[200,599]
triggerall=stateno!=[350,351]
triggerall=movecontact=1
triggerall=enemynear,statetype!=l
trigger1=var(59)>4
trigger1=stateno=[301,310]
trigger1=movehit=1



[state -1,獄鎖斬陣]
type=changestate
value=2000
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=1000||var(1)
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=p2bodydist x=[-5,30]
triggerall=p2bodydist y>-30
triggerall=random<(var(59)*power/350)||var(1)
trigger1=(stateno=[210,215])||stateno=410||stateno=[301,310]
trigger1=movehit=1

[state -1,斬風燕破どれか]
type=changestate
value=ifelse(random%2,ifelse(random%2,1000,1050),ifelse(random%2,1100,1110))
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=stateno=[200,599]
triggerall=stateno!=[350,351]
triggerall=movecontact=1
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype=h
triggerall=p2bodydist x=[-5,60]
triggerall=p2bodydist y>-60
triggerall=stateno=220||stateno=420||stateno=[301,310]
trigger1=random<(var(59)*143)

[state -1,MAX白羅滅精]
type=changestate
value=3500
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=3000||(var(1)&&power>=1000)
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=random<(var(59)*power/600)
trigger1=stateno=220||stateno=420||stateno=[301,310]
trigger1=movehit=1
trigger2=ctrl
trigger2=numtarget
trigger2=target,stateno=5412


[state -1,白羅滅精]
type=changestate
value=3100
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=1000||var(1)
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=random<(var(59)*power/350)||var(1)
trigger1=stateno=220|stateno=420||stateno=[301,310]
trigger1=movehit=1
trigger2=ctrl
trigger2=numtarget
trigger2=target,stateno=5412

[state -1,白羅滅精]
type=changestate
value=3500
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(7)
triggerall=!var(9)
triggerall=var(0)=64
triggerall=var(59)>7
triggerall=power>=4000||var(1)
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=ctrl
triggerall=enemynear,movetype=A
trigger1 = P2Name = "Mukuro"|| P4Name = "Mukuro"
trigger2 = P2Name = "Maori"  || P4Name = "Maori" 
trigger3 = P2Name = "cvsjill" || P4Name = "cvsjill" 
trigger4 = P2Name = "Mouri Motonari" || P4Name = "Mouri Motonari"
trigger5 = P2Name = "Captain Commando"||P4Name = "Captain Commando"
trigger6 = P2Name = "vega"||  P4Name = "vega"
trigger6 = EnemyNear,AuthorName = "zy5678 & エス"
trigger7 = P2Name = "JUDA-(NERICYA)" ||  P4Name = "JUDA-(NERICYA)"
trigger8 = P2Name = "SAMCHAY" ||  P4Name = "SAMCHAY"
trigger9 = P2Name = "wind_MCXX" ||  P4Name = "wind_MCXX"
trigger10 = P2Name = "osho_beta" ||  P4Name = "osho_beta" 
trigger11 = P2Name = "Ayu Tukumiya" ||  P4Name = "Ayu Tukumiya" 
trigger11 = EnemyNear,AuthorName = "IYO"  
trigger12 = P2Name = "Haruhi Suzumiya" ||  P4Name = "Haruhi Suzumiya" 	
trigger13 = P2Name = "Abigail"  ||  P4Name =  "Abigail"  

[state -1,白羅滅精]
type=changestate
value=3100
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(7)
triggerall=!var(9)
triggerall=var(0)=64
triggerall=var(59)>7
triggerall=power>=3000||var(1)
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=ctrl
triggerall=enemynear,movetype=A
trigger1 = P2Name = "Mukuro"|| P4Name = "Mukuro"
trigger2 = P2Name = "Maori"  || P4Name = "Maori" 
trigger3 = P2Name = "cvsjill" || P4Name = "cvsjill" 
trigger4 = P2Name = "Mouri Motonari" || P4Name = "Mouri Motonari"
trigger5 = P2Name = "Captain Commando"||P4Name = "Captain Commando"
trigger6 = P2Name = "vega"||  P4Name = "vega"
trigger6 = EnemyNear,AuthorName = "zy5678 & エス"
trigger7 = P2Name = "JUDA-(NERICYA)" ||  P4Name = "JUDA-(NERICYA)"
trigger8 = P2Name = "SAMCHAY" ||  P4Name = "SAMCHAY"
trigger9 = P2Name = "wind_MCXX" ||  P4Name = "wind_MCXX"
trigger10 = P2Name = "osho_beta" ||  P4Name = "osho_beta" 
trigger11 = P2Name = "Ayu Tukumiya" ||  P4Name = "Ayu Tukumiya" 
trigger11 = EnemyNear,AuthorName = "IYO"  
trigger12 = P2Name = "Haruhi Suzumiya" ||  P4Name = "Haruhi Suzumiya" 	
trigger13 = P2Name = "Abigail"  ||  P4Name =  "Abigail"  

;---------------------------------------------------------------------------
;どこキャン
[state -1,斬風燕破 鳳牙・弱]
type=changestate
value=1100
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=var(1)>150
triggerall=random<(var(59)*143)
trigger1=stateno=1000
trigger1=movehit
trigger1=animelemtime(13)=1
trigger2=stateno=1000
trigger2=moveguarded
trigger2=animelemtime(14)=1
trigger3=stateno=1050
trigger3=movehit
trigger3=animelemtime(12)=1
trigger4=stateno=1050
trigger4=moveguarded
trigger4=animelemtime(13)=1

[state -1,白羅滅精]
type=changestate
value=3100
triggerall=var(59)&&alive&&roundstate=2
triggerall=(var(1)&&power>=1000)
triggerall=!var(7)
triggerall=statetype!=a
triggerall=var(1)=[1,150]
triggerall=random<((var(59)-3)*250)
trigger1=stateno=1000
trigger1=movehit
trigger1=animelemtime(13)=1
trigger2=stateno=1000
trigger2=moveguarded
trigger2=animelemtime(14)=1
trigger3=stateno=1050
trigger3=movehit
trigger3=animelemtime(12)=1
trigger4=stateno=1050
trigger4=moveguarded
trigger4=animelemtime(13)=1

;地上立ち回り技振り

;投げ
[state -1,魔舞紅躁]
type=changestate
value=1600
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,statetype!=a
triggerall=enemynear,movetype!=h
triggerall=p2bodydist x<10
triggerall=ctrl
trigger1=random<(var(59)*50)
trigger2=(enemynear,stateno=[120,159])

;投げ
[state -1,魔舞紅躁]
type=changestate
value=2600
triggerall=var(59)&&alive&&roundstate=2
triggerall=(var(1)&&power>=1000)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,statetype!=a
triggerall=p2bodydist x<50
triggerall=ctrl
trigger1=random<(var(59)*50)
trigger2=(enemynear,stateno=[120,159])

;---------------------------------------------------------------------------
;地上隙突き
[state -1,ふっとばし]
type=changestate
value=350
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x=[-5,20]
triggerall=p2bodydist y>-65
triggerall=enemynear,animtime<=-9
triggerall=enemynear,movetype=i
triggerall=random<(var(59)*20)
trigger1=enemynear,stateno=[200,649]
trigger2=enemynear,statetype=a
trigger2=!enemynear,ctrl

[state -1,2C]
type=changestate
value=420
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x=[-5,40]
triggerall=p2bodydist y>-70
triggerall=enemynear,animtime<=-9
triggerall=enemynear,movetype=i
triggerall=random<(var(59)*75)
trigger1=enemynear,stateno=[200,649]
trigger2=enemynear,statetype=a
trigger2=!enemynear,ctrl

;
[state -1,白羅]
type=changestate
value=3100
triggerall=var(59)&&alive&&roundstate=2
triggerall=power>=1000||var(1) 
triggerall=!var(7)
triggerall=statetype!=a
trigger1 = Stateno = 810
trigger1 = AnimTime = 0
trigger1 = AnimElemtime(2)>0
trigger1=random<(var(59)*60)

;
[state -1,紫紀]
type=changestate
value=1400
triggerall=var(59)&&alive&&roundstate=2
triggerall=!numhelper(1400) 
triggerall=!var(7)
triggerall=statetype!=a
trigger1 = Stateno = 810
trigger1 = AnimTime = 0
trigger1 = AnimElemtime(2)>0
trigger1=random<(var(59)*60)

;---------------------------------------------------------------------------
;空中隙突き
[state -1,Jふっとばし]
type=changestate
value=650
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x<50
triggerall=p2bodydist y=[-30,90]
triggerall=enemynear,animtime<=-3
triggerall=enemynear,movetype=i
triggerall=random<(var(59)*20)
trigger1=enemynear,stateno=[200,649]
trigger2=enemynear,statetype=a
trigger2=!enemynear,ctrl

[state -1,JC or JD]
type=changestate
value=ifelse(random%2,610,640)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x<50
triggerall=p2bodydist y=[-30,90]
triggerall=enemynear,animtime<=-3
triggerall=enemynear,movetype=i
triggerall=random<(var(59)*60)
trigger1=enemynear,stateno=[200,649]
trigger2=enemynear,statetype=a
trigger2=!enemynear,ctrl

;崩し
[state -1,魔舞紅躁]
type=changestate
value=1600
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=!inguarddist
triggerall=p2bodydist x<10
triggerall=enemynear,statetype!=a
triggerall=random<(var(59)*50)
trigger1=enemynear,movetype=h
trigger2=enemynear,stateno=[120,159]

;===========================================================================
;地上移動
[state -1,しゃがみ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=var(58)=0
trigger1=random<(var(59)*20)
var(58)=1

[state -1,立ち]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=var(58)=1
trigger1=random<(var(59)*20)
var(58)=0

[state -1,前中ジャンプ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
trigger1=random<(var(59)*5)
trigger1=p2bodydist x>160
trigger2=numhelper(1500)
trigger2=helper,movecontact
trigger2=helper(1400), stateno=21410

var(58)=22

[state -1,ダッシュ]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype=i
triggerall=!inguarddist
trigger1=p2bodydist x>80
trigger1=random<(var(59)*20)
trigger2=p2bodydist x>0
trigger2=enemynear,movetype=h
trigger2=enemynear,stateno!=[120,159]
triggerall=!numhelper(1500)
var(58)=3

[state -1,バックステップ]
type=changestate
value=705
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=enemynear,stateno!=[120,159]
trigger1=backedgebodydist>70
trigger1=p2bodydist x<140
trigger1=random<(var(59)*20)

[state -1,歩き]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!inguarddist
trigger1=enemynear,statetype!=l
trigger1=enemynear,movetype=i
trigger1=p2bodydist x>80
trigger1=random<((7-var(59))*20)
var(58)=2

[state -1,後ろ歩き]
type=varset
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=enemynear,stateno!=[120,159]
trigger1=enemynear,statetype!=l
trigger1=enemynear,movetype!=h
trigger1=backedgebodydist>70
trigger1=p2bodydist x<140
trigger1=random<((7-var(59))*20)
var(58)=-2

;===========================================================================
;地上立ち回り技振り

;投げ
[state -1,邪骸喰刹]
type=changestate
value=800
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype=s
triggerall=stateno!=100
triggerall=enemynear,statetype!=l
triggerall=enemynear,statetype!=a
triggerall=enemynear,movetype!=h
triggerall=p2bodydist x<10
triggerall=ctrl
trigger1=random<(var(59)*143)
trigger2=(enemynear,stateno=[120,159])

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




;ぶっぱ
[state -1,MAX白羅滅精]
type=changestate
value=3500
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=3000||(var(1)&&power>=1000)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,movetype!=h
triggerall=enemynear,movetype=a||enemynear,ctrl
trigger1=var(59)<=4
trigger1=random<(var(59)*power/2000)
trigger2=var(59)>4
trigger2=random<((7-var(59))*power/500)
trigger3=numhelper(1500)
trigger3=helper,movecontact=1
trigger4=var(59)>=8
trigger4=(var(0)&1)||(var(0)&64)
trigger4=!enemynear,ctrl
trigger4=enemynear,time<=1
trigger4=random<(power/10)

[state -1,白羅滅精]
type=changestate
value=3100
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=power>=1000||var(1)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,movetype!=h
triggerall=enemynear,movetype=a||enemynear,ctrl
trigger1=var(59)<=4
trigger1=random<(var(59)*power/1000)
trigger2=var(59)>4
trigger2=random<((7-var(59))*power/250)
trigger3=var(1)=[1,90]
trigger4=numhelper(1500)
trigger4=helper,movecontact=1
trigger5=var(59)>=8
trigger5=(var(0)&1)||(var(0)&64)
trigger5=!enemynear,ctrl
trigger5=enemynear,time<=1
trigger6=var(59)>=8
trigger6=var(0)&32

;---------------------------------------------------------------------------
;投げ対策
[state -1,斬風燕破 鳳牙・弱]
type=changestate
value=1100
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=enemynear,ctrl||enemynear,movetype=a
triggerall=!inguarddist
triggerall=p2bodydist x=[0,80]
triggerall=p2bodydist y=0
triggerall=enemynear,statetype!=a
trigger1=random<(var(59)*70)

;---------------------------------------------------------------------------
;対空
[state -1,斬風燕破 鳳牙・弱]
type=changestate
value=1100
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
triggerall=p2bodydist x=[0,80]
triggerall=p2bodydist y>-100
triggerall=enemynear,statetype=a
trigger1=random<(var(59)*60)

;---------------------------------------------------------------------------
;牽制
[state -1,斬風燕破 叛鏡]
type=changestate
value=1050
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
triggerall=p2bodydist x=[60,150]
triggerall=p2bodydist y>-70
trigger1=random<(var(59)*70)

[state -1,STshiki]
type=changestate
value=1400
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(1)
triggerall=!var(7)
triggerall=statetype!=a
triggerall=!numhelper(1400)
triggerall=ctrl
triggerall=!inguarddist
triggerall=p2bodydist x>120
trigger1=random<(var(59)*40)

[state -1,STグルガン]
type=changestate
value=1300
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(1) 
triggerall=!var(7)
triggerall=statetype!=a
triggerall=!numhelper(1300)
triggerall=!numhelper(1500)
triggerall=ctrl
triggerall=!inguarddist
triggerall=p2bodydist x>120
trigger1=random<(var(59)*40)

[state -1,STshiki]
type=changestate
value=1400
triggerall=var(59)&&alive&&roundstate=2
triggerall=!var(1)
triggerall=!var(7)
triggerall=statetype!=a
triggerall=!numhelper(1400)
triggerall=ctrl
triggerall=!inguarddist
triggerall=p2bodydist x>120
trigger1=random<(var(59)*40)

[state -1,立A or 2A]
type=changestate
value=ifelse(p2bodydist y<0,200,400)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
triggerall=p2bodydist x=[10,50]
triggerall=p2bodydist y>-70
triggerall=(enemynear,stateno!=[120,159])||enemynear,statetype=a
trigger1=random<(var(59)*50)

[state -1,立b]
type=changestate
value=210
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=!inguarddist
trigger1=stateno=200
trigger1=movecontact

[state -1,立b]
type=changestate
value=410
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=!inguarddist
trigger1=stateno=210
trigger1=movecontact


[state -1,立B or 2B]
type=changestate
value=ifelse(p2bodydist y<0,210,410)
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
triggerall=p2bodydist x=[50,120]
triggerall=p2bodydist y>-40
triggerall=(enemynear,stateno!=[120,159])||enemynear,statetype=a
trigger1=random<(var(59)*50)

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

[state -1,MAX発動]
type=changestate
value=950
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=power>=1000
triggerall=statetype!=a
triggerall=!var(1)
triggerall=ctrl
triggerall=p2bodydist x>120
triggerall=power>=2000
trigger1=random<((var(59)-3)*power/2000)

;===========================================================================
;空中牽制
[state -1,JC or JD]
type=changestate
value=600
triggerall=var(59)&&alive&&roundstate=2
 
triggerall=statetype=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=enemynear,movetype!=h
triggerall=!inguarddist
triggerall=p2bodydist x<50
triggerall=p2bodydist y=[-30,90]
triggerall=(enemynear,stateno!=[120,159])||enemynear,statetype!=a
trigger1=random<(var(59)*30)
trigger2=numhelper(1500)
trigger2=helper,movecontact
trigger2=helper(1400), stateno=21410

;B
[State -1, Stand Light Kick]
type = ChangeState
value = 610
triggerall=var(59)
triggerall = statetype = a
trigger1=stateno=600
trigger1=movecontact
trigger2=var(1)
trigger2=stateno=[600,620]
trigger2=movecontact
;---------------------------------------------------------------------------

;C
[State -1, Stand Light Kick]
type = ChangeState
value = 620
triggerall=var(59)
triggerall = statetype = a
trigger1=stateno=[600,610]
trigger1=movecontact
trigger2=var(1)
trigger2=stateno=[600,620]
trigger2=movecontact

=======================================================

[state -1,鬼神猛撃拳]
type=changestate
value=1701
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype=a
triggerall=ctrl
triggerall=enemynear,statetype!=l
triggerall=p2bodydist x>150
trigger1=random<(var(59)*30)



;===========================================================================

[state -1,挑発]
type=changestate
value=195
triggerall=var(59)&&alive
 
triggerall=statetype!=a
triggerall=ctrl
triggerall=prevstateno!=195
trigger1=roundstate=2
trigger1=random<((5-var(59))*5)
trigger2=var(59)>=8
trigger2=winko

;===========================================================================

[state -1,しゃがみ解除]
type=ctrlset
triggerall=var(59)&&alive&&roundstate=2
triggerall=stateno=[10,11]
triggerall=ctrl=0
trigger1=var(58)!=1
trigger1=var(58)!=[12,13]
trigger1=var(58)!=[22,23]
trigger1=var(58)!=[-23,-22]
trigger2=(var(58)=[12,13])||(var(58)=[22,23])||var(58)=[-23,-22]
trigger2=var(5)>=19
value=1

[state -1,ガード実行]
type=changestate
value=120
triggerall=var(59)&&alive&&roundstate=2
triggerall=ctrl
triggerall=inguarddist
trigger1=var(58)=[50,51]

[state -1,ダッシュ実行]
type=changestate
value=100
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=stateno!=100
trigger1=var(58)=3
triggerall=!numhelper(1500)

[state -1,ジャンプ実行]
type=changestate
value=40
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
trigger1=var(58)=[10,11]
trigger2=var(58)=[20,21]
trigger3=var(58)=[-21,-20]
trigger4=(var(58)=[12,13])||(var(58)=[22,23])||var(58)=[-23,-22]
trigger4=var(5)>=16

[state -1,歩き実行]
type=changestate
value=20
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=stateno!=20
trigger1=var(58)=2
trigger2=var(58)=-2

[state -1,しゃがみ実行]
type=changestate
value=10
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=stateno!=[10,12]
trigger1=var(58)=1
trigger2=(var(58)=[12,13])||(var(58)=[22,23])||var(58)=[-23,-22]
trigger2=var(5)<20
ctrl=0

[state -1,立ち実行]
type=changestate
value=0
triggerall=var(59)&&alive&&roundstate=2
triggerall=statetype!=a
triggerall=ctrl
triggerall=stateno!=0
trigger1=var(58)=0
