; The CMD file.
;
; Two parts: 1. Command definition and  2. State entry
; (state entry is after the commands def section)
;
; 1. Command definition
; ---------------------
; Note: The commands are CASE-SENSITIVE, and so are the command names.
; The eight directions are:
;   B, DB, D, DF, F, UF, U, UB     (all CAPS)
;   corresponding to back, down-back, down, downforward, etc.
; The six buttons are:
;   a, b, c, x, y, z               (all lower case)
;   In default key config, abc are are the bottom, and xyz are on the
;   top row. For 2 button characters, we recommend you use a and b.
;   For 6 button characters, use abc for kicks and xyz for punches.
;
; Each [Command] section defines a command that you can use for
; state entry, as well as in the CNS file.
; The command section should look like:
;
;   [Command]
;   name = some_name
;   command = the_command
;   time = time (optional)
;   buffer.time = time (optional)
;
; - some_name
;   A name to give that command. You'll use this name to refer to
;   that command in the state entry, as well as the CNS. It is case-
;   sensitive (QCB_a is NOT the same as Qcb_a or QCB_A).
;
; - command
;   list of buttons or directions, separated by commas. Each of these
;   buttons or directions is referred to as a "symbol".
;   Directions and buttons can be preceded by special characters:
;   slash (/) - means the key must be held down
;          egs. command = /D       ;hold the down direction
;               command = /DB, a   ;hold down-back while you press a
;   tilde (~) - to detect key releases
;          egs. command = ~a       ;release the a button
;               command = ~D, F, a ;release down, press fwd, then a
;          If you want to detect "charge moves", you can specify
;          the time the key must be held down for (in game-ticks)
;          egs. command = ~30a     ;hold a for at least 30 ticks, then release
;   dollar ($) - Direction-only: detect as 4-way
;          egs. command = $D       ;will detect if D, DB or DF is held
;               command = $B       ;will detect if B, DB or UB is held
;   plus (+) - Buttons only: simultaneous press
;          egs. command = a+b      ;press a and b at the same time
;               command = x+y+z    ;press x, y and z at the same time
;   greater-than (>) - means there must be no other keys pressed or released
;                      between the previous and the current symbol.
;          egs. command = a, >~a   ;press a and release it without having hit
;                                  ;or released any other keys in between
;   You can combine the symbols:
;     eg. command = ~30$D, a+b     ;hold D, DB or DF for 30 ticks, release,
;                                  ;then press a and b together
;
;   Note: Successive direction symbols are always expanded in a manner similar
;         to this example:
;           command = F, F
;         is expanded when MUGEN reads it, to become equivalent to:
;           command = F, >~F, >F
;
;   It is recommended that for most "motion" commads, eg. quarter-circle-fwd,
;   you start off with a "release direction". This makes the command easier
;   to do.
;
; - time (optional)
;   Time allowed to do the command, given in game-ticks. The default
;   value for this is set in the [Defaults] section below. A typical
;   value is 15.
;
; - buffer.time (optional)
;   Time that the command will be buffered for. If the command is done
;   successfully, then it will be valid for this time. The simplest
;   case is to set this to 1. That means that the command is valid
;   only in the same tick it is performed. With a higher value, such
;   as 3 or 4, you can get a "looser" feel to the command. The result
;   is that combos can become easier to do because you can perform
;   the command early. Attacks just as you regain control (eg. from
;   getting up) also become easier to do. The side effect of this is
;   that the command is continuously asserted, so it will seem as if
;   you had performed the move rapidly in succession during the valid
;   time. To understand this, try setting buffer.time to 30 and hit
;   a fast attack, such as KFM's light punch.
;   The default value for this is set in the [Defaults] section below.
;   This parameter does not affect hold-only commands (eg. /F). It
;   will be assumed to be 1 for those commands.
;
; If you have two or more commands with the same name, all of them will
; work. You can use it to allow multiple motions for the same move.
;
; Some common commands examples are given below.
;
; [Command] ;Quarter circle forward + x
; name = "QCF_x"
; command = ~D, DF, F, x
;
; [Command] ;Half circle back + a
; name = "HCB_a"
; command = ~F, DF, D, DB, B, a
;
; [Command] ;Two quarter circles forward + y
; name = "2QCF_y"
; command = ~D, DF, F, D, DF, F, y
;
; [Command] ;Tap b rapidly
; name = "5b"
; command = b, b, b, b, b
; time = 30
;
; [Command] ;Charge back, then forward + z
; name = "charge_B_F_z"
; command = ~60$B, F, z
; time = 10
;
; [Command] ;Charge down, then up + c
; name = "charge_D_U_c"
; command = ~60$D, U, c
; time = 10


;-| Button Remapping |-----------------------------------------------------
; This section lets you remap the player's buttons (to easily change the
; button configuration). The format is:
;   old_button = new_button
; If new_button is left blank, the button cannot be pressed.
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
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


;-| Super Motions |--------------------------------------------------------
;-| Super Motions |--------------------------------------------------------
;-| Super Motions |-------------------------------------------------------- 
[Command]
name = "Final" ;3000
command = x+a 
[Command]
name = "Final" ;3000
command = ~D, DF, F, x+y+z
[Command]
name = "Final2" ;4000
command =  a+c
[Command]
name = "Final2" ;4000
command = ~D, DB, B, a+b+c

;-| Special Motions |------------------------------------------------------  
;-| Special Motions |------------------------------------------------------  
;-| Special Motions |------------------------------------------------------  
 
[Command]
name = "ScrewAttackX" ;2400
command = D, DF, F, UF, x
time = 35 
[Command]
name = "ScrewAttackX" ;2400
command = D, DB, B, UB, x
time = 35  
[Command]
name = "ScrewAttackX" ;2400
command = D, DF, F, UF, y
time = 35 
[Command]
name = "ScrewAttackX" ;2400
command = D, DB, B, UB, y
time = 35  
[Command]
name = "ScrewAttackX" ;2400
command = D, DF, F, UF, z
time = 35 
[Command]
name = "ScrewAttackX" ;2400
command = D, DB, B, UB, z
time = 35 
;-------------------------------
[Command]
name = "CatchX" ;1000
command = b+x
time = 30
[Command]
name = "CatchX" ;1000
command = ~B, D, DB, a
time = 30
[Command]
name = "CatchX" 
command = ~B, D, DB, b
time = 30
[Command]
name = "CatchX" 
command = ~B, D, DB, c
time = 30
;-------------------------------

[Command]
name = "ChargeShotX" ;1200 ;2200
command = ~F, DF, D, DB, B, x
time = 30
[Command]
name = "ChargeShotX" 
command = ~F, DF, D, DB, B, y
time = 30
[Command]
name = "ChargeShotX" 
command = ~F, DF, D, DB, B, z
time = 30
[Command]
name = "ChargeShotX" 
command = x+z
time = 30
;-------------------------------

[Command]
name = "DrillKickA" ;2000
command = ~UF, F, D, DF, F, UF,  a
[Command]
name = "DrillKickA" ;2000
command = ~F, D, DF, a
[Command]
name = "DrillKickA" ;2000
command = ~F, D, DF, b
[Command]
name = "DrillKickA" ;2000
command = ~F, D, DF, c
;-------------------------------


[Command]
name = "BlastWallX" ;1100 ;2100
command = ~F, D, DF, x
[Command]
name = "BlastWallY" ;1100 ;2100
command = ~F, D, DF, y
[Command]
name = "BlastWallZ" ;1100 ;2100
command = ~F, D, DF, z
;-------------------------------
 
[Command]
name = "MissleShotX" ;1300 ;2300
command = ~D, DF, F, x
[Command]
name = "MissleShotY" ;1310 ;2300
command = ~D, DF, F, y
[Command]
name = "MissleShotZ" ;1310 ;2300
command = ~D, DF, F, z
;-------------------------------

[Command]
name = "SuperMissleA" ;1400 ;2400
command = ~D, DF, F, a
[Command]
name = "SuperMissleB" ;1400 ;2400
command = ~D, DF, F, b
[Command]
name = "SuperMissleC" ;1400 ;2400
command = ~D, DF, F, c
;-------------------------------

[Command]
name = "BombDropA" ;1500
command = a+y
[Command]
name = "BombDropB" ;1500
command = b+z
[Command]
name = "BombDropA" ;1500
command = ~B, DB, D, a
[Command]
name = "BombDropB" ;1500
command = ~B, DB, D, b
[Command]
name = "BombDropC" ;1500
command = ~B, DB, D, c
;-------------------------------


;-----------------------------
[Command]
name = "Dirtythrow2"
command = a+y

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

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

;-| 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 = "UpUp"     ;Required (do not remove)
command = U, U
time = 10 
[Command]
name = "Float"     ;Required (do not remove)
command = /$U, U
time = 25
[Command]
name = "Float"     ;Required (do not remove)
command = U, /$U
time = 30
[Command]
name = "DownDown"     ;Required (do not remove)
command = D, D
time = 10
[Command]
name = "Drop"     ;Required (do not remove)
command = D, D
time = 15
;[Command]
;name = "Drop"     ;Required (do not remove)
;command = /$D, D
;time = 10
;[Command]
;name = "Drop"     ;Required (do not remove)
;command = D, /$D
;time = 10

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

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

[Command]
name = "down_b"
command = /$D,b
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


[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 = "SJump"
command = $D, $U
time = 10


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

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

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

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

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

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

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

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

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

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

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

[Command]
name = "up" ;Required (do not remove)
command = $U
time = 1
;---------------------------------------------------------------------------
; 2. State entry
; --------------
; This is where you define what commands bring you to what states.
;
; Each state entry block looks like:
;   [State -1, Label]           ;Change Label to any name you want to use to
;                               ;identify the state with.
;   type = ChangeState          ;Don't change this
;   value = new_state_number
;   trigger1 = command = command_name
;   . . .  (any additional triggers)
;
; - new_state_number is the number of the state to change to
; - command_name is the name of the command (from the section above)
; - Useful triggers to know:
;   - statetype
;       S, C or A : current state-type of player (stand, crouch, air)
;   - ctrl
;       0 or 1 : 1 if player has control. Unless "interrupting" another
;                move, you'll want ctrl = 1
;   - stateno
;       number of state player is in - useful for "move interrupts"
;   - movecontact
;       0 or 1 : 1 if player's last attack touched the opponent
;                useful for "move interrupts"
;
; Note: The order of state entry is important.
;   State entry with a certain command must come before another state
;   entry with a command that is the subset of the first.
;   For example, command "fwd_a" must be listed before "a", and
;   "fwd_ab" should come before both of the others.
;
; For reference on triggers, see CNS documentation.
;
; Just for your information (skip if you're not interested):
; This part is an extension of the CNS. "State -1" is a special state
; that is executed once every game-tick, regardless of what other state
; you are in.


; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

  
;===========================================================================
;This is not a move, but it sets up var(1) to be 1 if conditions are right
;for a combo into a special move (used below).
;Since a lot of special moves rely on the same conditions, this reduces
;redundant logic.
[State -1, Combo condition Reset]
type = VarSet
trigger1 = 1
var(1) = 0

[State -1, Combo condition Check]
type = VarSet
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = stateno != 440 ;Except for sweep kick
trigger2 = movecontact
trigger3 = stateno = 1310 || stateno = 1330 ;From blocking
var(1) = 1

;===========================================================================
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------------
[State 7700, Roll Foward]
type = ChangeState
value = 7700
triggerall = command = "holdfwd"
triggerall = command != "holddown"
triggerall = time = 1
trigger1 = (stateno = 5120) && (alive = 1)

;---------------------------------------------------------------------------------
[State 7705, Roll Back]
type = ChangeState
value = 7705
triggerall = command = "holdback"
triggerall = command != "holddown"
triggerall = time = 1
trigger1 = (stateno = 5120) && (alive = 1)


;---------------------------------------------------------------------------------
;Run Fwd
[State 100, Run Fwd]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Run Back
[State 105, Run Back]
type = ChangeState
value = 105
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl


;---------------------------------------------------------------------------------
[State 7000, SuperJump]
type = ChangeState
value = 7000
triggerall = Command = "SJump"
trigger1 = (statetype = S) && (ctrl)

[State 7000, SuperJump]
type = ChangeState
value = 7000
trigger1 = (stateno = 440) && (movehit) && (command = "holdup")


[State 1575, Ballup]
type = ChangeState
value = 1575
triggerall = var(11) = 0
triggerall = stateno != [1500,1599]
trigger1 = command = "Drop"
trigger1 = (ctrl); && StateType != A 
;trigger2 = StateType = A  && (ctrl)
;trigger2 = var(11) = 0

;---------------------------------------------------------------------------
;Kung Fu Throw
[State 800, Kung Fu Throw]
type = ChangeState
value = 800
triggerall = command = "y"
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
trigger1 = command = "holdfwd"
trigger1 = p2bodydist X < 12
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = command = "holdback"
trigger2 = p2bodydist X < 20
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H


;===========================================================================
;======================ULTRA MOVES==========================================
;===========================================================================
;Final
[State 3000, Ultra]
type = ChangeState
value = 3000
triggerall = power >= 1000
triggerall = command = "Final"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 
;Final2
[State 3500, Ultra2]
type = ChangeState
value = 3500
triggerall = power >= 1000
triggerall = command = "Final2"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 

;===========================================================================
;===========================================================================
;======================SUPER MOVES==========================================
;===========================================================================
;---------------------------------------------------------------------------
;Screw Attack
[State 2500, Screw Attack X]
type = ChangeState
value = 2500
triggerall = command = "ScrewAttackX" 
;trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact)
trigger4 = (stateno = [600,650]) && (movecontact)

;Catch
[State 1000, Catch]
type = ChangeState
value = 1000
triggerall = statetype != A
triggerall = command = "CatchX"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 

;Air Grapel
[State 2600, Catch]
type = ChangeState
value = 2600 
triggerall = command = "CatchX"
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)

;Charge Shot
[State 1200, Charge Shot]
type = ChangeState
value = 1200
triggerall = var(28) = 0
triggerall = statetype != A
triggerall = command = "ChargeShotX"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 

[State -1, chargeshotblast]
type = changestate
value = 1201
triggerall = statetype != a
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz" 
triggerall =var(28) = 1
trigger1 = ctrl 
trigger2 = (stateno = [200,250]) && (movecontact) 
trigger3 = (stateno = [400,450]) && (movecontact) 

[State -1, chargeshotblast]
type = changestate
value = 1201
triggerall = statetype != a
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz"  
trigger1 = stateno = 1230   

;Charge Shot
[State 2200, Air Charge Shot X]
type = ChangeState
value = 2200
triggerall = var(28) = 0
triggerall = command = "ChargeShotX"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)

[State -1, Air chargeshotblast]
type = changestate
value = 2200
triggerall = statetype = a
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz" 
triggerall = var(28) = 1
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)  


;Drill Kick
[State 2000, Drill Kick A]
type = ChangeState
value = 2000
triggerall = command = "DrillKickA" 
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)

;Blast Roof X
[State 1100, Blast Roof]
type = ChangeState
value = 1100
triggerall = statetype != A
triggerall = command = "BlastWallX"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
trigger4 = (stateno = 440) && (movehit);&& (command = "holdup")
;Blast Roof Y
[State 1110, Blast Roof]
type = ChangeState
value = 1110
triggerall = statetype != A
triggerall = command = "BlastWallY"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
trigger4 = (stateno = 440) && (movehit);&& (command = "holdup")
[State 1110, Blast Roof]
type = ChangeState
value = 1120
triggerall = statetype != A
triggerall = command = "BlastWallZ"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
trigger4 = (stateno = 440) && (movehit);&& (command = "holdup")

;Missle Shot
[State 1300, Missle Shot X]
type = ChangeState
value = 1300
triggerall = statetype != A
triggerall = command = "MissleShotX"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
;Missle Shot
[State 1300, Missle Shot Y]
type = ChangeState
value = 1310
triggerall = statetype != A
triggerall = command = "MissleShotY"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
;Missle Shot
[State 1300, Missle Shot Z]
type = ChangeState
value = 1320
triggerall = statetype != A
triggerall = command = "MissleShotZ"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
 
;Super Missle 
[State 1400, Super Missle A]
type = ChangeState
value = 1400
triggerall = statetype != A
triggerall = command = "SuperMissleA"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
 
;Super Missle 
[State 1401, Super Missle A]
type = ChangeState
value = 1401
triggerall = statetype != A
triggerall = command = "SuperMissleB"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 
 
;Super Missle 
[State 1400, Super Missle A]
type = ChangeState
value = 1402
triggerall = statetype != A
triggerall = command = "SuperMissleC"
triggerall = command != "holddown" 
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact) 

;Bomb Drop
[State 1500, Bomb Drop A]
type = ChangeState
value = 1500
;triggerall = statetype != A
triggerall = command = "BombDropA"
triggerall = command = "holddown" 
;trigger1 = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact)
trigger4 = (stateno = [600,650]) && (movecontact)
 
[State 1500, Bomb Drop A]
type = ChangeState
value = 1500
;triggerall = statetype != A
triggerall = command = "BombDropB" 
;trigger1 = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = [200,251]) && (movecontact)
trigger3 = (stateno = [400,450]) && (movecontact)
trigger4 = (stateno = [600,650]) && (movecontact)
 
;-----------------------------

;Air Blast Wall
[State 2100, Air Blast Wall X]
type = ChangeState
value = 2100
triggerall = command = "BlastWallX" 
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Air Blast Wall
[State 2100, Air Blast Wall X]
type = ChangeState
value = 2105
triggerall = command = "BlastWallY" 
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Air Blast Wall
[State 2100, Air Blast Wall X]
type = ChangeState
value = 2110
triggerall = command = "BlastWallZ" 
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)

;Missle Shot A
[State 2300, Air Missle Shot X]
type = ChangeState
value = 2300
triggerall = command = "MissleShotX"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Missle Shot B
[State 2310, Air Missle Shot Y]
type = ChangeState
value = 2310
triggerall = command = "MissleShotY"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Missle Shot C
[State 2320, Air Missle Shot Y]
type = ChangeState
value = 2320
triggerall = command = "MissleShotZ"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
 
;Super Missle A 
[State 2400, Air Super Missile A]
type = ChangeState
value = 2400
triggerall = command = "SuperMissleA"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Super Missle B
[State 2401, Air Super Missile A]
type = ChangeState
value = 2401
triggerall = command = "SuperMissleB"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)
;Super Missle C
[State 2402, Air Super Missile A]
type = ChangeState
value = 2402
triggerall = command = "SuperMissleC"  
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = (stateno = [600,650]) && (movecontact)

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

;---------------------------------------------------------------------------------
[State -1, Air Throw]
type = ChangeState
value = 855
triggerall = (StateType = A) && (Ctrl = 1)  && (P2MoveType != H)
triggerall = (Command = "y") || (Command = "z")
triggerall = P2StateType = A
triggerall = P2BodyDist X = [0,120]
triggerall = P2BodyDist Y = [-135, 110]
trigger1 = (Command = "holdfwd") ;&& (P2BodyDist X < 10)
trigger2 = (Command = "holdback") && (P2BodyDist X < 15)

;-----------------------------
[State 4000, Guard Push stand]
type = ChangeState
value = 4000
triggerall = command = "guardpush" && statetype = S
trigger1 = stateno = [150,153]

[State 4010, Guard Push crouch]
type = ChangeState
value = 4010
triggerall = command = "guardpush" && statetype = C
trigger1 = stateno = [150,153]
;trigger2 = stateno = 10

[State 4020, Guard Push air]
type = ChangeState
value = 4020
triggerall = command = "guardpush" && statetype = A
triggerall = statetype = A
trigger1 = stateno = [154,155]

;===========================================================================
;---------------------------------------------------------------------------
;Walljump - from Rajaa's Chun Li ;edited
[State 49,Walljump]
type = ChangeState
value = 49
triggerall = statetype=A&&pos y<=-40;&&!var(6)
triggerall = ctrl
trigger1 = Vel X < -4
trigger1 = (command="fwd"&&command="up")&&backedgebodydist<=3
trigger1 = Vel X > 4
trigger2 = (command="back"&&command="up")&&frontedgebodydist<=3
;===========================================================================
;===========================================================================

[State 101, Dash Attack]
type = ChangeState
value = 101
triggerall = stateno = 100
triggerall = command = "holdfwd"
triggerall = statetype = S
triggerall = ctrl 
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"

;---------------------------------------------------------------------------
;Light Punch
[State 200, Light Punch]
type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 

;---------------------------------------------------------------------------
;Light Kick
[State 210, Light Kick]
type = ChangeState
value = 210
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 200  && movecontact

;---------------------------------------------------------------------------
;Medium Punch
[State 220, Stand Strong Punch]
type = ChangeState
value = 220
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [200,210]) && (movecontact) 

;---------------------------------------------------------------------------
;Medium Kick
[State 230, Standing Medium Kick]
type = ChangeState
value = 230
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [200,220]) && (movecontact) 

;---------------------------------------------------------------------------
;Fierce Punch
[State 240, Fierce Punch]
type = ChangeState
value = 240
triggerall = command = "z"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [200,230]) && (movecontact) 

;---------------------------------------------------------------------------
;Fierce Kick
[State 251, Standing Strong Kick]
type = ChangeState
value = 251
triggerall = command = "c"
triggerall = command = "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [200,240]) && (movecontact) 

;---------------------------------------------------------------------------
;Fierce Kick
[State 250, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [200,240]) && (movecontact) 


;---------------------------------------------------------------------------
;Taunt
[State 195, Taunt]
type = ChangeState
value = 299;195
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Light Punch
[State 400, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Light Kick
[State 410, Crouching Light Kick]
type = ChangeState
value = 410
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 400  && movecontact
trigger3 = stateno = 200  && movecontact

;---------------------------------------------------------------------------
;Crouching Strong Punch
[State 420, Crouching Strong Punch]
type = ChangeState
value = 420
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = [400,410]) && (movecontact)
trigger3 = (stateno = [200,210]) && (movecontact)

;---------------------------------------------------------------------------
;Crouching Strong Kick
[State 430, Crouching Strong Kick]
type = ChangeState
value = 430
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = [400,420]) && (movecontact)
trigger3 = (stateno = [200,220]) && (movecontact)

;---------------------------------------------------------------------------
;Crouching Strong Punch
[State 440, Crouching Strong Punch]
type = ChangeState
value = 440
triggerall = command = "z"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = [400,430]) && (movecontact)
trigger3 = (stateno = [200,230]) && (movecontact)

;---------------------------------------------------------------------------
;Crouching Strong Kick
[State 450, Crouching Strong Kick]
type = ChangeState
value = 450
triggerall = command = "c"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = [400,440]) && (movecontact)
trigger3 = (stateno = [200,240]) && (movecontact) 

;---------------------------------------------------------------------------
;Jump Light Punch
[State 600, Jump Light Punch]
type = ChangeState
value = 600
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl 
trigger2 = stateno = 1350 ;Air blocking

;---------------------------------------------------------------------------
;Jump light knee
[State 611, Jump light knee]
type = ChangeState
value = 611
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 ;|| stateno = 630 ;jump_x or jump_a
trigger2 = movecontact
trigger3 = stateno = 1350 ;Air blocking

;--------------------------------------------------------------
;connect 
[State 612, Face Stomp]
type = ChangeState
value = 612 
triggerall = stateno = 611 && movecontact 
triggerall = statetype = A 
trigger1 = command = "a" && time = [6,20] 
 
;---------------------------------------------------------------------------
;Jump light kick
[State 610, Jump light kick]
type = ChangeState
value = 610
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 ;|| stateno = 630 ;jump_x or jump_a
trigger2 = movecontact
trigger3 = stateno = 1350 ;Air blocking

;---------------------------------------------------------------------------
;Jump medium punch
[State 620, Jump medium punch]
type = ChangeState
value = 620
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 1350 ;Air blocking
trigger3 = (stateno = [600,612]) && (movecontact)

;---------------------------------------------------------------------------
;Jump medium kick
[State 630, Jump medium kick]
type = ChangeState
value = 630
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,620]) && (movecontact)
trigger3 = stateno = 1350 ;Air blocking
;---------------------------------------------------------------------------
;Jump fierce punch
[State 640, Jump fierce punch]
type = ChangeState
value = 640
triggerall = command = "z"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 1350 ;Air blocking
trigger3 = (stateno = [600,630]) && (movecontact)

;---------------------------------------------------------------------------
;Jump fierce Kick
[State 650, Jump fierce Kick]
type = ChangeState
value = 650
triggerall = command = "c"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,640]) && (movecontact)
trigger3 = stateno = 1350 ;Air blocking


;===========================================================================
 
[State -1, varset upup]
type = VarSet
trigger1 = Pos Y < 0
trigger1 = Vel Y >= 2.5
trigger1 = command = "UpUp"
var(11) = 1

[State -1, varset drop]
type = VarSet
trigger1 = command = "Drop"
trigger2 = StateType != A
trigger3 = Movetype = H 
var(11) = 0

[State -1, PalFX]
type = PalFX
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz"
triggerall = stateno != [1200,1205]
triggerall = stateno != 2200
triggerall = stateno != 105 
trigger1 = var(28) = 1  && !ctrl 
time = 0 
[State -1, VarSet chargeshotfail]
type = VarSet
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz"
triggerall = stateno != [1200,1205]
triggerall = stateno != 2200
triggerall = stateno != 105 
trigger1 = var(28) = 1  && !ctrl 
v = 28    ;fv = 10
value = 0
ignorehitpause = 1
;persistent = 

  

;#####################################################################
;#####################################################################
;#####################################################################

[State -1, grounddefend]
type=changestate
value=ifelse((enemynear,statetype=C),131,130)
trigger1=var(59)&&statetype!=A&&roundstate=2&&ctrl&&inguarddist
persistent=0
  
[State -1, airdefend]
type=changestate
value=132
triggerall=var(59)&&statetype=A&&roundstate=2&&ctrl&&inguarddist
trigger1=enemynear,movetype=A&&p2bodydist x<80&&(p2bodydist y=[-75,75])
trigger2=enemy,numproj>0
persistent=0
 
[State -1, run]
type=changestate
value=100
trigger1=var(59)&&statetype=S&&roundstate=2&&ctrl&&random<200
trigger1=(stateno!=[100,105])&&enemynear,movetype!=A&&p2bodydist x>120
persistent=0

[State -1, dash]
type=changestate
value=105
trigger1=var(59)&&statetype=S&&roundstate=2&&ctrl&&random<200
trigger1=(stateno!=[100,105])&&enemynear,movetype=A&&backedgedist>120&&p2bodydist x<160
persistent=0

[State -1, airrun]
type=changestate
value=110
trigger1=var(59)&&statetype=A&&roundstate=2&&ctrl&&random<200
trigger1=stateno!=110&&enemynear,movetype!=A&&p2bodydist x>120
trigger1=ctrl&&var(7)!=2

[State -1, jump]
type=changestate
value=40
triggerall=var(59)&&statetype!=A&&roundstate=2&&ctrl
trigger1=ctrl&&p2bodydist x>160&&p2dist y<-100&&random<200
trigger2=enemynear,alive&&enemynear,const(data.liedown.time)>=35&&enemynear,statetype=L&&random<500
trigger3=enemynear,movetype=A&&p2bodydist x<160&&enemynear,hitdefattr=SC,AT
persistent=0

[State -1, airrecover]
type=changestate
value=ifelse((pos y>=-20),5200,5210)
trigger1=var(59)&&roundstate=2&&stateno=5050
trigger1=vel y>-1&&alive&&canrecover&&random<500
persistent=0


[State -1, SLP]
type=changestate
value=200
triggerall=var(59)&&statetype!=A&&roundstate=2
triggerall=(p2bodydist x=[0,100])&&(p2bodydist y=[-50,50])&&p2statetype!=L
trigger1=ctrl&&random<50
persistent=0

[State -1, SHP]
type=changestate
value=210
triggerall=var(59)&&statetype!=A&&roundstate=2
triggerall=(p2bodydist x=[0,175])&&(p2bodydist y=[-50,50])&&(p2statetype!=L)
trigger1=ctrl&&random<100
trigger2=(stateno=205||stateno=220||stateno=235||stateno=250)&&movecontact&&random<200
persistent=0




