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

; Kamehame ha
[Command]
name = "kame"
command = ~D, DF, F, y+b
time = 30

; Kamehame Ha
[Command]
name = "kame1"
command = ~D, DF, F, y+b
time = 30

; Giga Cell Combination ( Meteor Attack )
[Command]
name = "GigaCell"
command = ~F, B, F, B, F, y
time = 90

; Giga Cell Combination ( Meteor Attack )
[Command]
name = "GigaCell2"
command = ~F, B, F, B, F, b
time = 90

; Giga Burn ( Meteor Attack )
[Command]
name = "GigaBurn"
command = ~D, DB, B, F, y
time = 30

; Giga Burn ( Meteor Attack )
[Command]
name = "GigaBurn2"
command = ~D, DB, B, F, b
time = 30

;-| Special Motions |------------------------------------------------------
;-----------------
; Cell Jr. Attack
[Command]
name = "Cell Jr. Attack"
command = ~F, B, F, x
time = 30

; Cell Jr. Attack ( 2 )
[Command]
name = "Cell Jr. Attack2"
command = ~F, B, F, a
time = 30

; Levitation
[Command]
name = "levi"
command = ~D, DB, B, y
time = 30

; mini Kame 
[Command]
name = "minikame"
command = ~D, DB, B, F, x
time = 30

; mini Kame 
[Command]
name = "minikame1"
command = ~D, DB, B, F, a
time = 30

; Negative Arrow 
[Command]
name = "negative"
command = ~D, DB, B, y
time = 30

; QCF
[Command]
name = "QCF_a"
command = ~D, DF, F, a

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

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

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

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

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

; katsuu energy dan
[Command]
name = "katsuu"
command = ~F, B, F, y
time = 30

;-----------------
; QCB
[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 = "QCB_x"
command = ~D, DB, B, x

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

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

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

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

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

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

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

[Command]
name = "uppercut_z"
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

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

[Command]
name = "energy"
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,c
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 = "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

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


;-| AI activation |--------------------------------------------------------

[Command]
name = "ai1"
command = U, U, U, D, D, D, D, F, x+a+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai2"
command = U, U, U, D, D, D, D, F, b+a+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai3"
command = U, U, U, D, D, D, D, F, c+a+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai4"
command = U, U, U, D, D, D, D, F, z+a+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai5"
command = U, U, U, D, D, D, D, F, x+b+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai6"
command = U, U, U, D, D, D, D, F, x+c+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai7"
command = U, U, U, D, D, x+a+y, F, B, BF, a
time = 1

[Command]
name = "ai8"
command = U, U, U, D, B, B, U, F, x+a+y, a+z, D
time = 1

[Command]
name = "ai9"
command = U, U, U, F, D, D, F, s+a+y, c, B, BF, a+z, D
time = 1

[Command]
name = "ai10"
command = B, D, UF, F, x+a+b, U, B, BF, a+z, D
time = 1

[Command]
name = "ai11"
command = U, U, U, D, D, D, D, F, x+a+y, F, B, BF, a+c, y
time = 1

[Command]
name = "ai12"
command = U, U, U, D, D, F, x+b, F, B, BF, a, D
time = 1

[Command]
name = "ai13"
command = U, U, U, D, y, z, D, c, x+a+y, F, s, b, a+z, D
time = 1

[Command]
name = "ai14"
command = U, UB, B, b, D, c, D, F, c+x+z, F, B, BF, a+z, D
time = 1

[Command]
name = "ai15"
command = U, U, F, D, c, D, b+x, F, x+a+y, F, B, a+z, D
time = 1

[Command]
name = "ai16"
command = D, DF, F, a, D, D, a, D, F, x+a+y, c, B, BF, a+z, D
time = 1

[Command]
name = "ai17"
command = U, UF, DF, y+x, a, b, c, F, x+a+y, F, B, BF, a+z, D
time = 1

[Command]
name = "ai18"
command = U, U, c, D, D, b, D, F, a
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"
;   - 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]

[State -1, AI Ativation]
type = VarSet
triggerall = var(59) != 1
triggerall = RoundState != 3
trigger1 = command = "ai1"
trigger2 = command = "ai2"
trigger3 = command = "ai3"
trigger4 = command = "ai4"
trigger5 = command = "ai5"
trigger6 = command = "ai6"
trigger7 = command = "ai7"
trigger8 = command = "ai8"
trigger9 = command = "ai9"
trigger10 = command = "ai10"
trigger11 = command = "ai11"
trigger12 = command = "ai12"
trigger13 = command = "ai13"
trigger14 = command = "ai14"
trigger15 = command = "ai15"
trigger16 = command = "ai16"
trigger17 = command = "ai17"
trigger18 = command = "ai18"
v=59
value=1

[State -1,AI.Sair.do.Voa]
type = ChangeState
triggerall = var(59) = 1
triggerall = stateno = 3001
triggerall = MoveType != A 
trigger1 = p2statetype = S
trigger1 = p2bodydist Y > 30
value = 50
ctrl = 1

[State -1, AI Stand to Crouch Guard Transition]
type = ChangeState
triggerall = var(59) = 1
triggerall = stateno != [100,105]
triggerall = inguarddist && StateType != A && P2statetype = C && P2Movetype = A
triggerall = Pos Y != [-1,-999]
trigger1 = stateno = 150
trigger1 = 1
value = 152

[State -1, AI Crouch to Stand Guard Transition]
type = ChangeState
triggerall = var(59) = 1
triggerall = (stateno != [100,105]) && Statetype != A && P2statetype != C && P2Movetype = A
trigger1 = 1
trigger1 = stateno = 152
value = 150

[State -1]
type = ChangeState
triggerall = var(59) = 1 
triggerall = stateno != [100,105]
triggerall = (Ctrl) && (p2movetype = A) && (statetype = A)
trigger1 = (p2bodydist X <= 500) && (random <= 800)
value = 132

[State -1]
type = ChangeState
triggerall = var(59) = 1 
triggerall = stateno != [100,105]
triggerall = (Ctrl) && (p2movetype = A) && (statetype = C)
trigger1 = (p2bodydist X <= 500) && (random <= 800)
value = 131

[State -1]
type = ChangeState
triggerall = var(59) = 1
triggerall = stateno != [100,105]
triggerall = (Ctrl) && (p2movetype = A) && (statetype = S) && (p2statetype != C)
trigger1 = (p2bodydist X <= 500) && (random <= 800)
value = 130


[State -1, AI run]
type=changestate
value=100
triggerall = roundstate = 2
triggerall=var(59)=1 && statetype=S && ctrl && random < 149
triggerall = p2bodydist y =[-270,0]
trigger1= ((stateno!=[100,105]) && p2movetype!=A && (p2bodydist x=[150,788]))||(p2movetype=H && p2statetype=A&&(stateno!=[100,105]) && p2bodydist x >35)

[State -1, AIRun Back]
type = ChangeState
value = 105
triggerall = var(59)=1
triggerall = stateno !=105
triggerall = statetype != A
triggerall = random < 149
triggerall = var(58)!=2
triggerall = roundstate = 2
triggerall = ctrl
trigger1 = (p2statetype =L || p2movetype = A) && (p2bodydist x=[-99,15])

[State -1, AI5]
Type = ChangeState
Triggerall = (RoundState = 2) && (var(59)=1)
Triggerall = StateType !=A
triggerall = stateno != [800,3999]
Triggerall = (P2BodyDist Y = [-65,0])&&enemy,vel y >=0
Triggerall = Random <= 600
triggerall = p2bodydist x = [0,35]
triggerall = p2statetype != L
triggerall = p2stateno !=[120,150]
triggerall = movetype !=H
Triggerall = stateno !=410
Triggerall = stateno !=200
trigger1 = ctrl
value =200

[State -1, AI2]
Type = ChangeState
Triggerall = (RoundState = 2) && (var(59)=1)
Triggerall = StateType !=A
triggerall = stateno != [800,3999]
Triggerall = P2BodyDist Y = [-30,0]
Triggerall = Random < 600
triggerall = p2statetype != L
triggerall = p2stateno !=[120,150]
Triggerall = stateno !=410
Triggerall = stateno !=205
triggerall = movetype !=H
triggerall = ctrl
trigger1 = enemynear,numhelper > 0
trigger1 = enemynear,hitdefattr = SCA,NP,SP,HP,NA
trigger2 = enemynear,numproj > 0
value = 205

;Stand Strong Punch
;立ち強パンチ
[State -1, AI]
type = ChangeState
value = ifelse(p2bodydist x <=20,202,203)
Triggerall = (RoundState = 2) && (var(59)=1)
Triggerall = StateType !=A
triggerall = stateno != [800,3999]
Triggerall = (P2BodyDist Y = [-75,0])&&enemy,vel y >=0
Triggerall = Random < 300
triggerall = p2statetype != L
triggerall = p2stateno !=[120,150]
Triggerall = stateno !=220
triggerall = movetype !=H
triggerall = p2bodydist x = [0,30]
trigger1= stateno = 200&& movecontact && time >=4




;Jump Light Punch
;空中弱パンチ
[State -1, AI9]
type = ChangeState
value = 600
triggerall = var(59)=1
triggerall = statetype = A
triggerall = stateno !=601
triggerall = stateno !=602
triggerall = var(50) =1
triggerall = vel y >=-2||p2statetype=A
Triggerall = (P2BodyDist X = [0,60])
triggerall = p2bodydist y = [-30,50]
Triggerall = Random <= 500
triggerall = roundstate = 2
trigger1 = ctrl

;Jump Light Kick
[State -1, AI9]
type = ChangeState
value = 603
triggerall = var(59)=1
triggerall = statetype = A
triggerall = stateno !=601
triggerall = stateno !=602
triggerall = var(50) =1
triggerall = vel y >=-2||p2statetype=A
Triggerall = (P2BodyDist X = [0,65])
triggerall = p2bodydist y = [-30,70]
Triggerall = Random <= 500
triggerall = roundstate = 2
trigger1 = ctrl

[State -1,Grab]
type = ChangeState
value = ifelse(random<350,800,825)
triggerall = (var(59) = 1)
triggerall = stateno != [3000,8000]
triggerall = (prevstateno != [3000,8000])
triggerall = power >=200
trigger1 =  random <= 400 && stateno != [100,107]
trigger1 = p2stateno != 131 && p2stateno != 130 && P2bodydist X <= 30 && p2stateno != 1302 && statetype != A && p2statetype != A && p2statetype != L && p2stateno != 5120
trigger1 = p2movetype != H && p2movetype != A && ctrl

[State -1, AI9]
Type = ChangeState
Triggerall = (RoundState = 2) && (var(59) = 1)
Triggerall = StateType !=A
triggerall = stateno != [800,3999]
Triggerall = Random < 49
triggerall = p2statetype != L
triggerall = p2statetype != A
triggerall = p2stateno !=[120,150]
triggerall = p2bodydist x = [0,200]
triggerall = var(11) <= 12
triggerall = stateno != [800,3999]
triggerall = movetype !=H ||   ((stateno =[150,153]) && !hitshakeover)
trigger1 = ctrl||   ((stateno =[150,153]) && !hitshakeover)
trigger2= p2movetype=A && (ctrl ||((stateno =[150,153]) && !hitshakeover))
value = 825


[State -1, AI ki_blast]
type = ChangeState
trigger1 = Ctrl 
trigger1 = RoundState = 2
trigger1 = var(59) =1
triggerall = (prevstateno != [3000,8000])
triggerall = power >=160
trigger1 = p2bodydist X >= 90
trigger1 = Random <= 100
trigger1 = statetype = S 
trigger1 = p2statetype != C
value    = 1000

[State -1, AI miniCell / kame]
type = ChangeState
value = ifelse(random<300,1060,2000)
triggerall = stateno != [3000,8000]
triggerall = (prevstateno != [3000,8000])
Triggerall = numhelper(7200) < 1
triggerall = (roundstate = 2) && (var(59) = 1)
triggerall = (Ctrl) && (Statetype = S) && (random = [0,100])
trigger1 = ((p2bodydist x >= 90)) && (prevstateno != 5120) && (p2movetype != H) && (statetype != A)

[State -1, AIgh]
type = ChangeState
value = 2010
triggerall = var(59) =1 && StateType != A
triggerall = roundstate = 2
Triggerall = (P2BodyDist Y = [-180,-1]) && enemy,vel y >0
triggerall = p2bodydist x<=120
triggerall = stateno !=[800,4999]
triggerall = p2statetype != L
triggerall = !(EnemyNear,IsHelper)
triggerall = movetype != H ||   ((stateno =[150,153]) && !hitshakeover)
triggerall =(random <= 79)
triggerall = var(11) <= 12
trigger1 = ctrl||   ((stateno =[150,153]) && !hitshakeover)

[State -1, AI kame up]
type = ChangeState
value = 2001
triggerall = (var(59) = 1) && roundstate =2 &&statetype!=A
triggerall = (p2stateno!=[120,155])
triggerall = (enemy,vel y>-1)
triggerall = numhelper(3001) <= 0
triggerall = random < 22
triggerall = stateno != 2500
triggerall = p2statetype != L
triggerall = var(11) <= 12
triggerall = movetype != H||   ((stateno =[150,153]) && !hitshakeover)
triggerall = (p2bodydist y = [-150,-1])
triggerall = p2bodydist x<=80
trigger1 = ctrl ||   ((stateno =[150,153]) && !hitshakeover)

[State -1, AI]
type = ChangeState
value = 2011
triggerall = var(59) =1 && StateType != A
triggerall = roundstate = 2
triggerall = (p2bodydist y=[-180,0])&& enemy,vel y >=0
triggerall = stateno !=[800,4999]
triggerall = p2statetype != L
triggerall = (p2bodydist x =[0,40]) ||(p2bodydist x >5 && p2statetype=A)
Triggerall =  random <= 99
triggerall = stateno !=[800,899]
triggerall = var(11)<4
triggerall = p2movetype!=I
triggerall = movetype != H  ||   ((stateno =[150,153]) && !hitshakeover)
trigger1 = (ctrl&&(p2movetype!=I||p2statetype!=A))||   ((stateno =[150,153]) && !hitshakeover)
trigger2= (stateno=[200,430]) && movehit
trigger3 = p2movetype=A && (ctrl ||((stateno =[150,153]) && !hitshakeover))
trigger4= p2statetype=A&& (ctrl ||((stateno =[150,153]) && !hitshakeover))
triggerall = p2stateno !=[120,150]

[State -1, AI dodge]
type = changestate
value = 1090
triggerall = roundstate = 2
triggerall = var(59) =1 && StateType != A
triggerall = var(58) = 0
trigger1 =  random < 249
triggerall = p2movetype = A
triggerall=ctrl
triggerall = movetype !=H

[State -1, AI air death beam]
type = ChangeState
value = 1004
triggerall = (var(59) = 1) && roundstate =2 &&statetype=A
triggerall = pos y < -25
triggerall = stateno!=1004
triggerall = prevstateno!=1004
triggerall = p2statetype != L
triggerall = (P2BodyDist X = [0,80])
triggerall = p2bodydist y =[-10,200]
triggerall = random < 99
triggerall = movetype !=H
triggerall = var(11) <= 12
triggerall = pos y <-20
triggerall = numhelper(1004) < 1
trigger1 = ctrl

[State -1, AI9]
Type = ChangeState
Triggerall = (RoundState = 2) && (var(59) =1)
Triggerall = StateType !=A
triggerall = stateno != [800,3999]
Triggerall = Random < 99
triggerall = ((p2bodydist y=[-45,0]) && p2movetype!=H) || ((p2bodydist y=[-45,0]) &&enemy,vel y >=0 && p2movetype=H)
triggerall = p2stateno !=[120,150]
triggerall = p2statetype != L
triggerall = p2bodydist x = [0,75]
triggerall = var(11) <= 12
triggerall = movetype != H||   ((stateno =[150,153]) && !hitshakeover)
trigger1 = ctrl||   ((stateno =[150,153]) && !hitshakeover)
trigger2= stateno = 200 && movecontact
trigger3 = stateno = 205 && movecontact
trigger4= stateno = 203 && movecontact
trigger5 = stateno = 402 && movecontact
trigger6 = stateno = 403 && movecontact
value = 1050

[State -1, GigaCell Burn] 
type = ChangeState
triggerall = (roundstate = 2) && (var(59) = 1)
triggerall = stateno != [3000,8000]
triggerall = (prevstateno != [3000,8000])
triggerall = (p2bodydist x >= 115)
triggerall = (Ctrl=1) && (Statetype != A) && (p2statetype != A)
triggerall = stateno < 4900 ;Add to avoid chaining hypes
trigger1 = prevstateno != 5120
trigger1 = (power = [1000,1500]) && (random = [0,100])
value = 4010

[State -1, kamehamehaaa!!] 
type = ChangeState
triggerall = (roundstate = 2) && (var(59) = 1)
triggerall = stateno != [3000,8000]
triggerall = (prevstateno != [3000,8000])
triggerall = p2bodydist x >95
triggerall = (Ctrl=1) ;&& (Statetype != A) && (p2statetype != A)
triggerall = stateno < 4900 ;Add to avoid chaining hypes
trigger1 = prevstateno != 5120
trigger1 = (power = [1500,2500]) && (random = [0,160])
value = ifelse(statetype=A,3001,3000)

[State -1, GigaCell Meteor]
type = ChangeState
value = 4000
triggerall = (var(59) = 1) && roundstate =2 &&statetype!=A
triggerall = (p2stateno!=[120,155])
triggerall = numhelper(3001) <= 0
triggerall = random < 129
triggerall = life <=300
triggerall = p2statetype != L
triggerall = p2bodydist x = [0,200]
triggerall = p2statetype !=A
trigger1 = ctrl||   ((stateno =[150,153]) && !hitshakeover)
;===========================================================================
;---------------------------------------------------------------------------
; Hyper Kamehame Ha (level 1)
[State -1]
type = ChangeState
value = 3000
triggerall = command = "kame"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
; Hyper Kamehame Ha (level 2)
[State -1]
type = ChangeState
value = 3000
triggerall = command = "kame1"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
; Hyper Kamehame Ha (level 1) no ar
[State -1]
type = ChangeState
value = 3001
triggerall = command = "kame"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Hyper Kamehame Ha (level 2)no ar
[State -1]
type = ChangeState
value = 3001
triggerall = command = "kame1"
triggerall = power >= 1000
triggerall = numproj = 0
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Giga Cell Combination ( Meteor Attack )
[State -1]
type = ChangeState
value = 4000
triggerall = command = "GigaCell"
triggerall = power >= 1000
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
; Giga Cell Combination ( Meteor Attack )
[State -1]
type = ChangeState
value = 4000
triggerall = command = "GigaCell2"
triggerall = power >= 1000
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
; Giga Burn ( Meteor Attack )
[State -1]
type = ChangeState
value = 4010
triggerall = command = "GigaBurn"
triggerall = power >= 1000
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
; Giga Burn ( Meteor Attack )
[State -1]
type = ChangeState
value = 4010
triggerall = command = "GigaBurn2"
triggerall = power >= 1000
trigger1 = ctrl = 1
trigger1 = statetype != A

;---------------------------------------------------------------------------
;RunFwd
[State -1]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;RunBack
[State -1]
type = ChangeState
value = 105
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"


;===========================================================================
;---------------------------------------------------------------------------
; KI energizer
[State -1]
type = ChangeState
value = 700
triggerall = power < 3000
trigger1 = command = "hold_s"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; KI energizer ( no ar )
[State -1]
type = ChangeState
value = 702
triggerall = power < 3000
triggerall = command = "hold_s"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Voar 
[State -1]
type = ChangeState
value = 1800
triggerall = command = "fly"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Voar ( no ar)
[State -1]
type = ChangeState
value = 1900
triggerall = command = "fly"
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jogada
[State -1]
type = ChangeState
value = 800
trigger1 = command = "fwd_b"
trigger1 = statetype = S
trigger1 = stateno != 100
trigger1 = p2movetype != H
trigger1 = p2statetype != A
trigger1 = ctrl = 1
trigger1 = P2bodydist X <= 10

;---------------------------------------------------------------------------
; Energy Release
[State -1]
type = ChangeState
value = 2011
triggerall = command = "energy"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Giga Shoulder ( ou counter ) 
[State -1]
type = ChangeState
value = 1090
triggerall = command = "fwd_yb"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Giga Shoulder ( ou counter ) 
[State -1]
type = ChangeState
value = 1090
triggerall = command = "back_yb"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Levitation Slicer 
[State -1]
type = ChangeState
value = 825
triggerall = command = "levi"
triggerall = P2bodydist X >= 45
trigger1 = ctrl = 1
trigger1 = statetype = S

;---------------------------------------------------------------------------
; Cell Jr. Attack 
[State -1]
type = ChangeState
value = 1060
triggerall = command = "Cell Jr. Attack"
triggerall = P2Name != "Cell Jr."
triggerall = P4Name != "Cell Jr."
triggerall = NumHelper(1061) = 0
triggerall = NumHelper(1062) = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Cell Jr. Attack (2)
[State -1]
type = ChangeState
value = 1060
triggerall = command = "Cell Jr. Attack2"
triggerall = P2Name != "Cell Jr."
triggerall = P4Name != "Cell Jr."
triggerall = NumHelper(1061) = 0
triggerall = NumHelper(1062) = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Cell Combo (B)
[State -1]
type = ChangeState
value = 1050
triggerall = command = "QCB_b"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Power Attack
[State -1]
type = ChangeState
value = 2010
triggerall = command = "QCF_b"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Energy Dan
[State -1]
type = ChangeState
value = 1000
triggerall = command = "QCF_y"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Energy Dan reto (no ar)
[State -1]
type = ChangeState
value = 1001
triggerall = command = "QCB_y"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Energy Dan para cima (no ar) 
[State -1]
type = ChangeState
value = 1002
triggerall = command = "QCF_y"
triggerall = P2Dist Y <= -20
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Energy Dan para baixo (no ar) 
[State -1]
type = ChangeState
value = 1003
triggerall = command = "QCF_y"
triggerall = P2Dist Y <= 3000
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Negative Arrow ( no pulo )
[State -1]
type = ChangeState
value = 1004
triggerall = command = "negative"
triggerall = numproj = 0
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Katsuu Energy Dan
[State -1]
type = ChangeState
value = 1010
triggerall = command = "katsuu"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Katsuu Energy Dan ( no ar )
[State -1]
type = ChangeState
value = 1005
triggerall = command = "katsuu"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Cho Kamehame Ha 
[State -1]
type = ChangeState
value = 2000
triggerall = command = "minikame"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Cho Kamehame Ha 
[State -1]
type = ChangeState
value = 2000
triggerall = command = "minikame1"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Cho Kamehame Ha ( no voo )
[State -1]
type = ChangeState
value = 2002
triggerall = command = "minikame"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Cho Kamehame Ha ( no voo )
[State -1]
type = ChangeState
value = 2002
triggerall = command = "minikame1"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Kamehame Ha ( para cima )
[State -1]
type = ChangeState
value = 2001
triggerall = command = "QCF_x"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Kamehame Ha ( para cima )
[State -1]
type = ChangeState
value = 2001
triggerall = command = "QCF_a"
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Kamehame Ha ( para cima no voo)
[State -1]
type = ChangeState
value = 2003
triggerall = command = "QCF_x"
triggerall = P2Dist Y <= -20
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Kamehame Ha ( para cima no voo)
[State -1]
type = ChangeState
value = 2003
triggerall = command = "QCF_a"
triggerall = P2Dist Y <= -20
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Kamehame Ha ( para baixo no voo)
[State -1]
type = ChangeState
value = 2004
triggerall = command = "QCF_x"
triggerall = P2Dist Y <= 3000
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; Kamehame Ha ( para baixo no voo)
[State -1]
type = ChangeState
value = 2004
triggerall = command = "QCF_a"
triggerall = P2Dist Y <= 3000
triggerall = numproj = 0
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; soco fraco (perto)
[State -1]
type = ChangeState
value = 201
trigger1 = command = "y"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = P2bodydist X <= 6

; soco fraco
[State -1]
type = ChangeState
value = 200
triggerall = command = "y";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; chute fraco
[State -1]
type = ChangeState
value = 202
triggerall = command = "x";Place name of command here
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; soco forte (perto)
[State -1]
type = ChangeState
value = 204
trigger1 = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = P2bodydist X <= 6

; Soco forte
[State -1]
type = ChangeState
value = 205
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900
 
;---------------------------------------------------------------------------
; Chute forte
[State -1]
type = ChangeState
value = 203
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger2 = stateno = 1900

;---------------------------------------------------------------------------
; soco fraco abaixado
[State -1]
type = ChangeState
value = 400
triggerall = command = "y"
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; chute fraco abaixado
[State -1]
type = ChangeState
value = 401
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; soco forte abaixado
[State -1]
type = ChangeState
value = 402
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; chute forte abaixado
[State -1]
type = ChangeState
value = 403
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; soco fraco no ar
[State -1]
type = ChangeState
value = 600
trigger1 = command = "y"
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; chute fraco no ar
[State -1]
type = ChangeState
value = 602
trigger1 = command = "x"
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Chute forte no ar
[State -1]
type = ChangeState
value = 603
trigger1 = command = "a"
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Soco forte no ar
[State -1]
type = ChangeState
value = 601
trigger1 = command = "b"
trigger1 = statetype = A
trigger1 = ctrl = 1
