;-| Button Remapping |-----------------------------------------------------
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
command.time = 15

command.buffer.time = 1

;-| Super Moves |---------------------------------------------------------

[command]
name = "Strider Speed Run"
command = ~D, DF, F, x+y
time = 15

[command]
name = "Strider Speed Run"
command = ~D, DF, F, x+z
time = 15

[command]
name = "Strider Speed Run"
command = ~D, DF, F, y+z
time = 15

[command]
name = "Two Peoples"
command = ~F, D, DF, x+y
time = 15

[command]
name = "Two Peoples"
command = ~F, D, DF, x+z
time = 15

[command]
name = "Two Peoples"
command = ~F, D, DF, y+z
time = 15

[command]
name = "Psystrike"
command = ~D, DB, B, F, x+y
time = 15

[command]
name = "Psystrike"
command = ~D, DB, B, F, x+z
time = 15

[command]
name = "Psystrike"
command = ~D, DB, B, F, y+z
time = 15

;-| Special Moves |---------------------------------------------------------

[command]
name = "I hate fighting Cloud in Smash_X"
command = ~D, DF, F, x
time = 15

[command]
name = "I hate fighting Cloud in Smash_Y"
command = ~D, DF, F, y
time = 15

[command]
name = "I hate fighting Cloud in Smash_Z"
command = ~D, DF, F, z
time = 15

[command]
name = "Boring DP_X"
command = ~F, D, DF, x
time = 15

[command]
name = "Boring DP_Y"
command = ~F, D, DF, y
time = 15

[command]
name = "Boring DP_Z"
command = ~F, D, DF, z
time = 15

[command]
name = "Math fucks a boy in a Taokaka Costume_X"
command = ~D, DB, B, x
time = 15

[command]
name = "Math fucks a boy in a Taokaka Costume_Y"
command = ~D, DB, B, y
time = 15

[command]
name = "Math fucks a boy in a Taokaka Costume_Z"
command = ~D, DB, B, z
time = 15

[command]
name = "Adaptability was a mistake_A"
command = ~D, DF, F, a
time = 15

[command]
name = "Adaptability was a mistake_B"
command = ~D, DF, F, b
time = 15

[command]
name = "Adaptability was a mistake_C"
command = ~D, DF, F, c
time = 15

[command]
name = "I love you hon"
command = ~F, D, DF, a
time = 15

[command]
name = "I love you hon"
command = ~F, D, DF, b
time = 15

[command]
name = "I love you hon"
command = ~F, D, DF, c
time = 15

[command]
name = "QCB_A"
command = ~D, DB, B, a
time = 15

[command]
name = "QCB_B"
command = ~D, DB, B, b
time = 15

[command]
name = "QCB_C"
command = ~D, DB, B, c
time = 15

[command]
name = "QCF_S"
command = ~D, DF, F, s
time = 15

;-| Single Button |---------------------------------------------------------
[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

;---------------------------------------------------------------------------
;Hold button

[Command]
name = "holdx"
command = /x
time = 1

[Command]
name = "holdy"
command = /y
time = 1

[Command]
name = "holdz"
command = /z
time = 1

[Command]
name = "holda"
command = /a
time = 1

[Command]
name = "holdc"
command = /c
time = 1

[Command]
name = "holdb"
command = /b
time = 1

[Command]
name = "holds"
command = /s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

[Command]
name = "SJ"
command = $D,$U

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

[Command]
name = "guardpush"
command = x+y
time = 5

[Command]
name = "guardpush"
command = x+z
time = 5

[Command]
name = "guardpush"
command = y+z
time = 5

[Command]
name = "IK"
command = x+a
time = 5

[Command]
name = "IK"
command = x+b
time = 5

[Command]
name = "IK"
command = x+c
time = 5

[Command]
name = "IK"
command = y+a
time = 5

[Command]
name = "IK"
command = y+b
time = 5

[Command]
name = "IK"
command = y+c
time = 5

[Command]
name = "IK"
command = z+a
time = 5

[Command]
name = "IK"
command = z+b
time = 5

[Command]
name = "IK"
command = z+c
time = 5

[Command]
name = "SJ"
command = a+b+c
time = 5

[Command]
name = "FF"
command = x+y+z
time = 5


[Statedef -1]

;===========================================================================
[State -1, AI Guard]
Type = ChangeState
Value = 120
triggerall = StateType != A && Var(15) != 0 && Ctrl
trigger1 = (Var(30)**3)*2*0.9 > random
trigger1 = !(enemynear,hitdefattr=SCA,AT) && inguarddist
trigger1 = (stateno!=[120,155])

;===========================================================================
[State -1, Instant Kill]
type = ChangeState
value = 6000
triggerall = var(52) && roundstate = 2
triggerall = var(53) = 1 && var(23) > 1 && enemynear, life < lifemax / 8 || Var(53) >= 2
triggerall = (StateType = S) && (Ctrl) || (Stateno = [200,251]) && StateNo != 250 && Movecontact
trigger1 = Command = "IK" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.1 > random && RoundState = 2 ; AI might try to fuck em up
trigger2 = (StateNo = 210 || StateNo = 240 || StateNo = 220 || StateNo = 221) && MoveHit && EnemyNear,StateType != A

;--------------------------------------------------------------------------
[State -1, Super Methods of Mayhem 3]
type = ChangeState
value = 3200
triggerall = power >= 3000 && roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450]) || (stateno = [1000,1102]) || (stateno = [1200,1399]) || (stateno = [1500,1502])
trigger1 = Command = "Psystrike" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.5 > random && RoundState = 2 ; AI might try to break the chain
trigger2 = P2BodyDist X < 96 && EnemyNear,MoveType = A && EnemyNear,StateType != A

;--------------------------------------------------------------------------
[State -1, Super Methods of Mayhem 2]
type = ChangeState
value = 3100
triggerall = power >= 1000 && roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450]) || (stateno = [1000,1102]) || (stateno = [1200,1399]) || (stateno = [1500,1502])
trigger1 = Command = "Two Peoples" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI hopes i coded this right
trigger2 = EnemyNear,MoveType = H && StateNo = 1000 && AnimElem = 3, 1

;--------------------------------------------------------------------------
[State -1, Super Methods of Mayhem 1]
type = ChangeState
value = 3000
triggerall = power >= 1000 && roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450]) || (stateno = [1000,1102]) || (stateno = [1200,1399]) || (stateno = [1500,1502])
trigger1 = Command = "Strider Speed Run" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.3 > random && RoundState = 2 ; AI might try to break the chain
trigger2 = StateNo = 1305 && MoveHit = 1

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 6]
type = ChangeState
value = 1500
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "I love you hon" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.6 > random && RoundState = 2 ; AI gets too close
trigger2 = EnemyNear,StateType != A && EnemyNear,PrevStateNo != 5120 && EnemyNear,MoveType != H && (EnemyNear,StateNo != [5000,5999]) && P2BodyDist X < 8
trigger2 = PrevStateNo != 1500

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 5]
type = ChangeState
value = 1400
triggerall = Pos Y < -(const(movement.airjump.height)) && roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Adaptability was a mistake_A" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI calls that a crossup
trigger2 = StateNo = 650 && MoveHit
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI cant be stopped from jumping
trigger3 = EnemyNear,StateType != A && EnemyNear,MoveType = H

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 5]
type = ChangeState
value = 1401
triggerall = Pos Y < -(const(movement.airjump.height)) && roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Adaptability was a mistake_B" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 5]
type = ChangeState
value = 1402
triggerall = Pos Y < -(const(movement.airjump.height)) && roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Adaptability was a mistake_C" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.5 > random && RoundState = 2 ; AI hopes i coded this right
trigger2 = ctrl && (P2Dist X - Abs(P2Dist Y) = [-20,20]) && P2Dist X < 96 && Pos Y < EnemyNear,Pos Y

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 4]
type = ChangeState
value = 1300
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Adaptability was a mistake_A" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.6 > random && RoundState = 2 ; AI chains from cHP
trigger2 = StateNo = 222 && MoveHit

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 4]
type = ChangeState
value = 1301
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Adaptability was a mistake_B" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 4]
type = ChangeState
value = 1302
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Adaptability was a mistake_C" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI might try to slip in 
trigger2 = (P2BodyDist X = [64,192]) && EnemyNear,NumProj

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 3]
type = ChangeState
value = 1200
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Math fucks a boy in a Taokaka Costume_X" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 3]
type = ChangeState
value = 1201
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Math fucks a boy in a Taokaka Costume_Y" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 3]
type = ChangeState
value = 1202
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Math fucks a boy in a Taokaka Costume_Z" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.6 > random && RoundState = 2 ; AI counters
trigger2 = (enemynear,hitdefattr=SCA,AA) && inguarddist && p2bodydist X < 64
trigger2 = PrevStateNo != 1202

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2 Air]
type = ChangeState
value = 1150
triggerall = roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Boring DP_X" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2 Air]
type = ChangeState
value = 1151
triggerall = roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Boring DP_Y" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2 Air]
type = ChangeState
value = 1152
triggerall = roundstate = 2
triggerall = (StateType = A) && (Ctrl) || (stateno = [600,650])
trigger1 = Command = "Boring DP_Z" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2]
type = ChangeState
value = 1100
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Boring DP_X" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2]
type = ChangeState
value = 1101
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Boring DP_Y" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 2]
type = ChangeState
value = 1102
triggerall = roundstate = 2
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "Boring DP_Z" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 1]
type = ChangeState
value = 1000
triggerall = roundstate = 2 && var(18) = 0
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "I hate fighting Cloud in Smash_X" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.2 > random && RoundState = 2 ; we got the power
trigger2 = P2BodyDist X > 96 && EnemyNear,MoveType = I  && EnemyNear,StateType != A ; i can feel it comin
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; we got the power
trigger3 = StateNo = 220 && MoveHit ;; build it up, i gotta build it up

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 1]
type = ChangeState
value = 1001
triggerall = roundstate = 2 && var(18) = 0
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "I hate fighting Cloud in Smash_Y" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Methods of Mayhem 1]
type = ChangeState
value = 1002
triggerall = roundstate = 2 && var(18) = 0
triggerall = (StateType != A) && (Ctrl) || (stateno = [200,450])
trigger1 = Command = "I hate fighting Cloud in Smash_Z" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Punch Throw]
type = Changestate
value = 800
triggerall = statetype = S && ctrl
triggerall = p2bodydist X <25 && p2movetype != H
triggerall = stateno != [100,105]
trigger1 = (command = "holdfwd"  || command = "holdback") && command != "holddown" && command = "y" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.2 > random && RoundState = 2 ; AI gets too close
trigger2 = EnemyNear,StateType != A && EnemyNear,PrevStateNo != 5120 && EnemyNear,MoveType != H && (EnemyNear,StateNo != [5000,5999])

;--------------------------------------------------------------------------
[State -1, Punch Throw]
type = Changestate
value = 801
triggerall = statetype = S && ctrl
triggerall = p2bodydist X <25 && p2movetype != H
triggerall = stateno != [100,105]
trigger1 = (command = "holdfwd"  || command = "holdback") && command != "holddown" && command = "z" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.2 > random && RoundState = 2 ; AI gets too close
trigger2 = EnemyNear,StateType != A && EnemyNear,PrevStateNo != 5120 && EnemyNear,MoveType != H && (EnemyNear,StateNo != [5000,5999])

;--------------------------------------------------------------------------
[State -1, Kick Throw]
type = Changestate
value = 802
triggerall = statetype = S && ctrl
triggerall = p2bodydist X <25 && p2movetype != H
triggerall = stateno != [100,105]
trigger1 = (command = "holdfwd"  || command = "holdback") && command != "holddown" && command = "b" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.2 > random && RoundState = 2 ; AI gets too close
trigger2 = EnemyNear,StateType != A && EnemyNear,PrevStateNo != 5120 && EnemyNear,MoveType != H && (EnemyNear,StateNo != [5000,5999])

;--------------------------------------------------------------------------
[State -1, Kick Throw]
type = Changestate
value = 803
triggerall = statetype = S && ctrl
triggerall = p2bodydist X <25 && p2movetype != H
triggerall = stateno != [100,105]
trigger1 = (command = "holdfwd"  || command = "holdback") && command != "holddown" && command = "c" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.2 > random && RoundState = 2 ; AI gets too close
trigger2 = EnemyNear,StateType != A && EnemyNear,PrevStateNo != 5120 && EnemyNear,MoveType != H && (EnemyNear,StateNo != [5000,5999])

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

; Dash
[State -1, Dash Forward]
type = ChangeState
value = 100
triggerall = StateType = S
triggerall = (Ctrl) && (StateNo != 100)
trigger1 = Command = "FF" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI might run in
trigger2 = (P2BodyDist X = [8,64]) && EnemyNear,MoveType != A  && EnemyNear,StateType != A
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI might follow that projectile
trigger3 = P2BodyDist X > 8 && numhelper(10520)

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

; Melty Blood
[State -1, Jump Back]
type = ChangeState
value = 105
triggerall = StateType = S
triggerall = (Ctrl) && (StateNo != 100)
trigger1 = Command = "BB" && !Var(30)
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI should stop trying to OTG
trigger3 = P2BodyDist X < 16 && (EnemyNear,StateNo = [5100,5120])

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

;Taunt
[State -1, Taunt]
type = changestate
value = 195
triggerall = ctrl && Statetype != A
trigger1 = command = "start" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI does the thing
trigger2 = RoundState > 2 ;&& (PrevStateNo = 1515 || Random < 10 || (EnemyNear,StateNo = [1520,1525]))

;--------------------------------------------------------------------------
[State -1, Light Punch]
type = ChangeState
value = 200
triggerall = (StateType = S) && (Ctrl)
trigger1 = Command = "x" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.5 > random && RoundState = 2 ; AI starts the combo
trigger2 = P2BodyDist X < 16 && EnemyNear,StateType != A && (EnemyNear,StateNo != [5100,5120])

;--------------------------------------------------------------------------
[State -1, Close Medium Punch]
type = Changestate
value = 211
triggerall = P2bodydist X = [-25,25]
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 230) && Movecontact
trigger1 = Command = "y" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LK
trigger2 = StateNo = 230 && MoveHit

;--------------------------------------------------------------------------
[State -1, Medium Punch]
type = ChangeState
value = 210
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 230) && Movecontact
trigger1 = Command = "y" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LK
trigger2 = StateNo = 230 && MoveHit

;--------------------------------------------------------------------------
[State -1, Close Fierce Punch]
type = ChangeState
value = 221
triggerall = P2bodydist X = [-25,25]
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 210 || Stateno = 211 || Stateno = 230|| Stateno = 240) && Movecontact
trigger1 = Command = "z" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MK
trigger2 = StateNo = 240 && MoveHit

;--------------------------------------------------------------------------
[State -1, Close Fierce Punch 2]
type = ChangeState
value = 222
triggerall = (Statetype = S)
triggerall = (stateno = 221 && AnimElem = 7,> 0 && AnimElem = 8,< 0) || (stateno = 221 && Movecontact)
trigger1 = command !="holddown" && Command = "z"  && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from cHP
ignorehitpause = 0

;--------------------------------------------------------------------------
[State -1, Fierce Punch]
type = ChangeState
value = 220
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 210 || Stateno = 211 || Stateno = 230 || Stateno = 240) && Movecontact
trigger1 = Command = "z" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MK
trigger2 = StateNo = 240 && MoveHit

;--------------------------------------------------------------------------
[State -1, Light Kick]
type = ChangeState
value = 230
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200) && Movecontact
trigger1 = Command = "a" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LP
trigger2 = StateNo = 200 && MoveHit

;--------------------------------------------------------------------------
[State -1, Medium Kick]
type = ChangeState
value = 240
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 210 || Stateno = 211 || Stateno = 230) && Movecontact
trigger1 = Command = "b" && Command != "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MP
trigger2 = (StateNo = 210 || StateNo = 211) && MoveHit

;--------------------------------------------------------------------------
[State -1, Roundhouse Kick]
type = ChangeState
value = 251
triggerall = P2bodydist X = [-25,25]
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 210 || Stateno = 211 || Stateno = 220 || Stateno = 221 || Stateno = 230 || Stateno = 240) && Movecontact
trigger1 = Command = "c" && Command != "holddown" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Roundhouse Kick]
type = ChangeState
value = 250
triggerall = (StateType = S) && (Ctrl) || (Stateno = 200 || Stateno = 210 || Stateno = 211 || Stateno = 220 || Stateno = 221 || Stateno = 230 || Stateno = 240) && Movecontact
trigger1 = Command = "c" && Command != "holddown" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Crouch Light Punch]
type = ChangeState
value = 400
triggerall = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 230) && Movecontact
trigger1 = Command = "x" && Command = "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI starts the combo
trigger2 = P2BodyDist X < 16 && EnemyNear,StateType != A && (EnemyNear,StateNo != [5100,5120])

;--------------------------------------------------------------------------
[State -1, Crouch Medium Punch]
type = ChangeState
value = 410
triggerall = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 210 || stateno = 211 || stateno = 230 || stateno = 240 || stateno = 400 || stateno = 430 || stateno = 440) && Movecontact
trigger1 = Command = "y" && Command = "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LK
trigger2 = StateNo = 430 && MoveHit

;--------------------------------------------------------------------------
[State -1, Launcher]
type = ChangeState
value = 420
triggerall = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 210 || stateno = 211 || stateno = 230 || stateno = 240 || stateno = 400 || stateno = 410 || stateno = 430 || stateno = 440) && Movecontact
trigger1 = Command = "z" && Command = "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MK
trigger2 = (StateNo = 240 || StateNo = 440) && MoveHit

;--------------------------------------------------------------------------
[State -1, Crouch Light Kick]
type = ChangeState
value = 430
triggerall = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 230 || stateno = 400) && Movecontact
trigger1 = Command = "a" && Command = "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LP
trigger2 = StateNo = 400 && MoveHit
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LP
trigger3 = StateNo = 200 && MoveGuarded

;--------------------------------------------------------------------------
[State -1, Crouch Medium Kick]
type = ChangeState
value = 440
triggerall = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 210 || stateno = 211 || stateno = 230 || stateno = 240 || stateno = 400 || stateno = 410 || stateno = 430) && Movecontact
trigger1 = Command = "b" && Command = "holddown" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MK
trigger2 = StateNo = 410 && MoveHit

;--------------------------------------------------------------------------
[State -1, Crouch Medium Kick]
type = ChangeState
value = 450
trigger1 = (StateType = C) && (Ctrl) || (stateno = 200 || stateno = 210 || stateno = 211 || stateno = 230 || stateno = 240 || stateno = 400 || stateno = 410 || stateno = 430 || stateno = 440) && Movecontact
triggerall = Command = "c" && Command = "holddown" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Light Punch]
type = ChangeState
value = 600
triggerall = (StateType = A) && (Ctrl)
trigger1 = Command = "x" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI starts an air rave
trigger2 = EnemyNear,StateType = A && P2BodyDist X < 24

;--------------------------------------------------------------------------
[State -1, Light Punch]
type = ChangeState
value = 610
triggerall = (StateType = A) && (Ctrl) || (stateno = 600 || stateno = 630) && Movecontact
trigger1 = Command = "y" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from LP
trigger2 = StateNo = 600 && MoveHit

;--------------------------------------------------------------------------
[State -1, Light Punch]
type = ChangeState
value = 620
trigger1 = (StateType = A) && (Ctrl) || (stateno = 600 || stateno = 610 || stateno = 630 || stateno = 640) && Movecontact
trigger1 = Command = "z" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MP
trigger2 = StateNo = 610 && MoveHit

;--------------------------------------------------------------------------
[State -1, Light Kick]
type = ChangeState
value = 630
triggerall = (StateType = A) && (Ctrl) || (stateno = 600) && Movecontact
trigger1 = Command = "a" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Medium Kick]
type = ChangeState
value = 640
triggerall = (StateType = A) && (Ctrl) || (stateno = 600 || stateno = 610 || stateno = 630) && Movecontact
trigger1 = Command = "b" && !Var(30)

;--------------------------------------------------------------------------
[State -1, Medium Kick]
type = ChangeState
value = 650
triggerall = (StateType = A) && (Ctrl) || (stateno = 600 || stateno = 610 || stateno = 620 || stateno = 630 || stateno = 640) && movecontact
trigger1 = Command = "c" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI chains from MP
trigger2 = EnemyNear,StateType != A && (P2BodyDist X  - (Vel X * 4) = [16,24])

;--------------------------------------------------------------------------
[State -1, Guard Push Stand]
type = Helper
;value = 880
triggerall = numhelper(880) = 0
triggerall = stateno = 150 || stateno = 152 || stateno = 154
trigger1 = command = "guardpush" && !Var(30)
stateno = 880
ID = 880
supermovetime = 99999
pausemovetime = 99999
ignorehitpause = 1
ownpal = 1

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

[State -1, Forward Recovery Roll]
type = ChangeState
value = 890
triggerall = !Var(59)
triggerall = time = 1
triggerall = life > 0
triggerall = stateno = 5120
triggerall = alive = 1
trigger1 = command = "holdfwd" && !Var(30)

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

[State -1, Backward Recovery Roll]
type = ChangeState
value = 895
triggerall = !Var(59)
triggerall = time = 1
triggerall = life > 0
triggerall = stateno = 5120
triggerall = alive = 1
trigger1 = command = "holdback" && !Var(30)

;---------------------------------------------------------------------------
; Air Dash
[State -1, Air Dash]
type = ChangeState
value = 900
triggerall = Var(17) = 1 && statetype = A && Pos Y < -(const(movement.airjump.height))
triggerall = statetype = A && Ctrl && stateno != 900
trigger1 = command = "FF" && !Var(30)
trigger2 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI might run in
trigger2 = P2Dist X > 32

;--------------------------------------------------------------------------
;super jump
[State -1, Super Jump]
type = ChangeState
value = 7000
trigger1 = Command = "SJ" && !Var(30)
trigger1 = StateType != A
trigger1 = ctrl
trigger2 = Command = "holdup" || Var(30)
trigger2 = stateno = 420 && movehit
trigger3 = StateType != A && ctrl
trigger3 = Var(30) && (Var(30)**3)*2*0.9 > random && RoundState = 2 ; AI might try to hop on over
trigger3 = P2BodyDist X > 128 && EnemyNear,MoveType = A
