; The CMD file.
;
; Two parts: 1. Command definition and  2. State entry
; (state entry is after the commands def section)
;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

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

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

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

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

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

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

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

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

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

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

;-| Hold Button |----------------------------------------------------------
[Command]
name = "holda"
command = /a
time = 1

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

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

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

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

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

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

;-| CPU |--------------------------------------------------------------
[Command]
name = "a2"
command = a
time = 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[Command]
name = "recovery2"
command = x+y
time = 1

;-| Super Motions |--------------------------------------------------------
;
; 3 Small Kamehamehas
[Command]
name = "finalb"
command = ~B, F, y
time = 20

; Fusion
[Command]
name = "fusion"
command = ~B, F, b
time = 20

; Desperate Explosion (Ultra Solar Flare)
[Command]
name = "exp"
command = a+x
time = 20

; Super Warp Meteor Attack
[Command]
name = "wmattack"
command = ~D, B, y
time = 20

; Final Mega Kamehameha
[Command]
name = "finalk"
command = ~D, DF, F, a
time = 10

; Final Energy Wave
[Command]
name = "overhead"
command = ~D, DB, B, b
time = 10

; Counter
[Command]
name = "count"
command = /$B,a
time = 10

; Mouth Beam
[Command]
name = "mouth"
command = ~D, DF, F, x
time = 10

[Command]
name = "ax"    ;required
command= z+c
time = 1

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

;Wing Kicks
[Command]
name = "kick2"
command = ~D,F, b
time = 10

;Slow Energy Ball
[Command]
name = "sball"
command = ~D,U
time = 10

[Command]
name = "tair"
command = b+y
time = 10

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

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

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

[Command]
name = "vegeta"
command = ~D, B, z
time = 20

[Command]
name = "vegetaex"
command = x+y
time = 20

[Command] ;Tap a rapidly combo attack
name = "5x"
command = a,a,a
time = 40

[Command]
name = "ab"
command= a+b
time = 1

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

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

[Command]
name = "QCB_a"
command = ~D, DF, F, a

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

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

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


;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "DD"     ;Required (do not remove)
command = D, D
time = 10

[Command]
name = "UU"     ;Required (do not remove)
command = U, U
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

;---------------------------------------------------------------------------
; 2. State entry
; --------------
; This is where you define what commands bring you to what states.
; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

;--------------------------------------------------------------------------
;Normal Commands
;---------------------------------------------------------------------------
;Slow energy ball 
[State -1]
type = ChangeState
value = 1113
triggerall = var(30) != 59
triggerall = command = "c"
triggerall = command = "holdfwd"
triggerall = power >= 50
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000

;Final Energy Spark (level 1)
[State -1]
type = ChangeState
value = 1010
triggerall = var(30) != 59
triggerall = command = "overhead"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000


;Teledrill (teleport attacks)
[State -1]
type = ChangeState
value = 4806
triggerall = var(30) != 59
triggerall = command = "tair"
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000

; Wing Kick
[State -1]
type = ChangeState
value =6436
triggerall = var(30) != 59
triggerall = command = "kick2"
triggerall = stateno != 6436
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 2000

; Desperate Explosion
[State -1]
type = ChangeState
value = 1400
triggerall = var(30) != 59
triggerall = command = "exp"
triggerall = power >= 2000
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 2000
;----------------------------------------------------------------------
;Meteor Attack UB22 (unlock version)
[State -1]
type = ChangeState
value = 4435
triggerall = var(30) != 59
triggerall = command = "c"
triggerall = command = "holddown"
triggerall = power >= 0
trigger1 = statetype = S
trigger1 = ctrl =1
trigger2 = stateno = 2000

;Warp Meteor Attack
[State -1]
type = ChangeState
value = 2102
triggerall = var(30) != 59
triggerall = command = "wmattack"
triggerall = power >= 2000
trigger1 = statetype = S
trigger1 = ctrl =1
trigger2 = stateno = 2000

;Final Kamehameha (level 1)
[State -1]
type = ChangeState
value = 2050
triggerall = var(30) != 59
triggerall = command = "finalk"
triggerall = power >= 3000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000

;Mouth Beam (level 1)
[State -1]
type = ChangeState
value = 280
triggerall = var(30) != 59
triggerall = command = "mouth"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000

;---------------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 3005
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "ab"
triggerall = alive = 1
trigger1 = ctrl
trigger1 = stateno >= 150        
trigger2 = Stateno <= 153
trigger3 = stateno = 5000       
trigger4 = stateno = 5001
trigger5 = stateno = 5002
trigger6 = stateno = 5010
trigger7 = stateno = 5011
trigger8 = stateno = 5012
trigger9 = stateno = 5020
trigger10 = stateno = 5021
trigger11 = stateno = 5022
trigger12 = stateno = 5110
trigger13 = stateno = 5120
trigger14 = stateno = 5110
trigger15 = stateno = 5035
trigger16 = stateno = 5030
trigger17 = stateno = 5050
trigger18 = stateno = 5040
trigger19 = stateno = 5071

;Warp 
[State -1]
type = ChangeState
value = 3005
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "ab"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 2000

[State -1]
type = ChangeState
value = 3005
triggerall = var(30) != 59
triggerall = command = "ab"
trigger1 = ctrl
trigger1 = Stateno <= 4999

;Knee Attack Counter
[State -1, elbow counter]
type = ChangeState
value = 4046
triggerall = var(30) != 59
triggerall = command = "MultiKick"
;triggerall = command != "holddown"
triggerall = P2StateType != A
triggerall = P2MoveType = A
triggerall = MoveType = H
triggerall = GetHitVar(hitcount) < 6
triggerall = GetHitVar(hittime) < 40
triggerall = GetHitVar(slidetime) < 40
trigger1 = stateno = 5000
trigger2 = stateno = 5001
trigger3 = stateno = 5002
trigger4 = stateno = 5010
trigger5 = stateno = 5011
trigger6 = stateno = 5012

;---------------------------------------------------------------------------
;3 Kamehamehas (level 1)
[State -1]
type = ChangeState
value = 1000
triggerall = Var(30)!= 59
triggerall = command = "finalb"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 2000

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

;Fly Up Air Command
[State -1]
type = ChangeState
value = 2000
triggerall = var(30) != 59
triggerall = command = "s"
trigger1 = statetype = A
trigger1 = ctrl = 1

;Fly up
[State -1]
type = ChangeState
value = 1999
triggerall = var(30) != 59
trigger1 = command = "s"
trigger1 = statetype != A
trigger1 = ctrl = 1
;---------------------------------------------------------------------------
;Run Fwd
;ダッシュ
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = var(30) != 59
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

;Run Back
;後退ダッシュ
[State -1, Run Back]
type = ChangeState
value = 105
triggerall = var(30) != 59
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl
;-------------------------------------------------------------------------------

;Combo
[State -1]
type = ChangeState
value = 2435
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "spinball"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 2000
trigger3 = stateno = 275
;---------------------------------------------------------------------------

; Multi Kick
[State -1]
type = ChangeState
value =260
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "MultiKick"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 260
trigger2 = ctrl = 1
trigger3 = stateno = 260
trigger3 = ctrl = 1
trigger3 = stateno = 260
trigger4 = ctrl = 1
trigger4 = stateno = 260
trigger5 = ctrl = 1
trigger5 = stateno = 260
trigger6 = ctrl = 1
trigger6 = stateno = 260
trigger8 = ctrl = 1
trigger8 = stateno = 260
trigger9 = stateno = 260
trigger9 = ctrl = 1
trigger10 = stateno = 260
trigger10 = ctrl = 1
trigger11 = stateno = 260
trigger11 = ctrl = 1
trigger12 = stateno = 260
trigger12 = ctrl = 1
trigger13 = stateno = 260
trigger13 = ctrl = 1
trigger14 = stateno = 260
trigger14 = ctrl = 1
trigger15 = stateno = 260
trigger15 = stateno = 260
trigger16 = ctrl = 1
trigger16 = stateno = 260
trigger17 = ctrl = 1
trigger17 = stateno = 260
trigger18 = stateno = 260
trigger18 = MoveContact
;---------------------------------------------------------------------------
; Combo Attack
[State -1]
type = ChangeState
value =265
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "5x";"combo"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 265
trigger2 = ctrl = 1
trigger3 = stateno = 265
trigger3 = ctrl = 1
trigger3 = stateno = 265
trigger4 = ctrl = 1
trigger4 = stateno = 265
trigger5 = ctrl = 1
trigger5 = stateno = 265
trigger6 = ctrl = 1
trigger7 = stateno = 230
;trigger18 = stateno = 230 && time > 2
trigger8 = stateno = 2000

;----------------------------------------------------------------------
; Spinball 2
[State -1]
type = ChangeState
value =2436
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "spinball2"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 2436
trigger2 = ctrl = 1
trigger3 = stateno = 2436
trigger3 = ctrl = 1
trigger3 = stateno = 2436
trigger4 = ctrl = 1
trigger4 = stateno = 2436
trigger5 = ctrl = 1
trigger5 = stateno = 2436
trigger6 = ctrl = 1
trigger6 = stateno = 2436
trigger8 = ctrl = 1
trigger8 = stateno = 2436
trigger9 = stateno = 2436
trigger9 = ctrl = 1
trigger10 = stateno = 2436
trigger10 = ctrl = 1
trigger11 = stateno = 2436
trigger11 = ctrl = 1
trigger12 = stateno = 2436
trigger12 = ctrl = 1
trigger13 = stateno = 2436
trigger13 = ctrl = 1
trigger14 = stateno = 2436
trigger14 = ctrl = 1
trigger15 = stateno = 2436
trigger15 = stateno = 2436
trigger16 = ctrl = 1
trigger16 = stateno = 2436
trigger17 = ctrl = 1
trigger17 = stateno = 2436
trigger18 = stateno = 2436
trigger18 = MoveContact
trigger19 = stateno = 230 && movecontact
trigger20 = stateno = 200 && movecontact

;---------------------------------------------------------------------------
;Grapple Punch
[State -1, Grapp Punch]
type = ChangeState
value = 275
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = p2bodydist x <=10
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000
trigger3 = (stateno = 200) && time > 5
trigger3 = (stateno = 230) && time > 6
trigger4 = stateno = 265
;---------------------------------------------------------------------------
;Kung Fu Throw
[State -1, Kung Fu Throw]
type = ChangeState
value = 800
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "y"
triggerall = statetype = S
;triggerall = ctrl
triggerall = stateno != 100
trigger1 = command = "holdfwd"
trigger1 = p2bodydist X < 10
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = command = "holdback"
trigger2 = p2bodydist X < 10
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H
trigger3 = stateno = 2000

;--------------------------------------------------------------------
;Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000 
trigger3 = stateno = 200 || stateno = 230
trigger3 = movehit
;---------------------------------------------------------------------------
;Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = 210
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000
trigger3 = stateno = 200 || stateno = 230
trigger3 = movehit
;---------------------------------------------------------------------------
;Stand Light Kick
[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000
trigger3 = stateno = 200 || stateno = 230
trigger3 = movehit
;---------------------------------------------------------------------------
;High Kick
[State -1, Standing High Kick]
type = ChangeState
value = 250
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000
trigger3 = stateno = 200 || stateno = 230
trigger3 = movehit
;---------------------------------------------------------------------------
;Standing Strong Kick
[State -1, Standing Strong Kick]
type = ChangeState
value = 240
triggerall = var(30) != 59
triggerall = Var(9)!= 1
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 2000
trigger3 = stateno = 200 || stateno = 230
trigger3 = movehit
;---------------------------------------------------------------------------
;Crouching Light Punch
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = var(30) != 59
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Strong Punch
[State -1, Crouching Strong Punch]
type = ChangeState
value = 410
triggerall = var(30) != 59
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = movehit
;---------------------------------------------------------------------------
;Crouching Light Kick
[State -1, Crouching Light Kick]
type = ChangeState
value = 430
triggerall = var(30) != 59
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = movehit
;---------------------------------------------------------------------------
;Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 440
triggerall = var(30) != 59
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = 400) || (stateno = 430)
trigger2 = movehit
;---------------------------------------------------------------------------
;Jump Light Punch
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = var(30) != 59
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 && movecontact

;---------------------------------------------------------------------------
;Jump Strong Punch
[State -1, Jump Strong Punch]
type = ChangeState
value = 610
triggerall = var(30) != 59
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || stateno = 630 ;jump_x or jump_a
trigger2 = movehit
;---------------------------------------------------------------------------
;Jump Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = 630
triggerall = var(30) != 59
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || stateno = 630 
trigger2 = movecontact

;---------------------------------------------------------------------------
;Jump Strong Kick
[State -1, Jump Strong Kick]
type = ChangeState
value = 640
triggerall = var(30) != 59
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || stateno = 630 ;jump_x or jump_a
trigger2 = movehit

; CHARGE
[State -1]
type = ChangeState
value = 730
triggerall = var(30) != 59
;triggerall = Power < 3000
triggerall = command = "charge"
trigger1 = ctrl = 1
trigger1 = statetype = S
trigger2 = stateno = 2000
;---------------------------------------------------------------------------
;Fireball
[State -1]
type = ChangeState
value = 4000
triggerall = var(30) != 59
triggerall = command = "c"
triggerall = numproj = 0
triggerall = power >= 100 
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 4000
trigger3 = stateno = 2000
;========================================================================
;------------------------------------------------------------------------
;Other
;------------------------------------------------------------------------
[State -1, Hide]
type = AssertSpecial
trigger1 = IsHelper(44304)
flag = invisible
flag2 = NoShadow
IgnoreHitPause = 1

[State -1, Lets Go] 
type = destroyself
triggerall = IsHelper
trigger1 = parent,life <= 0
trigger2 = stateno = 5150

[State -1, Escape]
type = SelfState
triggerall = IsHelper
trigger1 = movereversed
trigger2 = enemy,HitDefAttr, SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
value = prevstateno
;ctrl = 1

;-------------------------------
;Helpers
;-------------------------------
[State -2, Vegeta 1]
type = Helper
trigger1 = RoundState = 2 && stateno != 5900
trigger1 = NumHelper(1001) = 0
name = "Vegeta1"
id = 1001
pos = 40,-270
postype = p2
stateno = 9999
Helpertype = player
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

[State -2, Vegeta 2]
type = Helper
trigger1 = RoundState = 2 && stateno != 5900
trigger1 = NumHelper(1002) = 0
name = "Vegeta2"
id = 1002
pos = 120,-270
postype = p2
stateno = 9999
Helpertype = player
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

[State -2, Vegeta 3]
type = Helper
trigger1 = RoundState = 2 && stateno != 5900
trigger1 = NumHelper(1003) = 0
name = "Vegeta3"
id = 1003
pos = 200,-270
postype = p2
stateno = 9999
Helpertype = player
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

[State -2, Vegeta 4]
type = Helper
trigger1 = RoundState = 2 && stateno != 5900
trigger1 = NumHelper(1004) = 0
name = "Vegeta4"
id = 1004
pos = 280,-270
postype = left
stateno = 9999
Helpertype = player
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

[State -1,charge]
type = ChangeState
value = 730
triggerall = Var(30)= 59 && Life != 0 
triggerall = stateno != 730 && stateno != 735 && stateno != 740 && stateno != 741 && StateNo != 105
trigger1 = random < 300
trigger1 = statetype = S && ctrl

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


