
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------

[Statedef -2]

[State 1006]
type = Helper
trigger1 = NumHelper(10037) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10037 
ownpal = 1
keyctrl = 1 
id = 10037  

[State 1006]
type = Helper
trigger1 = NumHelper(10036) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10036 
ownpal = 1
keyctrl = 1 
id = 10036  

[State 10035]
type = Helper
trigger1 = NumHelper(10035) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10035 
ownpal = 1
keyctrl = 1 
id = 10035    

[State 10020]
type = Helper
trigger1 = NumHelper(10020) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10020 
ownpal = 1
keyctrl = 1 
id = 10020    

[State 10021]
type = Helper
trigger1 = NumHelper(10021) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10021 
ownpal = 1
keyctrl = 1 
id = 10021

[State 10034]
type = Helper
trigger1 = NumHelper(10034) = 0
name = "test" 
pos = 0,0 
postype = P1  
stateno = 10034 
ownpal = 1
keyctrl = 1 
id = 10034     



[State 10034]
type = Helper
trigger1 = NumHelper(10034) = 0  
name = "test"                             
pos = 0,0                                 
postype = P1
stateno = 10034 
ownpal = 1
keyctrl = 1 
id = 10034     


[State 22126]
type = Helper
trigger1 = NumHelper(22126) = 0
name = "test" 
pos = 0,0                                
postype = P1                       
stateno = 22126                            
ownpal = 1
keyctrl = 1                                  
id = 22126    

[State 191, 1]
type = stopsnd
trigger1 = stateno != [191,192]
channel = 2

[State -3, 3]
type = null;PlaySnd
trigger1 = stateno = 150
trigger2 = stateno = 152
;trigger2 = anim = 150
;trigger3 = anim = 152
;trigger4 = anim = 154
triggerall = time = 0
value = S0,19
persistent = 0
ignorehitpause = 1

[State -3, 3]
type = PlaySnd
trigger1 = stateno = 150
trigger2 = stateno = 152
;trigger2 = anim = 150
;trigger3 = anim = 152
;trigger4 = anim = 154
triggerall = time = 0
value = S0,19
persistent = 0
ignorehitpause = 1

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

[State lin's lifeadd ]
type = lifeadd
triggerall = life >50 && time%5 =0 
trigger1 = enemy,name = "lin"
trigger1 = enemy,var(18) = 1
value = -1

[state -3, nolifebar]
type = assertspecial
trigger1 = roundstate != 2
flag = NoBarDisplay

[State -3, Turns Mode Intro]
type = ChangeState
triggerall = teammode = turns
triggerall = roundno > 1
triggerall = time = 0
triggerall = roundstate = 0
triggerall = roundsexisted >= 0
trigger1 = p2name = "k9999"
trigger2 = p4name = "k9999"
trigger3 = p2name = "k'"
trigger4 = p4name = "k'"
trigger5 = p2name = "kula"
trigger6 = p4name = "kula"
trigger7 = p2name = "maxima"
trigger8 = p4name = "maxima"
trigger9 = p2name = "Kung Fu Man"
trigger10 = p4name = "Kung Fu Man"
value = 192

[State 191, 3]
type = stopsnd
trigger1 = movetype = H
channel = 0

[State -3]
type = varset
trigger1 = 1
trigger1 = P2statetype != C
var(11) = -150 - (-150 - floor(p2bodydist y))

[State -3]
type = varset
trigger1 = 1
trigger1 = P2statetype = S
var(11) = 0

[State -3, 3]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 || stateno = 1011 || stateno = 1016
value = S0,16

[State -3, 5]
type = PlaySnd
trigger1 = stateno = 50
trigger1 = Time = 2
value = S0,15

[State -2]
type = AssertSpecial
trigger1 = 1
flag = NoAirGuard
ignorehitpause = 1

[State -3, 5]
type = varrandom
trigger1 = 1
v = 3
range = 1,4

[State -3, 5]
type = PlaySnd
triggerall = alive = 1
trigger1 = Time = 1 && stateno = 5000 && (anim = 5000 || anim = 5010)
triggerall = var(3) = 1
value = S0,33

[State -3, 5]
type = PlaySnd
triggerall = alive = 1
trigger1 = Time = 1 && stateno = 5000 && (anim = 5001 || anim = 5011)
triggerall = var(3) = 1
value = S0,34

[State -3, ai]
type = varset
triggerall = var(59) = 0
trigger1 = command = "cpu"
trigger2 = command = "cpu2"
trigger3 = command = "cpu3"
trigger4 = command = "cpu4"
trigger5 = command = "cpu5"
trigger6 = command = "cpu6"
trigger7 = command = "cpu7"
trigger8 = command = "cpu8"
trigger9 = command = "cpu9"
trigger10 = command = "cpu10"
trigger11 = command = "cpu11"
trigger12 = command = "cpu12"
trigger13 = command = "cpu13"
trigger14 = command = "cpu14"
trigger15 = command = "cpu15"
trigger16 = command = "cpu16"
trigger17 = command = "cpu17"
trigger18 = command = "cpu18"
trigger19 = command = "cpu19"
trigger20 = command = "cpu20"
trigger21 = command = "cpu21"
trigger22 = command = "cpu22"
trigger23 = command = "cpu23"
trigger24 = command = "cpu24"
trigger25 = command = "cpu25"
trigger26 = command = "cpu26"
trigger27 = command = "cpu27"
trigger28 = command = "cpu28"
trigger29 = command = "cpu29"
trigger30 = command = "cpu30"
trigger31 = command = "cpu31"
trigger32 = command = "cpu32"
trigger33 = command = "cpu33"
trigger33 = command = "cpu34"
var(59) = 1

[State -3, BOSS]
type = varset
trigger1 = palno = [7,12]
var(58) = 1

;[State -3, BOSS]
;type = powerset
;trigger1 = var(58) = 1
;trigger1 = 1
;value = 3000

[State -3, BOSS]
type = lifeadd
;trigger1 = timemod = 5,0
trigger1 = time >= 1
value = 5

[State 1]
type = Trans
trigger1 = 1
trans = addalpha
;alpha = 50,230
alpha = 250,180

[State 1]
type = HitOverride
triggerall = statetype != A
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 10051
ignorehitpause = 1

[State 1]
type = HitOverride
triggerall = statetype = A
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 38853
ignorehitpause = 1

[State 1]
type = HitOverride
triggerall = stateno = 40 || stateno = 52
trigger1 = 1
time = 1
attr = SCA, NA, SA, HA, NT,ST,HT, NP, SP, HP,AA,AT,AP
stateno = 38852
ignorehitpause = 1

;[State 1000, 2]
;type = HitOverRide
;trigger1 = statetype != A
;time = 1
;attr = SCA,AA,AP,AT
;stateno = 20004
;IgnoreHitPause = 1
;PauseMoveTime = 99999

[State -3, BOSS]
type = poweradd
trigger1 = timemod = 1,0
value = 1

[State -2]
type = AssertSpecial
trigger1 = 1
trigger1 = var(58) = 1
flag = Nojugglecheck
ignorehitpause = 1

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%5) = 1
anim = 22126
sprpriority = 0
postype = p1
pos = 0,-70
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = null;Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 0
postype = p1
pos = -5,-90
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%5) = 1
;trigger1 = time = 0
anim = 22125;22063
sprpriority = 0
postype = p1
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%20) = 1
anim = 22123
id = 22123
sprpriority = 99
postype = p1
pos = 0,-85
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%35) = 1
anim = 22123
id = 22123
sprpriority = 99
postype = p1
pos = 20,-60
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%30) = 1
anim = 22123
id = 22123
sprpriority = 99
postype = p1
pos = -20,-40
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%40) = 1
anim = 22122
id = 22123
sprpriority = 99
postype = p1
pos = -10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%46) = 1
anim = 22122
id = 22123
sprpriority = 99
postype = p1
pos = -10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%49) = 1
anim = 22122
id = 22123
sprpriority = 99
postype = p1
pos = 0,-30
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999



[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%46) = 1
anim = 22124
id = 22123
sprpriority = 99
postype = p1
pos = 10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%38) = 1
anim = 22124
id = 22123
sprpriority = 99
postype = p1
pos = 10,-10
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999


[State -1]
type = Explod
triggerall = anim = 0
triggerall = time >= 0
trigger1 = (GameTime%42) = 1
anim = 22124
id = 22123
sprpriority = 99
postype = p1
pos = 0,-30
bindtime = -1
under = 0
ownpal = 1
persistent = 0
ignorehitpause = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

;-------------------------------------------------------
;AI
[State -3]
type = ChangeState
value = 130
triggerall = p2movetype = A
triggerall = P2Life > 0
triggerall = statetype != A
triggerall = var(59) = 1
triggerall = ctrl
triggerall = stateno != 191
triggerall = statetype != A
trigger1 = p2statetype = S
trigger1 = random <= 900
trigger1 = Enemy, Numproj = 1 && P2MoveType = A

[State -3]
type = ChangeState
value = 900
triggerall = p2movetype = A
;triggerall = P2bodydist X <= 90
;triggerall = P2Life > 0
triggerall = statetype != A
triggerall = var(59) = 1
triggerall = ctrl
triggerall = stateno != [150,153]
;triggerall = stateno != 191
;trigger1 = p2statetype = S
triggerall = random <= 17
trigger1   = p2dist X < 30 && p2movetype = A && ctrl
trigger2   = p2dist X < 100 && p2movetype = A && ctrl
trigger3   = p2dist Y > -40 && p2bodydist X < 10 && p2movetype = A && ctrl
trigger4   = P2dist X > 70 && p2movetype != H && ctrl
trigger5   = enemy, numproj >= 1 && enemy, backedgedist <= 30 && ctrl
trigger6   = p2movetype = A && ctrl && enemy, ishelper
trigger7   = (enemy, p2bodydist X = [-10, 40]) && enemy, hitdefattr = SCA, AA, AT, AP
trigger8 = Enemy, Numproj = 1 && P2MoveType = A
trigger9   = enemy, numproj >= 1 && enemy, backedgedist <= 30 && ctrl
trigger10   = p2movetype = A && ctrl && enemy, ishelper
trigger10   = (enemy, p2bodydist X = [-10, 40]) && enemy, hitdefattr = SCA, AA, AT, AP

[State -3]
type = ChangeState
value = 900
;triggerall = p2movetype = A
triggerall = statetype != A
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = ctrl
triggerall = stateno != [150,153]
triggerall = random <= 70
trigger1   = p2dist X < 30 && p2movetype = A && ctrl
trigger2   = p2dist X < 100 && p2movetype = A && ctrl
trigger3   = p2dist Y > -40 && p2bodydist X < 10 && p2movetype = A && ctrl
trigger4   = P2dist X > 70 && p2movetype != H && ctrl
trigger5   = enemy, numproj >= 1 && enemy, backedgedist <= 30 && ctrl
trigger6   = p2movetype = A && ctrl && enemy, ishelper
trigger7   = (enemy, p2bodydist X = [-10, 40]) && enemy, hitdefattr = SCA, AA, AT, AP
trigger8 = Enemy, Numproj = 1 && P2MoveType = A
trigger9   = p2movetype = A && ctrl && enemy, ishelper
trigger9   = (enemy, p2bodydist X = [-10, 40]) && enemy, hitdefattr = SCA, AA, AT, AP
trigger10 = Enemy, Numhelper = 1 && P2MoveType = A
trigger11 = backedgedist <= 20 && P2MoveType = A

;--------------------------
[State -3]
type = ChangeState
value = 131
triggerall = p2movetype = A
triggerall = P2bodydist X <= 60
triggerall = P2Life > 0
triggerall = statetype != A
triggerall = var(59) = 1
triggerall = ctrl
triggerall = statetype != A
triggerall = stateno != 191
trigger1 = p2statetype = C
trigger1 = random <= 800
trigger1 = Enemy, Numproj = 1 && P2MoveType = A

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1060
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 25
triggerall = p2statetype != L
triggerall = p2life > 0
trigger1 = P2BodyDist X < 60
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022

[State -1]
type = ChangeState
value = 1060
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 100
triggerall = p2statetype != L
trigger1 = P2BodyDist X < 60
;trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
trigger7 = P2BodyDist X < 40
trigger7 = P2movetype = A
trigger7 = ctrl && statetype != A
trigger7 = p2movetype != H

trigger8 = movecontact
trigger8 = stateno = 1020
trigger8 = animelem = 12, >= 0
trigger8 = animelem = 14, <= 0
trigger9 = movecontact
trigger9 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1031
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 60
triggerall = p2statetype != L
trigger1 = P2BodyDist X < 80
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
triggerall = p2life > 0
trigger6 = ctrl && statetype != A

[State -1]
type = ChangeState
value = 1031
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 160
triggerall = p2statetype != L
trigger1 = P2BodyDist X < 80
;trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
trigger6 = ctrl && statetype != A

trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 14, <= 0
trigger8 = var(58) = 1
trigger8 = movecontact
trigger8 = stateno = 1030
triggerall = p2life > 0
triggerall = prevstateno != [1030,1031]
triggerall = stateno != [1030,1031]

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 800
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 30
triggerall = P2statetype != A
triggerall = p2stateno != [150,153]
trigger1 = enemynear,movetype != H
trigger1 = P2BodyDist X < 15
trigger1 = statetype != A && ctrl

[State -1]
type = ChangeState
value = 800
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 150
triggerall = P2statetype != A
triggerall = p2stateno != [150,153]
trigger1 = enemynear,movetype != H
trigger1 = P2BodyDist X < 15
trigger1 = statetype != A && ctrl
;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 810
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 30
triggerall = P2statetype != A
triggerall = p2stateno != [150,153]
trigger1 = enemynear,movetype != H
trigger1 = P2BodyDist X < 15
trigger1 = statetype != A && ctrl

[State -1]
type = ChangeState
value = 810
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 145
triggerall = P2statetype != A
triggerall = p2stateno != [150,153]
trigger1 = enemynear,movetype != H
trigger1 = P2BodyDist X < 15
trigger1 = statetype != A && ctrl

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1000
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 30
triggerall = p2statetype != L
triggerall = numprojID(1000) = 0
triggerall = numprojID(1025) = 0
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 = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = P2BodyDist X > 20
trigger6 = P2movetype = A
trigger6 = ctrl && statetype != A
trigger6 = Enemy, Numproj = 1 && P2MoveType = A
trigger6 = p2movetype != H
trigger7 = ctrl && statetype != A
trigger7 = p2stateno = 1022
triggerall = p2life > 0
trigger7 = ctrl && statetype != A

[State -1]
type = ChangeState
value = 1000
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = numprojID(1000) = 0
triggerall = numprojID(1025) = 0
triggerall = random <= 100
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 = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = P2BodyDist X > 20
trigger6 = P2movetype = A
trigger6 = ctrl && statetype != A
trigger6 = Enemy, Numproj = 1 && P2MoveType = A
trigger6 = p2movetype != H
trigger7 = ctrl && statetype != A
trigger7 = p2stateno = 1022
trigger7 = ctrl && statetype != A

trigger8 = movecontact
trigger8 = stateno = 1050 || stateno = 1060
trigger9 = movecontact
trigger9 = stateno = 1020
trigger9 = animelem = 12, >= 0
trigger9 = animelem = 14, <= 0
trigger10 = movecontact
trigger10 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0
trigger8 = power >= 1500
trigger9 = power >= 1500
trigger10 = power >= 1500

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1010
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 20
triggerall = p2statetype != L
triggerall = numprojID(1000) = 0
triggerall = numprojID(1025) = 0
trigger1 = P2BodyDist X > 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
triggerall = p2life > 0
trigger6 = ctrl && statetype != A

[State -1]
type = ChangeState
value = 1010
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 90
triggerall = p2statetype != L
trigger1 = P2BodyDist X > 30
trigger1 = P2BodyDist X < 150
;trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
trigger6 = ctrl && statetype != A

trigger7 = movecontact
trigger7 = stateno = 1050 || stateno = 1060
trigger8 = movecontact
trigger8 = stateno = 1020
trigger8 = animelem = 12, >= 0
trigger8 = animelem = 14, <= 0
trigger9 = movecontact
trigger9 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0
trigger7 = power >= 1500
trigger8 = power >= 1500
trigger9 = power >= 1500

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 2000
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 60
triggerall = power >= 2000
triggerall = p2statetype != L
triggerall = p2life > 0
trigger1 = P2BodyDist X < 30
;trigger1 = P2BodyDist Y < 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
triggerall = p2life > 0
trigger6 = ctrl && statetype != A

[State -1]
type = ChangeState
value = 2000
triggerall = var(59) = 1
triggerall = var(58) = 1

triggerall = random <= 50
triggerall = power >= 2000
triggerall = p2statetype != L
triggerall = p2life > 0
trigger1 = P2BodyDist X > 30
;trigger1 = P2BodyDist Y < 30
;trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022

trigger7 = movecontact
trigger7 = stateno = 1050 || stateno = 1060
trigger8 = movecontact
trigger8 = stateno = 1020
trigger8 = animelem = 12, >= 0
trigger8 = animelem = 15, <= 0
trigger9 = movecontact
trigger9 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0
trigger10 = P2BodyDist X > 30
trigger10 = ctrl && statetype != A
trigger10 = p2statetype = A
trigger10 = p2movetype != H

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1070
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 16
triggerall = power >= 1000
triggerall = p2statetype != L
trigger1 = P2BodyDist X > 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
triggerall = p2life > 0

[State -1]
type = ChangeState
value = 1070
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 50
triggerall = power >= 1000
triggerall = p2statetype != L
trigger1 = P2BodyDist X > 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger9 = ctrl && statetype != A
trigger9 = p2stateno = 1022

trigger6 = movecontact
trigger6 = stateno = 1050 || stateno = 1060
trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 15, <= 0
trigger8 = movecontact
trigger8 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1080
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 16
triggerall = power >= 1000
triggerall = p2statetype != L
triggerall = numhelper(1080) = 0
trigger1 = P2BodyDist X > 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = ctrl && statetype != A
trigger6 = p2stateno = 1022
triggerall = p2life > 0

[State -1]
type = ChangeState
value = 1080
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 50
triggerall = power >= 1000
triggerall = p2statetype != L
triggerall = numhelper(1080) = 0
trigger1 = P2BodyDist X > 30
trigger1 = P2movetype = A
trigger1 = ctrl && statetype != A
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger9 = ctrl && statetype != A
trigger9 = p2stateno = 1022

trigger6 = movecontact
trigger6 = stateno = 1050 || stateno = 1060
trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 15, <= 0
trigger8 = movecontact
trigger8 = stateno = 1030 || stateno = 1031
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1040
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 17
triggerall = statetype != A
trigger1   = (enemy, p2bodydist X = [10, 40]) && enemy, hitdefattr = SCA, NA, SA
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
triggerall = p2life > 0

[State -1]
type = ChangeState
value = 1040
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 350
triggerall = statetype != A
trigger1   = (enemy, p2bodydist X = [10, 40]) && enemy, hitdefattr = SCA, NA, SA
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1020
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 20
triggerall = statetype != A
trigger1   = p2bodydist X <= 20
trigger1 = ctrl
trigger1 = p2movetype != H
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6   = p2bodydist X >= 30
trigger6 = Enemy, Numproj = 1 && P2MoveType = A || enemy, hitdefattr = SCA, SP
trigger6 = ctrl
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 1020
triggerall = var(59) = 1
triggerall = var(58) = 0
triggerall = random <= 100
triggerall = statetype != A
trigger1   = p2bodydist X >= 30
trigger1 = Enemy, Numproj = 1 && P2MoveType = A || enemy, hitdefattr = SCA, SP
trigger1 = ctrl
triggerall = p2life > 0

[State -1]
type = ChangeState
value = 1020
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 850
triggerall = statetype != A
trigger1   = p2bodydist X >= 30
trigger1 = Enemy, Numproj = 1 && P2MoveType = A || enemy, hitdefattr = SCA, SP
trigger1 = ctrl
triggerall = p2life > 0

;---------------------------------------------------------------------------
[State -1]
type = null;ChangeState
value = 1089
triggerall = var(59) = 1
triggerall = random <= 1
triggerall = statetype != A
trigger1   = p2bodydist X >= 30
trigger1 = ctrl
triggerall = numhelper(1090) = 0

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 510
triggerall = var(59) = 1
triggerall = random <= 40
triggerall = statetype = A
trigger1   = p2bodydist X <= 60
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 5201
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = Vel Y > 0
triggerall = Pos Y >= 0
trigger1 = alive
trigger1 = CanRecover
trigger1 = stateno = 5050

;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 2100
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 37
triggerall = power >= 1000
triggerall = p2statetype != L
triggerall = numhelper(1080) = 0
triggerall = p2life > 0
trigger1 = P2BodyDist X > 30
trigger1 = ctrl && statetype != A
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger9 = ctrl && statetype != A
trigger9 = p2stateno = 1022

trigger6 = movecontact
trigger6 = stateno = 1050 || stateno = 1060
trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 15, <= 0
trigger8 = movecontact
trigger8 = stateno = 1030 || stateno = 1031
trigger9 = p2movetype = A
trigger9= P2BodyDist X > 80
trigger9 = ctrl && statetype != A
trigger10 = Enemy, Numproj = 1 && P2MoveType = A
trigger10 = ctrl && statetype != A
trigger11 = Enemy, Numhelper = 1 && P2MoveType = A
trigger11 = ctrl && statetype != A
trigger12 = backedgedist <= 20 && P2MoveType = A
trigger12 = ctrl && statetype != A

[State -1]
type = ChangeState
value = 2400
triggerall = var(59) = 1
triggerall = random <= 50
triggerall = power >= 3000 && life <= 500
triggerall = P2statetype != A
triggerall = P2BodyDist X < 30
trigger1 = ctrl && statetype != A
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = movecontact
trigger6 = stateno = 1050 || stateno = 1060
trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 15, <= 0
trigger8 = movecontact
trigger8 = stateno = 1030 || stateno = 1031

;---------------------------------------------------------
[State -1]
type = ChangeState
value = 2300
triggerall = var(59) = 1
triggerall = var(58) = 1
triggerall = random <= 40
triggerall = power >= 2000
triggerall = p2statetype != L
triggerall = numhelper(1080) = 0
triggerall = p2life > 0
trigger1 = P2BodyDist X > 30
trigger1 = ctrl && statetype != A
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = movecontact
trigger4 = stateno = 230
trigger4 = movecontact
trigger5 = stateno = 240
trigger5 = movecontact
trigger6 = movecontact
trigger6 = stateno = 1050 || stateno = 1060
trigger7 = movecontact
trigger7 = stateno = 1020
trigger7 = animelem = 12, >= 0
trigger7 = animelem = 15, <= 0
trigger8 = movecontact
trigger8 = stateno = 1030 || stateno = 1031
trigger9 = p2movetype = A
trigger9= P2BodyDist X > 80
trigger9 = ctrl && statetype != A
