; 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 -- defaults to 15 if omitted)
;
; - 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.
;   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
;   You can combine them:
;     eg. command = ~30$D, a+b     ;hold D, DB or DF for 30 ticks, release,
;                                  ;then press a and b together
;   It's recommended that for most "motion" commads, eg. quarter-circle-fwd,
;   you start off with a "release direction". This matches the way most
;   popular fighting games implement their command detection.
;
; - time (optional)
;   Time allowed to do the command, given in game-ticks. Defaults to 15
;   if omitted
;
; 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
;

;-| Super Motions |--------------------------------------------------------
;The following three have the same name, but different motion.
;Either one will be detected by a "command = Tatanga" trigger.
;Time is set to 20 (instead of default of 15) to make the move
;easier to do.
;
[Command]
name = "Tatanga"
command = ~D, DB, B, a+c
time = 20

[Command]
name = "Tatanga"
command = ~D, DB, B, b+c
time = 20

[Command]
name = "Tatanga"
command = ~D, DB, B, a+b
time = 20

[Command]
name = "Raoh"
command = ~D, DF, F, y+b
time = 20

[Command]
name = "starpower"
command = ~D, DF, F, c+z
time = 20

[Command]
name = "1upheart"
command = ~D, DF, F, a+x
time = 20

[Command]
name = "akuma"
command = ~x, x, F, a, z
time = 45

[Command]
name = "CrystalSmash"
command = ~D, DF, F, a+c
time = 20

[Command]
name = "CrystalSmash"
command = ~D, DF, F, b+c
time = 20

[Command]
name = "CrystalSmash"
command = ~D, DF, F, a+b
time = 20

[Command]
name = "skypop"
command = ~B, D, DB, B, a+c
time = 40

[Command]
name = "skypop"
command = ~B, D, DB, B, b+c
time = 40

[Command]
name = "skypop"
command = ~B, D, DB, B, a+b
time = 40

[Command]
name = "Hyperball"
command = ~D, DF, F, x+y
time = 20

[Command]
name = "Hyperball"
command = ~D, DF, F, x+z
time = 20

[Command]
name = "Hyperball"
command = ~D, DF, F, z+y
time = 20

[Command]
name = "HFlowerPower"
command = ~F, D, DF, F, x+y
time = 30

[Command]
name = "HFlowerPower"
command = ~F, D, DF, F, x+z
time = 30

[Command]
name = "HFlowerPower"
command = ~F, D, DF, F, y+z
time = 30

;-| Special Motions |------------------------------------------------------
[Command]
name = "upper_x"
command = ~F, D, DF, F, x
time = 30

[Command]
name = "upper_y"
command = ~F, D, DF, F, y
time = 30

[Command]
name = "upper_z"
command = ~F, D, DF, F, z
time = 30

[Command]
name = "upper_xy"
command = ~F, D, DF, F, x+y

[Command]
name = "upper_xz"
command = ~F, D, DF, F, x+z

[Command]
name = "upper_yz"
command = ~F, D, DF, F, y+z

[Command]
name = "QCF_x"
command = ~D, DF, F, x

[Command]
name = "QCF_y"
command = ~D, DF, F, y

[Command]
name = "QCF_s"
command = ~D, DF, F, s

[Command]
name = "QCF_z"
command = ~D, DF, F, z

[Command]
name = "QCF_xy"
command = ~D, DF, F, x+y

[Command]
name = "QCB_a"
command = ~D, DB, B, a

[Command]
name = "QCB_b"
command = ~D, DB, B, b

[Command]
name = "QCB_c"
command = ~D, DB, B, c

[Command]
name = "FF_x"
command = ~F, F, x

[Command]
name = "FF_y"
command = ~F, F, y

[Command]
name = "FF_z"
command = ~F, F, z


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

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

[Command]
name = "recovery"
command = y+z
time = 1

[Command]
name = "recovery"
command = x+z
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_up"
command = $D, $U


[Command]
name = "back_x"
command = /$B,x
time = 1

[Command]
name = "back_y"
command = /$B,y
time = 1

[Command]
name = "back_z"
command = /$B,z
time = 1

[Command]
name = "down_x"
command = /$D,x
time = 1

[Command]
name = "down_y"
command = /$D,y
time = 1

[Command]
name = "down_z"
command = /$D,z
time = 1

[Command]
name = "fwd_x"
command = /$F,x
time = 1

[Command]
name = "fwd_y"
command = /$F,y
time = 1

[Command]
name = "fwd_z"
command = /$F,z
time = 1

[Command]
name = "up_x"
command = /$U,x
time = 1

[Command]
name = "up_y"
command = /$U,y
time = 1

[Command]
name = "up_z"
command = /$U,z
time = 1

[Command]
name = "back_a"
command = /$B,a
time = 1

[Command]
name = "back_b"
command = /$B,b
time = 1

[Command]
name = "back_c"
command = /$B,c
time = 1

[Command]
name = "back_s"
command = /$B,s
time = 5

[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

[Command]
name = "down_c"
command = /$D,c
time = 1

[Command]
name = "fwd_a"
command = /$F,a
time = 1

[Command]
name = "fwd_b"
command = /$F,b
time = 1

[Command]
name = "fwd_c"
command = /$F,c
time = 1

[Command]
name = "fwd_s"
command = /$F,s
time = 5

[Command]
name = "up_a"
command = /$U,a
time = 1

[Command]
name = "up_b"
command = /$U,b
time = 1

[Command]
name = "up_c"
command = /$U,c
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

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

[Command]
name = "downfwd"
command = $DF
time = 1

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

[Command]
name = "downback"
command = $DB
time = 1

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

[Command]
name = "upback"
command = $UB
time = 1

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

[Command]
name = "upfwd"
command = $UF
time = 1

;-| Hold Button |---------------------------------------------------------
[Command]
name = "hold_x"
command = /x
time = 1

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

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

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

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

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

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

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

[Command]
name = "holddownfwd"
command = /$DF
time = 1

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

[Command]
name = "holddownback"
command = /$DB
time = 1

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

[Command]
name = "holdupback"
command = /$UB
time = 1

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

[Command]
name = "holdupfwd"
command = /$UF
time = 1

;-----------------------------------------------------------
;half circles

[Command]
name = "halfcirclefwd"
command = ~B, DB, D, DF, F
time = 30

[Command]
name = "halfcircleback"
command = ~F, DF, D, DB, B
time = 30

;---------------------------------------------------------------------------
; 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]
;---------------------------------------------------------------------------
; Parry System
;---------------------------------------------------------------------------
;----- Variables -----
[State -1, VarSet]
type = VarSet
triggerall = Var(4) > 0
trigger1 = StateType != C
trigger1 = Command != "holdfwd"
trigger2 = StateType = C
trigger2 = Command != "holddown"
ignorehitpause = 1
v = 4
value = 0

[State -1, VarAdd]
type = VarAdd
triggerall = Var(4) < 10
trigger1 = StateType != C
trigger1 = Command = "holdfwd"
trigger2 = StateType = C
trigger2 = Command = "holddown"
ignorehitpause = 1
v = 4
value = 1
;--------------------

;----- Override -----
[State -1, Parry]
type = HitOverride
triggerall = Var(4) > 0
triggerall = Var(4) < 10
trigger1 = StateType = S
trigger1 = MoveType = I
trigger1 = Ctrl = 1
ignorehitpause = 1
slot = 0
stateno = 990
attr = SCA, AA, AP
time = 1

[State -1, Parry]
type = HitOverride
triggerall = Var(4) > 0
triggerall = Var(4) < 10
trigger1 = StateType = C
trigger1 = MoveType = I
trigger1 = Ctrl = 1
ignorehitpause = 1
slot = 0
stateno = 991
attr = SCA, AA, AP
time = 1

[State -1, Parry]
type = HitOverride
triggerall = Var(4) > 0
triggerall = Var(4) < 10
trigger1 = StateType = A
trigger1 = MoveType = I
trigger1 = Ctrl = 1
ignorehitpause = 1
slot = 0
stateno = 992
attr = SCA, AA, AP
time = 1
;---------------------------------------------------------------------------
;Ra-oh's Fatal K.O
[State -1, Raoh]
type = ChangeState
Value = 3001
Triggerall = command= "Raoh"
Triggerall=Ctrl=1
Triggerall=statetype!=A
Triggerall=life<=200
Trigger1=Power=3000
trigger2 = StateNo = 200 && MoveContact
trigger3 = StateNo = 210 && MoveContact
trigger4 = StateNo = 220 && MoveContact
trigger5 = StateNo = 230 && MoveContact
trigger6 = StateNo = 240 && MoveContact
trigger7 = StateNo = 400 && MoveContact
trigger8 = StateNo = 410 && MoveContact
trigger9 = StateNo = 420 && MoveContact
trigger10 = StateNo = 430 && MoveContact
trigger11 = StateNo = 440 && MoveContact
trigger12 = StateNo = 255 && MoveContact
trigger12 = StateNo = 255 && MoveContact
;---------------------------------------------------------------------------
;star power
[State -1, star power]
type = ChangeState
value = 4001
triggerall = var(45) = 0
;Triggerall=life<=200
triggerall = command = "starpower"
triggerall = power >= 3000
trigger1 = statetype = S
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
trigger3 = StateNo = 210 && MoveContact
trigger4 = StateNo = 220 && MoveContact
trigger5 = StateNo = 230 && MoveContact
trigger6 = StateNo = 240 && MoveContact
trigger7 = StateNo = 400 && MoveContact
trigger8 = StateNo = 410 && MoveContact
trigger9 = StateNo = 420 && MoveContact
trigger10 = StateNo = 430 && MoveContact
trigger11 = StateNo = 440 && MoveContact
trigger12 = StateNo = 255 && MoveContact
trigger13 = StateNo = 200 && MoveContact
;---------------------------------------------------------------------------
;1-up heart
[State -1, 1-up heart]
type = ChangeState
value = 4000
triggerall = var(45) = 0
Triggerall=life<=200
triggerall = command = "1upheart"
triggerall = power >= 3000
trigger1 = statetype = S
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;???
[State -1, ???]
type = ChangeState
value = 3999
triggerall = var(45) = 0
triggerall = var(24) >= 10
triggerall = command = "akuma"
trigger1 = statetype = S
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Sky Pop
[State -1, Sky Pop]
type = ChangeState
value = 3500
triggerall = var(45) = 0
triggerall = command = "skypop"
triggerall = power >= 3000
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact

;===========================================================================
; Air Crystal Smash
[State -1, State]
type = ChangeState
value = 3790
triggerall = var(45) = 0
triggerall = command = "CrystalSmash"
triggerall = power >= 1000
triggerall = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && movecontact || StateNo = 610 && movecontact || StateNo = 620 && movecontact || StateNo = 630 && movecontact || StateNo = 640 && movecontact || StateNo = 650 && movecontact
;---------------------------------------------------------------------------
;Crystal smash
[State -1, Crystal Smash]
type = ChangeState
value = 3789
triggerall = var(45) = 0
triggerall = command = "CrystalSmash"
triggerall = power >= 1000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3050,3100)
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [1000,1999])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Tatanga
[State -1, Crystal Smash]
type = ChangeState
value = 3550
triggerall = var(45) = 0
triggerall = command = "Tatanga"
triggerall = power >= 1000
triggerall = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3050,3100)
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [1000,1999])
trigger2 = movecontact
;===========================================================================
;---------------------------------------------------------------------------
;Super Flower Power
[State -1, Smash Kung Fu Upper]
type = ChangeState
value = 3050
triggerall = var(45) = 0
triggerall = command = "HFlowerPower"
triggerall = power >= 1000
trigger1 = ctrl
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3050,3100)
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [1000,1999])
trigger2 = movecontact
;---------------------------------------------------------------------------
; Air superball frenzy
[State -1, State]
type = ChangeState
value = 3100
triggerall = var(45) = 0
triggerall = command = "Hyperball"
triggerall = power >= 1000
triggerall = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && movecontact || StateNo = 610 && movecontact || StateNo = 620 && movecontact || StateNo = 630 && movecontact || StateNo = 640 && movecontact
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;superball frenzy
[State -1, Triple Kung Fu Palm]
type = ChangeState
value = 3000
triggerall = var(45) = 0
triggerall = command = "Hyperball"
triggerall = power >= 1000
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact

;===========================================================================
;---------------------------------------------------------------------------
;Flower power strong
[State -1, Flower power strong]
type = ChangeState
value = 1070
triggerall = var(45) = 0
triggerall = command = "upper_z"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [600,699])
trigger2 = movecontact

;---------------------------------------------------------------------------
;Flower power light
[State -1, Flower power Light]
type = ChangeState
value = 1050
triggerall = var(45) = 0
triggerall = command = "upper_x"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [600,699])
trigger2 = movecontact

;---------------------------------------------------------------------------
;air Flower power light
[State -1, superball]
type = ChangeState
value = 1150
triggerall = var(45) = 0
triggerall = command = "upper_x"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;air Flower power medium
[State -1, superball]
type = ChangeState
value = 1160
triggerall = var(45) = 0
triggerall = command = "upper_y"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;air Flower power Strong
[State -1, superball]
type = ChangeState
value = 1170
triggerall = var(45) = 0
triggerall = command = "upper_z"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Flower power medium
[State -1, Flower power medium]
type = ChangeState
value = 1060
triggerall = var(45) = 0
triggerall = command = "upper_y"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499]) || (stateno = [600,699])
trigger2 = movecontact

;---------------------------------------------------------------------------
;Superball
[State -1, superball]
type = ChangeState
value = 1000
triggerall = var(45) = 0
triggerall = command = "QCF_x"
triggerall = statetype != A
triggerall = NumHelper(100) < 1
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;air Superball
[State -1, superball]
type = ChangeState
value = 1100
triggerall = var(45) = 0
triggerall = command = "QCF_x" 
triggerall = NumHelper(100) < 1
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;upward (medium) superball
[State -1, Strong Kung Fu Palm]
type = ChangeState
value = 1010
triggerall = var(45) = 0
triggerall = command = "QCF_y"
triggerall = NumHelper(100) < 1
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;upward air Superball
[State -1, superball]
type = ChangeState
value = 1101
triggerall = var(45) = 0
triggerall = command = "QCF_y" 
triggerall = NumHelper(100) < 1
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;stronger (hard) superball
[State -1, Fast Kung Fu Palm]
type = ChangeState
value = 1020
triggerall = var(45) = 0
triggerall = command = "QCF_z"
triggerall = NumHelper(100) < 1
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;stronger air Superball
[State -1, superball]
type = ChangeState
value = 1120
triggerall = var(45) = 0
triggerall = command = "QCF_z" 
triggerall = NumHelper(100) < 1
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Sarasaland attacks
[State -1, superball]
type = ChangeState
value = 2000
triggerall = var(45) = 0
triggerall = command = "QCB_a"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Sarasaland attacks
[State -1, superball]
type = ChangeState
value = 2010
triggerall = var(45) = 0
triggerall = command = "QCB_b"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;---------------------------------------------------------------------------
;Sarasaland attacks
[State -1, superball]
type = ChangeState
value = 2020
triggerall = var(45) = 0
triggerall = command = "QCB_c"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,299]) || (stateno = [400,499])
trigger2 = movecontact
;===========================================================================
;---------------------------------------------------------------------------
;Run Fwd
;ダッシュ
[State -1, Run Fwd]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Run Back
;後退ダッシュ
[State -1, Run Back]
type = ChangeState
value = 105
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Throw
[State -1, State]
type = ChangeState
value = 800
triggerall = ctrl
triggerall = Var(55) < 3
triggerall = statetype = S
triggerall = command = "holdfwd" || command = "holdback"
trigger1 = command = "x" && command = "y"
trigger2 = command = "y" && command = "z"
trigger3 = command = "x" && command = "z"
trigger4 = StateNo = 600 || StateNo = 610 || StateNo = 620 || StateNo = 630 || StateNo = 640 || StateNo = 650
 ;---------------------------------------------------------------------------
; 2nd Throw
[State -1, State]
type = ChangeState
value = 840
triggerall = ctrl
triggerall = Var(55) < 3
triggerall = statetype = S
triggerall = command = "holdfwd" || command = "holdback"
trigger1 = command = "a" && command = "b"
trigger2 = command = "b" && command = "c"
trigger3 = command = "c" && command = "a"
trigger4 = StateNo = 600 || StateNo = 610 || StateNo = 620 || StateNo = 630 || StateNo = 640 || StateNo = 650

;----------------------------------------------------------------------------
; air Throw
[State -1, State]
type = ChangeState
value = 801
triggerall = ctrl
triggerall = Var(55) < 3
triggerall = statetype = A
triggerall = command = "holdfwd" || command = "holdback"
triggerall = var(45) = 0
trigger1 = command = "x" && command = "y"
trigger2 = command = "y" && command = "z"
trigger3 = command = "x" && command = "z"
trigger4 = StateNo = 600 || StateNo = 610 || StateNo = 620 || StateNo = 630 || StateNo = 640 || StateNo = 650

;---------------------------------------------------------------------------
; taunt
[State -1, State]
type = ChangeState
value = 197
triggerall = command = "back_s"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = StateNo = 200 && MoveContact
trigger3 = StateNo = 210 && MoveContact
trigger4 = StateNo = 220 && MoveContact
trigger5 = StateNo = 230 && MoveContact
trigger6 = StateNo = 240 && MoveContact
trigger7 = StateNo = 400 && MoveContact
trigger8 = StateNo = 410 && MoveContact
trigger9 = StateNo = 420 && MoveContact
trigger10 = StateNo = 430 && MoveContact
trigger11 = StateNo = 440 && MoveContact
trigger12 = StateNo = 255 && MoveContact
trigger12 = StateNo = 255 && MoveContact
;---------------------------------------------------------------------------
; taunt
[State -1, State]
type = ChangeState
value = 195
triggerall = command = "fwd_s"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = StateNo = 200 && MoveContact 
trigger3 = StateNo = 210 && MoveContact 
trigger4 = StateNo = 220 && MoveContact 
trigger5 = StateNo = 230 && MoveContact 
trigger6 = StateNo = 240 && MoveContact 
trigger7 = StateNo = 400 && MoveContact 
trigger8 = StateNo = 410 && MoveContact 
trigger9 = StateNo = 420 && MoveContact 
trigger10 = StateNo = 430 && MoveContact 
trigger11 = StateNo = 440 && MoveContact 
trigger12 = StateNo = 255 && MoveContact 
trigger12 = StateNo = 255 && MoveContact 
;---------------------------------------------------------------------------
; taunt
[State -1, State]
type = ChangeState
value = 196
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl
;---------------------------------------------------------------------------
; air dodge
[State -1, State]
type = ChangeState
value = 863
triggerall = var(45) = 0
triggerall = command = "a" && command = "x" || command = "b" && command = "y" || command = "c" && command = "z"
trigger1 = statetype = A
trigger1 = ctrl
;---------------------------------------------------------------------------
; roll back
[State -1, State]
type = ChangeState
value = 862
triggerall = command = "holdback"
triggerall = command = "a" && command = "x" || command = "b" && command = "y" || command = "c" && command = "z"
trigger1 = statetype != A
trigger1 = ctrl
;---------------------------------------------------------------------------
; roll fwd
[State -1, State]
type = ChangeState
value = 861
triggerall = command = "holdfwd"
triggerall = command = "a" && command = "x" || command = "b" && command = "y" || command = "c" && command = "z"
trigger1 = statetype != A
trigger1 = ctrl
;---------------------------------------------------------------------------
; sidestep dodge
[State -1, State]
type = ChangeState
value = 860
triggerall = command = "a" && command = "x" || command = "b" && command = "y" || command = "c" && command = "z"
trigger1 = statetype != A
trigger1 = ctrl
;===========================================================================
;---------------------------------------------------------------------------
; Stand Light Punch
[State -1, State]
type = ChangeState
value = 200
triggerall = var(45) = 0
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = stateno != 200
triggerall = ctrl
trigger1 = statetype = S
trigger1 = statetype != A
trigger1 = StateNo < 800

;---------------------------------------------------------------------------
; Stand Medium Punch
[State -1, State]
type = ChangeState
value = 210
triggerall = var(45) = 0
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 != StateNo = 200 || StateNo = 230 || StateNo = 400 || StateNo = 430
trigger2 = StateNo = 200 && MoveContact || StateNo = 230 && MoveContact || StateNo = 400 && MoveContact || StateNo = 430 && MoveContact

;---------------------------------------------------------------------------
; Stand Strong Punch
[State -1, State]
type = ChangeState
value = 220
triggerall = var(45) = 0
triggerall = command = "z"
triggerall = command != "holddown"
trigger1 = StateNo < 800
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = StateNo = 200 && MoveContact
trigger3 = StateNo = 210 && MoveContact 
trigger4 = StateNo = 230 && MoveContact 
trigger5 = StateNo = 240 && MoveContact 
trigger6 = StateNo = 400 && MoveContact 
trigger7 = StateNo = 410 && MoveContact 
trigger8 = StateNo = 430 && MoveContact 
trigger9 = StateNo = 440 && MoveContact 
trigger10 = StateNo = 250 && MoveContact 

;---------------------------------------------------------------------------
; Stand Light Kick
[State -1, State]
type = ChangeState
value = 230
triggerall = var(45) = 0
triggerall = command = "a"
triggerall = command != "holddown"
triggerall = stateno != 230
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = StateNo = 200 && MoveContact || StateNo = 400 && MoveContact

;---------------------------------------------------------------------------
; Stand Medium Kick
[State -1, State]
type = ChangeState
value = 240
triggerall = var(45) = 0
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = StateNo != 200 || StateNo != 210 || StateNo != 230 || StateNo != 400 || StateNo != 410 || StateNo != 430
trigger2 = StateNo = 200 && MoveContact || StateNo = 210 && MoveContact || StateNo = 230 && MoveContact || StateNo = 400 && MoveContact || StateNo = 410 && MoveContact || StateNo = 430 && MoveContact 
;---------------------------------------------------------------------------
; luigi Stand Strong Kick
[State -1, State]
type = ChangeState
value = 251
triggerall = var(45) = 0
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = var(5) = 1
trigger1 = StateNo = 210 && MoveContact
;---------------------------------------------------------------------------
; Stand Strong Kick
[State -1, State]
type = ChangeState
value = 250
triggerall = var(45) = 0
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = StateNo < 800
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = StateNo = 200 && MoveContact 
trigger3 = StateNo = 210 && MoveContact 
trigger4 = StateNo = 220 && MoveContact 
trigger5 = StateNo = 230 && MoveContact 
trigger6 = StateNo = 240 && MoveContact 
trigger7 = StateNo = 400 && MoveContact 
trigger8 = StateNo = 410 && MoveContact 
trigger9 = StateNo = 420 && MoveContact 
trigger10 = StateNo = 430 && MoveContact 
trigger11 = StateNo = 440 && MoveContact 
trigger12 = StateNo = 255 && MoveContact 
;---------------------------------------------------------------------------
; Crouch Light Punch
[State -1, State]
type = ChangeState
value = 400
triggerall = var(45) = 0
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = StateNo < 800

;---------------------------------------------------------------------------
; Crouch Medium Punch
[State -1, State]
type = ChangeState
value = 410
triggerall = var(45) = 0
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = statetype != A
trigger2 != StateNo = 200 || StateNo = 230 || StateNo = 400 || StateNo = 430
trigger2 = StateNo = 200 && MoveContact || StateNo = 230 && MoveContact || StateNo = 400 && MoveContact || StateNo = 430 && MoveContact 

;---------------------------------------------------------------------------
; Crouch Strong Punch
[State -1, State]
type = ChangeState
value = 420
triggerall = var(45) = 0
triggerall = command = "z"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = statetype != A
trigger2 = StateNo = 200 && MoveContact 
trigger3 = StateNo = 210 && MoveContact 
trigger4 = StateNo = 230 && MoveContact 
trigger5 = StateNo = 240 && MoveContact 
trigger6 = StateNo = 400 && MoveContact 
trigger7 = StateNo = 410 && MoveContact 
trigger8 = StateNo = 430 && MoveContact 
trigger9 = StateNo = 440 && MoveContact

;---------------------------------------------------------------------------
; Crouch Light Kick
[State -1, State]
type = ChangeState
value = 430
triggerall = var(45) = 0
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = statetype != A
trigger2 = StateNo = 200 && movecontact|| StateNo = 400 && movecontact

;---------------------------------------------------------------------------
; Crouch Medium Kick
[State -1, State]
type = ChangeState
value = 440
triggerall = var(45) = 0
triggerall = command = "b"
triggerall = command = "holddown"
triggerall = var(33) != 1
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = statetype != A
trigger2 = StateNo = 200 && MoveContact || StateNo = 210 && MoveContact || StateNo = 230 && MoveContact || StateNo = 400 && MoveContact || StateNo = 410 && MoveContact || StateNo = 430 && MoveContact

;---------------------------------------------------------------------------
; Crouch Strong Kick
[State -1, State]
type = ChangeState
value = 450
triggerall = var(45) = 0
triggerall = command = "c"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = statetype != A
trigger2 = StateNo = 200 && MoveContact 
trigger3 = StateNo = 210 && MoveContact 
trigger4 = StateNo = 220 && MoveContact 
trigger5 = StateNo = 230 && MoveContact 
trigger6 = StateNo = 240 && MoveContact 
trigger7 = StateNo = 400 && MoveContact 
trigger8 = StateNo = 410 && MoveContact 
trigger9 = StateNo = 420 && MoveContact 
trigger10 = StateNo = 430 && MoveContact 
trigger11 = StateNo = 440 && MoveContact

;---------------------------------------------------------------------------
; Jump Light Punch
[State -1, State]
type = ChangeState
value = 600
trigger1 = command = "x"
triggerall = var(45) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = StateNo < 800
trigger1 = var(27) = 0

;---------------------------------------------------------------------------
; Jump Medium Punch
[State -1, State]
type = ChangeState
value = 610
triggerall = command = "y"
triggerall = var(45) = 0
triggerall = stateno != 610 || stateno != 600 || stateno != 630
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && MoveContact || StateNo = 630 && MoveContact

;---------------------------------------------------------------------------
; Jump Strong Punch
[State -1, State]
type = ChangeState
value = 620
triggerall = command = "z"
triggerall = var(45) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && MoveContact || StateNo = 610 && MoveContact || StateNo = 630 && MoveContact || StateNo = 640 && MoveContact

;---------------------------------------------------------------------------
; Jump Light Kick
[State -1, State]
type = ChangeState
value = 630
triggerall = command = "a"
triggerall = var(45) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && movecontact

;---------------------------------------------------------------------------
; Jump Medium Kick
[State -1, State]
type = ChangeState
value = 640
triggerall = command = "b"
triggerall = var(45) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && movecontact || StateNo = 610 && movecontact || StateNo = 630 && movecontact

;---------------------------------------------------------------------------
; Jump Strong Kick
[State -1, State]
type = ChangeState
value = 650
triggerall = command = "c"
triggerall = var(45) = 0
triggerall = statetype = A
trigger1 = ctrl
trigger2 = StateNo = 600 && movecontact || StateNo = 610 && movecontact || StateNo = 630 && movecontact || StateNo = 640 && movecontact
;---------------------------------------------------------------------------
; short SuperJump 
[State -1]
type = ChangeState
value = 700
trigger1 = command = "up"
trigger1 = movecontact
trigger1 = stateno = 420
;---------------------------------------------------------------------------
; SuperJump 
[State -1]
type = ChangeState
value = 710
trigger1 = command = "down_up"
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger2 = StateNo = 220 || StateNo = 250
trigger2 = statetype != A
trigger2 = ctrl = 1
;------------------------------
;Luigi Combo
[State -1]
type = varset
trigger1 = stateno >= 800
trigger1 = time = 5
v = 5
value = 0
;-----Hit Sounds-----
[State -3, VarRandom]
type = VarRandom
trigger1 = StateNo = 5000
trigger2 = StateNo = 5010
trigger3 = StateNo = 5020
trigger4 = stateNo = 5030
trigger5 = StateNo = 5050
trigger6 = StateNo = 5070
trigger7 = StateNo = 5080
v = 0
range = 0,100

[State -3, Hit1]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [25,50]
trigger1 = StateNo = 5000
trigger2 = StateNo = 5010
value = s6, 1
channel = 0

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [50,75]
trigger1 = StateNo = 5020
trigger2 = StateNo = 5030
trigger3 = StateNo = 5050
trigger4 = StateNo = 5070
trigger5 = StateNo = 5080
value = s6,2
channel = 0

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [75,100]
triggerall = life <= 400
trigger1 = StateNo = 5000
trigger2 = StateNo = 5010
trigger3 = StateNo = 5020
trigger4 = StateNo = 5030
trigger5 = StateNo = 5050
trigger6 = StateNo = 5070
trigger7 = StateNo = 5080
value = s6,3
channel = 0

[State -3, Hit2]
type = PlaySnd
triggerall = Alive
triggerall = Time = 0
triggerall = Var(0) = [0,25]
triggerall = life <= 400
trigger1 = StateNo = 5000
trigger2 = StateNo = 5010
trigger3 = StateNo = 5020
trigger4 = StateNo = 5030
trigger5 = StateNo = 5050
trigger6 = StateNo = 5070
trigger7 = StateNo = 5080
value = s6,4
channel = 0

[State 3100, 1]
type = varset
trigger1 = movetype = H
v = 30
value = 0

[State 3100, 1]
type = varset
trigger1 = stateno = 0
v = 45
value = 0

[State -1, 1]
type = playsnd
trigger1 = movetype = H
trigger1 = var(45) = 1
trigger1 = time = 0
value = 8,9
channel = 5
lowpriority = 0

[State 3100, sound]
type = playsnd
triggerall = winKO
triggerall = !IsHelper
trigger1 = Hitdefattr = S, HA
trigger2 = Hitdefattr = C, HA
trigger3 = Hitdefattr = A, HA
lowpriority = 1
value = 6,5
channel = 3

[State 3000, 4]
type = explod
triggerall = winKO
triggerall = NumExplod(6001) = 0
trigger1 = Hitdefattr = S, HA
trigger2 = Hitdefattr = C, HA
trigger3 = Hitdefattr = A, HA
anim = 6001
ID = 6001
removetime = -2
pos = 0,0
postype = left
bindtime = -1
supermove = 1
scale = 1,1
sprpriority = -2
ownpal = 1

[State 3000, 4]
type = explod
triggerall = winKO
triggerall = NumExplod(6001) = 1
triggerall = NumExplod(6002) = 0
trigger1 = Hitdefattr = S, HA
trigger2 = Hitdefattr = C, HA
trigger3 = Hitdefattr = A, HA
anim = 6002
ID = 6002
pos = 0,0
removetime = -2
postype = left
bindtime = -1
supermove = 1
scale = 1,1
sprpriority = -2
ownpal = 1

[State 3000, 4]
type = explod
triggerall = winKO
triggerall = NumExplod(6001) = 1
triggerall = NumExplod(6002) = 1
trigger1 = Hitdefattr = S, HA
trigger2 = Hitdefattr = C, HA
trigger3 = Hitdefattr = A, HA
anim = 6002
ID = 6002
pos = 160,0
removetime = -2
postype = left
bindtime = -1
supermove = 1
scale = 1,1
sprpriority = -2
ownpal = 1

[State 3000, 4]
type = explod
triggerall = winKO
trigger1 = Hitdefattr = S, HA
trigger2 = Hitdefattr = C, HA
trigger3 = Hitdefattr = A, HA
anim = 6003
ID = 6000
removetime = 71
pos = -80,-10
postype = left
bindtime = -1
supermove = 1
scale = 1.25,1.25
sprpriority = -3
ownpal = 1

[State 3100, 4]
type = removeexplod
trigger1 = movetype = H
trigger2 = stateno <= 800
ID = 6000


[State -1]
type = assertspecial
triggerall = var(48) >= 1
trigger1 = timemod = 6,0
trigger2 = timemod = 6,1
trigger3 = timemod = 6,2
flag = invisible

[State -1]
type = NotHitBy
trigger1 = var(48) >= 1
value = SCA,AA

[State -1]
type = NotHitBy
trigger1 = var(48) >= 1
value = SCA,AT

[State -1]
type = NotHitBy
trigger1 = var(48) >= 1
value = SCA,AP

[State -1]
type = varadd
trigger1 = var(48) >= 1
v = 48
value = 1

[State -1]
type = varset
trigger1 = var(48) >= 900
v = 48
value = -1

[State -1]
type = varset
trigger1 = var(48) = -1
trigger1 = time = 1
v = 48
value = 0

[State 3100, eye]
type = afterimage
trigger1 = var(24) >= 10
trigger1 = Time = 0
palcolor = 16
palcontrast = 100,30,0
time = -1
length = 20
trans = add1

[State 3100, eye]
type = afterimage
trigger1 = var(24) = -1
time = 1

[State 1000, 1]
type = varset
trigger1 = time = 1
v = 28
value = 0

[State 3100, 4]
type = lifeadd
trigger1 = var(47) = 1
value = 1000

[State -1]
type = varset
trigger1 = var(47) = 1
trigger1 = time = 1
v = 47
value = 0

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