; 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 = /F, a    ;hold fwd 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
;               command = ~30
;   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 engine.
;
; - 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 are given below. Delete, add, or modify as you wish.

;-| Super Motions |--------------------------------------------------------


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


;-----------------
; QCB
[Command]
name = "meltstop1"
command = ~D, DB, B, a

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

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

[Command]
name = "meltstop4"
command = ~D, DB, B, x

[Command]
name = "meltstop5"
command = ~D, DB, B, y

[Command]
name = "meltstop6"
command = ~D, DB, B, z

;-----------------
; Uppercut
[Command]
name = "meltstop7"
command = ~F, D, DF, a

[Command]
name = "meltstop8"
command = ~F, D, DF, b

[Command]
name = "meltstop9"
command = ~F, D, DF, c

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

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

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


;--------------------
;Charge_Down_up
[Command]
name = "chargedownup_a"
command = ~60$D, U, a
time = 10

[Command]
name = "chargedownup_b"
command = ~60$D, U, b
time = 10

[Command]
name = "chargedownup_c"
command = ~60$D, U, c
time = 10

[Command]
name = "chargedownup_x"
command = ~60$D, U, x
time = 10

[Command]
name = "chargedownup_y"
command = ~60$D, U, y
time = 10

[Command]
name = "chargedownup_z"
command = ~60$D, U, z
time = 10

;--------------------
;Charge_Back_fwd
[Command]
name = "chargebackfwd_a"
command = ~60$B, F, a
time = 10

[Command]
name = "chargebackfwd_b"
command = ~60$B, F, b
time = 10

[Command]
name = "chargedownup_c"
command = ~60$D, U, c
time = 10

[Command]
name = "chargedownup_x"
command = ~60$D, U, x
time = 10

[Command]
name = "chargedownup_y"
command = ~60$D, U, y
time = 10

[Command]
name = "chargedownup_z"
command = ~60$D, U, z
time = 10



;-| 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 = a+b
time = 1

;-| Dir + Button |---------------------------------------------------------
[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_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 = "back_a"
command = /B,a
time = 1

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

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

[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_yb"
command = /F, y+b
time = 1

[Command]
name = "back_yb"
command = /B, y+b
time = 1

[Command]
name = "back_ab"
command = /B, a+b
time = 1

;-| Single Button |---------------------------------------------------------
[Command]
name = "up"
command = ~5UF, /UF
time = 40

[Command]
name = "up"
command = ~5UB, /UB
time = 40

[Command]
name = "up"
command = ~5UB, /UF
time = 40

[Command]
name = "up"
command = ~5UF, /UB
time = 40

[Command]
name = "up"
command = ~U
time = 40

[Command]
name = "fwd"
command = F
time = 1

[Command]
name = "back"
command = B
time = 1

[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 = "s"
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 |--------------------------------------------------------------
[Command]
name = "hold_yb"
command = /y+b
time = 30

[Command]
name = "hold_xa"
command = /x+a
time = 30

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

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

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

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

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

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

[Command]
name = "hold_s"
command = /s
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]                  ;Don't change this
;   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"
;   - ctrl
;       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]

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


;---------------------------------------------------------------------------
;charge
[state -1]
type = changestate
value = 400
triggerall = command = "hold_s" && statetype = S
trigger1 = (ctrl)

;---------------------------------------------------------------------------
;pursuit
[state -1]
type = changestate
value = 90
triggerall = command = "holdfwd"
triggerall = (command = "a" || command = "b" || command = "c")
triggerall = statetype = S 
trigger1 = stateno = (203 + (var(59) * 5)) && time > 20
trigger1 = (movecontact) || projhit = 1, < 30
trigger2 = stateno = 1090 && (movecontact) && time > 20
trigger3 = stateno = 223 && numhelper(1195) = 1
trigger3 = helper(1195),movecontact

;finish pursuit
[state -1]
type = changestate
value = 602
triggerall = var(59) = 0
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;---------------------------------------------------------------------------
;RunFwd
[State -1]
type = ChangeState
value = 100 + 10000 * var(59)
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;RunBack
[State -1]
type = ChangeState
value = 105 + 10000 * var(59)
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;Stand_Throw (close dir+b)
; Complicated? Skip the throws and look at stand_a, etc, first.
; This is disabled right now. Remove the "null;" below when you
; want to use it.
[State -1]
type = null; ChangeState
value = 900
triggerall = statetype = S
triggerall = ctrl = 1
triggerall = p2bodydist X < 5 ;Near P2
trigger1 = command = "fwd_b";p2 stand
trigger1 = stateno != 100    ;Not running
trigger1 = p2statetype = S
trigger1 = p2movetype != H
trigger2 = command = "fwd_b";p2 crouch
trigger2 = stateno != 100    ;Not running
trigger2 = p2statetype = C
trigger2 = p2movetype != H
trigger3 = command = "back_b";p2 stand
trigger3 = p2statetype = S
trigger3 = p2movetype != H
trigger4 = command = "back_b";p2 crouch
trigger4 = p2statetype = C
trigger4 = p2movetype != H

;---------------------------------------------------------------------------
;Air_Throw1 (close dir+b)
; This is disabled right now. Remove the "null;" below when you
; want to use it.
[State -1]
type = null; ChangeState
value = 950
triggerall = statetype = A
triggerall = ctrl = 1
triggerall = p2bodydist X < 9
triggerall = p2bodydist Y > -22
triggerall = p2bodydist Y < 22
triggerall = p2statetype = A
triggerall = p2movetype != H
trigger1 = command = "fwd_b"
trigger2 = command = "back_b"


;==========================================================================
; sonic flare
[State -1]
type = ChangeState
value = 203
triggerall = var(59) = 0
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 202 && (movecontact)

; sonic updraft
[State -1]
type = ChangeState
value = 204
triggerall = var(59) = 0
triggerall = command = "c" && command = "holdback";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 202 && (movecontact) 

;---------------------------------------------------------------------------
;1st attack
; Sonic punch
[State -1]
type = ChangeState
value = 200
triggerall = var(59) = 0
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; sonic kick
[State -1]
type = ChangeState
value = 201
triggerall = var(59) = 0
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 200 && (movecontact)

; top kick 
[State -1]
type = ChangeState
value = 202
triggerall = var(59) = 0
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 201 && (movecontact)



;---------------------------------------------------------------------------
;windmill
[State -1]
type = ChangeState
value = 601
triggerall = var(59) = 0
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 100 || stateno = 105
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;sonic rocket
[State -1]
type = ChangeState
value = 600
triggerall = var(59) = 0
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (stateno != 100 || stateno != 105)
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;sonic Wave
[state -1]
type = changestate
value = 1010
triggerall = var(59) = 0
triggerall = command = "x"
trigger1 = statetype = S && ctrl = 1

;sonic Storm
[state -1]
type = changestate
value = 1020
triggerall = var(59) = 0
triggerall = command = "x" && stateno != 1010 && (stateno != 100 || stateno != 105)
trigger1 = Statetype = A && (ctrl) 
trigger2 = stateno = 600 && time > 10
trigger3 = stateno = 1000 && time > 15

;sonic drive
[state -1]
type = changestate
value = 1030
triggerall = var(59) = 0
triggerall = command = "y" && numhelper(1031) = 0
trigger1 = statetype = S && ctrl

;sonic drive part 2
[state -1]
type = changestate
value = 1033
triggerall = var(59) = 0
triggerall = command = "y" && numhelper(1031) = 1
trigger1 = statetype = S && stateno = 1030
trigger2 = statetype = S && (ctrl)

;sonic meteor
[state -1]
type = changestate
value = 1040
triggerall = var(59) = 0
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 50 || (stateno = 1000 && time > 10)
trigger3 = stateno = 600 && time > 20

;sonic cracker
[state -1]
type = changestate
value = 1050
triggerall = var(59) = 0
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;sonic air cracker
[state -1]
type = changestate
value = 1060
triggerall = var(59) = 0
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)

;>>>>>>>>Knuckles moves<<<<<<<<<<<<<<<
;==========================================================================
; megaton hook
[State -1]
type = ChangeState
value = 208
triggerall = var(59) = 1
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 207 && (movecontact)

; Enrage
[State -1]
type = ChangeState
value = 209
triggerall = var(59) = 1
triggerall = command = "c" && command = "holdback";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 207 && (movecontact) 

;---------------------------------------------------------------------------
;1st attack
; KN straight
[State -1]
type = ChangeState
value = 205
triggerall = var(59) = 1
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; knuckles chop
[State -1]
type = ChangeState
value = 206
triggerall = var(59) = 1
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 205 && (movecontact)

; knuckles upper
[State -1]
type = ChangeState
value = 207
triggerall = var(59) = 1
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 206 && (movecontact)

;---------------------------------------------------------------------------
;double punch
[State -1]
type = ChangeState
value = 604
triggerall = var(59) = 1
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 10100 && statetype = S

;---------------------------------------------------------------------------
; kn air hook
[State -1]
type = ChangeState
value = 603
triggerall = var(59) = 1
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (stateno != 100 || stateno != 105)
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;finish pursuit
[state -1]
type = changestate
value = 605
triggerall = var(59) = 1
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;---------------------------------------------------------------------------
;rock free fall
[state -1]
type = changestate
value = 1070
triggerall = var(59) = 1
triggerall = command = "x" && numhelper(1071) = 0
trigger1 = statetype = S && (ctrl)

;meteor crush
[state -1]
type = changestate
value = 1080
triggerall = var(59) = 1
triggerall = command = "x" && numhelper(1081) = 0
trigger1 = statetype = A && (ctrl)

;Deep impact
[state -1]
type = changestate
value = 1090
triggerall = var(59) = 1
triggerall = command = "y"
trigger1 = statetype = S && ctrl

;major eruption
[state -1]
type = changestate
value = 1100
triggerall = var(59) = 1
triggerall = command = "y"
trigger1 = statetype = A && ctrl

;molebomb
[state -1]
type = changestate
value = 1110
triggerall = var(59) = 1
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;air mole bomb
[state -1]
type = changestate
value = 1120
triggerall = var(59) = 1
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)

;----------------------------------------------------------------------------------------------
;>>>>>>Chaos basics
; C double stab
[State -1]
type = ChangeState
value = 213
triggerall = var(59) = 2
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 212 && (movecontact)

; Chaos upper
[State -1]
type = ChangeState
value = 214
triggerall = var(59) = 2
triggerall = command = "c" && command = "holdback";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 212 && (movecontact)

;1st attack
; Stretch chaos
[State -1]
type = ChangeState
value = 210
triggerall = var(59) = 2
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; elastic chaos
[State -1]
type = ChangeState
value = 211
triggerall = var(59) = 2
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 210 && (movecontact)

; flexible chaos
[State -1]
type = ChangeState
value = 212
triggerall = var(59) = 2
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 211 && (movecontact)

;---------------------------------------------------------------------------
;chaos dolphin
[State -1]
type = ChangeState
value = 607
triggerall = var(59) = 2
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 20100 && statetype = S

;---------------------------------------------------------------------------
; chaos rocket
[State -1]
type = ChangeState
value = 606
triggerall = var(59) = 2
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (stateno != 100 || stateno != 105)
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;finish pursuit
[state -1]
type = changestate
value = 608
triggerall = var(59) = 2
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;---------------------------------------------
;>>>>>>>>))Chaos specials
;Chaos Shot
[state -1]
type = changestate
value = 1130
triggerall = var(59) = 2
triggerall = command = "x" && numprojID(6040) = 0
trigger1 = statetype = S && (ctrl)

;Air C Shot
[state -1]
type = changestate
value = 1140
triggerall = var(59) = 2
triggerall = command = "x" && numprojID(6040) = 0
trigger1 = statetype = A && (ctrl)

;Chaos crush
[state -1]
type = changestate
value = 1150
triggerall = var(59) = 2
triggerall = command = "y" && numproj = 0
trigger1 = statetype = S && (ctrl)

;Air C crush
[state -1]
type = changestate
value = 1160
triggerall = var(59) = 2
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)

;Chaos splash
[state -1]
type = changestate
value = 1170
triggerall = var(59) = 2
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;air C splash
[state -1]
type = changestate
value = 1180
triggerall = var(59) = 2
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)

;===================================================================================
;gamma basics
; electric shock
[State -1]
type = ChangeState
ignorehitpause = 1
value = 218
triggerall = var(59) = 3
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 217 && time > 50

; upper e shock
[State -1]
type = ChangeState
value = 219
triggerall = var(59) = 3
triggerall = command = "c" && command = "holdback";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 217 && time > 50

;1st attack
; solid knuckle
[State -1]
type = ChangeState
value = 215
triggerall = var(59) = 3
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; electric stab
[State -1]
type = ChangeState
value = 216
triggerall = var(59) = 3
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 215 && (movecontact)

; paralyze cut
[State -1]
type = ChangeState
value = 217
triggerall = var(59) = 3
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 216 && (movecontact)

;---------------------------------------------------------------------------
;buster drill
[State -1]
type = ChangeState
value = 609
persistent = 1
triggerall = var(59) = 3
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 30100
trigger2 = stateno = 30105

;---------------------------------------------------------------------------
; air e shock
[State -1]
type = ChangeState
value = 611
triggerall = var(59) = 3
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A
trigger1 = ctrl = 1
trigger2 = stateno = 1003

;---------------------------------------------------------------------------
;finish pursuit
[state -1]
type = changestate
value = 610
triggerall = var(59) = 3
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;---------------------------------------------------------------------------
;==>>>>>>>>>Gamma specials
;devastator
[state -1]
type = changestate
value = 1190
triggerall = var(59) = 3
triggerall = command = "x" && statetype = S
trigger1 = ctrl && numhelper(1190) = 0

;air devastator
[state -1]
type = changestate
value = 1200
triggerall = var(59) = 3
triggerall = command = "x" && statetype = A
trigger1 = ctrl && numhelper(1190) = 0
trigger2 = stateno = 1003

;melt down helper
[state -1]
type = helper
triggerall = var(59) = 3
trigger1 = command = "y" && numhelper(1337) = 0 && var(15) = 0
;trigger2 = command = "y" && numhelper(1337) = 0 && var(15) = 1 && random < 50
helpertype = normal
name = "timer"
ID = 1337
pos = 0,0
stateno = 1337
keyctrl = 0
ownpal = 1

[state -1]
type = varset
trigger1 = command = "meltstop1" || command = "meltstop2" || command = "meltstop3"
trigger2 = command = "meltstop4" || command = "meltstop5" || command = "meltstop6"
trigger3 = command = "meltstop7" || command = "meltstop8" || command = "meltstop9"
trigger4 = command = "meltstop10" || command = "meltstop11" || command = "meltstop12"
v = 15
value = 1

;meltdown boom
[state -1]
type = changestate
value = 1230
triggerall = var(59) = 3 && stateno != 1230
triggerall = roundstate = 2
trigger1 = var(8) = 50 && movetype != H && alive = 1
trigger2 = life = 1
ctrl = 0

;blinker
[state -1]
type = changestate
value = 1210
triggerall = var(59) = 3
triggerall = command = "z" && statetype = S
trigger1 = ctrl

;air blinker
[state -1]
type = changestate
value = 1220
triggerall = var(59) = 3
triggerall = command = "z" && statetype = A
trigger1 = ctrl
trigger2 = stateno = 1003

;===================================================================================
;Cream basics
; Chao Tornado
[State -1]
type = ChangeState
ignorehitpause = 1
value = 223
triggerall = var(59) = 4
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 222 && numhelper(1194) = 1
trigger2 = helper(1194),movecontact

; Chao Upper
[State -1]
type = ChangeState
value = 224
triggerall = var(59) = 4
triggerall = command = "c" && command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 222 && numhelper(1194) = 1
trigger2 = helper(1194),movecontact

;1st attack
; Chao Arch
[State -1]
type = ChangeState
value = 220
triggerall = var(59) = 4
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; Chao winder
[State -1]
type = ChangeState
value = 221
triggerall = var(59) = 4
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 220 && numhelper(1192) = 1
trigger2 = helper(1192),movecontact

; Chao Slalom
[State -1]
type = ChangeState
value = 222
triggerall = var(59) = 4
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 221 && numhelper(1193) = 1
trigger2 = helper(1193),movecontact

;---------------------------------------------------------------------------
;Chao Dash
[State -1]
type = ChangeState
value = 613
persistent = 1
triggerall = var(59) = 4
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 40100 && (ctrl)

;---------------------------------------------------------------------------
; Chao Circle
[State -1]
type = ChangeState
value = 612
triggerall = var(59) = 4
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1004

;---------------------------------------------------------------------------
;Chao dunk
[state -1]
type = changestate
value = 614
triggerall = var(59) = 4
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;---------------------------------------------------------------------------
;==============))>>Cream specials<<((==============
;Chao cannon
[state -1]
type = changestate
value = 1240
triggerall = var(59) = 4
triggerall = command = "x"
trigger1 = statetype = S && numhelper(1241) = 0
trigger1 = (ctrl)

;Air C cannon
[state -1]
type = changestate
value = 1250
triggerall = var(59) = 4
triggerall = command = "x" && stateno != 40100 && stateno != 40105
trigger1 = statetype = A && (ctrl) && numhelper(1251) = 0
trigger2 = stateno = 1004 && numhelper(1251) = 0

;Chao Rush
[state -1]
type = changestate
value = 1260
triggerall = var(59) = 4
triggerall = command = "y"
trigger1 = statetype = S && numhelper(1261) = 0
trigger1 = (ctrl)

;Air C Rush
[state -1]
type = changestate
value = 1270
triggerall = var(59) = 4
triggerall = command = "y"
trigger1 = statetype = A && numhelper(1261) = 0
trigger1 = (ctrl)
trigger2 = stateno = 1004 && numhelper(1261) = 0

;Cream Cracker
[state -1]
type = changestate
value = 1280
triggerall = var(59) = 4
triggerall = command = "z"
trigger1 = statetype = S
trigger1 = (ctrl)

;Air C Cracker
[state -1]
type = changestate
value = 1290
triggerall = var(59) = 4
triggerall = command = "z"
trigger1 = statetype = A
trigger1 = (ctrl)
trigger2 = stateno = 1004

;===================================================================================
;Tails basics
; Magic Hook
[State -1]
type = ChangeState
ignorehitpause = 1
value = 228
triggerall = var(59) = 5
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 227 && (movecontact)

; Magic Upper
[State -1]
type = ChangeState
value = 229
triggerall = var(59) = 5
triggerall = command = "c" && command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 227 && (movecontact)

;1st attack
; IQ 200 attack
[State -1]
type = ChangeState
value = 225
triggerall = var(59) = 5
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; IQ 300 attack
[State -1]
type = ChangeState
value = 226
triggerall = var(59) = 5
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 225 && (movecontact)

; IQ 400 attack
[State -1]
type = ChangeState
value = 227
triggerall = var(59) = 5
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 226 && (movecontact)

;---------------------------------------------------------------------------
;Tails dash
[State -1]
type = ChangeState
value = 615
persistent = 1
triggerall = var(59) = 5
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 50100 && (ctrl)

;---------------------------------------------------------------------------
; Typhoon
[State -1]
type = ChangeState
value = 616
triggerall = var(59) = 5
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (ctrl)
trigger1 = stateno != 50105
trigger2 = stateno = 1005

;---------------------------------------------------------------------------
;Tails dunk
[state -1]
type = changestate
value = 617
triggerall = var(59) = 5
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;========++Tails Specials++=========
;energy ball
[state -1]
type = changestate
value = 1300
triggerall = var(59) = 5 && numhelper(1301) = 0
triggerall = command = "x"
trigger1 = statetype = S && (ctrl)

;Air E ball
[state -1]
type = changestate
value = 1310
triggerall = var(59) = 5 && numhelper(1311) = 0
triggerall = command = "x"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1005

;Tails Flick
[state -1]
type = changestate
value = 1320
triggerall = var(59) = 5 && numhelper(1321) = 0
triggerall = command = "y"
trigger1 = statetype = S && (ctrl)

;Tails Air Flick
[state -1]
type = changestate
value = 1330
triggerall = var(59) = 5 && numhelper(1321) = 0
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1005

;Chu2 bomb
[state -1]
type = changestate
value = 1340
triggerall = var(59) = 5
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;Air chu2 bomb
[state -1]
type = changestate
value = 1350
triggerall = var(59) = 5
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1005

;===================================================================================
;Rouge Basics
; Charlie Kick
[State -1]
type = ChangeState
ignorehitpause = 1
value = 233
triggerall = var(59) = 6
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 232 && (movecontact)

; Secret Kick
[State -1]
type = ChangeState
value = 234
triggerall = var(59) = 6
triggerall = command = "c" && command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 232 && (movecontact)

;1st attack
; Rouge Kick
[State -1]
type = ChangeState
value = 230
triggerall = var(59) = 6
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; Rouge s Kick
[State -1]
type = ChangeState
value = 231
triggerall = var(59) = 6
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 230 && (movecontact)

; Rouge sobat
[State -1]
type = ChangeState
value = 232
triggerall = var(59) = 6
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 231 && (movecontact)

;---------------------------------------------------------------------------
;Secret Spear
[State -1]
type = ChangeState
value = 619
persistent = 1
triggerall = var(59) = 6
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno != 60105
trigger1 = stateno = 60100 && (ctrl)

;---------------------------------------------------------------------------
; Agent Eagle
[State -1]
type = ChangeState
value = 618
triggerall = var(59) = 6
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1006

;---------------------------------------------------------------------------
;Homing Cutter
[state -1]
type = changestate
value = 620
triggerall = var(59) = 6
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;========++Rouge Specials++=========
;Beauty shock
[state -1]
type = changestate
value = 1360
triggerall = var(59) = 6 && numhelper(1361) = 0
triggerall = command = "x"
trigger1 = statetype = S && (ctrl)

;Air b shock
[state -1]
type = changestate
value = 1370
triggerall = var(59) = 6 && numhelper(1361) = 0
triggerall = command = "x"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1006

;Silent size
[state -1]
type = changestate
value = 1380
triggerall = var(59) = 6
triggerall = command = "y"
trigger1 = statetype = S && (ctrl)

;Spiral Dive
[state -1]
type = changestate
value = 1390
triggerall = var(59) = 6
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1006

;Bat Cracker
[state -1]
type = changestate
value = 1400
triggerall = var(59) = 6
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;Air B Cracker
[state -1]
type = changestate
value = 1410
triggerall = var(59) = 6
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)
trigger2 = stateno = 1006

;===================================================================================
;Shadow Basics
;shadow teleport
[state -1]
type = changestate
value = 1007
triggerall = command = "up"
trigger1 = var(59) = 7
trigger1 = prevstateno = 1007 && statetype = A

; C Knightmare
[State -1]
type = ChangeState
ignorehitpause = 1
value = 238
triggerall = var(59) = 7
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 237 && (movecontact)

; Chaos Upper
[State -1]
type = ChangeState
value = 239
triggerall = var(59) = 7
triggerall = command = "c" && command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 237 && (movecontact)

;1st attack
; Shadow Chop
[State -1]
type = ChangeState
value = 235
triggerall = var(59) = 7
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1

; Shadow Kick
[State -1]
type = ChangeState
value = 236
triggerall = var(59) = 7
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 235 && (movecontact)

; Shadow B Kick
[State -1]
type = ChangeState
value = 237
triggerall = var(59) = 7
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 236 && (movecontact)

;---------------------------------------------------------------------------
;Shadow Slider
[State -1]
type = ChangeState
value = 622
persistent = 1
triggerall = var(59) = 7
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno != 70105
trigger1 = stateno = 70100

;---------------------------------------------------------------------------
; Shadow Rocket
[State -1]
type = ChangeState
value = 621
triggerall = var(59) = 7
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (ctrl)

;---------------------------------------------------------------------------
;Shadow Eagle
[state -1]
type = changestate
value = 623
triggerall = var(59) = 7
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;--------------------------------------------------------------------------
;\\\\\\\\\\Shadow Specials/////////
;Chaos Magic
[state -1]
type = changestate
value = 1420
triggerall = var(59) = 7 && numhelper(1421) = 0
triggerall = command = "x"
trigger1 = statetype = S && (ctrl)

;Air C Magic
[state -1]
type = changestate
value = 1430
triggerall = var(59) = 7 && numhelper(1422) = 0
triggerall = command = "x"
trigger1 = statetype = A && (ctrl)

;Chaos Burst
[state -1]
type = changestate
value = 1440
triggerall = var(59) = 7
triggerall = command = "y"
trigger1 = statetype = S && (ctrl)

;Air C Burst
[state -1]
type = changestate
value = 1450
triggerall = var(59) = 7
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)

;Roaming Chaos
[state -1]
type = changestate
value = 1460
triggerall = var(59) = 7
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;Air R Chaos
[state -1]
type = changestate
value = 1470
triggerall = var(59) = 7
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)

;===================================================================================
;Amy Basics

; Girl Crush
[State -1]
type = ChangeState
ignorehitpause = 1
value = 243
triggerall = var(59) = 8
triggerall = command = "c" && command = "holdfwd";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 242 && (movecontact)

; Girl Swing
[State -1]
type = ChangeState
value = 244
triggerall = var(59) = 8
triggerall = command = "c" && command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 242 && (movecontact)

;1st attack
; Girl Jab
[State -1]
type = ChangeState
value = 240
triggerall = var(59) = 8
triggerall = command = "a"
 
trigger1 = statetype = S
trigger1 = ctrl = 1

; Girl Straight
[State -1]
type = ChangeState
value = 241
triggerall = var(59) = 8
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 240 && (movecontact)

; Girl Upper
[State -1]
type = ChangeState
value = 242
triggerall = var(59) = 8
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 241 && (movecontact)

;---------------------------------------------------------------------------
;Girl Bomber
[State -1]
type = ChangeState
value = 624
persistent = 1
triggerall = var(59) = 8
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno != 80105
trigger1 = stateno = 80100

;---------------------------------------------------------------------------
; Air Girl Crush
[State -1]
type = ChangeState
value = 625
triggerall = var(59) = 8
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = statetype = A && (ctrl)

;---------------------------------------------------------------------------
;Girl Dunk
[state -1]
type = changestate
value = 626
triggerall = var(59) = 8
triggerall = command = "a" || command = "b" || command = "c"
trigger1 = stateno = 90 || (prevstateno = 90 && (ctrl))

;--------------------------------------------------------------------------
;\\\\\\\\\\Amy Specials/////////
;Pink Typhoon
[state -1]
type = changestate
value = 1480
triggerall = var(59) = 8 && numhelper(1481) = 0
triggerall = command = "x"
trigger1 = statetype = S && (ctrl)

;Air Pink Typhoon
[state -1]
type = changestate
value = 1490
triggerall = var(59) = 8 && numhelper(1491) = 0
triggerall = command = "x"
trigger1 = statetype = A && (ctrl)

;G Tornado
[state -1]
type = changestate
value = 1500
triggerall = var(59) = 8
triggerall = command = "y"
trigger1 = statetype = S && (ctrl)

;Air G Tornado
[state -1]
type = changestate
value = 1510
triggerall = var(59) = 8
triggerall = command = "y"
trigger1 = statetype = A && (ctrl)

;Gift
[state -1]
type = changestate
value = 1520
triggerall = var(59) = 8
triggerall = command = "z"
trigger1 = statetype = S && (ctrl)

;Air Gift
[state -1]
type = changestate
value = 1530
triggerall = var(59) = 8
triggerall = command = "z"
trigger1 = statetype = A && (ctrl)
