; Attack Priority Order:
;
; QCB HCF
; F HCF
; QCF x 2
;
; DP
; HCF
; DU
; QCF
; DD

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

;-| Default Values |-------------------------------------------------------
[Defaults]
; Default value for the "time" parameter of a Command. Minimum 1.
command.time = 15

; Default value for the "buffer.time" parameter of a Command. Minimum 1,
; maximum 30.
command.buffer.time = 1

;-| 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 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

;-| Hold Button |----------------------------------------------------------
; Please define Anim 74140108 in your AIR file if AND ONLY IF you place these
; 7 Hold Button commands immediately after the 11 Single Button and Hold Dir
; commands at the very top of your CMD list, as demonstrated here.
; In this version of the AI code, these commands are only used by the XOR
; method, and thus are optional.  But there remains a possibility that a
; future version of the helper method might be helped by having these
; commands placed here, and Anim 74140108 would then be used to indicate
; that a partner character has a compatible CMD.
[Command]
name = "holda"
command = /a
time = 1

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

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

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

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

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

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

;--- None of your own command definitions should be above this line. ---

;-| CPU |--------------------------------------------------------------
; Note that if you make any changes to the basic one-button or recovery
; commands, you'll need to make the same changes to their matching commands here
; and/or in the XOR VarSet controller.  That includes things like, for example:
;  * changing the recovery command to use a different combination of buttons.
;  * renaming the b button command as "d", or the start button command as "s".
;  * switching the button names around, e.g. so button y triggers "a" and button a triggers "y".
;  * having more than one way to trigger the same command name.
; If you understand how the XOR method works, the proper changes should be obvious.
; If you don't understand it, then simply disable the lines in the XOR VarSet
; controller that correspond to the commands you've altered.

[Command]
name = "a2"
command = a
time = 1

[Command]
name = "b2"
command = b
time = 1

[Command]
name = "c2"
command = c
time = 1

[Command]
name = "x2"
command = x
time = 1

[Command]
name = "y2"
command = y
time = 1

[Command]
name = "z2"
command = z
time = 1

[Command]
name = "start2"
command = s
time = 1

[Command]
name = "holdfwd2"
command = /$F
time = 1

[Command]
name = "holdback2"
command = /$B
time = 1

[Command]
name = "holdup2"
command = /$U
time = 1

[Command]
name = "holddown2"
command = /$D
time = 1

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

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

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

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

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

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

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

[Command]
name = "recovery2"
command = x+y+a+b+z+c
time = 1

;-| Super Motions |--------------------------------------------------------
[Command]
name = "D,HCF_y"
command = ~D, B, D, F, x
time = 20

[Command]
name = "D,HCF_x"
command = ~D, B, D, F, y
time = 20

[Command]
name = "D,HCF_a"
command = ~D, B, D, F, b
time = 20

[Command]
name = "D,HCB_y"
command = ~D, F, D, B, x
time = 20

[Command]
name = "D,HCB_x"
command = ~D, F, D, B, y
time = 20

[Command]
name = "D,HCB_a"
command = ~D, F, D, B, b
time = 20

[Command]
name = "F,HCF_y"
command = ~F, B, D, F, x
time = 20

[Command]
name = "F,HCF_x"
command = ~F, B, D, F, y
time = 20

[Command]
name = "F,HCF_a"
command = ~F, B, D, F, b
time = 20

[Command]
name = "B,HCB_y"
command = ~B, F, D, B, x
time = 20

[Command]
name = "B,HCB_x"
command = ~B, F, D, B, y
time = 20

[Command]
name = "B,HCB_a"
command = ~B, F, D, B, b
time = 20

[Command]
name = "QCFx2_y"
command = ~D, F, D, F, x
time = 20

[Command]
name = "QCFx2_x"
command = ~D, F, D, F, y
time = 20

[Command]
name = "QCFx2_a"
command = ~D, F, D, F, b
time = 20

[Command]
name = "QCBx2_y"
command = ~D, B, D, B, x
time = 20

[Command]
name = "QCBx2_x"
command = ~D, B, D, B, y
time = 20

[Command]
name = "QCBx2_a"
command = ~D, B, D, B, b
time = 20

;-| Special Motions |------------------------------------------------------

[Command]
name = "DP_y"
command = ~F, D, $F, x
buffer.time = 8

[Command]
name = "DP_x"
command = ~F, D, $F, y
buffer.time = 8

[Command]
name = "DP_a"
command = ~F, D, $F, b
buffer.time = 8

[Command]
name = "RDP_y"
command = ~B, D, $B, x
buffer.time = 8

[Command]
name = "RDP_x"
command = ~B, D, $B, y
buffer.time = 8

[Command]
name = "RDP_a"
command = ~B, D, $B, b
buffer.time = 8

[Command]
name = "HCF_y"
command = ~B, D, F, x
time = 20
buffer.time = 8

[Command]
name = "HCF_x"
command = ~B, D, F, y
time = 20
buffer.time = 8

[Command]
name = "HCF_a"
command = ~B, D, F, b
time = 20
buffer.time = 8

[Command]
name = "HCB_y"
command = ~F, D, B, x
time = 20
buffer.time = 8

[Command]
name = "HCB_x"
command = ~F, D, B, y
time = 20
buffer.time = 8

[Command]
name = "HCB_a"
command = ~F, D, B, b
time = 20
buffer.time = 8

[Command]
name = "DU_y"
command = ~$D, >$U, x
buffer.time = 8

[Command]
name = "DU_x"
command = ~$D, >$U, y
buffer.time = 8

[Command]
name = "DU_a"
command = ~$D, >$U, b
buffer.time = 8

[Command]
name = "RDU_y"
command = ~$D, >UB, x
buffer.time = 8

[Command]
name = "RDU_x"
command = ~$D, >UB, y
buffer.time = 8

[Command]
name = "RDU_a"
command = ~$D, >UB, b
buffer.time = 8

[Command]
name = "QCF_y"
command = ~$D, F, x
buffer.time = 8

[Command]
name = "QCF_x"
command = ~$D, F, y
buffer.time = 8

[Command]
name = "QCF_a"
command = ~$D, F, b
buffer.time = 8

[Command]
name = "QCB_y"
command = ~$D, B, x
buffer.time = 8

[Command]
name = "QCB_x"
command = ~$D, B, y
buffer.time = 8

[Command]
name = "QCB_a"
command = ~$D, B, b
buffer.time = 8

[Command]
name = "DD_y"
command = D, >~D, >D, x
buffer.time = 8

[Command]
name = "DD_x"
command = D, >~D, >D, y
buffer.time = 8

[Command]
name = "DD_a"
command = D, >~D, >D, b
buffer.time = 8

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, >~F, /F
time = 12
buffer.time = 2

[Command]
name = "BB"     ;Required (do not remove)
command = B, >~B, /B
time = 12
buffer.time = 2

[Command]
name = "FF2"
command = F, >~F, /F
time = 15

[Command]
name = "BB2"
command = B, >~B, /B
time = 15

[Command]
name = "AFF"
command = F, >~F, /F
time = 12
buffer.time = 8

[Command]
name = "AFF"
command = UF, >~UF, /F
time = 12
buffer.time = 8

[Command]
name = "ABB"
command = B, >~B, /B
time = 12
buffer.time = 8

[Command]
name = "ABB"
command = UB, >~UB, /B
time = 12
buffer.time = 8

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y+a+b+z+c ; You shouldn't be able to recover, but it might get mad if I remove...?
time = 1

[Command]
name = "Throw"
command = x+y
time = 1
buffer.time = 8

[Command]
name = "Throw"
command = x+b
time = 1
buffer.time = 8

[Command]
name = "Throw"
command = y+b
time = 1
buffer.time = 8

[Command]
name = "DC"
command = x+a
time = 1
buffer.time = 2

[Command]
name = "DC"
command = y+a
time = 1
buffer.time = 2

[Command]
name = "DC"
command = b+a
time = 1
buffer.time = 2

[Command]
name = "LY"
command = /c, x
time = 1
buffer.time = 8

[Command]
name = "LX"
command = /c, y
time = 1
buffer.time = 8

[Command]
name = "LA"
command = /c, b
time = 1
buffer.time = 8

;-| Dir + Button |-------------------------------------------
;[Command]
;name = "down_l"
;command = /$D,c
;time = 1

;[Command]
;name = "up_l"
;command = /$U,c
;time = 1

;-| More Hold Dir |--------------------------------------------------------------
[Command]
name = "holddown2"
command = /D
time = 1

[Command]
name = "fakedup"
command = $U
time = 1

;-| Press Dir |-------------------------------------------------------------
[Command]
name = "back"
command = ~$B
time = 1

;---------------------------------------------------------------------------
; State entry
[Statedef -1]

[State -1, AI Helper Check]
type = ChangeState
trigger1 = IsHelper(9741)
value = 9741

[State -1, AI Helper Check 2]
type = ChangeState
trigger1 = IsHelper(9742)
value = 9742

;------------------------------------------------------------------------------
; Custom Commands
;------------------------------------------------------------------------------

[State -1, Down Down Increment]
type = varset
trigger1 = fvar(8) > 0
fvar(8) = fvar(8) + 1

[State -1, Down Down Reset]
type = varset
trigger1 = fvar(8) < 61
trigger1 = Floor(fvar(8)) % 15 = 0
trigger2 = fvar(8) > 61
trigger2 = Floor((fvar(8) - 10)) % 15 = 0
fvar(8) = 0

[State -1, Down Down 1st Down]
type = varset
trigger1 = command = "holddown"
trigger1 = fvar(8) = 0
fvar(8) = 1

[State -1, Down Down Release Down/2nd Down]
type = varset
trigger1 = fvar(8) > 0
trigger1 = fvar(8) < 15
trigger1 = command != "holddown"
trigger2 = fvar(8) > 15
trigger2 = fvar(8) < 30
trigger2 = command = "holddown"
fvar(8) = fvar(8) + 15

[State -1, Down Down Attack Button]
type = varset
trigger1 = fvar(8) > 30
trigger1 = fvar(8) < 45
trigger1 = command = "x" || command = "y" || command = "b"
fvar(8) = ifelse(command = "b", 91, ifelse(command = "y", 76, 61))

[State -1, Right Right Increment]
type = varset
trigger1 = fvar(9) > 0
fvar(9) = fvar(9) + 1

[State -1, Right Right Reset]
type = varset
trigger1 = fvar(9) < 61
trigger1 = Floor(fvar(9)) % 15 = 0
trigger2 = fvar(9) > 61
trigger2 = Floor((fvar(9) - 10)) % 15 = 0
fvar(9) = 0

[State -1, Right Right 1st Right]
type = varset
trigger1 = (facing = 1 && command = "holdfwd") || (facing = -1 && command = "holdback")
trigger1 = command != "holddown"
trigger1 = fvar(9) = 0
fvar(9) = 1

[State -1, Right Right Release Right]
type = varset
trigger1 = fvar(9) > 0
trigger1 = fvar(9) < 15
trigger1 = (facing = 1 && command != "holdfwd") || (facing = -1 && command != "holdback")
fvar(9) = fvar(9) + 15

[State -1, Right Right 2nd Right]
type = varset
trigger1 = fvar(9) > 15
trigger1 = fvar(9) < 30
trigger1 = (facing = 1 && command = "holdfwd") || (facing = -1 && command = "holdback")
trigger1 = command != "holddown"
fvar(9) = 61

[State -1, Left Left Increment]
type = varset
trigger1 = fvar(10) > 0
fvar(10) = fvar(10) + 1

[State -1, Left Left Reset]
type = varset
trigger1 = fvar(10) < 61
trigger1 = Floor(fvar(10)) % 15 = 0
trigger2 = fvar(10) > 61
trigger2 = Floor((fvar(10) - 10)) % 15 = 0
fvar(10) = 0

[State -1, Left Left 1st Left]
type = varset
trigger1 = (facing = -1 && command = "holdfwd") || (facing = 1 && command = "holdback")
trigger1 = command != "holddown"
trigger1 = fvar(10) = 0
fvar(10) = 1

[State -1, Left Left Release Left]
type = varset
trigger1 = fvar(10) > 0
trigger1 = fvar(10) < 15
trigger1 = (facing = -1 && command != "holdfwd") || (facing = 1 && command != "holdback")
fvar(10) = fvar(10) + 15

[State -1, Left Left 2nd Left]
type = varset
trigger1 = fvar(10) > 15
trigger1 = fvar(10) < 30
trigger1 = (facing = -1 && command = "holdfwd") || (facing = 1 && command = "holdback")
trigger1 = command != "holddown"
fvar(10) = 61

;------------------------------------------------------------------------------
; COMBO VARIABLE SETTINGS
; -----------------------
; When an attack connects with the opponent and a second command is input
; during the first hit, this variable is set to a specific value depending on
; the command for the second attack. If the second command can be chained from
; the first command, as specified in the first command's state definition (CNS
; file), then the second command will activate when a certain amount of time
; has elapsed during the first command (also in CNS file). This allows for
; buffering of combo inputs.
;
; I'm also using this to cancel running to other states so ctrl for running
;  canbe set to 0 (and thus no cancelling it to itself/crouching)
;
; Thank you to 645 for this. :D
;------------------------------------------------------------------------------

[State -1, Clear Combo Condition]
type = VarSet
trigger1 = !movecontact
trigger1 = ifelse((stateno = [600,799]) || ((stateno = 52) && time = 0), (var(1) != [100,105]), 1)
var(1) = 0
ignorehitpause = 1

[State -1, Running to Jump]
type = varset
triggerall = Command = "holdup"
trigger1 = StateNo = [100,105]
var(1) = 40
ignorehitpause = 1

[State -1, Land to Run Forward]
type = varset
triggerall = fvar(9) >= 61 || fvar(10) >= 61
trigger1 = StateNo = [600,799]
var(1) = 100
ignorehitpause = 1

;[State -1, Land to Run Back]
;type = varset
;triggerall = Command = "BB"
;trigger1 = StateNo = [600,799]
;var(1) = 105
;ignorehitpause = 1

[State -1, Running to Guard]
type = varset
triggerall = Command = "holdz"
trigger1 = StateNo = [100,105]
trigger2 = (StateNo = 856) || (StateNo = 858)
var(1) = 120
ignorehitpause = 1

[State -1, Running to Taunt]
type = varset
triggerall = Command = "start"
trigger1 = StateNo = [100,105]
var(1) = 195
ignorehitpause = 1

[State -1, Combo Into sL]
type = varset
triggerall = Command = "x"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 200
ignorehitpause = 1

[State -1, Combo Into sM]
type = varset
triggerall = Command = "y"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 210
ignorehitpause = 1

[State -1, Combo Into sH]
type = varset
triggerall = Command = "b"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 220
ignorehitpause = 1

[State -1, Combo Into cL]
type = varset
triggerall = Command = "x"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 400
ignorehitpause = 1

[State -1, Combo Into cM]
type = varset
triggerall = Command = "y"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 410
ignorehitpause = 1

[State -1, Combo Into cH]
type = varset
triggerall = Command = "b"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = statetype != A
var(1) = 420
ignorehitpause = 1

[State -1, Combo Into aL]
type = varset
triggerall = Command = "x"
trigger1 = statetype = A
trigger1 = MoveContact
trigger2 = (StateNo = 856) || (StateNo = 858)
trigger3 = StateNo = [800,805]
trigger3 = statetype = A
var(1) = 600
ignorehitpause = 1

[State -1, Combo Into aM]
type = varset
triggerall = Command = "y"
trigger1 = statetype = A
trigger1 = MoveContact
trigger2 = (StateNo = 856) || (StateNo = 858)
trigger3 = StateNo = [800,805]
trigger3 = statetype = A
var(1) = 610
ignorehitpause = 1

[State -1, Combo Into aH]
type = varset
triggerall = Command = "b"
trigger1 = statetype = A
trigger1 = MoveContact
trigger2 = (StateNo = 856) || (StateNo = 858)
trigger3 = StateNo = [800,805]
trigger3 = statetype = A
var(1) = 620
ignorehitpause = 1

[State -1, Combo Into Shunpo]
type = varset
triggerall = Command = "a"
triggerall = var(13) >= 1
;trigger1 = statetype != A
trigger1 = MoveContact
trigger2 = StateNo = [100,105]
trigger3 = StateNo = [800,805]
trigger3 = var(22) >= 11
;trigger3 = time >= 2
var(1) = 800
ignorehitpause = 1

;[State -1, Combo Into aShunpo]
;type = varset
;triggerall = Command = "a"
;triggerall = Command != "holdback"
;triggerall = var(13) >= 1
;trigger1 = statetype = A
;trigger1 = MoveContact
;trigger2 = (StateNo = 856) || (StateNo = 858)
;trigger3 = StateNo = [800,805]
;var(1) = 802

;[State -1, Combo Into aShunpo back]
;type = varset
;triggerall = Command = "a"
;triggerall = Command = "holdback"
;triggerall = var(13) >= 1
;trigger1 = statetype = A
;trigger1 = MoveContact
;trigger2 = (StateNo = 856) || (StateNo = 858)
;trigger3 = StateNo = [800,805]
;var(1) = 803

[State -1, Air Dash to Air Dash Fwd]
type = varset
triggerall = command = "AFF"
triggerall = var(49) > 0
trigger1 = (StateNo = 856) || (StateNo = 858)
trigger1 = time >= 8
value = 855
ignorehitpause = 1

[State -1, Air Dash to Air Dash Back]
type = varset
triggerall = command = "ABB"
triggerall = var(49) > 0
trigger1 = (StateNo = 856) || (StateNo = 858)
trigger1 = time >= 8
value = 857
ignorehitpause = 1

;------------------------------------------------------------------------------
; JUMP ATTACK BUFFER VARIABLE SETTINGS
; -----------------------
; Like the combo one but for jump cancels.
;------------------------------------------------------------------------------

[State -1, Clear Jump Cancel Condition]
type = VarSet
trigger1 = StateNo != [45,50]
var(2) = 0

[State -1, Jump Cancel Into aL]
type = varset
trigger1 = command = "x"
trigger1 = StateNo = [45,50]
var(2) = 600

[State -1, Jump Cancel Into aM]
type = varset
trigger1 = command = "y"
trigger1 = StateNo = [45,50]
var(2) = 610

[State -1, Jump Cancel Into aH]
type = varset
trigger1 = command = "b"
trigger1 = StateNo = [45,50]
var(2) = 620

[State -1, Jump Cancel Into aSlide]
type = varset
trigger1 = command = "a"
trigger1 = command = "holdback"
trigger1 = StateNo = [45,50]
var(2) = 800

;===========================================================================
[State -1, Shunpo Direction Reset]
type = VarSet
trigger1 = stateno != [800,801]
var(23) = 0

[State -1, Senbonzakura Combo Condition Reset]
type = VarSet
trigger1 = 1
var(2) = 0

[State -1, Senka Combo Condition Reset]
type = VarSet
trigger1 = 1
var(3) = 0

[State -1, Soukatsui Combo Condition Reset]
type = VarSet
trigger1 = 1
var(4) = 0

[State -1, Rikujou Kourou Combo Condition Reset]
type = VarSet
trigger1 = 1
var(5) = 0

[State -1, Senbonzakura Kageyoshi Combo Condition Reset]
type = VarSet
trigger1 = 1
var(7) = 0

[State -1, Senkei Combo Condition Reset]
type = VarSet
trigger1 = 1
var(8) = 0

[State -1, Hakuteiken Combo Condition Reset]
type = VarSet
trigger1 = 1
var(9) = 0

[State -1, Senbonzakura Combo Condition Check]
type = VarSet
trigger1 = ctrl
trigger2 = (stateno = [200,799])
trigger2 = movecontact
trigger3 = (stateno = [800,801])
trigger3 = pos y >= 0
var(2) = 1

[State -1, Senka Combo Condition Check]
type = VarSet
trigger1 = ctrl
trigger2 = (stateno = [200,799])
trigger2 = movecontact
trigger3 = (stateno = [800,801])
trigger3 = pos y >= 0
var(3) = 1

;[State -1, Soukatsui Combo Condition Check]
;type = VarSet
;trigger1 = ctrl
;trigger2 = (stateno = [200,799])
;trigger2 = movecontact
;trigger3 = (stateno = [800,801])
;trigger3 = pos y >= 0
;var(4) = 1

[State -1, Rikujou Kourou Combo Condition Check]
type = VarSet
trigger1 = ctrl
trigger2 = (stateno = [200,799])
trigger2 = movecontact
trigger3 = (stateno = [800,801])
trigger3 = pos y >= 0
var(5) = 1

[State -1, Senbonzakura Kageyoshi Combo Condition Check]
type = VarSet
trigger1 = ctrl
trigger2 = (stateno = [200,799])
trigger2 = movecontact
trigger3 = (stateno = 1100)
trigger3 = movecontact < 9
trigger3 = movecontact != 0
trigger4 = (stateno = [800,801])
trigger4 = pos y >= 0
var(7) = 1

[State -1, Senkei Combo Condition Check]
type = VarSet
trigger1 = ctrl
trigger2 = (stateno = [200,799])
trigger2 = movecontact
trigger3 = (stateno = 1100)
trigger3 = movecontact < 9
trigger3 = movecontact != 0
trigger4 = (stateno = [800,801])
trigger4 = pos y >= 0
var(8) = 1

;[State -1, Hakuteiken Combo Condition Check]
;type = VarSet
;trigger1 = ctrl
;trigger2 = (stateno = [200,799])
;trigger2 = movecontact
;trigger3 = (stateno = 1100)
;trigger3 = movecontact < 9
;trigger3 = movecontact != 0
;trigger4 = (stateno = [800,801])
;trigger4 = pos y >= 0
;var(9) = 1
 n

;===========================================================================
;---------------------------------------------------------------------------
; AI Controls
;---------------------------------------------------------------------------

;[State -1, Haha!]
;type = ChangeState
;trigger1 = var(0) ; (Or use "var(58)>0" if you've chosen not to
                  ; use the Simplifier variable/controller.)
;trigger1 = ctrl
;trigger1 = StateType = S
;trigger1 = MoveType = I
;trigger1 = P2MoveType = H
;trigger1 = NumEnemy = 1
;trigger1 = Enemy,GetHitVar(HitTime) > 60
;trigger1 = PrevStateNo != 195
;trigger1 = Random < 99
;value = 195

;[State -1, Jump in]
;type = ChangeState
;trigger1 = var(0)
;trigger1 = ctrl
;trigger1 = StateType = S
;;trigger1 = sysvar(1) := 1
;value = 40

;[State -1, wtf r u doin]
;type = VarSet
;trigger1 = 1
;var(0) = 0

[State -1, Start guarding]
type = ChangeState
triggerall = var(0)
triggerall = inguarddist
triggerall = enemynear, time < 250 
triggerall = ctrl || stateno = [100,105]
trigger1 = random % 20
value = 120

[State -1, Stop guarding]
type = ChangeState
triggerall = var(0)
triggerall = stateno = [130,132]
;triggerall = playerID(var(35)), movetype != A
triggerall = !inguarddist || (time >= 250) 
trigger1 = random % 4 = 0
;trigger1 = numenemy = 1
;trigger2 = numenemy = 2
;trigger2 = var(36) != 0
;trigger2 = playerID(var(36)), movetype != A
value = 140

[State -1, Senkei]
type = ChangeState
triggerall = var(0)
triggerall = ctrl || stateno = 100
triggerall = statetype != A
triggerall = (facing * (enemynear, pos x) + (-facing) * pos x) > 200
triggerall = power >= 1000
triggerall = numhelper(70) = 0
trigger1 = numenemy = 1
trigger1 = enemy, stateno = [932,935]
trigger1 = enemy, movetype = H
trigger2 = numenemy = 2
trigger2 = !(PlayerID(var(35)), alive)
trigger3 = (PlayerID(var(36)), stateno = 932)
trigger3 = (PlayerID(var(36)), movetype = H)
trigger3 = numenemy = 2
trigger3 = !(PlayerID(var(36)), alive)
trigger3 = (PlayerID(var(35)), stateno = 932)
trigger3 = (PlayerID(var(35)), movetype = H)
value = 3100

[State -1, Rikujou Kourou]
type = ChangeState
triggerall = var(0)
triggerall = ctrl || stateno = 100
triggerall = statetype != A
triggerall = (facing * (enemynear, pos x) + (-facing) * pos x) > 200
trigger1 = numenemy = 1
trigger1 = enemy, stateno = [932,935]
trigger1 = enemy, movetype = H
trigger2 = numenemy = 2
trigger2 = !(PlayerID(var(35)), alive)
trigger3 = (PlayerID(var(36)), stateno = 932)
trigger3 = (PlayerID(var(36)), movetype = H)
trigger3 = numenemy = 2
trigger3 = !(PlayerID(var(36)), alive)
trigger3 = (PlayerID(var(35)), stateno = 932)
trigger3 = (PlayerID(var(35)), movetype = H)
value = 1300

[State -1, Run]
type = ChangeState
triggerall = var(0)
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) > 160
value = 100

[State -1, Stop Run]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 100
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) < -40 || abs(pos x) = 145
value = 0
ctrl = 1

[State -1, Standing Turn]
type = ChangeAnim
triggerall = var(0)
triggerall = stateno = 0
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (playerID(var(35)), alive) && (playerID(var(36)), alive)
trigger1 = ifelse((facing = -1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (enemynear, pos x), 1)
value = 5

[State -1, Standing Turn]
type = Turn
triggerall = var(0)
triggerall = stateno = 0
triggerall = numenemy = 2
triggerall = (var(35) != 0) && (var(36) != 0)
triggerall = (PlayerID(var(35)), alive) && (PlayerID(var(36)), alive)
trigger1 = ifelse((facing = -1), pos x < (enemynear, pos x), 1)
trigger1 = ifelse((facing = 1), pos x > (enemynear, pos x), 1)

[State -1, sL/cL]
type = ChangeState
triggerall = var(0)
trigger1 = ctrl || stateno = [100,105]
trigger1 = statetype != A
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) < 70
trigger1 = enemynear, statetype = S
trigger1 = random % 4 = 0
trigger2 = stateno = 801 && time >= 8
trigger2 = pos y = 0
trigger2 = (facing * (enemynear, pos x) + (-facing) * pos x) < 35
trigger2 = !inguarddist
trigger2 = random % 4 = 0
value = ifelse(random % 2, 200, 400)

[State -1, sL/cL]
type = ChangeState
triggerall = var(0)
trigger1 = ctrl || stateno = [100,105]
trigger1 = statetype != A
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) < 70
trigger1 = enemynear, statetype = C
trigger1 = random % 4 = 0
value = ifelse(random % 10, 400, 200)

[State -1, cH]
type = ChangeState
triggerall = var(0)
trigger1 = numenemy = 1
trigger1 = enemy, life > 50
trigger1 = stateno = 200 || stateno = 400
trigger1 = MoveHit
trigger1 = AnimTime > -18
trigger1 = power < 3000
trigger1 = var(13) = 0
;trigger1 = random % 8
trigger2 = numenemy = 2
trigger2 = var(36) != 0
trigger2 = (PlayerID(var(35)), life > 50 && PlayerID(var(36)), life > 50)
trigger2 = stateno = 200 || stateno = 400
trigger2 = MoveHit
trigger2 = AnimTime > -18
trigger2 = power < 3000
trigger2 = var(13) = 0
;trigger2 = random % 8
value = 420

[State -1, Jump Cancel]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 420
trigger1 = MoveHit
value = 40

[State -1, aL]
type = ChangeState
triggerall = var(0)
trigger1 = ctrl
trigger1 = statetype = A
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) < 60
trigger1 = (facing * (enemynear, pos x) + (-facing) * pos x) > 14
trigger1 = ((enemynear, pos y) - pos y) > -60
trigger1 = ((enemynear, pos y) - pos y) < 15
trigger1 = ifelse(enemynear, movetype = H, 1, random % 4 = 0)
;trigger2 = stateno = 801 && time >= 8
;trigger2 = pos y = 0
;trigger2 = (facing * (enemynear, pos x) + (-facing) * pos x) < 30
value = 600

[State -1, aM]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 600
trigger1 = MoveHit
trigger1 = AnimTime > -16
trigger1 = random % 4
;trigger2 = stateno = 801 && time >= 8
;trigger2 = pos y = 0
;trigger2 = (facing * (enemynear, pos x) + (-facing) * pos x) < 30
value = 610

[State -1, aH]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 610
trigger1 = MoveHit
trigger1 = AnimTime > -20
trigger1 = var(48) = 0
trigger1 = random % 4
;trigger2 = stateno = 801 && time >= 8
;trigger2 = pos y = 0
;trigger2 = (facing * (enemynear, pos x) + (-facing) * pos x) < 30
value = 620

[State -1, Jump Cancel]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 610
trigger1 = MoveHit
trigger1 = target, statetype = A
trigger1 = var(48) = 1
trigger1 = sysvar(1) = 0
value = 45

[State -1, sM/cM]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 200 || stateno = 400
trigger1 = MoveHit
trigger1 = AnimTime > -18
trigger1 = random % 4
value = ifelse(random % 2, 210, 410)

[State -1, sH]
type = ChangeState
triggerall = var(0)
trigger1 = stateno = 210 || stateno = 410
trigger1 = MoveHit
trigger1 = AnimTime > -20
trigger1 = random % 4
value = 220

[State -1, Shunpo]
type = ChangeState
triggerall = var(0)
triggerall = var(13) >= 1
trigger1 = stateno = 220
trigger1 = MoveHit
trigger1 = AnimTime > -24
trigger1 = var(23) := 3
trigger2 = stateno = [150,155]
trigger2 = random % 10 = 0
trigger2 = var(23) := 3
value = 800

[State -1, SU-A]
type = ChangeState
triggerall = roundstate != 3
triggerall = var(0)
triggerall = numtarget > 0
trigger1 = numenemy = 1
trigger1 = (enemy, life) <= 50
trigger1 = stateno = 220
trigger1 = MoveHit
trigger1 = AnimTime > -24
trigger1 = power >= 1000
trigger1 = var(13) = 0
trigger2 = numenemy = 2
trigger2 = var(36) != 0
trigger2 = !(PlayerID(var(35)), alive) || !(PlayerID(var(36)), alive)
trigger2 = ifelse((PlayerID(var(35)), alive), (PlayerID(var(35)), life) <= 50, (PlayerID(var(36)), life) <= 50)
trigger2 = stateno = 220
trigger2 = MoveHit
trigger2 = AnimTime > -24
trigger2 = power >= 1000
trigger2 = var(13) = 0
value = 3000

[State -1, Jump Toward Wake Up]
type = ChangeState
triggerall = var(0)
triggerall = stateno = 5110
triggerall = alive
triggerall = Anim != [5111,5119]
triggerall = var(40) = 1
trigger1 = AnimTime = 0
trigger1 = random % 20
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger2 = random % 5
value = 850

;---------------------------------------------------------------------------
; Human Controls
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
;Throw
[State -1, Throw]
type = ChangeState
value = 900
triggerall = !var(0)
triggerall = command = "Throw"
triggerall = (stateno != 100) && (stateno != 105) && (stateno != [855,858])
trigger1 = ctrl

;---------------------------------------------------------------------------
;Reverse Senkei: Senbonzakura Kageyoshi (Uses one super stock)
[State -1, Reverse Senkei: Senbonzakura Kageyoshi]
type = ChangeState
value = 3105
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(70) = 0
triggerall = power >= 1000
triggerall = statetype != A
triggerall = stateno != [100,105]
trigger1 = command = "D,HCB_y"
trigger1 = var(8) = 1
trigger2 = command = "D,HCB_x"
trigger2 = var(8) = 1
trigger3 = command = "D,HCB_a"
trigger3 = var(8) = 1
trigger4 = (command = "LX")
trigger4 = (var(46) = 0)
trigger4 = command = "holdback"
trigger4 = var(8) = 1
trigger5 = command = "D,HCB_y"
trigger5 = StateNo = [150,155]
trigger6 = command = "D,HCB_x"
trigger6 = StateNo = [150,155]
trigger7 = command = "D,HCB_a"
trigger7 = StateNo = [150,155]

;---------------------------------------------------------------------------
;Reverse Senkei: Senbonzakura Kageyoshi while running (Uses one super stock)
[State -1, Reverse Senkei: Senbonzakura Kageyoshi Running]
type = ChangeState
value = 3105
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(70) = 0
triggerall = power >= 1000
triggerall = stateno = [100,105]
trigger1 = command = "D,HCB_y"
trigger2 = command = "D,HCB_x"
trigger3 = command = "D,HCB_a"
trigger4 = (command = "LX")
trigger4 = (var(46) = 0)
trigger4 = command != "holdback"

;---------------------------------------------------------------------------
;Senkei: Senbonzakura Kageyoshi (Uses one super stock)
[State -1, Senkei: Senbonzakura Kageyoshi]
type = ChangeState
value = 3100
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(70) = 0
triggerall = power >= 1000
triggerall = statetype != A
triggerall = stateno != [100,105]
trigger1 = command = "D,HCF_y"
trigger1 = var(8) = 1
trigger2 = command = "D,HCF_x"
trigger2 = var(8) = 1
trigger3 = command = "D,HCF_a"
trigger3 = var(8) = 1
trigger4 = (command = "LX")
trigger4 = (var(46) = 0)
trigger4 = command != "holdback"
trigger4 = var(8) = 1
trigger5 = command = "D,HCF_y"
trigger5 = StateNo = [150,155]
trigger6 = command = "D,HCF_x"
trigger6 = StateNo = [150,155]
trigger7 = command = "D,HCF_a"
trigger7 = StateNo = [150,155]

;---------------------------------------------------------------------------
;Senkei: Senbonzakura Kageyoshi while running (Uses one super stock)
[State -1, Senkei: Senbonzakura Kageyoshi Running]
type = ChangeState
value = 3100
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(70) = 0
triggerall = power >= 1000
triggerall = stateno = [100,105]
trigger1 = command = "D,HCF_y"
trigger2 = command = "D,HCF_x"
trigger3 = command = "D,HCF_a"
trigger4 = (command = "LX")
trigger4 = (var(46) = 0)
trigger4 = command != "holdback"

;---------------------------------------------------------------------------
;Reverse Senbonzakura Kageyoshi (Uses one super stock)
[State -1, Reverse Senbonzakura Kageyoshi]
type = ChangeState
value = 3005
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(60) = 0
triggerall = power >= 1000
triggerall = statetype != A
triggerall = stateno != [100,105]
trigger1 = command = "QCBx2_y"
;trigger1 = (command = "QCBx2_y")
trigger1 = var(7) = 1
trigger2 = command = "QCBx2_x"
;trigger2 = (command = "QCBx2_x")
trigger2 = var(7) = 1
trigger3 = command = "QCBx2_a"
;trigger3 = (command = "QCBx2_a")
trigger3 = var(7) = 1
;trigger4 = ((command = "LY") && (var(45) = 0) && (command = "holdback"))
trigger4 = (command = "LY")
trigger4 = (var(45) = 0)
trigger4 = command = "holdback"
trigger4 = var(7) = 1
trigger5 = command = "QCBx2_y"
;trigger5 = (command = "QCBx2_y")
trigger5 = StateNo = [150,155]
trigger6 = command = "QCBx2_x"
;trigger6 = (command = "QCBx2_x")
trigger6 = StateNo = [150,155]
trigger7 = command = "QCBx2_a"
;trigger7 = (command = "QCBx2_a")
trigger7 = StateNo = [150,155]

;---------------------------------------------------------------------------
;Reverse Senbonzakura Kageyoshi while running (Uses one super stock)
[State -1, Reverse Senbonzakura Kageyoshi Running]
type = ChangeState
value = 3005
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(60) = 0
triggerall = power >= 1000
triggerall = stateno = [100,105]
trigger1 = command = "QCBx2_y"
trigger2 = command = "QCBx2_x"
trigger3 = command = "QCBx2_a"
trigger4 = (command = "LY")
trigger4 = (var(45) = 0)
trigger4 = command != "holdback"

;---------------------------------------------------------------------------
;Senbonzakura Kageyoshi (Uses one super stock)
[State -1, Senbonzakura Kageyoshi]
type = ChangeState
value = 3000
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(60) = 0
triggerall = power >= 1000
triggerall = statetype != A
triggerall = stateno != [100,105]
trigger1 = command = "QCFx2_y"
;trigger1 = (command = "QCFx2_y")
trigger1 = var(7) = 1
trigger2 = command = "QCFx2_x"
;trigger2 = (command = "QCFx2_x"))
trigger2 = var(7) = 1
trigger3 = command = "QCFx2_a"
;trigger3 = (command = "QCFx2_a")
trigger3 = var(7) = 1
;trigger4 = ((command = "LY") && (var(45) = 0) && (command != "holdback"))
trigger4 = (command = "LY")
trigger4 = (var(45) = 0)
trigger4 = command != "holdback"
trigger4 = var(7) = 1
trigger5 = command = "QCFx2_y"
;trigger5 = (command = "QCFx2_y")
trigger5 = StateNo = [150,155]
trigger6 = command = "QCFx2_x"
;trigger6 = (command = "QCFx2_x")
trigger6 = StateNo = [150,155]
trigger7 = command = "QCFx2_a"
;trigger7 = (command = "QCFx2_a")
trigger7 = StateNo = [150,155]

;---------------------------------------------------------------------------
;Senbonzakura Kageyoshi while running (Uses one super stock)
[State -1, Senbonzakura Kageyoshi Running]
type = ChangeState
value = 3000
triggerall = roundstate != 3
triggerall = !var(0)
triggerall = numhelper(60) = 0
triggerall = power >= 1000
triggerall = stateno = [100,105]
trigger1 = command = "QCFx2_y"
trigger2 = command = "QCFx2_x"
trigger3 = command = "QCFx2_a"
trigger4 = (command = "LY")
trigger4 = (var(45) = 0)
trigger4 = command != "holdback"

;---------------------------------------------------------------------------
;Reverse RF Shoryuuken
[State -1, Reverse RF Shoryuuken]
type = ChangeState
value = 1425
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = var(11) >= 1
trigger1 = StateNo != [100,105]
trigger1 = statetype = A
trigger1 = command = "RDP_a"
trigger1 = var(6) = 1
trigger2 = statetype = A
trigger2 = command = "RDP_a"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger3 = command = "RDP_a"
;triggerall = command = "RDP_a"
trigger3 = var(6) = 1
trigger4 = command = "RDP_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;RF Shoryuuken
[State -1, RF Shoryuuken]
type = ChangeState
value = 1420
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = var(11) >= 1
trigger1 = StateNo != [100,105]
trigger1 = statetype = A
trigger1 = command = "DP_a"
trigger1 = var(6) = 1
trigger2 = statetype = A
trigger2 = command = "DP_a"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger3 = command = "DP_a"
;triggerall = command = "DP_a"
trigger3 = var(6) = 1
trigger4 = command = "DP_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Reverse Medium Shoryuuken
[State -1, Reverse Medium Shoryuuken]
type = ChangeState
value = 1415
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = StateNo != [100,105]
triggerall = statetype != A ; was commented out for a reason?
trigger1 = command = "RDP_x"
;trigger1 = command = "RDP_x"
trigger1 = var(6) = 1
trigger2 = command = "RDP_a"
;trigger2 = command = "RDP_a"
trigger2 = var(6) = 1
trigger2 = var(11) < 1
trigger3 = command = "RDP_x"
;trigger3 = command = "RDP_x"
trigger3 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = command = "RDP_a"
;trigger4 = command = "RDP_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Medium Shoryuuken
[State -1, Medium Shoryuuken]
type = ChangeState
value = 1410
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = StateNo != [100,105]
triggerall = statetype != A ; was commented out for a reason?
trigger1 = command = "DP_x"
;trigger1 = command = "DP_x"
trigger1 = var(6) = 1
trigger2 = command = "DP_a"
;trigger2 = command = "DP_a"
trigger2 = var(6) = 1
trigger2 = var(11) < 1
trigger3 = command = "DP_x"
;trigger3 = command = "DP_x"
trigger3 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = command = "DP_a"
;trigger4 = command = "DP_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = var(11) < 1

;---------------------------------------------------------------------------
;Reverse Light Shoryuuken
[State -1, Reverse Light Shoryuuken]
type = ChangeState
value = 1405
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = StateNo != [100,105]
trigger1 = statetype = A
trigger1 = command = "RDP_y"
trigger1 = var(6) = 1
trigger2 = statetype = A
trigger2 = command = "RDP_y"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger3 = command = "RDP_y"
;triggerall = command = "RDP_y"
trigger3 = var(6) = 1
trigger4 = command = "RDP_y"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = var(11) < 1

;---------------------------------------------------------------------------
;Light Shoryuuken
[State -1, Light Shoryuuken]
type = ChangeState
value = 1400
triggerall = !var(0)
triggerall = var(53) = 1
triggerall = StateNo != [100,105]
trigger1 = statetype = A
trigger1 = command = "DP_y"
trigger1 = var(6) = 1
trigger2 = statetype = A
trigger2 = command = "DP_y"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger3 = command = "DP_y"
;triggerall = command = "DP_y"
trigger3 = var(6) = 1
trigger4 = command = "DP_y"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Reverse Senbonzakura
[State -1, Reverse Senbonzakura]
type = ChangeState
value = 1005
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A ; was commented out for a reason?
triggerall = var(11) >= 1
trigger1 = (command = "HCB_y") || (command = "HCB_x") || (command = "HCB_a")
trigger1 = var(2) = 1
trigger2 = (command = "HCB_y") || (command = "HCB_x") || (command = "HCB_a")
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Senbonzakura
[State -1, Senbonzakura]
type = ChangeState
value = 1000
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A ; was commented out for a reason?
triggerall = var(11) >= 1
trigger1 = (command = "HCF_y") || (command = "HCF_x") || (command = "HCF_a")
trigger1 = var(2) = 1
trigger2 = (command = "HCF_y") || (command = "HCF_x") || (command = "HCF_a")
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Reverse Rikujou Kourou
[State -1, Reverse Rikujou Kourou]
type = ChangeState
value = 1305
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A
triggerall = numhelper(50) = 0
trigger1 = (command="RDU_y")||(command="RDU_x")||(command="RDU_a")
trigger1 = var(5) = 1
trigger2 = (command="RDU_y")||(command="RDU_x")||(command="RDU_a")
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Rikujou Kourou
[State -1, Rikujou Kourou]
type = ChangeState
value = 1300
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A
triggerall = numhelper(50) = 0
trigger1 = (command="DU_y")||(command="DU_x")||(command="DU_a")
trigger1 = var(5) = 1
trigger2 = (command="DU_y")||(command="DU_x")||(command="DU_a")
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Reverse RF Soukatsui
[State -1, Reverse RF Soukatsui]
type = ChangeState
value = 1225
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
triggerall = command = "QCB_a"
;triggerall = command = "QCB_a"
trigger1 = var(4) = 1
trigger1 = var(11) >= 1
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger2 = var(11) >= 1

;---------------------------------------------------------------------------
;RF Soukatsui
[State -1, RF Soukatsui]
type = ChangeState
value = 1220
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
triggerall = command = "QCF_a"
;triggerall = command = "QCF_a"
trigger1 = var(4) = 1
trigger1 = var(11) >= 1
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger2 = var(11) >= 1

;---------------------------------------------------------------------------
;Reverse Medium Soukatsui
[State -1, Reverse Medium Soukatsui]
type = ChangeState
value = 1215
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
trigger1 = command = "QCB_x"
;trigger1 = command = "QCB_x"
trigger1 = var(4) = 1
trigger2 = command = "QCB_a"
;trigger2 = command = "QCB_a"
trigger2 = var(4) = 1
trigger2 = var(11) < 1
trigger3 = command = "QCB_x"
;trigger3 = command = "QCB_x"
trigger3 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = command = "QCB_a"
;trigger4 = command = "QCB_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = var(11) < 1

;---------------------------------------------------------------------------
;Medium Soukatsui
[State -1, Medium Soukatsui]
type = ChangeState
value = 1210
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
trigger1 = command = "QCF_x"
;trigger1 = command = "QCF_x"
trigger1 = var(4) = 1
trigger2 = command = "QCF_a"
;trigger2 = command = "QCF_a"
trigger2 = var(4) = 1
trigger2 = var(11) < 1
trigger3 = command = "QCF_x"
;trigger3 = command = "QCF_x"
trigger3 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = command = "QCF_a"
;trigger4 = command = "QCF_a"
trigger4 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)
trigger4 = var(11) < 1

;---------------------------------------------------------------------------
;Reverse Light Soukatsui
[State -1, Reverse Light Soukatsui]
type = ChangeState
value = 1205
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
;triggerall = command = "QCB_y"
triggerall = command = "QCB_y"
trigger1 = var(4) = 1
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Light Soukatsui
[State -1, Light Soukatsui]
type = ChangeState
value = 1200
triggerall = !var(0)
triggerall = statetype != A
triggerall = StateNo != [100,105]
;triggerall = command = "QCF_y"
triggerall = command = "QCF_y"
trigger1 = var(4) = 1
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Reverse Senka
[State -1, Reverse Senka]
type = ChangeState
value = 1105
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A
triggerall = (fvar(8) >= 61)
trigger1 = command != "holdback"
trigger1 = var(3) = 1
trigger2 = command != "holdback"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Senka
[State -1, Senka]
type = ChangeState
value = 1100
triggerall = !var(0)
triggerall = StateNo != [100,105]
triggerall = statetype != A
triggerall = (fvar(8) >= 61)
trigger1 = command != "holdback"
trigger1 = var(3) = 1
trigger2 = command != "holdback"
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;===========================================================================
;---------------------------------------------------------------------------
;Run Fwd
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = !var(0)
triggerall = fvar(9) >= 61 || fvar(10) >= 61
trigger1 = statetype = S
trigger1 = ctrl


;===========================================================================
;---------------------------------------------------------------------------
;Taunt
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = !var(0)
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
;Standing Heavy
[State -1, Standing Heavy]
type = ChangeState
value = 220
triggerall = !var(0)
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Standing Medium
[State -1, Standing Medium]
type = ChangeState
value = 210
triggerall = !var(0)
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Standing Light
[State -1, Standing Light]
type = ChangeState
value = 200
triggerall = !var(0)
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Heavy
[State -1, Crouching Heavy]
type = ChangeState
value = 420
triggerall = !var(0)
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Medium
[State -1, Crouching Medium]
type = ChangeState
value = 410
triggerall = !var(0)
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Light
[State -1, Crouching Light]
type = ChangeState
value = 400
triggerall = !var(0)
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Jumping Heavy
[State -1, Jumping Heavy]
type = ChangeState
value = 620
triggerall = !var(0)
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl
;trigger1 = vel X >= 0

;---------------------------------------------------------------------------
;Jumping Medium
[State -1, Jumping Medium]
type = ChangeState
value = 610
triggerall = !var(0)
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl
;trigger1 = vel X >= 0

;---------------------------------------------------------------------------
;Jumping Light
[State -1, Jumping Light]
type = ChangeState
value = 600
triggerall = !var(0)
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl
;trigger1 = vel X >= 0

;---------------------------------------------------------------------------
;Crouching
[State -1, Crouching]
type = ChangeState
value = 10
triggerall = !var(0)
triggerall = statetype = S
triggerall = command = "holddown"
trigger1 = StateNo != [100,105]
trigger1 = ctrl

;---------------------------------------------------------------------------
;Guarding
[State -1, Guarding]
type = ChangeState
value = 120
triggerall = !var(0)
triggerall = command = "holdz"
trigger1 = ctrl

;---------------------------------------------------------------------------
;Forward Shunpo
[State -1, Shunpo Fwd]
type = ChangeState
value = 800
triggerall = !var(0)
triggerall = command = "a"
triggerall = command != "holdback"
triggerall = statetype != A
triggerall = var(13) >= 1
trigger1 = ctrl
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Backward Shunpo
[State -1, Shunpo Back]
type = ChangeState
value = 800
triggerall = !var(0)
triggerall = command = "a"
triggerall = statetype != A
triggerall = var(13) >= 1
triggerall = command = "holdback"
trigger1 = ctrl
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Forward Air Shunpo
[State -1, Air Shunpo Fwd]
type = ChangeState
value = 800
triggerall = !var(0)
triggerall = command = "a"
triggerall = command != "holdback"
triggerall = statetype = A
triggerall = var(13) >= 1
trigger1 = ctrl
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Backward Air Shunpo
[State -1, Air Shunpo Back]
type = ChangeState
value = 800
triggerall = !var(0)
triggerall = command = "a"
triggerall = statetype = A
triggerall = command = "holdback"
triggerall = var(13) >= 1
trigger1 = ctrl
trigger2 = StateNo = [150,155] ;(Stateno = 151) || (Stateno = 153) || (Stateno = 155)

;---------------------------------------------------------------------------
;Air Dash
[State -1, Air Dash Fwd]
type = ChangeState
value = 855
triggerall = !var(0)
triggerall = ifelse(facing = 1, fvar(9) >= 61, fvar(10) >= 61 ) ;command = "AFF"
triggerall = statetype = A
triggerall = var(49) > 0
triggerall = ifelse((prevstateno = [40,45]), (time >= 6), 1)
trigger1 = ctrl

;---------------------------------------------------------------------------
;Air Dash Back
[State -1, Air Dash Back]
type = ChangeState
value = 857
triggerall = !var(0)
triggerall = ifelse(facing = 1, fvar(10) >= 61, fvar(9) >= 61 ) ;command = "ABB"
triggerall = statetype = A
triggerall = var(49) > 0
triggerall = ifelse((prevstateno = [40,45]), (time >= 6), 1)
trigger1 = ctrl

;---------------------------------------------------------------------------
;Damage Cancel
[State -1, Damage Cancel]
type = ChangeState
value = 950
triggerall = !var(0)
triggerall = command = "DC"
triggerall = power >= 1000
triggerall = alive
triggerall = movetype = H
trigger1 = (stateno = [5000,5040]) || (stateno = [5070,5081]) || (stateno = 5050 && time < 10)
trigger1 = var(14) = 1
