; 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)
;   buffer.time = time (optional)
;
; - 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. Each of these
;   buttons or directions is referred to as a "symbol".
;   Directions and buttons can be preceded by special characters:
;   slash (/) - means the key must be held down
;          egs. command = /D       ;hold the down direction
;               command = /DB, a   ;hold down-back while you press a
;   tilde (~) - to detect key releases
;          egs. command = ~a       ;release the a button
;               command = ~D, F, a ;release down, press fwd, then a
;          If you want to detect "charge moves", you can specify
;          the time the key must be held down for (in game-ticks)
;          egs. command = ~30a     ;hold a for at least 30 ticks, then release
;   dollar ($) - Direction-only: detect as 4-way
;          egs. command = $D       ;will detect if D, DB or DF is held
;               command = $B       ;will detect if B, DB or UB is held
;   plus (+) - Buttons only: simultaneous press
;          egs. command = a+b      ;press a and b at the same time
;               command = x+y+z    ;press x, y and z at the same time
;   greater-than (>) - means there must be no other keys pressed or released
;                      between the previous and the current symbol.
;          egs. command = a, >~a   ;press a and release it without having hit
;                                  ;or released any other keys in between
;   You can combine the symbols:
;     eg. command = ~30$D, a+b     ;hold D, DB or DF for 30 ticks, release,
;                                  ;then press a and b together
;
;   Note: Successive direction symbols are always expanded in a manner similar
;         to this example:
;           command = F, F
;         is expanded when MUGEN reads it, to become equivalent to:
;           command = F, >~F, >F
;
;   It is recommended that for most "motion" commads, eg. quarter-circle-fwd,
;   you start off with a "release direction". This makes the command easier
;   to do.
;
; - time (optional)
;   Time allowed to do the command, given in game-ticks. The default
;   value for this is set in the [Defaults] section below. A typical
;   value is 15.
;
; - buffer.time (optional)
;   Time that the command will be buffered for. If the command is done
;   successfully, then it will be valid for this time. The simplest
;   case is to set this to 1. That means that the command is valid
;   only in the same tick it is performed. With a higher value, such
;   as 3 or 4, you can get a "looser" feel to the command. The result
;   is that combos can become easier to do because you can perform
;   the command early. Attacks just as you regain control (eg. from
;   getting up) also become easier to do. The side effect of this is
;   that the command is continuously asserted, so it will seem as if
;   you had performed the move rapidly in succession during the valid
;   time. To understand this, try setting buffer.time to 30 and hit
;   a fast attack, such as KFM's light punch.
;   The default value for this is set in the [Defaults] section below.
;   This parameter does not affect hold-only commands (eg. /F). It
;   will be assumed to be 1 for those commands.
;
; If you have two or more commands with the same name, all of them will
; work. You can use it to allow multiple motions for the same move.
;
; Some common commands examples are given below.
;
; [Command] ;Quarter circle forward + x
; name = "QCF_x"
; command = ~D, DF, F, x
;
; [Command] ;Half circle back + a
; name = "HCB_a"
; command = ~F, DF, D, DB, B, a
;
; [Command] ;Two quarter circles forward + y
; name = "2QCF_y"
; command = ~D, DF, F, D, DF, F, y
;
; [Command] ;Tap b rapidly
; name = "5b"
; command = b, b, b, b, b
; time = 30
;
; [Command] ;Charge back, then forward + z
; name = "charge_B_F_z"
; command = ~60$B, F, z
; time = 10
;
; [Command] ;Charge down, then up + c
; name = "charge_D_U_c"
; command = ~60$D, U, c
; time = 10


;-| Button Remapping |-----------------------------------------------------
; This section lets you remap the player's buttons (to easily change the
; button configuration). The format is:
;   old_button = new_button
; If new_button is left blank, the button cannot be pressed.
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
; Default value for the "time" parameter of a Command. Minimum 1.
command.time = 15

; Default value for the "buffer.time" parameter of a Command. Minimum 1,
; maximum 30.
command.buffer.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 = "TripleKFPalm"
command = ~D, DF, F, D, DF, F, x
time = 20

[Command]
name = "TripleKFPalm"   ;Same name as above
command = ~D, DF, F, D, DF, F, y
time = 20

[Command]
name = "SmashKFUpper"
command = ~D, DB, B, D, DB, B, x;~F, D, DF, F, D, DF, x
time = 20

[Command]
name = "SmashKFUpper"   ;Same name as above
command = ~D, DB, B, D, DB, B, y;~F, D, DF, F, D, DF, y
time = 20


[Command]
name = "Doggystyle"
command = B
time = 10

[Command]
name = "Cowgirl"
command = U
time = 10

[Command]
name = "Missionary"
command = D
time = 10

[Command]
name = "Release"
command = s
time = 20

[Command]
name = "Futa Grab"
command = B, F , b
time = 20

[Command]
name = "Violent Assault"
command = B, F, c
time = 20

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

;-| Hold Button |---------------------------------------------------------

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

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

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

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

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

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

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

;-| Hold Dir |---------------------------------------------------------

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

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

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

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


;-| Single Dir |---------------------------------------------------------

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

[Command]
name = "down"
command = $D
time = 1

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

[Command]
name = "up"
command = $U
time = 1

;-| Negative Edge |---------------------------------------------------------

[Command]
name = "highjump"
command = $D, $U
time = 15


;-| Special Motions |------------------------------------------------------
[Command]
name = "blocking"
command = $F,x
time = 3

[Command]
name = "blocking" ;Same name as above (buttons in opposite order)
command = x,$F
time = 3

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

[Command]
name = "a+b" 
command = a+b
time = 3

[Command]
name = "x+y" 
command = x+y
time = 3

[Command]
name = "x+a" 
command = x+a
time = 3

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


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

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

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

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

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

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

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

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

[Command]
name = "QCF_xy"
command = x+y

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

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

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

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

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

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

[Command]
name = "QCF_ab"
command = ~D, DF, F, a+b

[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 = "swift"
command = s
time = 1

[Command]
name = "Upper_"
command = $F,x
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





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

;===========================================================================
;---------------------------------------------------------------------------


[State -1, Futa Grab]
type = ChangeState
value = 65500
triggerall = ctrl && statetype != A && !AILevel
trigger1 = command = "Futa Grab"
ctrl = 0

[State -1, Futa Violent Grab]
type = ChangeState
value = 67500
triggerall = ctrl && statetype != A && !AILevel
trigger1 = command = "Violent Assault"
ctrl = 0


[State -1, Futa AI Grab]
type = ChangeState
value = 65500
triggerall = ctrl && StateType != A && AILevel && RoundState = 2
triggerall = Gametime > 500
triggerall = enemynear,statetype != L
trigger1 = abs(enemynear,Pos X - Pos X) <= 90
ctrl = 0

[State -1, Futa AI Violent Grab]
type = ChangeState
value = 67500
triggerall = ctrl && StateType != A && AILevel && RoundState = 2
triggerall = Gametime > 500 
triggerall = enemynear,statetype != L
trigger1 = (Gametime % 15) = 0 && random < 250


[State -1, Luxirous High kick]
type = ChangeState
value = 1200
triggerall = !ailevel
triggerall = command = "upper_b"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = stateno = 220 && (animelemtime(5) >=5 || movecontact)
trigger3 = (stateno = [200,499]) && movecontact
trigger4 = (stateno = 1800) && movehit

[State -1, Tri Axel kick]
type = ChangeState
value = 21000
triggerall = !ailevel
triggerall = command = "QCF_z"
triggerall = statetype = A
triggerall = power >= 3000 || (power >=1000 && p2life <= 333)
trigger1 = ctrl
trigger2 = stateno = 220 && (animelemtime(5) >=5 || movehit)
trigger3 = (stateno = [200,499]) && movehit
trigger4 = (stateno = [600,699]) && movehit
trigger4 = stateno != 620
trigger5 = stateno = 1200 && movehit
trigger6 = stateno = 1800 && movehit


[State -1, air dbl kick]
type = ChangeState
value = 1225
triggerall = !ailevel
triggerall = command = "QCF_b"
triggerall = statetype = A && numexplod(12251) = 0
trigger1 = ctrl
trigger2 = (stateno = [600,699]) && movecontact
trigger2 = stateno != 620


[State -1, Dive kick bounce]
type = ChangeState
value = 1201
triggerAll = numexplod(10161) = 0
triggerAll = !AILevel
triggerAll = command = "QCF_x"
triggerAll = RoundState = 2 && StateType = A
trigger1 = ctrl || (StateNo = [600,699]) || (stateno = 1200)


[State -1, Drill kick EX]
type = ChangeState
value = 1725
triggerAll = !AILevel
triggerAll = power >= 2000
triggerAll = command = "QCB_x"
triggerAll = RoundState = 2 && StateType = A
trigger1 = ctrl || (StateNo = [600,699]) || (stateno = 1200)


[State -1, air grab]
type = ChangeState
value = 2100
triggerall = !ailevel
triggerall = command = "x+y"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = (stateno = [600,699]) && movecontact
trigger2 = stateno != 620


[State -1, Luxirous High kick]
type = ChangeState
value = 1200
triggerall = !ailevel
triggerall = command = "b"
triggerall = statetype != A
trigger1 = (StateNo = [100,101])

[State -1, Swift]
type = ChangeState
value = 15000
triggerall = !ailevel
triggerall = command = "QCB_y"
triggerall = statetype != A && power >= 2000
trigger1 = ctrl 
trigger2 = (stateno = [200,499]) 
trigger2 = stateno != 480
trigger2 = stateno != 240
trigger2 = stateno != 425
trigger3 = stateno = 253 && animelemtime(9) >= 5
trigger4 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)


[State -1, signal beam]
type = ChangeState
value = 13000
triggerall = !ailevel
triggerall = command = "QCB_x"
triggerall = statetype != A && power >= 2000
trigger1 = ctrl 
trigger2 = (stateno = [200,499]) 
trigger2 = stateno != 480
trigger2 = stateno != 240
trigger2 = stateno != 425
trigger3 = stateno = 253 && animelemtime(9) >= 5
trigger4 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)

[State -1, low sweep]
type = ChangeState
value = 1800
triggerall = !ailevel
triggerall = command = "QCF_x"
triggerall = statetype != A
trigger1 = ctrl|| (StateNo = [100,101])
trigger2 = (stateno = [200,499]) && movecontact
;trigger3 = stateno = 1310 || stateno = 1330 ;quick guard

;low sweep
[State -1, low sweep]
type = ChangeState
value = 1800
triggerall = !ailevel
triggerall = command = "x"
triggerall = statetype != A
trigger1 = (StateNo = [100,101])


;Double kick
[State -1, Double kick]
type = ChangeState
value = 1625
triggerall = !ailevel
triggerall = command = "QCF_a"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
;trigger3 = stateno = 1310 || stateno = 1330 ;quick guard

;Double kick
[State -1, Double kick]
type = ChangeState
value = 1625
triggerall = !ailevel
triggerall = command = "a"
triggerall = statetype != A
trigger1 = stateno = 100



;Dash 2
[State -1, Dash 2]
type = ChangeState
value = 100
triggerall = !ailevel
triggerall = command != "QCF_a"
triggerall = command = "QCF"
triggerall = statetype != A
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact










[State -1,  Sub AI]
type = ChangeState
value = 7777
triggerall = var(40) >= 2000
triggerall = !numexplod(70501) 
triggerall = ailevel && palno != 12
triggerall = RoundState = 2 
triggerall = alive = 1 && (movetype = H ||ctrl) && Time >= 1
trigger1 =   Life <= 1
trigger1 =   Random < (999 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger2 =   var(40) >= 2000
trigger2 =   Random < (999 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))


[State -1]; The engine will still guard by through pressing the back button, we need to disable that.
Type=Assertspecial
Triggerall=StateNo!=[120,160]
Trigger1=AILevel
trigger1 = !numhelper(34999)
trigger1 = !numhelper(37499)
Trigger2= numhelper(4900)
flag=noairguard
flag2=nocrouchguard
flag3=nostandguard


[State -1, Run]
type = ChangeState
value = 100
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && StateType = S
triggerall = ctrl && (StateNo != [100,106])
trigger1 = (EnemyNear, MoveType != A) && P2BodyDist x >= 80 && Random < (25 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = (p2stateno = [1665,1666]) && p2movetype = h && P2BodyDist x >= 80

[State -1, parry]
type = ChangeState
value =  740
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && StateType != A
Triggerall = !numhelper(4900)
triggerall = (facing=1 && (enemy,facing=-1)) || (facing=-1 && (enemy,facing=1))
triggerall = (ctrl || (StateNo = [100,101])) && !var(26)
trigger1 = Random < ceil(325 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = (EnemyNear, MoveType = A) && !(EnemyNear, HitDefAttr = SCA,AT) && (p2bodydist x = [ 0, 150])

[State -1, parry]
type = ChangeState
value =  740
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && StateType != A
triggerall = ctrl || StateNo = 766 || (StateNo = [100,101]) ;&& !var(26)
trigger1 = Random < ceil(666 +150 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = (EnemyNear, MoveType = A) && (EnemyNear, HitDefAttr = SCA,HP,HA,SP,SA) && EnemyNear,animtime 
trigger1 = (facing=1 && (enemy,facing=-1)) || (facing=-1 && (enemy,facing=1))
trigger2 = Random < (125 +600 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 
trigger2 = !numhelper(34999)
trigger2 = !numhelper(37499)
trigger2 = enemynear,movetype = A && (EnemyNear, HitDefAttr = SCA,HP,HA,SP,SA)
trigger2 = enemynear,numproj
trigger2 = enemy,numproj||enemy(numenemy>1),numproj 
trigger2 = p2dist x = [0,200]
trigger3 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger3 = PlayerID(helper(33333333),var(3)), pos y > -200 || PlayerID(helper(33333333),var(3)), vel y > 0 ; Avoid attempt to reflect projectiles that are to high. 100 = char height or reflector height, unless the enemy projectile is moving downwards.
trigger3 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
trigger3 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) = [0,25]
trigger3 = Random < 333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))
trigger3 = !numhelper(34999)
trigger3 = !numhelper(37499)

[State -1,Blocking]
type = hitoverride
triggerall = AILevel && NumEnemy
Trigger1 = statetype != A  || stateno = 5120 || (StateNo = [100,101])
Trigger1 = ctrl  || ((stateno=[740,766]) && movetype=I)
attr = SA,AA,AP
stateno = 740
slot = 0
time = 8

[State -1,Blocking]
type = hitoverride
triggerall = AILevel && NumEnemy
triggerall = numhelper(37499) = 0
triggerall = numhelper(7050) = 0
Trigger1 = statetype != A  || stateno = 5120
Trigger1 = ctrl  || (movetype=I)
attr = SA,AT
stateno = 1700
slot = 0
time = 8


[State -1,Blocking]
type = hitoverride
triggerall = AILevel && NumEnemy
Trigger1 = statetype = A  
Trigger1 = ctrl  || ((stateno=766) && movetype=I)
attr = SA,AA,AP
stateno = 771
slot = 0
time = 8



[State -1, parry spin throws]
type = ChangeState
value =  1700
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && StateType != A
triggerall = numhelper(37499) = 0
triggerall = numhelper(7050) = 0
triggerall = (ctrl || (StateNo = [100,101])) || (StateNo = [120, 155]) 
trigger1 = Random < ceil(325 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = (EnemyNear, MoveType = A) && (EnemyNear, HitDefAttr = SCA,AT) && (p2bodydist x = [ 0, 150])

trigger2 = PlayerIdExist(helper(4444444),var(3)) ;enemy projectile exists
trigger2 = (((PlayerID(helper(4444444),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(4444444),var(3)),const(size.ground.front))  = [0,25]
trigger2 = Random < 150 + 333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))




;Quick guard ex ai
[State -1, Quick guard ex]
type = ChangeState
value = 741
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && StateType != A
triggerall = power >= 1000
triggerall = (EnemyNear, MoveType = A) && !(EnemyNear, HitDefAttr = SCA,AT)
triggerall = stateno != 253
triggerall = stateno != 260

trigger1 = Random < (ifElse((EnemyNear, HitDefAttr = SCA, NA), 100, ifElse((EnemyNear, HitDefAttr = SCA, SA), 333, 1000)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger1 = (stateno = [200,499]) || stateno = 1800 || stateno = 1625 || (stateno = 19500 &&  animelemtime(5) >= 2) || (stateno = 19550 && numhelper(22500))

trigger2 = (stateno = 1800 || stateno = 1625 )
trigger2 = moveguarded || !movecontact
trigger2 = Random < (ifElse((EnemyNear, HitDefAttr = SCA, NA), 100, ifElse((EnemyNear, HitDefAttr = SCA, SA), 333, 1000)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))

trigger3 = (stateno = [200,499]) || stateno = 1800 || stateno = 1625 || (stateno = 19500 &&  animelemtime(5) >= 2) || (stateno = 19550 && numhelper(22500))
trigger3 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger3 = PlayerID(helper(33333333),var(3)), pos y > -100 || PlayerID(helper(33333333),var(3)), vel y > 0 ; Avoid attempt to reflect projectiles that are to high. 100 = char height or reflector height, unless the enemy projectile is moving downwards.
trigger3 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
trigger3 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) = [0,5]
trigger3 = Random < 333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))
trigger3 = !numhelper(34999)
trigger3 = !numhelper(37499)
ignorehitpause = 1

[State -1, agility fwd]
type = ChangeState
value = 700
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 
triggerall = var(28):=1 || 1

;vs projectiles, vs throws and corner is too close, on the ground

;on the ground
trigger1 =  StateNo = 5210 || StateNo = 5201 || StateNo = 5120
trigger1 = (p2bodydist x = [0, 100]) && BackEdgeBodyDist <= 40 && time >= 3
trigger1 = Random < 50 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))

;vs projectiles
trigger2 = (p2bodydist x = [100, 999]) 
trigger2 = (ctrl || (StateNo = [100,101])) || StateNo = 150 || StateNo = 152
trigger2 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger2 = PlayerID(helper(33333333),var(3)), pos y > -100 || PlayerID(helper(33333333),var(3)), vel y > 0 ; Avoid attempt to reflect projectiles that are to high. 100 = char height or reflector height, unless the enemy projectile is moving downwards.
trigger2 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
trigger2 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) = [0,25]
trigger2 = Random < 25 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))
trigger2 = !numhelper(34999)
trigger2 = !numhelper(37499)

;vs throws
trigger3 = (EnemyNear, MoveType = A) && (EnemyNear, HitDefAttr = SCA,AT) && (P2BodyDist x = [0,100])
trigger3 = (ctrl || (StateNo = [100,106])) || StateNo = 150 || StateNo = 152
trigger3 = Random < (100+(750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))))
trigger3 = BackEdgeDist < 40

trigger4 = (EnemyNear, MoveType = A) && (EnemyNear, pos x = [-12,12]) && (P2BodyDist y = [-300,-10])
trigger4 = (ctrl || (StateNo = [100,106])) || StateNo = 150 || StateNo = 152
trigger4 = Random < (100+(750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))))
trigger4 = BackEdgeDist < 40


[State -1, agility back]
type = ChangeState
value = 700
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 
triggerall = var(28):=1 || 1
triggerall = BackEdgeDist >= 40
;triggerall = facing = 1
;vs throws vs on the ground enemies
trigger1 = (EnemyNear, MoveType = A) && (EnemyNear, HitDefAttr = SCA,AT) && (P2BodyDist x = [0,100])
trigger1 = (ctrl || (StateNo = [100,106])) || StateNo = 150 || StateNo = 152
trigger1 = Random < (100+(750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))))

trigger2 = (ctrl || (StateNo = [100,106]))
trigger2 = (P2BodyDist x = [0,80]) 
trigger2 = EnemyNear, StateNo = 5120 && EnemyNear, AnimTime >= -2 && Random < (750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, air parry]
type = ChangeState
value =  771
trigger1 = AILevel && NumEnemy
trigger1 = RoundState = 2 && StateType = A
trigger1 = Random < ceil(255 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = ctrl  && !var(26)
trigger1 = (EnemyNear, MoveType = A) && !(EnemyNear, HitDefAttr = SCA,AT) && (p2bodydist x = [ 0, ceil(const(size.xscale) * 200)] )

[State -1, Guard]
type = ChangeState
value = 120
triggerall = AILevel && NumEnemy
triggerall = RoundState = 2 && InGuardDist
triggerall = ctrl && (StateNo != [120, 155]) && !var(20)
triggerall = !var(26) || P2BodyDist x >= 20
triggerall = !(EnemyNear, HitDefAttr = SCA, AT,AP) && (EnemyNear, Time < 120)
triggerall = StateType != A || P2StateType = A
Triggerall = !numhelper(4900)
triggerall = ifElse(StateType = A, ((var(3) != [1, 2]) || StateNo = 5210), 1)
trigger1 = Random < (ifElse((EnemyNear, HitDefAttr = SCA, NA), 100, ifElse((EnemyNear, HitDefAttr = SCA, SA), 333, 1000)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = (EnemyNear, HitDefAttr = SCA, AP)

trigger2 = (EnemyNear, HitDefAttr = SCA, AP) && (EnemyNear, Time < 120)
trigger2 = Random < (ifElse((EnemyNear, HitDefAttr = SCA, NP), 100, ifElse((EnemyNear, HitDefAttr = SCA, SP), 333, 1000)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = enemynear,numproj
trigger2 = enemy,numproj||enemy(numenemy>1),numproj 
trigger2 = (p2bodydist x = [ 0, 200])
trigger2 = !numhelper(37499) && !numhelper(34999)

[State -1, AI projectile against enemy projectile] ;by Inktrebuchet editd By vorse raidier
type = ChangeState
value = 13000
triggerall = ailevel && numenemy
triggerall = ctrl
triggerall = statetype != a
triggerall = power >= 2000 && (numhelper(35501) || numhelper(37499))
triggerall = random >= (50+150*numhelper(35501)+ 333*ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
triggerall = (enemynear,const(size.mid.pos.y)= [-60,20])
trigger1 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger1 = PlayerID(helper(33333333),var(3)), pos y > -100 ; Avoid attempt to counter projectiles that are to high. 100 = char height
trigger1 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
;distance / velocity = time >= startup time
trigger1 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) >= 5 ;5= startup time
 

[State -1, AI Reflect enemy projectile] 
type = ChangeState
value = 740
triggerall = ailevel && numenemy  
triggerall = ctrl || stateno = 150 || stateno = 120
triggerall = !numhelper(35501)
triggerall = !numhelper(37499) 
triggerall = random >= (100+ 450*ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
triggerall = statetype != A 
trigger1 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger1 = PlayerID(helper(33333333),var(3)), pos y > -100 || PlayerID(helper(33333333),var(3)), vel y > 0 ; Avoid attempt to reflect projectiles that are to high. 100 = char height or reflector height, unless the enemy projectile is moving downwards.
trigger1 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
;distance / velocity = time = startup time + active 
trigger1 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) = [0,5] ; 5 = startup time, 22 = active ; [0,5] for last second reflect.
 

[State -1, AI Reflect enemy projectile] ;by Inktrebuchet
type = ChangeState
value = 740
triggerall = ailevel && numenemy  
triggerall = ctrl || stateno = 150 || stateno = 120
triggerall = !numhelper(35501)
triggerall = !numhelper(37499)
triggerall = statetype != A 
trigger1 = PlayerIdExist(helper(33333333),var(3)) ;enemy projectile exists
trigger1 = PlayerID(helper(33333333),var(3)), pos y > -200 || PlayerID(helper(33333333),var(3)), vel y > 0 ; Avoid attempt to reflect projectiles that are to high. 100 = char height or reflector height, unless the enemy projectile is moving downwards.
trigger1 = PlayerID(helper(33333333),var(3)), vel x != 0 ; Avoid "Division by Zero" debug overflow
trigger1 = random >= (100+ 333*ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
;distance / velocity = time = startup time + active 
trigger1 = (((PlayerID(helper(33333333),var(3)), pos x - pos x )* facing) - const(size.ground.front) - PlayerID(helper(33333333),var(3)),const(size.ground.front)) / (PlayerId(helper(33333333),var(3)),vel x) = [0,15] ; 5 = startup time, 22 = active ; [0,5] for last second reflect.
trigger2 = Random < (200 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 
trigger2 = enemynear,movetype = A
trigger2 = enemynear,numproj
trigger2 = enemy,numproj||enemy(numenemy>1),numproj 
 

 [State -1, Dash Backward%]
type = ChangeState
value = 105
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = S
triggerAll = ctrl && (StateNo != [100,106]) && !var(26)
trigger1 = (EnemyNear, MoveType = A) && BackEdgeDist >= 40 && (P2BodyDist x = [40,60]) && (EnemyNear, vel x)
trigger1 = Random < (ifElse((EnemyNear, HitDefAttr = SC, AT), 150, 50) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = (P2BodyDist x = [0,40]) && BackEdgeBodyDist >= 40
trigger2 = EnemyNear, StateNo = 5120 && EnemyNear, AnimTime = -4 && Random < (750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

[State -1, Zero Counter]
type = ChangeState
value = 2900
trigger1 = AILevel && NumEnemy
trigger1 = StateNo = 150 || StateNo = 152
trigger1 = RoundState = 2 && StateType != A
trigger1 = Power >= 2000 
trigger1 = Random < (450* ifelse(Life < 0.50 * LifeMax, 2,1)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))

[State -1, air to axel]
type = ChangeState
value = 17800
triggerAll = AILevel && numenemy
triggerall = power >=2000
triggerAll = RoundState = 2 && (StateType = A)
triggerall = ctrl || (StateNo = [610,699]) || (stateno = 1200 && animelemtime(6) >= 0)  
triggerall = pos y <= -20
triggerall = stateno != 600
trigger1 = (p2bodydist x = [60,125]) && (p2dist y = [0,200]) && random < (250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger1 = P2statetype != a && (ctrl || movecontact)
trigger2 = (p2bodydist x = [0,75]) && (p2dist y = [0,200]) && random < (500 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger2 =  stateno = 640 && movecontact
trigger3 = (p2bodydist x = [25,75]) && (p2dist y = [0,200]) && random < (200 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger3 = P2statetype = a && (movehit || ctrl)

[State -1, close combat]  
type =ChangeState
value = 32000
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 && StateType != A 
triggerAll = (P2BodyDist x = [0,250]) && (P2Dist y = [-40,0]) && (enemynear,vel y > -2)
triggerAll = !(EnemyNear, StateNo = [150,155]) 
triggerAll = P2StateType != L  || (P2BodyDist x = [-20,80])
triggerall = p2stateno != 5120 
triggerall = prevstateno != 910
triggerall = prevstateno != 915
triggerall = prevstateno != 810
triggerall = enemynear,StateNo != [150,151]
triggerall = stateno != 480
triggerall = !inguarddist
triggerall = stateno != 240
triggerall = stateno != 425
triggerall = (StateNo = [100,106]) || ctrl || (StateNo = [120, 155]) || ((stateno = [200,499])&& movehit)
triggerall = Power >= 3000 || (Power >= 1000 && p2life <= 333)

;guardcounter
trigger1 = StateNo = 150 || StateNo = 152
trigger1 = Random < (25 * ifelse(Life < 0.75 * LifeMax, 2,1)* ifelse(Life < 0.50 * LifeMax, 2,1)* ifelse(Life < 0.25 * LifeMax, 2,1) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

;scoop from ground
trigger2 = (ctrl || StateNo = 52 || (StateNo = [100,101])) && (EnemyNear, MoveType = H) && (P2BodyDist x = [0,80]) 
trigger2 = Random < (150 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 

;basic moves confirm into hyper
trigger3 =  (stateno = [200,499]) && Random < (200  * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 
trigger3 = MoveHit && (EnemyNear, GetHitVar(HitTime) >= 5) && Random < (150 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))

;override basic attack of foe
trigger4 = !inguarddist
trigger4 = ctrl || (StateNo = [100, 101]) 
trigger4 = numhelper(4900)
trigger4 = Random < (150 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 
trigger4 = (P2StateNo = [200, 699])

;scoop from ground2
trigger5 = Random < (225 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) ) 
trigger5 = p2stateno = 5100 || (!inguarddist && numhelper(35501))
trigger6 = ((P2StateType = a || p2statetype = l) ||(p2stateno = [1665,1666])) && P2MoveType = H  && Random < (333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )




;nihilego
[State -1, nihilego]
type = ChangeState
value = 17500+ 1*statetype = a
triggerAll = AILevel && NumEnemy 
triggerall = numhelper(22500) = 0
triggerall = power >= 1000
triggerall = enemy,power >= 2000
triggerall = ctrl
triggerall = enemynear,vel x = [-1,1]
triggerall= (enemynear, gethitvar(hittime) >= 5) 
;triggerall = enemynear,ctrl =0 
triggerall = p2stateno != 5120 
triggerall = prevstateno != 910
triggerall = prevstateno != 915
triggerall = prevstateno != 810
triggerall = Random < (100*floor(enemy,power/1000) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

trigger1 = ctrl &&  P2StateType = a && P2MoveType = H  
trigger2 = enemynear,backedgedist < 50 



;call poipole ai
[State -1, poipole]
type = ChangeState
value = 19500
triggerAll = AILevel && NumEnemy 
triggerall = numhelper(14250) = 0
triggerAll = RoundState = 2 && StateType != a 
triggerall = enemynear,StateNo != [150,151]
triggerall = ctrl
triggerall = !PlayerIdExist(helper(33333333),var(3)) || numhelper(4900) || numhelper(35501) || numhelper(37500) 
trigger1 = (EnemyNear, MoveType != A) && P2BodyDist x >= 150 && Random < (125 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = (p2stateno = [1665,1666]) && p2movetype = h && P2BodyDist x >= 80
trigger3 = (P2BodyDist x >= 100 ) || (p2bodydist y = [-999,-200])
trigger3 = p2bodydist x != [-5,80]
trigger3 = numhelper(7050)



[State -1, S Light punch]
type = changestate
value = 200
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = (p2bodydist x = [ 0,63])
triggerall = ((p2dist y = [0 , -83]) && (p2dist y = [-115 , 0])) || ((p2bodydist x = [ -10, 33]) && (p2dist y = [-115 , 0]))
triggerall =(EnemyNear, const(size.head.pos.y) >= -35) || (p2bodydist x = [ -10, 33])
;triggerall =( p2dist y = [-115 , -83])  
triggerall = !var(16) && var(15) < 1 && p2statetype != L
triggerall = (enemynear, statetype != A)
trigger1 = ctrl  && random < (200+ 250 * (AIlevel ** 2 / 64.0))

[State -1, S Light punch2]
type = changestate
value = 201
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = (p2bodydist x = [ 0, 68] ) 
triggerall = !var(16) && var(15) < 1 && p2statetype != L
triggerall = (enemynear, statetype != A)
trigger1 = stateno = 200 
trigger1 = movecontact && random < (333+ifelse(moveguarded, 150,150) * (AIlevel ** 2 / 64.0))

[State -1, S Light punch3]
type = changestate
value = 202
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = (p2bodydist x = [ -10, 85] ) 
triggerall = !var(16) && var(15) < 1 && p2statetype != L
triggerall = (enemynear, statetype != A)
trigger1 = stateno = 201
trigger1 = movecontact && random < (550+ifelse(moveguarded, -150,150) * (AIlevel ** 2 / 64.0))

[State -1, S Light kick]
type = changestate
value = 230
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = (p2bodydist x = [ -20, ceil(const(size.xscale) * 190)] ) 
triggerall =(( p2dist y = [-250*ceil(const(size.yscale)) , 0*ceil(const(size.yscale))])) 
triggerall = !var(16) && var(15) < 1 && p2statetype != L
trigger1 = stateno = 202
trigger1 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (333 + 150 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 200
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (50 + 25 * (AIlevel ** 2 / 64.0))
trigger3 = stateno = 400 
trigger3 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (666 * (AIlevel ** 2 / 64.0))
trigger4 = stateno = 490 || stateno = 491
trigger4 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (333 * (AIlevel ** 2 / 64.0))

[State -1, Standing light kick 2]
type = ChangeState
value = 235
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = (p2bodydist x = [ -20, ceil(const(size.xscale) * 300)] ) 
triggerall =(( p2dist y = [-300*ceil(const(size.yscale)) , 0*ceil(const(size.yscale))])) 
triggerall = !var(16) && var(15) < 1 && p2statetype != L
trigger1 = stateno = 230
trigger1 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (200 + 750 * (AIlevel ** 2 / 64.0))

[State -1, C Light kick]
type = changestate
value = 430
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ 0, 72]
triggerall = !var(16) && var(15) < 1
triggerall = ( p2dist y = [-30 , 0] ) && p2statetype != L
triggerall = (enemynear, statetype != A)
trigger1 = ctrl  && random < (200 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 430 
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (50 *var(13) * (AIlevel ** 2 / 64.0))
trigger2 = p2bodydist x = [ 60, 72]
trigger3 = stateno = [200,203]
trigger3 = moveguarded && p2statetype != a && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, knock down punch]
type = changestate
value = 425
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ 0, 100]
triggerall = !var(16) && !var(14)
triggerall = ( p2dist y = [-50 , 0] ) 
triggerall = (enemynear, statetype = s)
triggerall = stateno != 480
triggerall = stateno != 240
triggerall = stateno != 425
triggerall = ctrl || ((stateno = [200,499]) || (stateno = 1800) ||  (stateno = 1625 && animelemtime(13) >= 0)) && movecontact
trigger1 = ctrl && random < (15 * (AIlevel ** 2 / 64.0))
trigger2 = moveguarded && random < (150 * (AIlevel ** 2 / 64.0))




[State -1, lt kick start up]
type = changestate
value = cond(numexplod(1490),491,490)
triggerall = AIlevel && numenemy
triggerall = !numexplod(1491)  
triggerall = roundstate = 2 && statetype != A
triggerall =(p2bodydist x = [ 0,95])
triggerall = !var(16) && var(15) < 1
triggerall = ( p2dist y = [-150*ceil(const(size.yscale)) , 0] ) && p2statetype != L && p2statetype != A


trigger1 = ctrl  && random < (50 * (AIlevel ** 2 / 64.0))
trigger1 = p2bodydist x = [0,95]

trigger2 = p2bodydist x < ceil(const(size.xscale)) * 200 
trigger2 = stateno = [200,202]
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (150 * (AIlevel ** 2 / 64.0))

trigger3 = p2bodydist x < ceil(const(size.xscale)) * 200 
trigger3 = stateno = 430
trigger3 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (150 * (AIlevel ** 2 / 64.0))

trigger4 = stateno = 235
trigger4 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (750 * (AIlevel ** 2 / 64.0))

trigger5 = stateno = 430 
trigger5 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (666 * (AIlevel ** 2 / 64.0))




[State -1, lt kick start up]
type = changestate
value = 480
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, 102]
triggerall = !var(16) && var(15) < 1 && !numexplod(14801)
triggerall = ( p2dist y = [-160 , 0] ) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = ctrl  && random < (ifelse(p2statetype = A, 200, 10) * (AIlevel ** 2 / 64.0))
;trigger2 = (stateno = [200, 499]) 
;trigger2 = movehit && (enemynear, gethitvar(hittime) >= 5) && random < (50 *var(13) * (AIlevel ** 2 / 64.0))

trigger2 = p2bodydist x < ceil(const(size.xscale)) * 250
trigger2 = stateno = 202
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (150 * (AIlevel ** 2 / 64.0))

trigger3 = p2bodydist x < ceil(const(size.xscale)) * 275
trigger3 = stateno = 430
trigger3 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (150 * (AIlevel ** 2 / 64.0))

trigger4 = stateno = 235
trigger4 = movehit && numexplod(1491) && random < (750 * (AIlevel ** 2 / 64.0))



[State -1, Standing Heavy Kick]
type = ChangeState
value = 250 
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType != A
triggerAll = !var(16) && var(15) < 1
triggerAll = (P2BodyDist x = [0,100]) && ( (P2Dist y = [-100,0])  || (p2stateno= 481 && p2movetype = h) )
trigger1 = (ctrl || (StateNo = [100,101])) && Random < (50 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) ) && P2StateType = c
trigger2 = (stateno = [200,205]) || (stateno = 230) || (stateno = [400,430]) || (stateno = 235) || (stateno = 1625 && animelemtime(13) >= 0) ||  (stateno = 1800) 
trigger2 = Movecontact && Random < (150*(EnemyNear, statetype!=s)  * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger3 = (p2stateno= 481 && p2movetype = h) && Random < (250  * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger3 = (enemynear, vel x >= 1 ) || ((P2BodyDist x = [0,100]) &&  (P2Dist y = [-100,0]))



[State -1, Standing Heavy Kick]
type = ChangeState
value = ifelse(p2bodydist x > 100, 220, ifelse(p2bodydist y > -100, 1900, 250))
triggerAll = AILevel && NumEnemy
triggerall = numhelper(22500) = 0
triggerAll = RoundState = 2 && StateType != A
triggerall =(p2dist x = [ 0,140])
triggerall = numexplod(808) = 0
trigger1 = ctrl &&  P2StateType = a && P2MoveType = H  && Random < (250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = p2stateno != 5120 
trigger1 = prevstateno != 910
trigger1 = prevstateno != 915
trigger1 = prevstateno != 810


[State -1, Bug Buzz]
type = ChangeState
value = 220
triggerAll = AILevel && NumEnemy             
triggerAll = RoundState = 2 && StateType != a
triggerAll = p2statetype != l 
triggerall= p2movetype!= i
triggerall= p2stateno != 5120 && ((p2stateno!= 481 && p2movetype != h) || p2dist x > 125)
triggerall =(p2dist x = [ 0,140])
triggerAll =  P2BodyDist y > -400*ceil(const(size.yscale) )
trigger1 = ctrl && Random < (125 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, throw]
type=changestate
value=900
triggerall= AIlevel && numenemy
triggerall= roundstate=2 && statetype=S && stateno!=100 && ctrl 
triggerall= !(enemynear,statetype=A) && !(enemynear,statetype=L) && !(enemynear,movetype=H)
trigger1 = (p2bodydist x=[0,32])
trigger1 = random<250*(AIlevel**2/64.0)

trigger2= (enemynear,stateno=[120,140]) && (p2bodydist x=[0,24]) && random<500*(AIlevel**2/64.0)



[State -1, Jumping rapid kick]
type = ChangeState
value = 600
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = A
triggerAll =  (P2Dist y = [-40,0]) && (P2Dist x = [0,125]) && P2StateType = a
triggerall = Random < (abs(15 * vel x)  * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger1 = ctrl
trigger2 = stateno = 620 || stateno = 640 || stateno = 650 
trigger2 = movecontact

[State -1, Jumping Knock down kick]
type = ChangeState
value = 620
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = A
triggerAll =  (P2Dist y = [-10,50]) && (P2Dist x = [-25,100]) || (stateno = 650 && movehit)
trigger1 = ctrl 
trigger1 = Random < (10 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = stateno = 650
trigger2 = Random < (50 + movehit*333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, Jumping light atk]
type = ChangeState
value = 640
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = A
triggerAll =  (P2Dist y = [-100,10]) && (P2Dist x = [0,75]) 
trigger1 = ctrl 
trigger1 = Random < (750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

[State -1, Jumping med atk]
type = ChangeState
value = 650
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = A
triggerAll =  ((P2Dist y = [-60,0]) && (P2Dist x = [0,75]) ) || (stateno = 640 && movehit)
trigger1 = ctrl 
trigger1 = Random < (50 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = stateno = 640
trigger2 = Random < (150 + movehit*333 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, air dbl kick]
type = ChangeState
value = 1225
triggerAll = AILevel && NumEnemy
triggerAll = RoundState = 2 && StateType = A
triggerall = stateno != 620 &&  numexplod(12251) = 0
triggerAll =  (P2Dist y = [-10,90]) && (P2Dist x = [0,150]) 
trigger1 = ctrl
trigger1 = vel y >= 0
trigger1 = Random < (25 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

trigger2 = stateno != 650 && movecontact
trigger2 = Random < ((25 +150*movehit) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )
trigger2 = vel y >= 0

trigger3 = stateno = 650 && movecontact 
trigger3 = Random < (100 +(333*movehit)+ 250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )






[State -1, high kick]
type = ChangeState
value = 1200
triggerall = AILevel
triggerall = roundstate = 2
triggerall = enemynear(var(59)),statetype != L
triggerall = p2stateno != [150,155]
triggerall = p2bodydist x = [-5,80]
triggerall = p2bodydist y = [-300,0]
triggerall = enemynear,stateno != 804 || enemynear,movetype != h
triggerall = enemynear,stateno != 802 || enemynear,movetype != h
triggerall = enemynear,stateno != 914 || enemynear,movetype != h
triggerall = enemynear,stateno != 918 || enemynear,movetype != h
triggerall = p2stateno != 481  && (var(44) >= 3 || stateno != 220)
triggerall = statetype != A && (Ctrl || (stateno = 220 && var(44) >= 3 ))
trigger1 = enemynear(var(59)),movetype = A
trigger1 = random <= 450
trigger2 = random <= 100
trigger2 = p2statetype= a
trigger3 = (StateNo = 220) 
trigger3 = (MoveHit || (Var(44) = [2,3])) && Random < (250* var(44) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger4 = ((stateno = [200,299]) || stateno = 1800)  && movehit 
trigger4 = p2statetype = a
trigger4= random <= 450





[State -1, Tri Axel kick]
type = ChangeState
value = 21000
triggerall = AILevel && numenemy
triggerall = power >= 3000 || (power >=1000 && p2life <= 333)
triggerall = roundstate = 2
triggerall = enemynear(var(59)),statetype != L
triggerall = enemynear,stateno != 804 || enemynear,movetype != h
triggerall = enemynear,stateno != 802 || enemynear,movetype != h
triggerall = enemynear,stateno != 914 || enemynear,movetype != h
triggerall = enemynear,stateno != 918 || enemynear,movetype != h
triggerall = p2stateno != [150,155]
triggerall = p2bodydist x = [-5,80]
triggerall = p2bodydist y = [-300,0]
triggerall = p2stateno != 481  && var(44) <= 3   
triggerall = (Ctrl || (stateno = 220 && animelemtime(5) >=5 && movecontact))
trigger1 = enemynear(var(59)),movetype = A
trigger1 = random <= 100
trigger2 = random <= 50
trigger2 = p2statetype= a
trigger3 = (StateNo = 220) 
trigger3 = (MoveHit || (Var(44) = [2,3])) && Random < (250* var(44) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger4 = ((stateno = [200,299]) || stateno =1800 )&& movehit 
trigger4 = p2statetype = a
trigger4= random <= 600



[State -1, dive kick AI]
type = ChangeState
value = 1201
triggerAll = numexplod(10161) = 0
triggerAll = AILevel && numenemy
triggerAll = RoundState = 2 && (StateType = A)
triggerall = ctrl || (StateNo = [610,699]) || (stateno = 1200 && animelemtime(6) >= 0)  
triggerall = pos y <= -20
triggerall = stateno != 600
triggerall = enemynear,stateno != 804 || enemynear,movetype != h
triggerall = enemynear,stateno != 802 || enemynear,movetype != h
triggerall = enemynear,stateno != 914 || enemynear,movetype != h
triggerall = enemynear,stateno != 918 || enemynear,movetype != h
trigger1 = (p2bodydist x = [60,125]) && (p2dist y = [0,200]) && random < (250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger1 = P2statetype != a && (ctrl || movecontact)
trigger2 = (p2bodydist x = [0,75]) && (p2dist y = [0,200]) && random < (500 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger2 =  stateno = 640 && movecontact
trigger3 = (p2bodydist x = [25,75]) && (p2dist y = [0,200]) && random < (200 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
trigger3 = P2statetype = a && (movehit || ctrl)
;trigger3 = vel y >= 0



[State -1, Lunge]
type = ChangeState
value = 1900
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 && StateType != a
triggerall= p2movetype!= i  
TriggerAll = Var(14) = 0
triggerall = enemynear,StateNo != [150,151]
triggerall= p2stateno != 5120
triggerall = numhelper(22500) = 0
triggerAll = (P2BodyDist x = [0,130]) && P2BodyDist y > -100
triggerall =  ctrl && (StateNo != [100,106])
trigger1 = Random < (125 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) ) 
trigger1 = p2stateno = 5100 || (!inguarddist && numhelper(35501))
trigger2 = ((P2StateType = a || p2statetype = l) ||(p2stateno = [1665,1666])) && P2MoveType = H  && Random < (250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

[State -1, dbl kick]
type = ChangeState
value = 1625
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 && StateType != a
triggerall= (enemynear, gethitvar(hittime) >= 2) || p2statetype = c || numhelper(35501)
triggerall= p2statetype != a && p2statetype != l
triggerall= p2movetype!= i
triggerall =enemynear,StateNo != [150,151]
triggerall= p2stateno != 5120
triggerall= !numexplod(16251)
triggerAll = (P2BodyDist x = [0,150]) && P2BodyDist y > -120
trigger1 =  ctrl || (StateNo = [100,106])
trigger1 = Random < (125 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) ) 
trigger1 = !inguarddist && ((p2statetype = c && (P2BodyDist x = [0,80])) || numhelper(35501))

trigger2 = (stateno = [200,202]) || (stateno = 430)
trigger2 = (movehit && P2BodyDist x < 80) ||  (moveguarded && p2statetype = c)
trigger2 = Random < ( (250+(-200*moveguarded)) * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, poipole]
type = ChangeState
value = 19550
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 && StateType != a
triggerall = (p2stateno = [5000,5200]) || p2movetype != h 
triggerall = p2statetype != l
triggerall = numhelper
triggerall = !PlayerIdExist(helper(33333333),var(3)) || numhelper(4900) || numhelper(35501) || numhelper(37500) 
triggerall = !numhelper(15151) || numenemy > 1
triggerall = numhelper(14250) 
triggerall = helper(14250),stateno = 14251
triggerall = StateType != a && var(45)  
triggerall = ctrl
triggerall= p2statetype!=L && (enemynear,vel y>-1)
triggerall= (enemynear,const(size.head.pos.y)<=-40) || (enemynear,statetype=A)
trigger1= ctrl && p2dist x>160 && random<25


[State -1, poipole]
type = ChangeState
value = 19551
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 
triggerall = p2statetype != l
triggerall = (p2stateno = [5000,5200]) || p2movetype != h 
triggerall = numhelper
triggerall = numhelper(14250) 
triggerall = !numhelper(15151) || numenemy > 1
triggerall = helper(14250),stateno = 14251
triggerall = StateType = a && var(45) 
triggerall = ctrl 
trigger1 = p2movetype != h || p2statetype = a
trigger1 = (P2BodyDist x >= 100 ) || (p2bodydist y = [-999,-200])
trigger1 = p2stateno != [150,155]

;trigger2 = p2bodydist y = [-500,0]
trigger2 = p2stateno != 481  && var(44) <= 3   
trigger2 = enemynear(var(59)),movetype != A || numhelper(35501)
trigger2 = random <= 100 + ifelse(p2statetype= a,250,0)



[State -1, Swift]
type = ChangeState
value = 15000
triggerAll = AILevel && NumEnemy 
triggerAll = RoundState = 2 && StateType != a &&  power >= 2000
triggerall = enemynear,StateNo != [150,151]
triggerall = ctrl
triggerall = !numhelper(37130)
trigger1 = Random < (125 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) ) 
trigger1 = p2movetype = h
trigger1 = EnemyNear, StateNo = 5120 && EnemyNear, AnimTime = -4 && Random < (750 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )

trigger2 = (P2BodyDist x >= 100 ) || (p2bodydist y = [-999,-10])
trigger2 = p2stateno != [150,155]
trigger2 = p2bodydist x != [-5,80]
;trigger2 = p2bodydist y = [-500,0]
trigger2 = p2stateno != 481  && var(44) <= 3   
trigger2 = enemynear(var(59)),movetype != A || numhelper(35501)
trigger2 = random <= 100 + ifelse(p2statetype= a,250,0)

[State -1, low sweep AI]
type = changestate
value = 1800
triggerall = AIlevel && numenemy 
triggerall = roundstate = 2 && statetype != A
triggerall= p2statetype = s 
triggerall =enemynear,StateNo != [150,151]
triggerall= p2stateno != 5120
triggerall= !numexplod(16251)
triggerAll = (P2BodyDist x = [0,225]) && P2BodyDist y > -20
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = p2statetype != A && p2statetype != L
triggerall = (ctrl || stateno = 52 || (stateno = [100, 101])) || ((stateno = [200,499]) && movecontact)
triggerall = !PlayerIdExist(helper(33333333),var(3)) || numhelper(4900) || numhelper(35501) || numhelper(37500) 
trigger1 = p2bodydist x >= 110 && random < (50 * (AIlevel ** 2 / 64.0)) && !inguarddist
trigger2 = (stateno = [200,499]) && moveguarded && random < (15 * (AIlevel ** 2 / 64.0))

trigger3 = (stateno = [200,202]) || (stateno = 430)
trigger3 = (movehit && P2BodyDist x < 80) ||  (moveguarded && p2statetype = s)
trigger3 = Random < ( 250 * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)) )


[State -1, lux air grab kick]
type = ChangeState
value = 2100
triggerall = Ailevel && numenemy
triggerall = roundstate = 2
triggerall = enemynear(var(59)),statetype = a
triggerall = statetype = a 
triggerall = enemynear,stateno != 804 || enemynear,movetype != h
triggerall = enemynear,stateno != 802 || enemynear,movetype != h
triggerall = enemynear,stateno != 914 || enemynear,movetype != h
triggerall = enemynear,stateno != 918 || enemynear,movetype != h
triggerall = p2stateno != [150,155]
triggerall = p2bodydist x = [-5,80]
triggerall = p2bodydist y = [-300,0]
triggerall = p2stateno != 481     
triggerall = ctrl 
trigger1 = enemynear(var(59)),movetype = A
trigger1 = random <= 100
trigger2 = random <= 50








;---------------------------------------------------------------------------
[State -1, Sub ]
type = ChangeState
value = 7777
triggerall = !ailevel
triggerall = !numexplod(70501) && palno != 12
triggerall = command = "holddown" && command = "z"
;triggerall = var(40) >= 2000
trigger1=  alive = 1 && movetype = H && Time >= 1
trigger1 = (!EnemyNear,HitDefAttr = SCA,HA,HP,HT,AT ) && GetHitVar(guarded) = 0
trigger2 = ctrl



;---------------------------------------------------------------------------
;Run Fwd
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = !ailevel
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Run Back
[State -1, Run Back]
type = ChangeState
value = 105
triggerall = !ailevel
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Kung Fu Throw
[State -1, Kung Fu Throw]
type = ChangeState
value = 900
triggerall = !ailevel
triggerall = statetype != a
triggerall =  ctrl 
trigger1 = command = "x+y"



[State -1, Dodge]
type = ChangeState
value = 700
triggerAll = !AILevel
triggerAll = command = "x+a"
triggerAll = RoundState = 2 ;&& StateType != A
trigger1 = (ctrl || (StateNo = [100,101]))
trigger2 =  StateNo = 5210 || StateNo = 5201 || StateNo = 5120
trigger3 = StateNo = 150 || StateNo = 152
;===========================================================================
;---------------------------------------------------------------------------


[State -1, Air to Ground Rapid Spin]
type = ChangeState
value = 17800
triggerall = !ailevel
triggerall = power >=2000
triggerall = statetype = A
trigger1 =  ctrl
trigger1 = command = "QCF_y"

;poipole
[State -1, lightkick]
type = ChangeState
value = 230
triggerall = !ailevel
triggerall = command = "a"
triggerall = !ailevel
trigger1 = statetype = s
trigger1 = ctrl
trigger2 = (stateno = [200,205]) && movecontact
trigger3 = stateno = 400 && movecontact
trigger4 = (stateno = [400,430]) 
trigger4 = movecontact 
trigger5 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)

[State -1, Standing light kick 2]
type = ChangeState
value = 235
triggerall = !ailevel
triggerAll = command = "a"
triggerAll = StateType != A
trigger1 = StateNo = 230  && movecontact


;lunge 
[State -1, lunge]
type = ChangeState
value = 1900
triggerall = !ailevel
triggerall = statetype != a
triggerall = (StateNo = [100,101])
trigger1 =  command = "y"

[State -1, close combat]
type = ChangeState
value = 32000
triggerall = !ailevel
triggerall = Power >= 3000 || (Power >= 1000 && p2life <= 333)
triggerall = statetype != a
triggerall = ctrl || ((stateno = [200,499]) && movehit)
trigger1 =  command = "QCF_z"

[State -1, close combat]
type = ChangeState
value = 32000
triggerall = !ailevel
triggerall = Power >= 3000 || (Power >= 1000 && p2life <= 333)
triggerall = statetype != a
triggerall=  command = "z"
trigger1 = stateno = [150,152]
trigger2 = (StateNo = [100,101])



;swift = 35000
;signal beam = 13000
;tri axel    = 21000

[State -1, test swift]
type = ChangeState
value =  195
triggerall = !ailevel
triggerall = command = "swift"
trigger1 = statetype != a
trigger1 = ctrl



[State -1, rapid spin]
type = ChangeState
value = 1700
triggerall = !ailevel
triggerall = command = "c" && command = "holddown"
trigger1 = ctrl
trigger2 = (stateno = [200,499]) 
trigger2 = stateno != 480
trigger2 = stateno != 240
trigger2 = stateno != 425
trigger7 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)


[State -1, rapid spin]
type = ChangeState
value = 1700
triggerall = !ailevel
triggerall = command = "c" && command = "holddown"
trigger1 = ctrl
trigger2 = (stateno = [200,499]) 
trigger2 = stateno != 480
trigger2 = stateno != 240
trigger2 = stateno != 425
trigger7 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)


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

;---------------------------------------------------------------------------
;nihilego
[State -1, nihilego]
type = ChangeState
value = 17500+ 1*statetype = a
triggerall = power >= 2000
triggerall = ctrl
triggerall = !ailevel
trigger1 = command = "z"
trigger1 = command = "holdfwd"

;poipole attack
[State -1, ]
type = ChangeState
value = 19550+ 1*statetype = a
triggerall = numhelper
triggerall = numhelper(14250) 
triggerall = helper(14250),stateno = 14251
triggerall = ctrl
triggerall = !ailevel
trigger1 = command = "z"
trigger1 = command = "holdback"

;poipole
[State -1, poipole]
type = ChangeState
value = 19500
triggerall = numhelper(14250) = 0
triggerall = StateType != a 
triggerall = ctrl
triggerall = !ailevel
trigger1 = command = "z"
trigger1 = command = "holdback"


[State -1, Standing Light Punch]
type = ChangeState
value = 200 
triggerAll = !AILevel
triggerAll = command != "holddown" && command = "x"
triggerAll = StateType != A
trigger1 = ctrl 
trigger2 = (StateNo = 230 || StateNo = 400 || StateNo = 430) && movecontact

[State -1, Standing Light Punch 2]
type = ChangeState
value = 201
triggerall = !ailevel
triggerAll = command != "holddown" && command = "x"
triggerAll = StateType != A
trigger1 = StateNo = 200  && movecontact

[State -1, Standing Light Punch 3]
type = ChangeState
value = 202
triggerall = !ailevel
triggerAll = command != "holddown" && command = "x"
triggerAll = StateType != A
trigger1 = StateNo = 201  && movecontact


;---------------------------------------------------------------------------
;Standing Strong Kick
[State -1, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = !ailevel
triggerall = command = "b"
triggerall = command != "holddown"
triggerall = command != "upper_b"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = [200,205]) && movecontact
trigger3 = (stateno = 230) && movecontact
trigger4 = (stateno = [400,430]) && movecontact
trigger5 = (stateno = 235) && movecontact
trigger6 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)

;-----------------------------------------------------------
;BugBuzz
[State -1, Standing Strong Kick]
type = ChangeState
value = 220
triggerall = !ailevel
triggerall = command = "y"
triggerall = command != "holddown"
;triggerall = command != "holdback"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)
trigger3 = (stateno = [200,499]) && (stateno != 480) && (stateno != 425)  && (stateno != 220)  && movecontact



;Quick guard
[State -1, Quick guard ex]
type = ChangeState
value = 741
triggerall = !ailevel
triggerall = command = "c"
triggerall = command != "holddown"
triggerall = power >= 1000
triggerall = stateno != 253
triggerall = stateno != 260
trigger1 = (stateno = [200,499]) 
trigger2 = (stateno = 1800 || stateno = 1625 )|| (stateno = 19500 &&  animelemtime(5) >= 2) || (stateno = 19550 && numhelper(22500))
ignorehitpause = 1

;Quick guard
[State -1, Quick guard]
type = ChangeState
value = 740
triggerall = !ailevel
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl 
trigger2 = StateNo = 150 || StateNo = 152

;Quick guard
[State -1, Quick guard]
type = ChangeState
value = 771
triggerall = !ailevel
triggerall = command = "c"
trigger1 = statetype = a
trigger1 = ctrl 


;---------------------------------------------------------------------------
;Crouching Strong Punch
[State -1, Crouching Strong Punch]
type = ChangeState
value = 425
triggerall = !ailevel
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C 
trigger1 = ctrl
trigger2 = (stateno = [200,499]) && movecontact
trigger2 = stateno != 480
trigger2 = stateno != 240
trigger2 = stateno != 425
trigger7 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)
;---------------------------------------------------------------------------
;Crouching hard knockdown punch 
[State -1, Crouching Light Kick]
type = ChangeState
value = 430
triggerall = !ailevel
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C 
trigger1 = ctrl 
trigger2 = (stateno = 400) || (stateno = 430) || (stateno = 1800)
trigger2 =  (movecontact)
trigger3 =  (StateNo = [200,205])
trigger3 =  (movecontact)
trigger4 =  (StateNo = 215)
trigger4 =  (movecontact)
trigger5 = (stateno = 1800) && movecontact && ((stateno = 1625 && animelemtime(13) >= 0) && movecontact)

;---------------------------------------------------------------------------
;Crouching med Kick
[State -1, Crouching med Kick 1]
type = ChangeState
value = 490
triggerall = !ailevel
triggerall = command = "a"
triggerall = command = "holddown"
triggerall = numexplod(1490) = 0
trigger1 = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = 400) || (stateno = 430) || (stateno = 420) || (stateno = 1800)
trigger2 = movecontact
trigger3 = (stateno = [200,255]) 
trigger3 = movecontact 

;Crouching med Kick
[State -1, Crouching med Kick 2]
type = ChangeState
value = 491
triggerall = !ailevel
triggerall = command = "a"
triggerall = command = "holddown"
triggerall = numexplod(1490)
trigger1 = statetype = C
trigger1 = ctrl 
trigger2 = (stateno = 400) || (stateno = 430) || (stateno = 420) || (stateno = 1800)
trigger2 = movecontact
trigger3 = (stateno = [200,255]) 
trigger3 = movecontact 


;Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 480
triggerall = !ailevel
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = (stateno = 400) || (stateno = 430) || (stateno = 420) || (stateno = 1800)
trigger2 = movecontact
trigger3 = (stateno = [200,255]) 
trigger3 = movecontact 


;---------------------------------------------------------------------------
;Jump rapid Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = 600
triggerall = !ailevel
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl


;---------------------------------------------------------------------------
;Jump hard kick knockdown 
[State -1, Jump Light Punch]
type = ChangeState
value = 620
triggerall = !ailevel
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || (stateno = 640 && animelemtime(6) >=0) || stateno = 650 
trigger2 = movecontact
trigger3 = (stateno = 640 && animelemtime(6) >=0) || (stateno = 600 && animelemtime(5) >=0) || (stateno = 650 && animelemtime(6) >=0) 

;---------------------------------------------------------------------------
;Jump updraft punch
[State -1, Jump updraft punch]
type = ChangeState
value = 640
triggerall = !ailevel
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || stateno = 650 ;jump_x or jump_a
trigger2 = movecontact
trigger3 = (stateno = 600 && animelemtime(5) >=0) || (stateno = 650 && animelemtime(6) >=0)

;---------------------------------------------------------------------------
;Jump med Punch
[State -1, Jump med Punch]
type = ChangeState
value = 650
triggerall = !ailevel
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600 || stateno = 630 || stateno = 640 ;jump_x or jump_a
trigger2 = movecontact
trigger3 = stateno = 1350 ;Air blocking


[state -1, Air Jump]
type = changestate
value = 945
triggerall = !ailevel
triggerall = command = "holdup"
triggerall = statetype = A
triggerall = numhelper(40000)
triggerall = !helper(40000), var(0) && !helper(40000), var(1)
trigger1 = ctrl && vel y >= 0 

[state -1, Air Dash]
type = changestate
value = 950
triggerall = !ailevel
triggerall = command = "FF" || command = "BB"
triggerall = statetype = A
triggerall = numhelper(40000)
triggerall = !helper(40000), var(2)
trigger1 = ctrl 


