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

command.buffer.time = 2
;============AI Activation======================
[Command]
name = "cpu1"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu2"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu3"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu4"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu5"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu6"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu7"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu8"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu9"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu10"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu11"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu12"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu13"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu14"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu15"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu16"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu17"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu18"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu19"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu20"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu21"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu22"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu23"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu24"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

[Command]
name = "cpu25"
command = x,x,x,x,x,x,x,x,x,x,x,x,x
time = 1

;-| Super Motions |--------------------------------------------------------
;The following two have the same name, but different motion.
;Either one will be detected by a "command = TripleKFPalm" trigger.
;Time is set to 20 (instead of default of 15) to make the move
;easier to do.

[command]
name = "Dark Barage"
command = ~D, DF, F, a+b
time = 30

[command]
name = "Punishment"
command = ~D, DB, B, D, DB, B, a
time = 30

[command]
name = "GeroStone"
command = ~F, DF, D, DB, B, a+b
time = 30

[command]
name = "QCF_a"
command = ~D, DF, F, a
time = 10

[command]
name = "QCF_b"
command = ~D, DF, F, b
time = 10

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

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

[command]
name = "multikick"
command = F, F, x
time = 20

[command]
name = "preypecker"
command = ~B, F, a
time = 20
;-| Special Motions |------------------------------------------------------

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

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

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

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

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

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

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

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

[Command]
name = "QCB_xy"
command = ~D, DB, B, x+y

[Command]
name = "FF_ab"
command = F, F, a+b

[Command]
name = "FF_a"
command = F, F, a

[Command]
name = "FF_b"
command = F, F, b

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

;-| 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 = "down"
command = D
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

[command]
name = "Wafflecopy"
command = /$b
time = 1

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

[command]
name = "Swallow"
command = D
time = 1

[command]
name = "ford"
command = F
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]
;===========================================================================
;Variables
;Var(5) = Boss set
;Var(1) = combo variable
;Var(2) = copy vairable
;Var(10) = Eat Bar
;Var(20) = Car

;CPU activate
[state -1]
type = varset
triggerall = roundstate < 3
trigger1 = command = "cpu1"
trigger2 = command = "cpu2"
trigger3 = command = "cpu3"
trigger4 = command = "cpu4"
trigger5 = command = "cpu5"
trigger6 = command = "cpu6"
trigger7 = command = "cpu7"
trigger8 = command = "cpu8"
trigger9 = command = "cpu9"
trigger10 = command = "cpu10"
trigger11 = command = "cpu11"
trigger12 = command = "cpu12"
trigger13 = command = "cpu13"
trigger14 = command = "cpu14"
trigger15 = command = "cpu15"
trigger16 = command = "cpu16"
trigger17 = command = "cpu17"
trigger18 = command = "cpu18"
trigger19 = command = "cpu19"
trigger20 = command = "cpu20"
trigger21 = command = "cpu21"
trigger22 = command = "cpu22"
trigger23 = command = "cpu23"
trigger24 = command = "cpu24"
trigger25 = command = "cpu25"
var(30) = 1

[state -1]
type = varset
trigger1 = roundstate != 2
v = 30
value = 0

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

[State -1, Combo condition Check]
type = VarSet
trigger1 = statetype != A
trigger1 = movecontact && stateno != 645 && stateno != 646 && stateno != 1 && stateno != 2
var(1) = 1

[state -1]
type = varset
trigger1 = roundstate = 1
var(2) = 0

[state -1, DISPLAY]
type = displaytoclipboard
trigger1 = 1
text = "AI = %d  P2DIST X = %d  P2DIST Y = %d"
params = Var(30), Floor(P2bodydist x), Floor(P2bodydist y)
;===========================================================================
;---------------------------------------------------------------------------
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = !Var(30)
triggerall = command = "FF"
triggerall = command != "c"
triggerall = statetype = S
triggerall = Stateno != 100
triggerall = Stateno != 105
trigger1 = ctrl
trigger2 = var(1) && VAR(5)
;---------------------------------------------------------------------------
[State -1, Run Back]
type = ChangeState
value = 105
triggerall = !Var(30)
triggerall = Stateno != 100
triggerall = Stateno != 105
trigger1 = command = "BB"
trigger1 = command != "c"
trigger1 = statetype = S
trigger1 = ctrl
;======================
[state -1, Reversal]
type = changestate
value = 14
triggerall = !var(30)
triggerall = command = "z"
triggerall = statetype != A
trigger1 = ctrl

;__________Supers________
[state -1, Gerostone]
type = changestate
value = 3100
triggerall = !Numhelper(3170)
triggerall = !Numhelper(3100)
triggerall = var(5) = 0
triggerall = !var(30)
triggerall = statetype != A
triggerall = command = "GeroStone"
triggerall = power >= 1000
trigger1 = ctrl
trigger2 = var(1)

[state -1, Dark Barage]
type = changestate
value = 3000
triggerall = !var(30)
triggerall = command = "Dark Barage"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 1000
trigger2 = Movecontact
trigger3 = stateno = 1010
trigger3 = movecontact
trigger4 = (stateno = [200,230]) && Movecontact

[state -1, Punishment Of the Crows]
type = changestate
value = 645
triggerall = !var(30)
triggerall = command = "Punishment"
triggerall = power >= 3000
trigger1 = statetype = S
trigger1 = ctrl
,===============================
[state -1, Charging Swoop 1]
type = changestate
value = 1000
triggerall = command = "QCF_a"
triggerall = stateno != 211
triggerall = !var(30)
triggerall = power >= 9999999999
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [210,230]) && Movecontact
trigger2 = Stateno != 225

[state -1, Charging Swoop 2]
type = changestate
value = 1010
triggerall = command = "QCF_b"
triggerall = stateno != 211
triggerall = !var(30)
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = (stateno = [210,230]) && Movecontact
trigger2 = Stateno != 225

[state -1, Pelican Beak]
type = changestate
value = 2000
triggerall = !var(30)
triggerall = command = "QCB_a" || command = "QCB_b"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [210,230]) && Movecontact

[state -1, Light Attack]
type = changestate
value = 400
triggerall = !var(30)
triggerall = command = "holddown"
triggerall = command = "a"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = Stateno = 400 && movecontact
trigger3 = stateno = 400 && time >= 4

[state -1, Light Attack]
type = changestate
value = 210
triggerall = !var(30)
triggerall = command = "a"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = Stateno = 210 && movecontact
trigger3 = stateno = 210 && time >= 4

[state -1, Medium Attack]
type = changestate
value = 220
triggerall = !var(30)
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 210 && movecontact
trigger3 = stateno = 210 && time >= 4

[state -1, Strong Attack]
type = changestate
value = 230
triggerall = !var(30)
triggerall = command = "c"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 210 && movecontact
trigger3 = stateno = 220 && movecontact
trigger4 = stateno = 210 && time >= 4

[state -1,Crouch Reversal]
type = changestate
value = 702
triggerall = !var(30)
trigger1 = command = "z"
trigger1 = Movetype = H
trigger1 = power >= 200
trigger1 = statetype = C

[state -1]
type = changestate
value = 16
triggerall = !var(30)
triggerall = command = "a"
triggerall = statetype = A
trigger1 = ctrl

[state -1, MultiKick]
type = changestate
value = 17
triggerall = command = "multikick"
triggerall = !var(30)
triggerall = statetype = S
trigger1 = ctrl
trigger2 = var(1)

[state -1, Fire Kick]
type = changestate
value = 18
triggerall = !var(30)
triggerall = var(30) != 1
triggerall = power >= 1000
triggerall = command = "x"
trigger1 = stateno = 101

;[state -1]
;type = changestate
;value = 200
;triggerall = var(5) = 0
;triggerall = command = "y"
;triggerall = statetype = S
;triggerall = var(30) != 1
;trigger1 = ctrl
;trigger2 = var(1)

[state -1]
type = nothitby
trigger1 = prevstateno = 2025
trigger1 = stateno != 14
value = SCA
;--------Severely defeated-------------
[state -1]
type = helper
trigger1 = roundno > 2
trigger1 = lose
trigger1 = p2life > 500
trigger1 = numhelper(50) = 0
helpertype = normal
name = "Severely lost"
stateno = 9020
ID = 50
postype = left
pos = 500,0
facing = -1
ownpal = 1

[state -1, gray]
type = AllPalFx
trigger1 = roundno > 2
trigger1 = lose
trigger1 = p2life > 500
time = 1
color = 256 - time

[state -1]
type = assertspecial
trigger1 = roundno > 2
trigger1 = lose
trigger1 = p2life > 500
flag = nobg
flag2 = nofg
flag3 = nokoslow

[state -1]
type = Varset ;Corrupt Mode
trigger1 = palno = 5
var(5) = 1
