;===========================================================================
; ?常時監視ステ?ト（?３）
;===========================================================================
;---------------------------------------------------------------------------
; こちらは通常の食らい状態以外の「P2StateNo」や「TargetState」等で制御された、
; 作成者が任意に指定した相手側の食らいステ?トに限り、
; 登?したステ?トコントロ?ラが有効にはなりません。
; ?１や?２と上手く使い分けて行きましょう。
;---------------------------------------------------------------------------

[Statedef -3]

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

[State 0, VarSet];デバッグスイッ?。０で何もなし。1でX??ンを押すたびに満開ゲ?ジが10溜まる。Yで-10。
type = VarSet
trigger1 = 1
v = 41    
value = 1                     ;左の数値を変更

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

[State 0, VarSet];強制満開スイッ?。1で強制的に満開を発動させられることがある。2で自分が負けているときのみ強制満開発動
type = VarSet
trigger1 = 1
v = 46    
value = 1                     ;左の数値を変更

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

[State 0, VarSet];火車スイッ?  1で常に火車が使えるように。通常は満開経験後に使用可?。
type = VarSet
trigger1 = 1
v = 47    
value = 1                     ;左の数値を変更

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

[State 0, VarSet];目の散華のオンオフ。0でなし。1で完全に散華。2で控えめな散華。3で微妙な散華。4で何とも言えない散華。
type = VarSet
trigger1 = 1
v = 48    
value = 2                      ;左の数値を変更

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

[State 0, VarSet];散華があるかどうか。1であり。2でなし。
type = VarSet
trigger1 = 1
v = 49    
value = 1                      ;左の数値を変更

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

[State 0, VarSet];くらい抜けの上限回数?デフォルトでは1
type = VarSet
trigger1 = 1
v = 24
value = 1                      ;左の数値を変更

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

;-----------------------------------
;ここは「ジャンプ」か「バックステップ」をした後に
;着地する音を鳴らす設定をしています。


[State 0, VarAdd]
type = VarAdd
trigger1 = Var(41) = 1
trigger1 = command ="x"
trigger1 = Ailevel = 0
v = 58    ;fv =
value = 10

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(41) = 1
trigger1 = command ="y"
trigger1 = Ailevel = 0
v = 58    ;fv =
value = -10

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 33    ;fv = 10
value = Gametime


[State 0, LifeAdd]
type = LifeAdd
trigger1 = Var(57) = 1
trigger1 = Life <=0
value = 1
kill = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Var(52)
flag = nokosnd


[State 0, NotHitBy]
type = NotHitBy
trigger1 = Var(57)=1
value = ,NT,ST,HT
time = 1





[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 100  ;着地ステ?ト
trigger2 = stateno = 110  ;着地ステ?ト
value = s40, 1

[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステ?ト
trigger2 = stateno = 45  ;着地ステ?ト
value = s40, 1

[State 0, Explod]
type = Explod
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステ?ト
trigger2 = stateno = 45  ;着地ステ?ト
trigger3 = stateno = 252  ;着地ステ?ト
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,0.6
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステ?ト
trigger2 = stateno = 45  ;着地ステ?ト
trigger3 = stateno = 252  ;着地ステ?ト
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,0.6
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, VarAdd]
type = VarAdd
trigger1 = (stateno != [1200,1230]) &&(stateno != 1700)
trigger1 = movecontact = 1
v = 58    ;fv =
value = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = (stateno != [1200,1230]) &&(stateno != 1700)
trigger1 = movehit = 1
v = 58    ;fv =
value = 1

[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52  ;着地ステ?ト
trigger2 = stateno = 106 ;バックステップ後の着地ステ?ト
value = 40, 0

[State 0, Helper]
type = Helper
trigger1 = Numhelper(11000) = 0
trigger1 = teamside = 1
helpertype = normal ;player
name = "gage"
ID = 11000
stateno = 11000
pos = 0,-0
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.2
size.yscale = 0.2



[State 0, Helper]
type = Helper
trigger1 = Numhelper(11000) = 0
trigger1 = teamside = 2
helpertype = normal ;player
name = "gage"
ID = 11000
stateno = 11000
pos = 0,-0
postype = right    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.2
size.yscale = 0.2

[State 0, Helper]
type = Helper
trigger1 = Numhelper(21100) = 0
trigger1 = teamside = 1
helpertype = normal ;player
name = "silhouette"
ID = 21100
stateno = 21100
pos = 0,0
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.4
size.yscale = 0.4

[State 0, Helper]
type = Helper
trigger1 = Numhelper(21100) = 0
trigger1 = teamside = 2
helpertype = normal ;player
name = "silhouette"
ID = 21100
stateno = 21100
pos = 0,0
postype = right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.4
size.yscale = 0.4

[State 0, VarSet]
type = VarSet
trigger1 = Ailevel = 0
trigger1 = command ="z"
trigger1 = movehit = 1
v = 21    ;fv = 10
value = 1
;ignorehitpause = 1
;persistent =


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


; AI state by Eperion

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= 100+(power >= 3000)*1000
triggerall = P2bodydist X = [0,120]
triggerall = P2bodydist Y = [-20,10]
triggerall = enemynear,movetype = A && enemynear,animtime <= -10
triggerall = Var(54) = 0
triggerall = var(57) = 0
triggerall = power >= 1000
trigger1 = ctrl
value = 2999

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= (life <= 300)*500
triggerall = P2bodydist X = [0,100]
triggerall = P2bodydist Y = [-100,80]
triggerall = enemynear,movetype = A
triggerall = var(57) = 0
triggerall = var(58) >= 100
trigger1 = ctrl
value = 3500

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= 800-(enemynear,statetype != A && enemynear,animtime >= -6)*1000-(enemynear,stateno = 52)*1000-(enemynear,p2dist x < 0 && enemynear,vel x > 0)*1000
triggerall = P2bodydist X = [0,60]
triggerall = P2bodydist Y = [-60,10]
triggerall = enemynear,movetype = A
triggerall = Var(54) = 0
triggerall = var(57) = 0
trigger1 = ctrl
value = 710

[State -3]
type = ChangeState
value = 4120
triggerall = Ailevel > 0 && random <= 50+(p2bodydist x > 100)*1000
triggerall = Var(57) = 1
triggerall = enemynear,movetype = A
trigger1 = stateno = 4000
trigger2 = stateno = 4200
trigger2 = AnimelemTime(6) >= 3
trigger3 = stateno = 4210
trigger3 = AnimelemTime(10) >= 0
trigger3 = stateno = 4220
trigger4 = AnimelemTime(5) >= 3

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(57) = 1
triggerall = power >= 1000 && random <= 300
trigger1 = stateno = 4220 && movehit
value = 4300

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(57) = 1
trigger1 = stateno = 4220 && movehit
value = 4230

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0 && random <= 500
triggerall = Var(57) = 1
triggerall = p2bodydist x = [0,100]
triggerall = p2bodydist y = [-100,50]
trigger1 = stateno = 4000
value = 4200

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(57) = 1
trigger1 = stateno = 4200 && movecontact
value = 4210

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(57) = 1
trigger1 = stateno = 4210 && movehit && AnimElemTime(8) >= 0
value = 4220

[State -3]
type = ChangeState
value = 4100
triggerall = Ailevel > 0 && random <= 200
triggerall = Var(57) = 1
triggerall = p2bodydist x > 100
triggerall = stateno = 4000
triggerall = enemynear,movetype != A
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
Type = ChangeState
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 1000+(enemynear,stateno != [200,699])*400
triggerall = stateno != [120,159]
triggerall = !ishelper
triggerall = ctrl
triggerall = var(57) = 0
trigger1 = InGuardDist && P2MoveType = A
trigger2 = (enemy,numhelper > 0 || enemy,numproj > 0) && P2MoveType = A
Value = 120

[State -3]
type = ChangeState
value = 100
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 50
triggerall = p2bodydist x >= 120
triggerall = statetype != A
triggerall = ctrl
triggerall = stateno != [120,159]
triggerall = enemynear,movetype != A
triggerall = var(57) = 0
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
type = ChangeState
value = 19
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= (enemynear,statetype != A)*200
triggerall = p2bodydist x > 8
triggerall = statetype != A
triggerall = ctrl
triggerall = stateno != [120,159]
triggerall = enemynear,movetype != A
triggerall = var(57) = 0
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
type = ChangeState
value = 39
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 10+(enemynear,statetype != A)*200
triggerall = p2bodydist x >= 150
triggerall = statetype != A
triggerall = ctrl
triggerall = stateno != [120,159]
triggerall = var(51) = 0
triggerall = var(57) = 0
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
type = ChangeState
value = 105
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && var(57) = 0 && var(51) = 0
triggerall = p2bodydist x = [0,60]
triggerall = statetype != A
triggerall = enemynear,statetype = L && enemynear,alive = 1
triggerall = ctrl
triggerall = backedgedist >= 60
trigger1 = ctrl

[State -3]
type = ChangeState
value = 195 + (life >= 400 && random <= 500)*10000
triggerall = winko
triggerall = Ailevel > 0 && var(57) = 0
triggerall = Roundstate > 2
triggerall = statetype != A
triggerall = ctrl
trigger1 = stateno !=195
trigger1 = prevstateno !=195
trigger1 = stateno !=10195
trigger1 = prevstateno !=10195
persistent = 0

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(51) = 0
triggerall = var(57) = 0
triggerall = power >= 2000
trigger1 = stateno = 2999 && movehit
value = 3200

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(54) = 0
triggerall = var(57) = 0
triggerall = power >= 1000
trigger1 = stateno = 1415 && movehit
trigger2 = stateno = 1215 && movehit && time <= 5 && random <= 20
trigger3 = stateno = 210 && movehit && var(55) != 0 && time <= 8 && random <= 300
value = 2999

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0 && random <= 200+(power >= 3500)*1000
triggerall = Var(51) = 0
triggerall = var(57) = 0
triggerall = power >= 1500
triggerall = enemynear,statetype != A
trigger1 = stateno = 230 && movehit
trigger2 = stateno = 210 && movehit && var(55) != 0 && time <= 8
trigger3 = stateno = 400 && movehit && var(54) != 0 && time <= 7
value = 1400

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(55) = 0
triggerall = var(57) = 0
triggerall = enemynear,statetype != A
trigger1 = stateno = 230 && movehit
trigger2 = stateno = 400 && movehit && var(54) != 0 && time <= 7
value = 1200

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(54) = 0
triggerall = var(57) = 0
triggerall = enemynear,statetype = A
trigger1 = stateno = 230 && movehit
trigger2 = stateno = 400 && movehit && var(54) != 0 && time <= 7
value = 710

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(54) = 0
triggerall = var(57) = 0
trigger1 = stateno = 230 && movehit
trigger2 = stateno = 230 && moveguarded && var(51) != 0
trigger3 = stateno = 210 && movecontact && var(55) != 0
value = 1000

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(51) = 0
triggerall = var(57) = 0
trigger1 = stateno = 230 && moveguarded
trigger2 = stateno = 400 && moveguarded && var(54) != 0
value = 1300

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(51) = 0
triggerall = var(57) = 0
trigger1 = stateno = 610 && movehit
value = 1100+(enemynear,statetype != A)*10

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(55) = 0
triggerall = var(57) = 0
trigger1 = stateno = 210 && movecontact
value = 230

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = Ailevel > 0
triggerall = Var(54) = 0
triggerall = var(57) = 0
trigger1 = stateno = 400 && movecontact
value = 210

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype = A && ctrl
trigger1 = Ailevel > 0 && random <= 100
trigger1 = pos y <= -150
trigger1 = P2bodydist X = [140,200]
trigger1 = var(55) = 0
trigger1 = var(57) = 0
trigger1 = ctrl
value = 1230

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype = A && ctrl
trigger1 = Ailevel > 0 && random <= 200
trigger1 = pos y <= -150
trigger1 = P2bodydist X = [-10,50]
trigger1 = var(51) = 0
trigger1 = var(57) = 0
trigger1 = ctrl
value = 1110

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A && ctrl
trigger1 = Ailevel > 0
trigger1 = enemynear,stateno = [1027,1028]
trigger1 = enemynear,statetype = A && enemynear,movetype = H
trigger1 = P2bodydist X = [0,60]
trigger1 = var(54) = 0
trigger1 = var(57) = 0
trigger1 = ctrl
value = 710

[State -3]
type = ChangeState
value = 800
triggerall=Roundstate=2
triggerall = Ailevel > 0 && random <= 990
triggerall = statetype != A && ctrl = 1
triggerall = stateno != 100
triggerall = var(54) = 0 && var(55) = 0 && var(57) = 0
triggerall = enemynear,stateno != [5200,5201]
trigger1 = p2bodydist X = [-2,10]
trigger1 = p2statetype != A && p2statetype != L && p2movetype != H

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A && ctrl
trigger1 = Ailevel > 0 && random <= 150+(enemynear,Ailevel = 0)*50+(enemynear,p2dist x < 0)*350+(numtarget(1110) > 0)*750-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [0,40]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(55) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype != A
trigger1 = enemynear,statetype != L
trigger1 = ctrl
value = 400

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A && ctrl
trigger1 = Ailevel > 0 && random <= 100+(enemynear,Ailevel = 0)*50-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [50,100]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(51) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype = C
value = 240

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A && ctrl
trigger1 = Ailevel > 0 && random <= 100+(enemynear,Ailevel = 0)*20+(enemynear,p2dist x < 0)*80+(numtarget(1110) > 0)*750-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [0,70]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(55) != 0
trigger1 = var(54) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype != A
trigger1 = enemynear,statetype != L
trigger1 = ctrl
value = 210

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype = A && ctrl
trigger1 = Ailevel > 0 && random <= 690
trigger1 = var(55) = 0
trigger1 = var(57) = 0
trigger1 = P2bodydist X = [-10,70]
trigger1 = P2bodydist Y = [-60,100]
value = 600

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype = A && ctrl
trigger1 = Ailevel > 0 && random <= 690
trigger1 = var(51) = 0
trigger1 = var(57) = 0
trigger1 = P2bodydist X = [-10,100]
trigger1 = P2bodydist Y = [-80,100]
value = 610

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype = A && ctrl
trigger1 = Ailevel > 0 && random <= 690
trigger1 = var(54) = 0
trigger1 = var(57) = 0
trigger1 = P2bodydist X = [-10,80]
trigger1 = P2bodydist Y = [-60,100]
value = 630

[State -3];Bonus :>
type = poweradd
trigger1 = movetype = A && time = 1
trigger1 = stateno < 2999
value = 50


;---------------------------------------------------------------------------
; Walk AI
[Statedef 19]
type    = S
physics = S
sprpriority = 0
ctrl = 0

[State 20, 1]
type = VelSet
trigger1 = 1
x = const(velocity.walk.fwd.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= 100+(power >= 3000)*1000
triggerall = P2bodydist X = [0,120]
triggerall = P2bodydist Y = [-20,10]
triggerall = enemynear,movetype = A && enemynear,animtime <= -10
triggerall = Var(54) = 0
triggerall = var(57) = 0
triggerall = power >= 1000
trigger1 = 1
value = 2999

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= (life <= 300)*500
triggerall = P2bodydist X = [0,100]
triggerall = P2bodydist Y = [-100,80]
triggerall = enemynear,movetype = A
triggerall = var(57) = 0
triggerall = var(58) >= 100
trigger1 = 1
value = 3500

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
triggerall = Ailevel > 0 && random <= 800-(enemynear,statetype != A && enemynear,animtime >= -6)*1000-(enemynear,stateno = 52)*1000-(enemynear,p2dist x < 0 && enemynear,vel x > 0)*1000
triggerall = P2bodydist X = [0,60]
triggerall = P2bodydist Y = [-60,10]
triggerall = enemynear,movetype = A
triggerall = Var(54) = 0
triggerall = var(57) = 0
trigger1 = 1
value = 710

[State -3]
Type = ChangeState
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 1000+(enemynear,stateno != [200,699])*400
triggerall = stateno != [120,159]
triggerall = !ishelper
triggerall = var(57) = 0
trigger1 = InGuardDist && P2MoveType = A
trigger2 = (enemy,numhelper > 0 || enemy,numproj > 0) && P2MoveType = A
Value = 120

[State -3]
type = ChangeState
value = 100
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 50
triggerall = p2bodydist x >= 120
triggerall = statetype != A
triggerall = stateno != [120,159]
triggerall = enemynear,movetype != A
triggerall = var(57) = 0
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
type = ChangeState
value = 39
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && random <= 10+(enemynear,statetype != A)*200
triggerall = p2bodydist x >= 150
triggerall = statetype != A
triggerall = ctrl
triggerall = stateno != [120,159]
triggerall = var(51) = 0
triggerall = var(57) = 0
trigger1 = enemynear,statetype != L
trigger2 = enemynear,statetype = L && enemynear,alive = 0

[State -3]
type = ChangeState
value = 105
triggerall = Roundstate = 2
triggerall = Ailevel > 0 && var(57) = 0 && var(51) = 0
triggerall = p2bodydist x = [0,60]
triggerall = statetype != A
triggerall = enemynear,statetype = L && enemynear,alive = 1
triggerall = backedgedist >= 60
trigger1 = 1

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A && ctrl
trigger1 = Ailevel > 0
trigger1 = enemynear,stateno = [1027,1028]
trigger1 = enemynear,statetype = A && enemynear,movetype = H
trigger1 = P2bodydist X = [0,60]
trigger1 = var(54) = 0
trigger1 = var(57) = 0
trigger1 = ctrl
value = 710

[State -3]
type = ChangeState
value = 800
triggerall=Roundstate=2
triggerall = Ailevel > 0 && random <= 990
triggerall = statetype != A && ctrl = 1
triggerall = stateno != 100
triggerall = var(54) = 0 && var(55) = 0 && var(57) = 0
triggerall = enemynear,stateno != [5200,5201]
trigger1 = p2bodydist X = [-2,10]
trigger1 = p2statetype != A && p2statetype != L && p2movetype != H

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
trigger1 = Ailevel > 0 && random <= 150+(enemynear,Ailevel = 0)*50+(enemynear,p2dist x < 0)*350+(numtarget(1110) > 0)*750-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [0,40]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(55) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype != A
trigger1 = enemynear,statetype != L
trigger1 = ctrl
value = 400

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
trigger1 = Ailevel > 0 && random <= 100+(enemynear,Ailevel = 0)*50-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [50,100]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(51) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype = C
value = 240

[State -3]
type = ChangeState
triggerall=Roundstate=2
triggerall = statetype != A
trigger1 = Ailevel > 0 && random <= 100+(enemynear,Ailevel = 0)*20+(enemynear,p2dist x < 0)*80+(numtarget(1110) > 0)*750-(enemynear,stateno = [38,40])*1000
trigger1 = P2bodydist X = [0,70]
trigger1 = P2bodydist Y = [-5,10]
trigger1 = var(55) != 0
trigger1 = var(54) = 0
trigger1 = var(57) = 0
trigger1 = enemynear,statetype != A
trigger1 = enemynear,statetype != L
trigger1 = ctrl
value = 210

[State 100, Change to Walk Stop]
type=ChangeState
trigger1 = roundstate > 2
trigger2 = p2bodydist x <= 8
value=0
ctrl=1



;---------------------------------------------------------------------------
;HIgh Jump AI
[Statedef 39]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
facep2 = 1


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 41, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 10
length = 10
timegap = 1
framegap = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S40,2
volume = 0
channel = -1

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = f60
ID = 100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 40, 2]
type = VarSet
trigger1 = 1
sysvar(1) = 1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x)+2, const(velocity.jump.back.x)-2))
y = const(velocity.jump.y)-5

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1
