; 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 = /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
;   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 command detection.
;
; - 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 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

;---------------------------------------------------------------------------
;Artificial Intelligence
;---------------------------------------------------------------------------
;-|-AI-|--------------------------------------------------------------------
[Command]
name = "AIT_1"
command = a, x, F, D, a, a, D
time = 1
[Command]
name = "AIT_2"
command = a, a, a, a, a, a, b
time = 1
[Command]
name = "AIT_3"
command = a, a, b, D, F, b, x
time = 1
[Command]
name = "AIT_4"
command = y, a, F, b, B, y, a
time = 1
[Command]
name = "AIT_5"
command = a, b, x, y, y, b, b
time = 1
[Command]
name = "AIT_6"
command = b, y, y, F, b, B, B
time = 1
[Command]
name = "AIT_7"
command = a, y, F, a, x, a, F, b
time = 1
[Command]
name = "AIT_8"
command = a, a, b, y, x, B, x
time = 1
[Command]
name = "AIT_9"
command = x, x, a, F, F, b, D
time = 1
[Command]
name = "AIT_10"
command = x, x, a, F, y, a, a, F
time = 1
[Command]
name = "AIT_11"
command = a, b, a, x, a, y, a
time = 1
[Command]
name = "AIT_12"
command = b, y, a, F, y, a, x
time = 1
[Command]
name = "AIT_13"
command = x, a, y, y, x, B, B
time = 1
[Command]
name = "AIT_14"
command = a, F, F, x, B, F, x
time = 1
[Command]
name = "AIT_15"
command = y, x, b, b, a, x, y
time = 1
[Command]
name = "AIT_16"
command = x, x, U, z, z, z, D
time = 1
[Command]
name = "AIT_17"
command = a, a, U, z, z, z, b
time = 1
[Command]
name = "AIT_18"
command = c, c, U, D, U, b, z
time = 1
[Command]
name = "AIT_19"
command = c, x, a, b, B, z, a
time = 1
[Command]
name = "AIT_20"
command = a, x, y, y, y, z, z
time = 1
[Command]
name = "AIT_21"
command = c, y, z, F, z, c, B
time = 1
[Command]
name = "AIT_22"
command = y, y, z, x, c, a, F, U
time = 1
[Command]
name = "AIT_23"
command = z, c, c, c, U, B, D
time = 1
[Command]
name = "AIT_24"
command = z, z, B, B, B, x, D
time = 1
[Command]
name = "AIT_25"
command = x, x, U, D, U, z, D, z
time = 1
[Command]
name = "AIT_26"
command = a, c, b, c, z, a, z
time = 1
[Command]
name = "AIT_27"
command = y, z, y, z, F, F, U
time = 1
[Command]
name = "AIT_28"
command = c, x, c, c, U, z, B
time = 1
[Command]
name = "AIT_29"
command = a, B, z, B, U, F, c
time = 1
[Command]
name = "AIT_30"
command = U, c, c, D, z, y, a
time = 1
[Command]
name = "AIT_31"
command = U, U, c, D, F, y, a
time = 1
[Command]
name = "AIT_32"
command = U, D, c, U, F, x, a
time = 1
[Command]
name = "AIT_33"
command = U, D, c, c, c, U, b
time = 1
[Command]
name = "AIT_34"
command = D, D, c, F, F, x, F
time = 1
[Command]
name = "AIT_35"
command = F, c, c, U, D, x, a
time = 1
[Command]
name = "AIT_36"
command = F, b, b, U, D, x, a
time = 1
[Command]
name = "AIT_37"
command = b, c, b, U, D, x, a
time = 1
[Command]
name = "AIT_38"
command = a, c, b, U, D, a, a
time = 1
[Command]
name = "AIT_39"
command = a, c, c, b, D, a, b
time = 1
[Command]
name = "AIT_40"
command = a, a, c, b, D, a, x
time = 1
[Command]
name = "AIT_41"
command = U, U, c, D, F, c, y, a
time = 1
[Command]
name = "AIT_42"
command = U, D, c, U, F, c, y, a
time = 1
[Command]
name = "AIT_43"
command = U, D, c, c, c, c, y, b
time = 1
[Command]
name = "AIT_44"
command = D, D, c, F, F, c, y, F
time = 1
[Command]
name = "AIT_45"
command = F, c, c, U, D, c, y, a
time = 1
[Command]
name = "AIT_46"
command = F, b, b, U, D, c, y, a
time = 1
[Command]
name = "AIT_47"
command = b, c, b, U, D, c, y, a
time = 1
[Command]
name = "AIT_48"
command = a, c, b, U, D, c, y, a
time = 1
[Command]
name = "AIT_49"
command = a, c, c, b, D, c, y, b
time = 1
[Command]
name = "AIT_50"
command = a, a, c, b, D, c, y, x
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 = "Up"
command = U
time = 1
[Command]
name = "Down"
command = D
time = 1
[Command]
name = "Fwd"
command = F
time = 1
[Command]
name = "Back"
command = B
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1
[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1
[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1
[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1
;-| Hold Button |----------------------------------------------------------
[Command]
name = "holda"
command = /a
time = 1
[Command]
name = "holdb"
command = /b
time = 1
[Command]
name = "holdc"
command = /c
time = 1
[Command]
name = "holdx"
command = /x
time = 1
[Command]
name = "holdy"
command = /y
time = 1
[Command]
name = "holdz"
command = /z
time = 1
[Command]
name = "holdstart"
command = /s
time = 1
[Command]
name = "holdp"
command = /x
time = 1
[Command]
name = "holdp"
command = /y
time = 1
[Command]
name = "holdp"
command = /z
time = 1
;-| Super Motions |--------------------------------------------------------
[Command]
name = "Chaos"
command = ~F,D,B, a+b
Time = 20
[Command]
name = "Chaos"
command = ~F,D,B, b+c
Time = 20
[Command]
name = "Chaos"
command = ~F,D,B, a+c
Time = 20
[Command]
name = "Tri_Edge_L"
command = ~D,F,D,F, x
Time = 25
[Command]
name = "Tri_Edge_M"
command = ~D,F,D,F, y
Time = 25
[Command]
name = "Tri_Edge_H"
command = ~D,F,D,F, z
Time = 25
;---------------------------------
[Command]
name = "Tri_Blade_L"
command = ~D,B,D,B, x
Time = 25
[Command]
name = "Tri_Blade_M"
command = ~D,B,D,B, y
Time = 25
[Command]
name = "Tri_Blade_H"
command = ~D,B,D,B, z
Time = 25
;---------------------------------
[Command]
name = "Hyper_Cannon_L"
command = ~D,F,D,F, a
Time = 25
[Command]
name = "Hyper_Cannon_M"
command = ~D,F,D,F, b
Time = 25
[Command]
name = "Hyper_Cannon_H"
command = ~D,F,D,F, c
Time = 25
;-| Special Motions |------------------------------------------------------
[Command]
name = "Death_Pheno_L"
command = ~F,D,B, a
Time = 20
[Command]
name = "Death_Pheno_M"
command = ~F,D,B, b
Time = 20
[Command]
name = "Death_Pheno_H"
command = ~F,D,B, c
Time = 20
;------------------------------------------------------------
[Command]
name = "Reverie_Sword_L"
command = ~F,D,DF, x
Time = 20
[Command]
name = "Reverie_Sword_M"
command = ~F,D,DF, y
Time = 20
[Command]
name = "Reverie_Sword_H"
command = ~F,D,DF, z
Time = 20
;----------------------------------------------------
[Command]
name = "Jamming_Ghost_L"
command = ~F,D,B, x
Time = 20
[Command]
name = "Jamming_Ghost_M"
command = ~F,D,B, y
Time = 20
[Command]
name = "Jamming_Ghost_H"
command = ~F,D,B, z
Time = 20
;----------------------------------------------------
[Command]
name = "Electron_Cannon_L"
command = ~F,D,DF, a
Time = 20
[Command]
name = "Electron_Cannon_M"
command = ~F,D,DF, b
Time = 20
[Command]
name = "Electron_Cannon_H"
command = ~F,D,DF, c
Time = 20
;----------------------------------------------------
[Command]
name = "Flamma_Cannon_L"
command = ~B,D,DB, a
Time = 20
[Command]
name = "Flamma_Cannon_M"
command = ~B,D,DB, b
Time = 20
[Command]
name = "Flamma_Cannon_H"
command = ~B,D,DB, c
Time = 20
;----------------------------------------------------
[Command]
name = "Dragon's_Roar_L"
command = ~D,D, x;~F,B, x
time = 12
[Command]
name = "Dragon's_Roar_M"
command = ~D,D, y;~F,B, y
time = 12
[Command]
name = "Dragon's_Roar_H"
command = ~D,D, z;~F,B, z
time = 12
;----------------------------------------------------
[Command]
name = "Fortune_Seal"
command = ~D,D, a
time = 12
[Command]
name = "Fortune_Seal"
command = ~D,D, b
time = 12
[Command]
name = "Fortune_Seal"
command = ~D,D, c
time = 12
;----------------------------------------------------
[Command]
name = "Pursuit Attack"
command = /$U,a
time = 1
[Command]
name = "Pursuit Attack"
command = /$U,b
time = 1
[Command]
name = "Pursuit Attack"
command = /$U,c
time = 1
;----------------------------------------------------
[Command]
name = "Chakra_Wave_L"
command = ~D,F, x
Time = 12
[Command]
name = "Chakra_Wave_M"
command = ~D,F, y
Time = 12
[Command]
name = "Chakra_Wave_H"
command = ~D,F, z
Time = 12
;----------------------------------------------------
[Command]
name = "Glace_Cannon_L"
command = ~D,F, a
Time = 12
[Command]
name = "Glace_Cannon_M"
command = ~D,F, b
Time = 12
[Command]
name = "Glace_Cannon_H"
command = ~D,F, c
Time = 12
;----------------------------------------------------
[Command]
name = "UGC_Heavy"
command = ~B,D, x
Time = 20
[Command]
name = "UGC_Heavy"
command = ~B,D, y
Time = 20
[Command]
name = "UGC_Heavy"
command = ~B,D, z
Time = 20
[Command]
name = "UGC_Cold"
command = ~B,D, a
Time = 20
[Command]
name = "UGC_Cold"
command = ~B,D, b
Time = 20
[Command]
name = "UGC_Cold"
command = ~B,D, c
Time = 20
;---------------------------------------------------------------------------------------------
;Super Jump
[Command]
name = "SJ"
command = $D, $U
[Command]
name = "Super_Jump"
command = $D, $U
[Command]
name = "Super_Jump"
command = D, U
;-----------------------------
;Recovery Roll
[Command]
name = "F_Roll_Long"
command = x+y
Time = 20
[Command]
name = "F_Roll_Long"
command = y+z
Time = 20
[Command]
name = "F_Roll_Long"
command = x+z
Time = 20
[Command]
name = "B_Roll_Long"
command = a+b
Time = 20
[Command]
name = "B_Roll_Long"
command = b+c
Time = 20
[Command]
name = "B_Roll_Long"
command = a+c
Time = 20

;-| 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
[Command]
name = "DD"     ;Required (do not remove)
command = D, D
time = 10
;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery" ;Required (do not remove)
command = x+a
time = 1
[Command]
name = "recovery"
command = y+b
time = 1
[Command]
name = "recovery"
command = z+c
time = 1
[Command]
name = "Bluff"
command = x+a
time = 1
buffer.time = 8
[Command]
name = "Ultimate1"
command = x+a
time = 1
[Command]
name = "Ultimate";Required (do not remove)
command = z+c
time = 1
[Command]
name = "Ultimate";Required (do not remove)
command = y+b
time = 1
;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "Super_Jump"
command = /U
[Command]
name = "Forward Wakeup Roll"
command = /$F
time = 10
[Command]
name = "Backward Wakeup Roll"
command = /$B
time = 10
;---------------------------------------------------------------------------
; 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, AI ON]
type = VarSet
triggerall = P2life !=0
triggerall = time>= 0
triggerall = roundstate = 2
triggerall = var(58) <= 10 && !numhelper(57) || var(58) > 10 && numhelper(57) > 0;> 0
trigger1 = command = "AIT_1"
trigger2 = command = "AIT_2"
trigger3 = command = "AIT_3"
trigger4 = command = "AIT_4"
trigger5 = command = "AIT_5"
trigger6 = command = "AIT_6"
trigger7 = command = "AIT_7"
trigger8 = command = "AIT_8"
trigger9 = command = "AIT_9"
trigger10 = command = "AIT_10"
trigger11 = command = "AIT_11"
trigger12 = command = "AIT_12"
trigger13 = command = "AIT_13"
trigger14 = command = "AIT_14"
trigger15 = command = "AIT_15"
trigger16 = command = "AIT_16"
trigger17 = command = "AIT_17"
trigger18 = command = "AIT_18"
trigger19 = command = "AIT_19"
trigger20 = command = "AIT_20"
trigger21 = command = "AIT_21"
trigger22 = command = "AIT_22"
trigger23 = command = "AIT_23"
trigger24 = command = "AIT_24"
trigger25 = command = "AIT_25"
trigger26 = command = "AIT_26"
trigger27 = command = "AIT_27"
trigger28 = command = "AIT_28"
trigger29 = command = "AIT_29"
trigger30 = command = "AIT_30"
trigger31 = command = "AIT_31"
trigger32 = command = "AIT_32"
trigger33 = command = "AIT_33"
trigger34 = command = "AIT_34"
trigger35 = command = "AIT_35"
trigger36 = command = "AIT_36"
trigger37 = command = "AIT_37"
trigger38 = command = "AIT_38"
trigger39 = command = "AIT_39"
trigger40 = command = "AIT_40"
v = 59
value = 0+(var(58))-ifelse((var(58)>35),var(58),0)
persistent = 1
ignorehitpause = 1

[State -1, AI OFF]
type = VarSet
trigger1 = P2life = 0
trigger1 = roundstate != 2
trigger2 = Win||Lose||Matchover
trigger3 = roundstate < 2
v = 59
value = 0

;===================================================================
;--|-AI Basic Gameplay-|---------------------------------------------------
;===================================================================
[State -1,AI-PA]
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = !numhelper(720)
triggerall = statetype != A
triggerall = enemynear, prevstateno != 1910
triggerall = enemynear, stateno != 5120 || enemynear, stateno != [5155,5156]
triggerall = enemynear, gethitvar(fall)||enemynear, statetype = L
trigger1 = (ctrl=1)
triggerall = p2bodydist x >= 40
trigger1 = (enemynear, stateno =[5030,5035])||(enemynear, stateno = [5050,5110])
trigger1 = (enemynear, stateno != 5040)||(enemynear, stateno != [5200,5201]);(enemynear,statetype = L)
trigger1 = (stateno = 40)||(stateno != 1080)||(prevstateno != 1080)
trigger1 = (random <= ifelse((var(59)>10),500,800))
value = 1080

[State -1,AI-STAND];Stand
type = ChangeState
triggerall = (var(59) = [1,10])
triggerall = (ctrl)
triggerall = (statetype !=A)
triggerall = stateno != 0 || prevstateno != 0
trigger1 = enemynear, movetype = A || enemynear, movetype = I || enemynear, movetype = H
trigger1 = (random <= 900);ifelse((var(59)<=5),900,900-(var(59)-5)*100))
value = 0
;ignorehitpause = 1

[State -1,AI-RUN-F]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (stateno != [100,105])||(prevstateno != [100,103])
triggerall = (ctrl)
triggerall = (statetype !=A)
trigger1 = (enemynear, movetype !=A)
trigger1 = (p2bodydist x > 80)
trigger1 = (random <= ifelse((var(59)>8),200,ifelse((var(59)<5),600,400)))
trigger2 = backedgebodydist <= 10 && p2bodydist x > 100
trigger2 = enemynear, movetype = H || enemynear, statetype = L 
trigger2 = random <= 300
trigger3 = numhelper(17501) > 0 && backedgebodydist <=20 || numhelper(17502) > 0 && frontedgebodydist <= 60 || numhelper(33400) > 0 && frontedgebodydist >= 60
trigger3 = random <= 100
value = 100

;[State -1,AI-ST]
;type = ChangeState
;triggerall = (var(59) >= 5)
;triggerall = (stateno = 100);&&(enemynear, stateno = [5080,5150])
;trigger1 = time > 0
;trigger1 = p2bodydist x >= 0 && p2bodydist x <= 100
;trigger1 = random >= ifelse((var(59)>= 7),750,950)
;value = 101

[State -1,AI-ST2]
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = var(16) = 0
triggerall = (stateno = 100)
trigger1 = (time > 0)
trigger1 = enemynear, movetype = A
trigger1 = (random >= ifelse((var(59)>= 8),300,900))
value = 102

[State -1,AI-CR]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = var(16) = 0
triggerall = stateno = 100
trigger1 = time > 3
trigger1 = enemynear, movetype = A
trigger1 = (random >= ifelse((var(59)>= 8),300,900))
value = 103

[State -1,AI-RUN-B]
type = ChangeState
triggerall = (var(59) >= 3)
;triggerall = prevstateno!=107||prevstateno!=105
triggerall = (stateno != [100,199]) || (prevstateno != [100,199])
triggerall = pos y >= 0 && (statetype !=A)
trigger1 = (ctrl)
trigger1 = prevstateno=1710 && backedgebodydist>60
trigger1 = (!enemynear, hitdefattr = ,NP,SP,HP)
trigger1 = (random >= 800)
trigger2 = (ctrl = 1)
trigger2 = prevstateno = 1905 
;trigger2 = numhelper(1930) > 0
trigger2 = backedgebodydist > 50
trigger2 = random <= 900
trigger3 = (ctrl)
trigger3 = numhelper(17501) > 0 && frontedgebodydist <= 40 || numhelper(17502) > 0 && backedgebodydist >= 60 || numhelper(33400) && backedgebodydist >= 60
trigger3 = random <= 100
trigger4 = backedgebodydist > 80
trigger4 = (ctrl)
trigger4 = p2bodydist x = [20,60]
trigger4 = enemynear, movetype = A && enemynear, vel y <= 0;(enemynear, stateno != [120,155]) || enemynear, movetype != H
trigger4 = random >=ifelse((var(59)>8),499,ifelse((var(59)<4),899,699))
trigger5 = (ctrl)
trigger5 = (enemynear, movetype = A) && (!enemynear, hitdefattr = ,NP,SP,HP)
trigger5 = backedgebodydist > 40
trigger5 = random >=ifelse((var(59)>8),699,ifelse((var(59)<4),899,799))
trigger6 = ctrl
trigger6 = backedgebodydist >60 && p2bodydist x <= 60
trigger6 = enemynear, statetype = L
trigger6 = random >= 500
trigger7 = stateno = 804
trigger7 = time >= 65 && backedgebodydist >= 50
value = 105
;trigger6 = prevstateno = 1905 && stateno = 0


[State -1,AI-CROUCH]
type = ChangeState
triggerall = (var(59) >= 3)
trigger1 = (statetype = S)
trigger1 = (ctrl)
trigger1 = (random >= ifelse((var(59)>= 5),600,970))
trigger1 = (prevstateno != 11)
trigger1 = (prevstateno != 10)
trigger1 = (enemynear,stateno !=[5070,5156]);||(enemynear,stateno !=[5155,5156])
value = 10

[State -1,AI-J]
type = ChangeState
triggerall = (var(59) > 0)
triggerall = (prevstateno != 52)||(stateno !=52)
triggerall = (stateno != [120,132])||(prevstateno != [120,132])
trigger1 = (ctrl)
trigger1 = (enemynear, movetype !=H) && p2bodydist x >= 100
trigger1 = (statetype != A);||(stateno = 100)&&(enemynear,stateno!=[5080,5156])
trigger1 = random >= ifelse((var(59)>= 5),800,900)
value = 40

[State -1,AI-EA-F]
type = ChangeState
triggerall = (var(59) > 8)
triggerall = var(16) = 0
triggerall = (stateno = 100)
triggerall = stateno !=[0,52]
triggerall = enemynear, statetype != L
triggerall = numhelper(1795) < 1
triggerall = time > 5
trigger1 = (enemynear, movetype != H)
trigger1 = p2bodydist x = [60,120] ;|| backedgebodydist <= 100
trigger1 = random >= 499 
value = 112

[State -1,AI-EA-B]
type = ChangeState
triggerall = (var(59) > 8)
triggerall = var(16) = 0
triggerall = (stateno = 105)
triggerall = stateno !=[0,52]
triggerall = numhelper(1795) < 1
triggerall = enemynear, statetype != L
triggerall = time > 10
trigger1 = (enemynear, movetype != H)
trigger1 = p2bodydist x <= 100 ;|| backedgebodydist <= 100
trigger1 = backedgebodydist > 20
trigger1 = random >= 699 
value = 111


[State -1,AI-Bluff-EA]
type = ChangeState
triggerall = (var(59) > 10)
triggerall = var(26) = [0,1]
triggerall = enemynear, statetype = L
triggerall = (stateno != [197,198]) && (prevstateno != [197,198])
triggerall = StateType != A && pos y >= 0
triggerall = (var(5) = 0)
triggerall = stateno = 100 && time >= 5
trigger1 = p2bodydist x <= 100
trigger1 = random <= 100
value = 198

[State -1,AI-SJ]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = numhelper(1795) < 1
triggerall = (ctrl)
triggerall = (statetype != A)
trigger1 = p2bodydist x >= 0 && p2bodydist x <= 20
trigger1 = (prevstateno != 52)
trigger1 = (enemynear, pos y < -10)
trigger1 = (random <= ifelse((var(59)>= 8),200,500))
trigger1 = enemynear, statetype = A
trigger1 = enemynear, movetype != H
trigger1 = enemynear, stateno !=[5070,5156]
trigger2 = backedgebodydist < 20 && p2bodydist x <= 60
trigger2 = enemynear, movetype != H
trigger2 = (random >= ifelse((var(59)>= 8),750,950))
value = 7000

[State -1,AI-TH1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (statetype  != A)
triggerall = (ctrl)
triggerall = (stateno != 100)
triggerall = p2bodydist x =[0,25]
trigger1 = enemynear, stateno !=[5070,5156]
trigger1 = (enemynear,movetype!=A)
trigger1 = (enemynear,statetype!=A)
trigger1 = (enemynear,movetype!=H)
trigger1 = (random >= ifelse((var(59)<10),999,750))
trigger2 = (enemynear, stateno = [700,710]) && (enemynear, movetype != A)
trigger2 = (random >= ifelse((var(59)<10),900,500))
value = 800

;==================
;--|-AI Defense-|--
;==================
[State -1,G-C];CG
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = !numhelper(1790)
triggerall = !enemynear, hitdefattr = ,NT,ST,HT
triggerall = inguarddist
trigger1 = (Ctrl)
trigger1 = (statetype != A)
trigger1 = (enemynear, statetype != A)
trigger1 = (enemynear, movetype = A)
trigger1 = (random >= ifelse((var(59)>8),199,ifelse((var(59)<6),799,499)))||(p2statetype=C)&&(random >= ifelse((var(59)>8),199,ifelse((var(59)<4),999,599)))
value = 131

[State -1,G-S];SG
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = !numhelper(1790)
triggerall = !enemynear, hitdefattr = ,NT,ST,HT
triggerall = inguarddist
trigger1 = (Ctrl)
trigger1 = (statetype != A)
trigger1 = (enemynear, movetype = A)&&(enemynear, statetype != C)
trigger1 = (random >= ifelse((var(59)>8),199,ifelse((var(59)<6),799,499)))
value = 130

[State -1,G-A];AG
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = !numhelper(1790)
triggerall = inguarddist
trigger1 = (Ctrl)
trigger1 = (statetype = A)||stateno=105&&time >= ifelse((var(59)>9),0,10)||stateno=7001&&time>=20;||stateno=104&&time>=35||stateno=108&&time>=35
trigger1 = (enemynear, movetype = A)
trigger1 = backedgebodydist > 60&&stateno != 7001
trigger1 = (random >= ifelse((var(59)>8),299,ifelse((var(59)<6),899,599)))
value = 132

[State -1,UG-S];UGS
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = numhelper(1795) < 1
triggerall = (enemynear, stateno !=[5070,5156])
triggerall = (statetype != A)&&(Pos y >= 0)
triggerall = enemynear, movetype = A
triggerall = (life)
triggerall = !enemynear, hitdefattr = ,NT,ST,HT
triggerall = inguarddist
trigger1 = (Ctrl)
trigger1 = (var(59)>10)&&random>=ifelse((life<300),500,700)||(enemynear, hitdefattr = ,HA,HP)&&(random >= ifelse((var(59)>10),300,ifelse((var(59)<6),800,500)))
trigger2 = stateno = [150,153]
trigger2 = (var(59)>10)&&(enemynear,hitdefattr=,SA,HA,SP,HP)&&(random>=ifelse((life<300),500,700))|| (var(59) = [1,10]) && random >= 900
trigger3 = var(16) = 0
trigger3 = stateno = 100 && time >= 3 && p2movetype = A
trigger3 = (var(59)>10)&&(enemynear,hitdefattr=,SA,HA,SP,HP)&&(random>=ifelse((life<300),500,700))|| (var(59) = [1,10]) && random >= 900
value = 700

[State -1,UG-S-C1];UAG
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = (stateno = 703)
triggerall = !numhelper(720)
triggerall = !enemynear, hitdefattr = ,HA,HP,HT
trigger1 = (power >= 500)
trigger1 = (time = [1,20])
trigger1 = (random <=ifelse((life>800),899,ifelse((life<300),199,599)))
value = 710

[State -1,UG-S-C2];UAG
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = (stateno = 703)
triggerall = !enemynear, hitdefattr = ,HA,HP,HT
trigger1 = (power >= 500)
trigger1 = (time = [1,20])
trigger1 = p2bodydist x >= 1 && p2bodydist x <= 60
trigger1 = (random <=ifelse((life>800),899,ifelse((life<300),199,599)))
value = 730

[State -1,AI-F-Roll]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = (stateno = 5110)
triggerall = (time >= ifelse((var(59)>10),5,ifelse((var(59)<4),15,10)))
trigger1 = Life
trigger1 = p2bodydist x >= 0
;trigger1 = random <= ifelse((var(59)>7),300,800)
value = 5155

[State -1,AI-B-Roll]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = (stateno = 5110)
triggerall = (time >= ifelse((var(59)>10),5,ifelse((var(59)<4),15,10)))
trigger1 = Life
trigger1 = p2bodydist x < 0
;trigger1 = random <= ifelse((var(59)>7),300,800)
value = 5156

[State -1, AI-Ground Recover]
type = ChangeState
triggerall = (var(59) >= 10)
triggerall = alive
triggerall = CanRecover
trigger1 = stateno = 5050
trigger1 = Vel Y > 0 && Pos Y >= -20
trigger1 = random <= 500
value = 5200

[State -1, AI-Air Recover]
type = ChangeState
triggerall = (var(59) >= 10)
triggerall = alive
triggerall = CanRecover
trigger1 = stateno = 5050
trigger1 = Vel Y > -1
trigger1 = random <= 500
value = 5210


[State -1,AI-F-Stand-Up];REC F
type = ChangeState
triggerall = (var(59) >= 1)
trigger1 = (stateno = 5110)
trigger1 = (life)
trigger1 = (time >= ifelse((random>=500),15,10))
value = 5120
;ignorehitpause = 1

[State -1,AI-Air-Bluff]
type = ChangeState
triggerall = (var(59) > 20)
triggerall = var(26) = [0,1]
triggerall = (stateno != 690) && (prevstateno != 690)
triggerall = StateType = A ;&& pos y >= 0
triggerall = power >= 1000
trigger1 = (stateno = [630,640])&&moveguarded||(stateno = [651,653])&& var(40) = 1||stateno=681&&moveguarded||stateno=610&&time>16&&var(41)=1||(stateno = [622,623])&&var(41)=1
trigger1 = random <= 500
value = 690


;======================
;-|-AI Normal Combo-|--
;======================
[State -1, AI-X];x 
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
trigger1 = Ctrl
trigger1 = statetype != A
trigger1 = var(39) = 1 || p2bodydist x <= 20;p2bodydist x >= 10 && p2bodydist x <= 30
trigger1 = p2statetype != A
trigger1 = stateno != 201
trigger1 = random >= ifelse((var(59)>7),300,ifelse((var(59)<4),700,ifelse((numhelper(1790)>0),100,500))) ;500;700
trigger2 = stateno = 201 && var(32) = 1
trigger2 = time >= 10
value = 200
;trigger2 = p2statetype = S
;trigger2 = p2bodydist x >= 10 && p2bodydist x <= 30


[State -1, AI-X2];x2
type = ChangeState
triggerall = (var(59) = 1)
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
triggerall = stateno = 200 && var(32) = 1
trigger1 = time >= 10
;trigger1 = p2statetype = S
value = 201

[State -1,AI-Y];y
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger1 = Ctrl
trigger1 = (enemynear, statetype = S)&&(statetype != A)
trigger1 = (p2bodydist x = [40,90]) && enemynear, vel x <= 2
trigger1 = random >= ifelse((var(59)>9),500,ifelse((var(59)<5),900,ifelse((numhelper(1790)>0),100,700)))
value = 210

[State -1,AI-Z];z start
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = enemynear, movetype != A
triggerall = enemynear, movetype != H
triggerall = !enemynear, hitdefattr = ,NP,SP,HP
triggerall = backedgebodydist >= 30
trigger1 = (p2bodydist x = [120,160])&&(enemynear, vel x <= 0)||(p2bodydist x = [120,160])&&(enemynear,statetype = A)&&(enemynear, pos y < -10)
trigger1 = Ctrl
trigger1 = statetype != A
trigger1 = random >= ifelse((var(59)>7),500,ifelse((var(59)<4),800,700))
value = 220

[State -1,AI-ZD];z d formating
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = anim = 221
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = (Time > 26 && time < 40)
trigger1 = (var(36) = 1) && (enemynear, statetype != A) || (p2bodydist x = [100,150]) && enemynear, pos y>= 0; && enemynear, movetype = A
value = 224

[State -1,AI-ZF];z f
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = anim = 221
triggerall = (enemynear, statetype != C)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = (time >= 18 && time <= 26)
trigger1 = (var(36) = 1) || (p2bodydist x = [80,150]) && enemynear, pos y > -100
value = 223
;persistent = 1

[State -1,AI-ZUP];z up
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = anim = 221 
triggerall = enemynear, statetype = A
triggerall = enemynear, stateno != 525 ||enemynear, stateno != 7020
triggerall = (enemynear, stateno !=[5070,5156]) || (enemynear, stateno != [515,527])
triggerall = (time >= 0 && time <= 18)
trigger1 = (var(36) = 1)&& (enemynear, pos y <= -120) || p2bodydist x < 100 && (enemynear, pos y = [-120,150])
value = 222

[State -1,AI-A];a
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype != A && pos y >= 0
trigger1 = enemynear, statetype != A && (enemynear, pos y >= 0) && Ctrl = 1 || prevstateno = 681 && stateno = 52 && time >= 3 && p2movetype = H
trigger1 = p2bodydist x = [1,20]
trigger1 = random >= ifelse((var(59)> 7),200,ifelse((var(59)<4),900,ifelse((numhelper(1790)>0),100,600)))
trigger2 = ctrl
trigger2 = stateno = 197 && (prevstateno = [230,453])
trigger2 = enemynear, movetype = H
trigger2 = random >= 600
value = 230

[State -1,AI-B];a
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype != A && pos y >= 0
trigger1 = enemynear, statetype != A && (enemynear, pos y >= 0) && Ctrl = 1 || prevstateno = 681 && stateno = 52 && time >= 3 && p2movetype = H
trigger1 = p2bodydist x = [1,50]
trigger1 = random >= ifelse((var(59)> 8),200,ifelse((var(59)<4),900,ifelse((numhelper(1790)>0),100,800)))
trigger2 = ctrl
trigger2 = stateno = 197 && (prevstateno = [230,453])
trigger2 = enemynear, movetype = H
trigger2 = random >= 500
value = 240

[State -1,AI-C];c
type = ChangeState
triggerall = (var(59) >= 3)
Triggerall = numhelper(290)=0||numhelper(291)=0
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
triggerall = backedgebodydist >= 20
triggerall = p2movetype != A
trigger1 = Ctrl
trigger1 = statetype != A
trigger1 = p2bodydist x >= 120
trigger1 = random >= ifelse((var(59)>9),700,ifelse((var(59)<6),900,800))
value = 250

[State -1,AI-C2]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = anim = 250 
triggerall = time >= 36 && time <= 70
triggerall = p2stateno != [5000,5050]
trigger1 = (p2stateno !=[5070,5156]) || p2statetype != L
trigger1 = p2movetype = A || (p2bodydist x = [1,50])
value = 252

[State -1,AI-C3]
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = anim = 250
triggerall = time > 70
trigger1 = p2stateno != [5000,5050]
trigger1 = (p2stateno !=[5070,5156]) || p2statetype != L
trigger1 = p2movetype = A || (p2bodydist x = [1,100]) 
trigger2 = time >= 110
value = 253

[State -1,AI-C1];1
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = anim = 250
triggerall = time >= 0 && time <= 35
triggerall = p2stateno != [5000,5050]
trigger1 = (p2stateno !=[5070,5156]) || p2statetype != L
trigger1 = p2movetype = A || (p2bodydist x = [1,30])
value = 251

[State -1,AI-CR-X]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger1 = Ctrl
trigger1 = statetype != A
trigger1 = var(39) = 1;p2bodydist x = [10,30]
trigger1 = p2statetype !=A
trigger1 = stateno != 401
trigger1 = random >= ifelse((var(59)>7),300,ifelse((var(59)<4),800,500));,ifelse((numhelper(1790)>0),100,500)));900
trigger2 = stateno = 401 && var(32) = 1
trigger2 = time >= 10
trigger3 = ctrl
trigger3 = prevstateno = 681 && stateno = 52 && time >= 3 
trigger3 = random >= ifelse((var(59)>7),500,ifelse((var(59)<4),800,500));900
value = 400
;trigger2 = p2statetype !=A

[State -1, AI-CR-X2]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = stateno = 400 && var(32) = 1
trigger1 = time >= 10
value = 401
;trigger1 = p2statetype !=A

[State -1,AI-CR-Z]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = prevstateno != 422|| prevstateno !=411
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = !enemynear, hitdefattr = ,NP,SP,HP
triggerall = !numhelper(512)
triggerall = backedgebodydist >= 20
trigger1 = (enemynear, statetype != A) && (statetype != A)
trigger1 = p2bodydist x > 50
trigger1 = Ctrl
trigger1 = random >= ifelse((var(59)>9),400,ifelse((var(59)<6),900,700))
value = 420

[State -1,AI-CR-Z2];formatting
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (anim = 421)
triggerall = time >= 0 && time <= 141
trigger1 = var(35) = 1
value = 422

[State -1,AI-CR-A]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype != A && pos y >= 0
triggerall = p2bodydist x =[1,40]
trigger1 = enemynear, statetype = S && Ctrl = 1 || prevstateno = 681 && stateno = 52 && time >= 3 || enemynear, statetype = S && enemynear, movetype = A && Ctrl = 1
trigger1 = random >= ifelse((var(59)>7),200,ifelse((var(59)<4),900,ifelse((numhelper(1790)>0),100,300)));800
trigger2 = ctrl
trigger2 = stateno = 197 && (prevstateno = [230,453])
trigger2 = enemynear, movetype = H
trigger2 = random >= 600
value = 430

[State -1,AI-CR-B];b
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype != A && pos y >= 0
triggerall = p2bodydist x = [20,70]
trigger1 = enemynear, statetype != A && Ctrl = 1 || prevstateno = 681 && stateno = 52 && time >= 3 || enemynear, statetype = S && enemynear, movetype = A && Ctrl = 1
trigger1 = random >= ifelse((var(59)>7),200,ifelse((var(59)<4),900,ifelse((numhelper(1790)>0),100,700)));900
trigger2 = ctrl
trigger2 = stateno = 197 && (prevstateno = [230,453])
trigger2 = enemynear, movetype = H
trigger2 = random >= 500
value = 440

[State -1,AI-CR-B2];b
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger1 = statetype != A && Ctrl||prevstateno = 681 && stateno = 52 && time = 3
trigger1 = enemynear, movetype != H
trigger1 = (p2bodydist x = [1,50])&&(enemynear, pos y >= -80)
trigger1 = random >= ifelse((var(59)>9),199,ifelse((numhelper(1790)>0),100,499))
value = 470

[State -1,AI-CR-A2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger1 = statetype != A && Ctrl||prevstateno = 681 && stateno = 52 && time = 3
trigger1 = p2statetype != A
trigger1 = enemynear, movetype != H
trigger1 = (p2bodydist x = [1,20])&&(enemynear, pos y >= -80)
trigger1 = random >= ifelse((var(59)>9),299,ifelse((var(59)<6),699,ifelse((numhelper(1790)>0),100,599)))
value = 460

[State -1,AI-CR-C];c
type = ChangeState
triggerall = (var(59) >= 3)
Triggerall = numhelper(290)=0||numhelper(291)=0
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
triggerall = p2stateno != [5000,5050]
triggerall = backedgebodydist >= 20
triggerall = p2movetype != A
trigger1 = p2bodydist x >= 90 && p2statetype != A
trigger1 = Ctrl
trigger1 = statetype != A && pos y >= 0
trigger1 = random >= ifelse((var(59)>9),499,ifelse((var(59)<6),799,699))
value = 450

[State -1,AI-CR-C2];priority
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = anim = 450
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
triggerall = p2stateno != [5000,5050]
triggerall = p2statetype != A
triggerall = ((time >= 36 && time <= 70))
trigger1 = p2statetype = S || p2movetype = A || (p2bodydist x = [1,60])
value = 452

[State -1,AI-CR-C3];priority
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = anim = 450
trigger1 = (p2stateno !=[5070,5156]) || p2statetype != L ;&& (enemynear, movetype != A)
triggerall = p2statetype != A
triggerall = (time > 70)
trigger1 = p2stateno != [5000,5050]
trigger1 = p2statetype = S || p2movetype = A || (p2bodydist x = [1,100])
trigger2 = time >= 110
value = 453

[State -1,AI-CR-C1];priority
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = anim = 450
triggerall = (p2stateno !=[5070,5156]) || p2statetype != L
triggerall = (time >= 0 && time <= 35);((time >= 1 && time <= 35))
triggerall = p2stateno != [5000,5050]
triggerall = p2statetype != A
trigger1 = p2statetype = S || p2movetype = A || (p2bodydist x = [1,40])
value = 451

[State -1,AI-CR-Y]
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = prevstateno != 410
triggerall = (p2stateno !=[5070,5156])
triggerall = p2statetype != A && p2movetype != H
triggerall = statetype != A && pos y >= 0
triggerall = Ctrl
;trigger1 = backedgebodydist > 10
trigger1 = (p2bodydist x = [20,40]) && (enemynear, pos y = [-50,0])
trigger1 = random >= ifelse((var(59)>8),600,ifelse((var(59)<5),900,700))
value = 410
;trigger1 = enemynear, vel y <= 0
;trigger1 = p2movetype = A





;=====================
;-|-AI Air Attacks-|--
;=====================

[State -1, AI-DK]
type = ChangeState
triggerall = (var(59) >= 5)
Triggerall = statetype = A
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = (p2bodydist y >= 10); ifelse((stateno=109),0,20))
triggerall = p2bodydist x = [5,100]
trigger1 = enemynear, statetype != A && enemynear, vel x < 2
trigger1 = (stateno = 7001 && time > 5)||(stateno = 109 && ctrl)||(stateno = 50)&&prevstateno = 40&& time >= 20||(stateno = 104 && time > 10)||(stateno = 108 && time>10)
trigger1 = (random >= ifelse((var(59)>8),199,ifelse((var(59)<=6),899,ifelse((numhelper(1790)>0),100,599))))
trigger2 = (prevstateno = 631) && (stateno = 660 && time >= 3);||(stateno = 7001 && time > 0)||(stateno = 109 && time > 0)
trigger2 = (random >= ifelse((var(59)>8),299,ifelse((var(59)<=6),899,599)))
trigger3 = (stateno = 50)&&prevstateno = 40&& time >= 20 || stateno = 7001 || stateno = 104 && time > 10 || (stateno = 108 && time > 10)|| stateno = 109 && ctrl
trigger3 = numhelper(17501) > 0 && backedgebodydist <=20
trigger3 = (random >= ifelse((var(59)>8),199,ifelse((var(59)<=6),899,599)))
value = 680
;trigger3 = backedgebodydist <= 10 && p2bodydist x <= 100
;trigger3 = time >= 15
;trigger3 = stateno = 660 || stateno = 7001 || stateno = 104 && time > 10 || (stateno = 108 && time > 10)|| stateno = 109 && ctrl
;trigger3 = (random <= ifelse((var(59)>8),199,ifelse((var(59)<=6),899,ifelse((numhelper(1790)>0),100,599))))


[State -1,AI-AX]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger2 = stateno = 601 && var(32) = 1
trigger2 = time >= 10
trigger1 = ctrl
trigger1 = stateno = 50 && vel x < 0
trigger1 = var(39) = 1;p2bodydist x <= 10
trigger1 = random >= ifelse((var(59)>7),99,ifelse((var(59)<4),599,399))
value = 600

[State -1, AI-AX2]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = stateno = 600 && var(32) = 1
;trigger1 = statetype = A
trigger1 = time >= 10
value = 601


[State -1, AI-AY]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = enemynear, pos y >= 0 && vel y > 0 || enemynear, statetype = A && vel y > 0
trigger1 = ctrl
trigger1 = statetype = A
trigger1 = p2bodydist y = [-20,50]
trigger1 = p2bodydist x = [10,40]
trigger1 = random <= ifelse((var(59)>6),499,ifelse((var(59)<5),899,699))
value = 610

[State -1, AI-AZ];formating
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
trigger1 = (p2bodydist y >= 80) && backedgebodydist >=60
trigger1 = (p2bodydist x = [80,120]) && (enemynear, vel x <= 0)
trigger1 = vel x <= 0
trigger1 = stateno != 109
trigger1 = ctrl
trigger1 = random >= ifelse((var(59)>8),600,ifelse((var(59)<4),900,700))
;ctrl = 0
value = 620

[State -1,AI-AZ3];formating
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 621) 
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = (time > 5)
trigger1 =  var(33) = 1 || enemynear, movetype = A
;trigger1 = enemynear, movetype != H
value = 623
persistent = 1

[State -1,AI-AZ2];formating
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 621) 
triggerall = (enemynear, stateno != [5070,5156])||(enemynear, stateno != [515,527])
triggerall = ((time >= 0 && time <= 5))
trigger1 = var(33) = 1 ||enemynear, movetype = A ;&& (enemynear, pos y < pos y);p2bodydist y <= -50
;trigger1 = enemynear, movetype != H ;(enemynear, statetype = A) &&
value = 622

[State -1, AI-AA]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = enemynear, statetype != A && enemynear,pos y >= 0 && vel y > 0 || enemynear, statetype = A
trigger1 = ctrl
trigger1 = statetype = A||(stateno = 109)
trigger1 = p2bodydist y = [-15,45]
trigger1 = p2bodydist x = [0,30]
trigger1 = random >= ifelse((var(59)>7),199,ifelse((var(59)<3),899,699))
value = 630

[State -1, AI-AB]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = enemynear, statetype != A && enemynear,pos y >= 0 && vel y > 0 || enemynear, statetype = A
trigger1 = ctrl
trigger1 = statetype = A||(stateno = 109)
trigger1 = p2bodydist y = [-20,50]
trigger1 = p2bodydist x = [0,50]
trigger1 = random >= ifelse((var(59)>7),199,ifelse((var(59)<3),899,ifelse((numhelper(1790)>0),100,599)))
value = 640

[State -1, AI-AC]
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = enemynear, stateno != [5000,5050]
Triggerall = numhelper(290)=0||numhelper(291)=0
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = backedgebodydist >= 20
trigger1 = (p2bodydist y = [-10,100]) && (statetype = A)||(stateno = 109)
trigger1 = enemynear, movetype != A
trigger1 = ctrl
trigger1 = vel x <= 0
trigger1 = random >= ifelse((var(59)>7),500,ifelse((var(59)<4),900,700))
value = 650

[State -1, AI-AC1]
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = anim = 650 
triggerall =  ((time >= 0 && time <= 25));((time >= 1 && time <= 20))
triggerall = (p2bodydist x = [1,40]) && (p2bodydist y = [-10,100])
trigger1 = (enemynear, stateno !=[5070,5156]) && (statetype = A)
trigger1 = (enemynear, stateno != [5000,5050]) || enemynear, statetype != L
;trigger1 = enemynear, statetype = A
trigger2 = vel y > 0 && pos y >= -20
value = 651

[State -1, AI-AC2]
type = ChangeState
triggerall = (var(59) >= 7)
triggerall = anim = 650 
triggerall = (p2bodydist x = [1,60]) && (p2bodydist y = [-10,100])
triggerall = (time >= 26 && time <= 50)
trigger1 = (statetype = A) && (enemynear, stateno !=[5070,5156])
trigger1 = (enemynear, stateno != [5000,5050]) || enemynear, statetype != L
;trigger1 = enemynear, statetype = A
trigger2 = vel y > 0 && pos y >= -20
value = 652

[State -1, AI-AC3]
type = ChangeState
triggerall = (var(59) >= 9)
triggerall = anim = 650 
triggerall = (p2bodydist x = [1,100]) && (p2bodydist y = [-10,100])
triggerall = (time > 50)
trigger1 = (statetype = A) &&(enemynear, stateno !=[5070,5156])
trigger1 = (enemynear, stateno != [5000,5050]) || enemynear, statetype != L
;trigger1 = enemynear, statetype = A
trigger2 = vel y > 0 && pos y >= -20
value = 653


;=========================
;--|-AI Hypers Attempt-|--
;=========================
;flask 3 priority
[State -1,AI-TE3]
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = power >= 3000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 211||stateno !=211
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 211&&stateno !=211
triggerall = enemynear, stateno != [1090,1099]
triggerall = enemynear, stateno != [53000,53001]
triggerall = StateType != A
triggerall = p2bodydist x = [30,100]
triggerall = random >= 500
trigger1 = (var(7) = 0)
trigger1 = ctrl
trigger1 = enemynear, movetype != H
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 1  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 1
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit=1
trigger5 = ctrl
trigger5 = enemynear, stateno = 525 && enemynear, movetype = H
value = 2002

[State -1,AI-TE2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = power >= 2000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 211||stateno !=211
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 211&&stateno !=211
triggerall = StateType != A
triggerall = p2bodydist x = [30,80]
trigger1 = (var(7) = 0)
trigger1 = ctrl
trigger1 = enemynear, movetype != H
trigger1 = random >= ifelse((var(59)> 9&&life<300),300,ifelse((var(59)<6&&life<300),900,800))
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 1  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 1
trigger2 = random >= ifelse((var(59)> 9&&Life<300),200,ifelse((var(59)<6&&Life<300),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = random >= ifelse((var(59)> 9&&life<300),400,ifelse((var(59)<6&&life<300),900,800))
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit=1
trigger4 = random >= ifelse((var(59)> 9&&life<300),300,ifelse((var(59)<6&&life<300),900,800))
trigger5 = (prevstateno = [200,499]) && (stateno = [197,198])
trigger5 = enemynear, movetype = H
trigger5 = ctrl = 1
trigger5 = time > 0
trigger5 = random >= 500
trigger6 = ctrl
trigger6 = enemynear, stateno = 525 && enemynear, movetype = H
trigger6 = random <= 500
value = 2001

[State -1,AI-TE1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = power >= 1500
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 211||stateno !=211
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 211&&stateno !=211
triggerall = enemynear, stateno != [1090,1099]
triggerall = enemynear, stateno != [53000,53001]
triggerall = p2bodydist x = [30,80]
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = enemynear, movetype != H
trigger1 = random >= ifelse((var(59)> 7&&life<300),200,ifelse((var(59)<4&&life<300),900,800))
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 1  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 1
trigger2 = random >= ifelse((var(59)> 7&&life<300),100,ifelse((var(59)<4&&life<300),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = random >= 500
trigger3 = random >= ifelse((var(59)> 7&&life<300),100,ifelse((var(59)<4&&life<300),900,800))
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit=1
trigger4 = random >= ifelse((var(59)> 7&&life<300),100,ifelse((var(59)<4&&life<300),800,800))
trigger5 = (prevstateno = [200,499]) && (stateno = [197,198])
trigger5 = enemynear, movetype = H
trigger5 = ctrl = 1
trigger5 = time > 0
trigger5 = random >= 500
trigger6 = ctrl
trigger6 = enemynear, stateno = 525 && enemynear, movetype = H
trigger6 = random <= 200
value = 2000
;trigger1 = frontedgedist >= 80

;hyper cannon 3 priority
[State -1,AI-HC3]
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = power >= 3000
triggerall = (enemynear, stateno !=[5070,5150])&&(enemynear,statetype!=L)
triggerall = StateType != A
triggerall = random >= 500
trigger1 = ctrl
trigger1 = p2bodydist x >= 70
trigger1 = enemynear, statetype != A && enemynear, movetype = A
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 3  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 3
trigger2 = p2bodydist x >= 60
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = var(32) = 1
trigger4 = ctrl
trigger4 = enemynear, stateno = 525 && enemynear, movetype = H
value = 6002
;triggerall = numhelper(6011)=0||numhelper(6012)=0||numhelper(6013)=0||numhelper(6014)=0||numhelper(6015)=0||numhelper(6016)=0||numhelper(6017)=0||numhelper(6018)=0
;triggerall = numhelper(6011)=0&&numhelper(6012)=0&&numhelper(6013)=0&&numhelper(6014)=0&&numhelper(6015)=0&&numhelper(6016)=0&&numhelper(6017)=0&&numhelper(6018)=0
;triggerall = (enemynear,stateno!=1910)||(enemynear,stateno!=[5070,5156])||(stateno!=[6000,6006])||(prevstateno!=[6000,6006])
;triggerall = (enemynear,stateno!=1910)&&(enemynear,stateno!=[5070,5156])&&(stateno!=[6000,6006])&&(prevstateno!=[6000,6006])


[State -1,AI-HC2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = power >= 2000
triggerall = (enemynear, stateno !=[5070,5150])&&(enemynear,statetype!=L)
triggerall = StateType != A
trigger1 = ctrl
trigger1 = p2statetype != A
trigger1 = p2bodydist x >= 50 && enemynear, movetype = A
trigger1 = random >= ifelse((var(59)> 7),300,ifelse((var(59)<4),900,800))
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 3  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 3
trigger2 = p2bodydist x >= 40
trigger2 = random >= ifelse((var(59)>7),300,ifelse((var(59)<4),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = p2bodydist x >= 40
trigger3 = random >= ifelse((var(59)>7),300,ifelse((var(59)<4),900,800))
trigger4 = ctrl
trigger4 = enemynear, stateno = 525 && enemynear, movetype = H
trigger4 = random <= 500
ctrl = 0
value = 6001

;triggerall = numhelper(6011)=0||numhelper(6012)=0||numhelper(6013)=0||numhelper(6014)=0||numhelper(6015)=0||numhelper(6016)=0||numhelper(6017)=0||numhelper(6018)=0
;triggerall = numhelper(6011)=0&&numhelper(6012)=0&&numhelper(6013)=0&&numhelper(6014)=0&&numhelper(6015)=0&&numhelper(6016)=0&&numhelper(6017)=0&&numhelper(6018)=0
;triggerall = (enemynear,stateno!=1910)||(enemynear,stateno!=[5070,5156])||(stateno!=[6000,6006])||(prevstateno!=[6000,6006])
;triggerall = (enemynear,stateno!=1910)&&(enemynear,stateno!=[5070,5156])&&(stateno!=[6000,6006])&&(prevstateno!=[6000,6006])

[State -1,AI-HC1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = power >= 1500
triggerall = (enemynear, stateno !=[5070,5150])&&(enemynear,statetype!=L)
triggerall = StateType != A
trigger1 = ctrl
trigger1 = p2bodydist x >= 50
trigger1 = enemynear, statetype != A && enemynear, movetype = A
trigger1 = random >= ifelse((var(59)> 7&&life<299),399,ifelse((var(59)<4),999,899))
trigger2 = stateno = 230 && movehit=1 || stateno = 240 && movehit >= 3  || stateno = 430 && movehit=1 || stateno = 440 && movehit >= 3
trigger2 = p2bodydist x >= 40
trigger2 = random >= ifelse((var(59)> 7&&life<299),399,ifelse((var(59)<4),999,899))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = p2bodydist x >= 40
trigger3 = random >= ifelse((var(59)> 7&&life<299),399,ifelse((var(59)<4),999,899))
trigger4 = ctrl
trigger4 = enemynear, stateno = 525 && enemynear, movetype = H
trigger4 = random <= 200
ctrl = 0
value = 6000

;triggerall = numhelper(6011)=0||numhelper(6012)=0||numhelper(6013)=0||numhelper(6014)=0||numhelper(6015)=0||numhelper(6016)=0||numhelper(6017)=0||numhelper(6018)=0
;triggerall = numhelper(6011)=0&&numhelper(6012)=0&&numhelper(6013)=0&&numhelper(6014)=0&&numhelper(6015)=0&&numhelper(6016)=0&&numhelper(6017)=0&&numhelper(6018)=0
;triggerall = (enemynear,stateno!=1910)||(enemynear,stateno!=[5070,5156])||(stateno!=[6000,6006])||(prevstateno!=[6000,6006])
;triggerall = (enemynear,stateno!=1910)&&(enemynear,stateno!=[5070,5156])&&(stateno!=[6000,6006])&&(prevstateno!=[6000,6006])

[State -1,AI-CHAOS];priority
type = ChangeState
triggerall = (var(59) >= 7)
triggerall = power >= 1000
triggerall = p2bodydist x = [1,170]
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0||numhelper(7015)=0||numhelper(7021)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0&&numhelper(7015)=0&&numhelper(7021)=0
triggerall = enemynear,stateno !=1910||(enemynear, stateno !=[5070,5156])
triggerall = enemynear,stateno !=1910&&(enemynear, stateno !=[5070,5156])
triggerall = stateno!=7010||stateno!=7016||prevstateno!=7010||prevstateno!=7016
triggerall = stateno!=7010&&stateno!=7016&&prevstateno!=7010&&prevstateno!=7016
triggerall = (var(7) = 0)
triggerall = pos y >= 0 && ctrl
trigger1 = StateType != A
trigger1 = enemynear,statetype != A
trigger1 = p2bodydist x = [0,180]
trigger1 = enemynear, movetype != H 
trigger1 = random >= ifelse((power>=1000),600, ifelse((power>=2000&&power<3000),500,300))
trigger2 = enemynear, statetype = L || (enemynear, stateno =[5070,5150])
trigger2 = random >= ifelse((power>=1000),600, ifelse((power>=2000&&power<3000),500,300))
trigger3 = (prevstateno = [200,499]) && (stateno = [197,198])
trigger3 = enemynear, movetype = H
trigger3 = ctrl = 1
trigger3 = time > 0
trigger3 = random >= 500
trigger4 = ctrl
trigger4 = enemynear, stateno = 525 && enemynear, movetype = H
trigger4 = random <= 500
value = 7010

;ice blade hyper 3 priority
[State -1,AI-TB3]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = power >= 3000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 411||stateno !=411
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 411&&stateno !=411
triggerall = enemynear, stateno != [1090,1099]
triggerall = enemynear, stateno != [53000,53001]
triggerall = StateType != A
triggerall = p2bodydist x = [1,80]
triggerall = random >= 500
trigger1 = var(7) = 0
trigger1 = ctrl
trigger1 = enemynear, movetype != H
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit
value = 3002
;trigger1 = frontedgedist >= 70


[State -1,AI-TB2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = power >= 2000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 411||stateno !=411
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 411&&stateno !=411
triggerall = enemynear, stateno != [1090,1099]
triggerall = enemynear, stateno != [53000,53001]
triggerall = p2bodydist x = [1,80]
trigger1 = var(7) = 0
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = enemynear, movetype != H
trigger1 = random >= ifelse((var(59)> 9&&life<300),300,ifelse((var(59)<5&&life<300),900,800))
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = random >= ifelse((var(59)> 9&&life<300),200,ifelse((var(59)<5&&life<300),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = random >= ifelse((var(59)> 9&&life<300),300,ifelse((var(59)<5&&life<300),900,800))
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit
trigger4 = random >= ifelse((var(59)> 8&&life<300),200,ifelse((var(59)<5&&life<300),900,800))
trigger5 = (prevstateno = [200,499]) && (stateno = [197,198])
trigger5 = enemynear, movetype = H
trigger5 = ctrl = 1
trigger5 = time > 0
trigger5 = random >= 500
value = 3001


[State -1,AI-TB1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = power >= 1500
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = enemynear,stateno!=1910||(enemynear,stateno!=[5070,5156])||prevstateno!= 411||stateno !=411
triggerall = enemynear,stateno!=1910&&(enemynear,stateno!=[5070,5156])&&prevstateno!= 411&&stateno !=411
triggerall = enemynear, stateno != [1090,1099]
triggerall = enemynear, stateno != [53000,53001]
triggerall = p2bodydist x = [60,80]
trigger1 = var(7) = 0
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = enemynear, movetype != H
trigger1 = random >= ifelse((var(59)> 7&&life<300),300,ifelse((var(59)<4&&life<300),900,800))
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = random >= ifelse((var(59)> 7&&life<300),300,ifelse((var(59)<4&&life<300),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = var(32) = 1
trigger3 = random >= ifelse((var(59)> 7&&life<300),400,ifelse((var(59)<4&&life<300),900,800))
trigger4 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit
trigger4 = random >= ifelse((var(59)> 7&&life<300),200,ifelse((var(59)<4&&life<300),900,800))
trigger5 = (prevstateno = [200,499]) && (stateno = [197,198])
trigger5 = enemynear, movetype = H
trigger5 = ctrl = 1
trigger5 = time > 0
trigger5 = random >= 500
value = 3000


;=======================================
[State -1,AI-TEH1];hold1
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 2001) && (time >= 0 && time <= 15)
trigger1 = var(36) = 1 || enemynear, movetype = A || enemynear, movetype = H
value = 2022
CTRL= 0
persistent = 1
ignorehitpause = 1

[State -1,AI-TEH2];hold2
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 2001) && ((time >= 19 && time <= 25))
trigger1 = var(36) = 1 || enemynear, movetype = A || enemynear, movetype = H
value = 2023
CTRL= 0
persistent = 1
ignorehitpause = 1

[State -1,AI-TEH3];hold3
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = anim = 2001
triggerall = time >= 29 && time <= 39
trigger1 = var(36) = 1 || enemynear, movetype = A || enemynear, movetype = H
value = 2024
CTRL= 0
persistent = 1
ignorehitpause = 1

[State -1,AI-TBH];hold
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 3001) && ((time >= 0 && time <= 142))
trigger1 = var(35) = 1
value = 3022
CTRL= 0
persistent = 1
ignorehitpause = 1

;air ice hyper
[State -1,AI-ATH3]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = power >= 3000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = p2stateno != [1090,1099]
triggerall = p2stateno != [53000,53001]
triggerall = p2statetype != L
triggerall = p2bodydist x = [30,80]
trigger1 = p2stateno!=1910||(p2stateno!=[5070,5156])
triggerall = random >= 500
trigger1 = (var(7) = 0)
trigger1 = StateType = A
trigger1 = ctrl
trigger1 = pos y <= -15 && p2bodydist y <= 15 
trigger1 = frontedgedist >= 80
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger3 = (stateno = [600,601]) && var(32) = 1
value = 4002

[State -1,AI-ATH2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = power >= 2000
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = p2stateno != [1090,1099]
triggerall = p2stateno != [53000,53001]
triggerall = p2statetype != L
triggerall = p2bodydist x = [30,80]
trigger1 = p2stateno!=1910||(P2stateno!=[5070,5156])
trigger1 = (var(7) = 0)
trigger1 = StateType = A
trigger1 = ctrl
trigger1 = pos y <= -15 && p2bodydist y <= 15 
trigger1 = frontedgedist >= 80
trigger1 = random >= ifelse((var(59)> 9&&life<300),200,ifelse((var(59)<6&&life<300),400,500))
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger2 = random >= ifelse((var(59)> 9&&life<300),100,ifelse((var(59)<6&&life<300),300,500))
trigger3 = (stateno = [600,601]) && var(32) = 1
trigger3 = random >= ifelse((var(59)> 9&&life<300),300,ifelse((var(59)<6&&life<300),400,500))
value = 4001

[State -1,AI-ATH1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = power >= 1500
triggerall = numhelper(2050)=0||numhelper(3050)=0||numhelper(4049)=0
triggerall = numhelper(2050)=0&&numhelper(3050)=0&&numhelper(4049)=0
triggerall = p2stateno != [1090,1099]
triggerall = p2stateno != [53000,53001]
triggerall = p2statetype != L
triggerall = p2bodydist x = [30,80]
trigger1 = p2stateno!=1910||(p2stateno!=[5070,5156])
trigger1 = (var(7) = 0)
trigger1 = StateType = A
trigger1 = ctrl
trigger1 = pos y <= -15 && p2bodydist y <= 15 
trigger1 = frontedgedist >= 80
trigger1 = random >= ifelse((var(59)> 7&&life<300),300,ifelse((var(59)<4&&life<300),400,500))
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger2 = random >= ifelse((var(59)> 7&&life<200),300,ifelse((var(59)<4&&life<300),300,500))
trigger3 = (stateno = [600,601]) && var(32) = 1
trigger3 = random >= ifelse((var(59)> 7&&life<300),400,ifelse((var(59)<4&&life<300),400,500))
value = 4000

;--------------------------------------
[State -1,AI-ATEH];hold
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (anim = 4002) && (time > 0)
trigger1 = var(34)=1
value = 4023
CTRL= 0
persistent = 1
ignorehitpause = 1

;===========================
;--|-AI Specials Attempt-|--
;===========================

[State -1,AI-DF3]
type = ChangeState
triggerall = (var(59) >= 8)
triggerall = numhelper(1930)<1||numhelper(1680)=0||numhelper(1605)=0
Triggerall = numhelper(1930)<1&&numhelper(1680)=0&&numhelper(1605)=0
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno !=1903
triggerall = StateType != A
triggerall = enemynear, statetype != C
trigger1 = ctrl
trigger1 = (enemynear,movetype!=A)
trigger1 = (enemynear,statetype!=A)
trigger1 = (enemynear,movetype!=H)
trigger1 = p2bodydist x <= 30
trigger1 = random <= ifelse((Life<300),399,499)
trigger2 = stateno = [100,103]
trigger2 = enemynear, movetype = I || enemynear, stateno= [120,155]
trigger2 = p2bodydist x <= 30
trigger2 = random <= ifelse((Life<300),399,499)
value = 1902

[State -1,AI-DF2]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = numhelper(1930)<1||numhelper(1680)=0||numhelper(1605)=0
Triggerall = numhelper(1930)<1&&numhelper(1680)=0&&numhelper(1605)=0
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno !=1903
triggerall = StateType != A
triggerall = enemynear, statetype != C
trigger1 = ctrl
trigger1 = (enemynear,movetype!=A)
trigger1 = (enemynear,statetype!=A)
trigger1 = (enemynear,movetype!=H)
trigger1 = p2bodydist x <= 30
trigger1 = random <= ifelse((var(59)>= 9),499,ifelse((var(59)<9),999,699))
trigger2 = stateno = [100,103]
trigger2 = enemynear, movetype = I || enemynear, stateno= [120,155]
trigger2 = p2bodydist x <= 30
trigger2 = random >= ifelse((var(59)>=9),400,ifelse((var(59)<9),900,700))
value = 1901

[State -1,AI-DF1]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = numhelper(1930)<1||numhelper(1680)=0||numhelper(1605)=0
Triggerall = numhelper(1930)<1&&numhelper(1680)=0&&numhelper(1605)=0
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno !=1903
triggerall = StateType != A
triggerall = enemynear, statetype != C
trigger1 = ctrl
trigger1 = enemynear,statetype!=A
trigger1 = p2bodydist x <= 30
trigger1 = random <= ifelse((var(59)< 5),99,ifelse((var(59)>8),599,299))
trigger2 = stateno = [100,103]
trigger2 = enemynear, movetype = I || enemynear, stateno= [120,155]
trigger2 = p2bodydist x <= 30
trigger2 = random <= ifelse((var(59)< 5),100,ifelse((var(59)>8),500,300))
value = 1900

[State -1,AI-RS1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156])||enemynear,statetype!=L
triggerall = enemynear, statetype != A && enemynear, pos Y >= 0 || enemynear, statetype = A && enemynear, pos y >= -70
triggerall = prevstateno!=1200||prevstateno!=1201||prevstateno!=1202
triggerall = prevstateno!=1200&&prevstateno!=1201&&prevstateno!=1202
triggerall = stateno != 52 || prevstateno != 52
triggerall = statetype != A
triggerall = enemynear, stateno != 1911
trigger1 = ctrl
trigger1 = enemynear, statetype = A && p2bodydist x <= 25 && enemynear, movetype != H
trigger1 = random >= ifelse((var(59)> 8),299,ifelse((var(59)=[4,7]),999,799))
trigger2 = ctrl
trigger2 = prevstateno=1710||prevstateno =431
trigger2 = p2bodydist x >= 0 && p2bodydist x <= 30
trigger2 = random <= ifelse((var(59)> 7),499,ifelse((var(59)<4),999,899))
trigger3 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger3 = p2bodydist x <= 30
trigger3 = random >= ifelse((var(59)>8),500,ifelse((var(59)<4),1000,900))
trigger4 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger4 = p2bodydist x <= 30
trigger4 = random >= ifelse((var(59)>8),700,ifelse((var(59)<4),900,800))
trigger5 = stateno = [100,103]
trigger5 = enemynear, statetype = A && enemynear, pos y <= -50 || enemynear, movetype = A|| (enemynear, stateno = [525,526])
trigger5 = p2bodydist x <= 30
trigger5 = random >= ifelse((var(59)>8),500,ifelse((var(59)<4),900,800))
trigger6 = ctrl
trigger6 = backedgebodydist < 20 && p2bodydist x <= 40 && enemynear, movetype = A
;trigger6 = enemynear, statetype = A
trigger6 = random >= ifelse((var(59)>8),500,ifelse((var(59)<4),900,700))
value = 1200

[State -1,AI-RS2]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = (enemynear, stateno !=[5070,5156])||enemynear,statetype!=L
triggerall = enemynear, statetype != A && enemynear, pos Y >= 0 || enemynear, statetype = A && enemynear, pos y >= -70
triggerall = prevstateno !=1200||prevstateno !=1201||prevstateno!=1202
triggerall = prevstateno !=1200&&prevstateno !=1201&&prevstateno!=1202
triggerall = stateno != 52 || prevstateno != 52
triggerall = statetype != A
triggerall = enemynear, stateno != 1911
trigger1 = ctrl
trigger1 = enemynear, statetype = A
trigger1 = (p2bodydist x <= 50) && (enemynear, movetype != H)
trigger1 = random >= ifelse((var(59)>9),299,ifelse((var(59)<6),999,799))
trigger2 = ctrl
trigger2 = prevstateno=1710||prevstateno =431
trigger2 = p2bodydist x >= 0 && p2bodydist x <= 40
trigger2 = random >= ifelse((var(59)>9),400,ifelse((var(59)<6),1000,900))
trigger3 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger3 = p2bodydist x <= 30
trigger3 = random >= ifelse((var(59)>9),499,ifelse((var(59)<6),999,899))
trigger4 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger4 = p2bodydist x <= 30
trigger4 = random >= 700
trigger5 = stateno = [100,103]
trigger5 = enemynear, statetype = A && enemynear, pos y <= -50 || enemynear, movetype = A|| (enemynear, stateno = [525,526])
trigger5 = p2bodydist x <= 30
trigger5 = random >= ifelse((var(59)>9),499,ifelse((var(59)<6),999,899))
trigger6 = ctrl
trigger6 = backedgebodydist < 20 && p2bodydist x <= 40 && enemynear, movetype = A
trigger6 = enemynear, statetype = A
trigger6 = random >= ifelse((var(59)>9),500,ifelse((var(59)<6),1000,900))
value = 1201

;Sword
[State -1,AI-RS3]
type = ChangeState
triggerall = (var(59) >= 7)
triggerall = (enemynear, stateno !=[5070,5156])||enemynear,statetype!=L
triggerall = enemynear, statetype != A && enemynear, pos Y >= 0 || enemynear, statetype = A && enemynear, pos y >= -70
triggerall = prevstateno !=1200||prevstateno !=1201||prevstateno!=1202
triggerall = prevstateno !=1200&&prevstateno !=1201&&prevstateno!=1202
triggerall = stateno != 52 || prevstateno != 52
triggerall = statetype != A
triggerall = enemynear, stateno != 1911
trigger1 = ctrl
trigger1 = enemynear, statetype = A ||(enemynear, stateno = [525,526])&&p2bodydist x = [20,40]
trigger1 = p2bodydist x <= 50 && enemynear, movetype != H
trigger1 = random <= ifelse((var(59)> 9),499,99)
trigger2 = ctrl
trigger2 = prevstateno=1710||prevstateno =431
trigger2 = p2bodydist x = [1,40]
trigger2 = random >= ifelse((var(59)> 9),500,900)
trigger3 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger3 = p2bodydist x <= 40
trigger3 = random >= 500
trigger4 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10 || stateno = 460 && movehit
trigger4 = p2bodydist x <= 40
trigger4 = random >= 700
trigger5 = stateno = [100,103]
trigger5 = enemynear, statetype = A && enemynear, pos y <= -50 || enemynear, movetype = A || (enemynear, stateno = [525,526])
trigger5 = p2bodydist x <= 40
trigger5 = random >= ifelse((var(59)>9),500,900)
trigger6 = ctrl
trigger6 = backedgebodydist < 20 && p2bodydist x <= 40 && enemynear, movetype = A
trigger6 = enemynear, statetype = A
trigger6 = (random <= ifelse((var(59)> 9),400,900))
trigger7 = (stateno = [196,198]) && prevstateno = 470
trigger7 = ctrl = 1
trigger7 = enemynear, movetype = H && enemynear, statetype = A
trigger7 = random >= 500
value = 1202

;Dragon
[State -1,AI-DR3]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno!=1700||prevstateno!=1701||prevstateno!=1702
;triggerall = (helper(1766),anim != 1765)
triggerall = statetype != A
triggerall = numhelper(17502) < 1
trigger1 = ctrl
trigger1 = p2bodydist x = [60,100]
trigger1 = enemynear, statetype != A
trigger1 = random <= ifelse((var(59)>= 9),499,ifelse((numhelper(1790)>0),899,99))
trigger2 = ctrl
trigger2 = statetype !=A
trigger2 = numhelper(17501) > 0 && var(30) = 2 
trigger2 = random <= ifelse((var(59)>10),900,100)
trigger3 = stateno = 430 && movecontact >= 1 || stateno = 440 && movecontact >= 3 || stateno = 460 && movecontact = 1
trigger3 = p2bodydist x >= 60
trigger3 = random <= ifelse((var(59)>= 9),799,199)
trigger4 = ctrl
trigger4 = backedgebodydist < 20 && (p2bodydist x = [70,110]) && enemynear, movetype = A
trigger4 = (random <= ifelse((var(59)>= 9),800,100))
trigger5 = var(9) != 1
trigger5 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit >= 4
trigger5 = p2bodydist x <= 30
trigger5 = random <= ifelse((var(59)>=10),800,100)
trigger6 = (stateno = [196,198]) && prevstateno = 470
trigger6 = ctrl = 1
trigger6 = enemynear, stateno = [120,155]
trigger6 = random >= 500
value = 1702
;trigger2 = numhelper(1763)>0||numhelper(1764)>0||numhelper(1765)>0||numhelper(1767)>0||(helper(1766),anim = 1764)
;trigger2 = abs(abs(rootdist x)>=-150)*(-facing);rootdist x <= 0 && rootdist x >= -100
;trigger2 = random <= ifelse((var(59)>= 9),499,899)

[State -1,AI-DR2]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno!= 1700||prevstateno!= 1701||prevstateno!= 1702
;triggerall = (helper(1766),anim!=1765)
triggerall = numhelper(17502) < 1
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist x = [51,100]
trigger1 = enemynear, statetype != A||prevstateno = 431;important
trigger1 = random <= ifelse((var(59)>= 8),899,ifelse((numhelper(1790)>0),999,99))
trigger2 = ctrl
trigger2 = statetype !=A
trigger2 = numhelper(17501) > 0 && var(30) = 2 
trigger2 = random <= ifelse((var(59)>=8),799,99)
trigger3 = stateno = 430 && movecontact >= 1 || stateno = 440 && movecontact >= 3 || stateno = 460 && movecontact = 1
trigger3 = p2bodydist x >= 60
trigger3 = random <= ifelse((var(59)>= 8),800,100)
trigger4 = ctrl
trigger4 = backedgebodydist < 20 && (p2bodydist x = [51,100]) && enemynear, movetype = A
trigger4 = enemynear, statetype = S
trigger4 = (random >= ifelse((var(59)>= 8),200,900))
value = 1701
;trigger2 = numhelper(1763)>0||numhelper(1764)>0||numhelper(1765)>0||numhelper(1767)>0||(helper(1766),anim=1764)
;trigger2 = abs(abs(rootdist x)>=-250)*(-facing);rootdist x <= 0 && rootdist x >= -120
;trigger2 = random <= ifelse((var(59)>= 9),499,899)

[State -1,AI-DR1]
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = prevstateno!=1700||prevstateno!=1701||prevstateno!=1702
;triggerall = (helper(1766),anim!=1765)
triggerall = statetype != A
triggerall = numhelper(17502) < 1
trigger1 = ctrl
trigger1 = p2bodydist x <= 50
trigger1 = enemynear, statetype != A
trigger1 = random <= ifelse((var(59)> 8),800,ifelse((var(59)<5),100,ifelse((numhelper(1790)>0),900,200)))
trigger2 = ctrl
trigger2 = statetype !=A
trigger2 = numhelper(17501) > 0 && var(30) = 2
trigger2 = random <= ifelse((var(59)> 8),800,ifelse((var(59)<5),100,200))
trigger3 = stateno = 430 && movecontact >= 1 || stateno = 440 && movecontact >= 3 || stateno = 460 && movecontact = 1
trigger3 = p2bodydist x <= 60
trigger3 = random <= ifelse((var(59)> 8),800,ifelse((var(59)<5),100,200))
trigger4 = ctrl
trigger4 = backedgebodydist < 20 && (p2bodydist x = [20,50]) && enemynear, movetype = A
trigger4 = enemynear, statetype = S
trigger4 = random <= ifelse((var(59)> 8),700,ifelse((var(59)<5),100,200))
value = 1700
;trigger2 = numhelper(1763)>0||numhelper(1764)>0||numhelper(1765)>0||numhelper(1767)>0||(helper(1766),anim =1764)
;trigger2 = abs(abs(rootdist x)>=-50)*(-facing);rootdist x <= 0 && rootdist x >= -10
;trigger2 = random <= ifelse((var(59)>= 9),100,500)

[State -1,AI-Bluff-CW-DR]
type = ChangeState
triggerall = (var(59) > 10)
triggerall = (stateno != [197,198]) && (prevstateno != [197,198])
triggerall = StateType != A && pos y >= 0
trigger1 = var(26) = 0
;triggerall = (stateno != [210,225]) || (stateno != [410,425])
trigger1 = enemynear, statetype = L || enemynear, movetype = I
trigger1 = ctrl
trigger1 = p2bodydist x = [80,160]
trigger1 = random <= 150
trigger2 = var(26) = [0,1]
trigger2 = (stateno = [230,240])||(stateno=[430,440])||(stateno=[460,470]);||(stateno = [251,253])||(stateno=[451,453])
trigger2 = moveguarded ;|| (enemynear, stateno = [120,155]) && var(32) = 1 || (enemynear, stateno = [120,155]) && var(40) = 1
trigger2 = power >= 1000
trigger2 = random <= 100
trigger2 = movetype = A
trigger3 = var(26) = [0,1]
trigger3 = var(40)=1&&(stateno = [251,253])||var(40)=1&&(stateno=[451,453])||stateno=470&&movehit
trigger3 = power >= 1000
trigger3 = random <= 100
trigger4 = var(26) = [0,1]
trigger4 = var(41)=1
trigger4 = (enemynear, stateno = [120,155]) || (enemynear, stateno = [525,527])
trigger4 = stateno=210 && time > 16||(stateno=[222,224])||stateno=410 && time > 16||stateno=422
trigger4 = power >= 1000
trigger4 = random <= 100
value = 197


[State -1,AI-EC3]
type = ChangeState
triggerall = (var(59) >= 7)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1400,1402])
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist x >= 60
trigger1 = (p2bodydist y = [-150,0])
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 10),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>= 10),300,900)
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = movecontact
trigger3 = p2bodydist x >= 60
trigger3 = random >= ifelse((var(59)>= 10),500,900)
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x > 80)
trigger4 = random <= ifelse((var(59)>=10),600,100)
value = ifelse((random >= 850), ifelse((var(6)=0),1802,1402), 1402)
;trigger5 = var(9) != 1
;trigger5 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit
;trigger5 = random <= ifelse((var(59)>=10),300,500)

[State -1,AI-EC2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1400,1402])
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist x >= 60
trigger1 = (p2bodydist y = [-150,0])
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 7),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>8),400,ifelse((var(59)<5),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= ifelse((var(59)>8),500,900)
trigger3 = movecontact
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [80,130])
trigger4 = random <= ifelse((var(59)>8),700,100)
value = ifelse((random >= 850), ifelse((var(6)=0),1801,1401), 1401)
;trigger5 = var(9) != 1
;trigger5 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit
;trigger5 = random <= ifelse((var(59)>=10),300,500)

[State -1,AI-EC1]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1400,1402])
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist x >= 60
trigger1 = (p2bodydist y = [-150,0])
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 7),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= 400
trigger3 = movecontact
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= ifelse((var(59)>=7),500,900)
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [60,100])
trigger4 = random <= ifelse((var(59)>=7),500,100)
trigger5 = var(9) != 1
trigger5 = stateno = 470 && movehit && time > 15 || stateno = 460 && movehit >= 5
trigger5 = p2bodydist x > 30
trigger5 = random <= ifelse((var(59)>=10),300,100)
value = ifelse((random >= 850), ifelse((var(6)=0),1800,1400), 1400)

[State -1,AI-JG3]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = (enemynear, stateno !=[5070,5156]) && (enemynear, statetype != L)
Triggerall = numhelper(1680) = 0
triggerall = numhelper(1605) = 0
triggerall = prevstateno != 1604
triggerall = statetype != A
triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x > 100
trigger1 = random <= ifelse((var(59)>= 9),499,99)
value = 1602

[State -1,AI-JG2]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = (enemynear, stateno !=[5070,5156]) && (enemynear, statetype != L)
Triggerall = numhelper(1680) = 0
triggerall = numhelper(1605) = 0
triggerall = prevstateno != 1604
triggerall = frontedgebodydist > 100
trigger1 = ctrl
triggerall = statetype != A
trigger1 = p2bodydist x = [40,80]
trigger1 = random <= ifelse((var(59)>= 8),499,99)
value = 1601

[State -1,AI-JG1]
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = enemynear, stateno !=[5070,5156]
Triggerall = numhelper(1680) = 0
triggerall = numhelper(1605) = 0
triggerall = prevstateno != 1604
triggerall = frontedgebodydist > 100
triggerall = statetype != A && pos y >= 0
trigger1 = ctrl
trigger1 = frontedgebodydist < 100
trigger1 = p2bodydist x > 40
trigger1 = random <= ifelse((var(59)>8),499,ifelse((var(59)<5),99,199))
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x >= 60
trigger2 = random >= ifelse((var(59)>8),500,ifelse((var(59)<5),900,700))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= 500
trigger3 = movecontact
trigger4 = ctrl
trigger4 = (enemynear, statetype = L)&&(p2bodydist x = [80,120])
trigger4 = random <= ifelse((var(59)>8),500,ifelse((var(59)<5),100,200))
trigger5 = var(9) != 1
trigger5 = stateno = 470 && movehit && time >= 15 || stateno = 460 && movehit >= 4
trigger5 = p2bodydist x > 30
trigger5 = random <= ifelse((var(59)>=10),300,100)
value = 1600

[State -1,AI-FC3]
type = ChangeState
triggerall = (var(59) >= 4)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1500,1502])
triggerall = statetype != A && pos y >= 0
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = enemynear, statetype != A
trigger1 = p2bodydist x >= 70
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 8),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>= 8),300,900)
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = movecontact
trigger3 = p2bodydist x >= 60
trigger3 = random >= 500
trigger4 = ctrl
trigger4 = enemynear, statetype = L && p2bodydist x > 100
trigger4 = random <= ifelse((var(59)>=10),500,100)
trigger5 = ctrl
trigger5 = (enemynear, hitdefattr = ,NP,SP) && p2bodydist x >=100
trigger5 = random >= 500
value = ifelse((random >= 850), ifelse((var(6)=0),1802,1502), 1502)

[State -1,AI-FC2]
type = ChangeState
triggerall = (var(59) >= 2)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1500,1502])
triggerall = statetype != A && pos y >= 0
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x >= 70
trigger1 = enemynear, statetype != A
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 7),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>= 8),300,ifelse((var(59)<5),900,800))
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= 500
trigger3 = movecontact
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [60,120])
trigger4 = random <= ifelse((var(59)>=10),500,ifelse((var(59)<6),100,200))
trigger5 = ctrl
trigger5 = (enemynear, hitdefattr = ,NP,SP) && p2bodydist x >=100
trigger5 = random >= 500
value = ifelse((random >= 850), ifelse((var(6)=0),1801,1501), 1501)

[State -1,AI-FC1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1500,1502])
triggerall = statetype != A
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x >= 70
trigger1 = enemynear, movetype = I || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)> 7),400,ifelse((var(59)<4),900,600))
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>7),400,900)
trigger3 = movecontact
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= 500
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [60,80])
trigger4 = random <= ifelse((var(59)>=10),500,ifelse((var(59)<5),100,300))
trigger5 = ctrl
trigger5 = (enemynear, hitdefattr = ,NP,SP) && p2bodydist x >=100
trigger5 = random >= 500
value = ifelse((random >= 850), ifelse((var(6)=0),1800,1500), 1500)

[State -1,AI-GC3]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = enemynear, stateno !=[5070,5150]
triggerall = (prevstateno!=[1300,1302])
triggerall = statetype != A
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x >= 70 && p2bodydist y = [-100,0]
trigger1 = enemynear, vel y <= 0
trigger1 = enemynear, movetype = I && enemynear, statetype = S || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59) > 7),499,ifelse((var(59)<4),799,599))
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= 500
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = movecontact
trigger3 = p2bodydist x >= 60
trigger3 = random >= 800
trigger4 = ctrl
trigger4 = enemynear, statetype = L && p2bodydist x > 80
trigger4 = random >= ifelse((var(59) > 7),450,ifelse((var(59)<4),850,650))
value = ifelse((random >= 850), ifelse((var(6)=0),1802,1302), 1302)

[State -1,AI-GC2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1300,1302])
triggerall = statetype != A
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x >= 70 && p2bodydist y = [-100,0]
trigger1 = enemynear, vel y <= 0
trigger1 = enemynear, movetype = I && enemynear, statetype = S || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 8),500,800)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x >= 80
trigger2 = random >= ifelse((var(59)>= 8),500,700)
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= ifelse((var(59)>= 7),500,800)
trigger3 = movecontact
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [80,120])
trigger4 = random <= ifelse((var(59)>=7),500,100)
value = ifelse((random >= 850), ifelse((var(6)=0),1801,1301), 1301)


[State -1,AI-GC1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = enemynear, stateno !=[5070,5156]
triggerall = (prevstateno!=[1300,1302])
triggerall = statetype != A
triggerall = !numhelper(1400)&&!numhelper(1300)&&!numhelper(1500)
;triggerall = frontedgebodydist > 100
trigger1 = ctrl
trigger1 = p2bodydist x >= 70 && p2bodydist y = [-100,0]
trigger1 = enemynear, vel y <= 0
trigger1 = enemynear, movetype = I && enemynear, statetype = S || enemynear, numproj > 0 || enemynear, hitdefattr = ,NP,SP
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)> 7),500,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>7),400,ifelse((var(59)<4),700,600))
trigger3 = movecontact
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x <= 60
trigger3 = random >= ifelse((var(59)>7),400,ifelse((var(59)<4),700,600))
trigger4 = ctrl
trigger4 = enemynear, statetype = L && (p2bodydist x = [60,100])
trigger4 = random <= ifelse((var(59)>=10),500,ifelse((var(59)<4),100,300))
value = ifelse((random >= 850),ifelse((var(6)=0),1800,1300), 1300)

;Chakara
[State -1,AI-CW3]
type = ChangeState
triggerall = (var(59) >= 5)
triggerall = (enemynear, stateno !=[5070,5156])||enemynear, statetype != L
triggerall = prevstateno != [1000,1005]
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = p2bodydist x >= 120
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>= 8), 800,999)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= 700
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 80
trigger3 = random >= 900
value = 1002

[State -1,AI-CW2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (enemynear, stateno !=[5070,5156])||enemynear, statetype != L
triggerall = prevstateno != [1000,1005]
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = p2bodydist x >= 80
trigger1 = enemynear, statetype != A
trigger1 = random >= ifelse((var(59)>7),800,900)
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>7),500,900)
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = movecontact
trigger3 = random >= ifelse((var(59)>7),600,900)
value = 1001

[State -1,AI-CW1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = prevstateno != [1000,1005]
trigger1 = ctrl
trigger1 = StateType != A
trigger1 = p2bodydist x >= 10 && p2bodydist x <= 80
trigger1 = enemynear, statetype != A
trigger1 = random >= 800
trigger2 = stateno = 230 && movehit || stateno = 240 && movehit >= 1  || stateno = 430 && movehit || stateno = 440 && movehit >= 1
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>7),499,999)
trigger3 = (stateno = [200,201]) && time >= 10 || (stateno = [400,401]) && time >= 10
trigger3 = p2bodydist x >= 60
trigger3 = random >= ifelse((var(59)>7),499,999)
trigger3 = movecontact
value = 1000

[State -1,AI-A-CW3]
type = ChangeState
triggerall = (var(59) >= 6)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype = A ;|| pos y <
triggerall = p2bodydist y = [-20,20]
trigger1 = (p2bodydist x = [10,120]) && backedgebodydist >= 30
trigger1 = ctrl
trigger1 = random >= ifelse((var(59)>= 9),600,900)
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger2 = p2bodydist x <= 80
trigger2 = random >= 700
trigger3 = (stateno = [600,601]) && var(32) = 1
trigger3 = p2bodydist x <= 80 && enemynear, statetype != A
trigger3 = random >= 800
trigger4 = stateno = 100 && time >= 5 || stateno = 106 && time > 0
trigger4 = enemynear, movetype = A
trigger4 = p2bodydist x >= 60
trigger4 = random >= ifelse((var(59)>=7),700,900)
value = 1102

[State -1,AI-A-CW2]
type = ChangeState
triggerall = (var(59) >= 3)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype = A
triggerall = p2bodydist y = [-20,20]
trigger1 = ctrl
trigger1 = (p2bodydist x = [10,60]) && backedgebodydist >= 30
trigger1 = random >= ifelse((var(59)>= 8),650,950)
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger2 = p2bodydist x <= 80 && frontedgebodydist < 50
trigger2 = random >= ifelse((var(59)>= 8),600,900)
trigger3 = (stateno = [600,601]) && var(32) = 1
trigger3 = p2bodydist x <= 80 && enemynear, statetype != A
trigger3 = random >= 700
trigger4 = stateno = 100 && time >= 5 || stateno = 106 && time > 0
trigger4 = enemynear, movetype = A
trigger4 = p2bodydist x >= 60
trigger4 = random >= ifelse((var(59)>=8),700,900)
value = 1101

[State -1,AI-A-CW1]
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = (enemynear, stateno !=[5070,5156]) || enemynear, statetype != L
triggerall = statetype = A
triggerall = p2bodydist y = [-20,20]
trigger1 = ctrl
trigger1 = (p2bodydist x = [10,120]) && backedgebodydist >= 30
trigger1 = random >= ifelse((var(59)>= 7),700,900)
trigger2 = stateno = 630 && movehit || stateno = 640 && movehit >= 4
trigger2 = p2bodydist x <= 80
trigger2 = random >= ifelse((var(59)>= 7),700,900)
trigger3 = (stateno = [600,601]) && var(32) = 1
trigger3 = p2bodydist x <= 80 && enemynear, statetype != A
trigger3 = random >= 500
trigger4 = stateno = 100 && time >= 5 || stateno = 106 && time > 0
trigger4 = enemynear, movetype = A
trigger4 = p2bodydist x >= 60
trigger4 = random >= ifelse((var(59)>=7),700,900)
value = 1100

[State -1,AI-FS];1763-1770
type = ChangeState
triggerall = (var(59) >= 1)
triggerall = var(5) = 0
triggerall = numhelper(1760)=0
triggerall = numhelper(1762)=0
triggerall = numhelper(1790)=0;!numhelper(1790)
triggerall = numhelper(1791)=0;!numhelper(1791)
triggerall = numhelper(1732)=0;!numhelper(1732)
triggerall = numhelper(1795)=0;!numhelper(1795)
triggerall = pos y >= 0 && ctrl
trigger1 = statetype != A
trigger1 = enemynear,movetype != A
trigger1 = p2bodydist x > 140
trigger1 = random <= 399
trigger2 = enemynear, statetype = L || (enemynear, stateno =[5070,5150])
trigger2 = p2bodydist x >= 80
trigger2 = random >= ifelse((var(59)>10),799,999)
value = 1750
ctrl = 0
persistent = 1

;---------------------------------------------
;Chaos
[State -1, Chaos]
triggerall = Var(59) < 1
type = ChangeState
value = 7010
triggerall = StateType != A && power >= 1000
trigger1 = Command = "Chaos"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Edge_L
[State -1, Tri_Edge_L]
triggerall = Var(59) < 1
type = ChangeState
value = 2000
triggerall = StateType != A && power >= 1000
trigger1 = Command = "Tri_Edge_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Edge_M
[State -1, Tri_Edge_M]
triggerall = Var(59) < 1
type = ChangeState
value = 2001
triggerall = StateType != A && power >= 2000
trigger1 = Command = "Tri_Edge_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Edge_H
[State -1, Tri_Edge_H]
triggerall = Var(59) < 1
type = ChangeState
value = 2002
triggerall = StateType != A && power >= 3000
trigger1 = Command = "Tri_Edge_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Blade_L
[State -1, Tri_Blade_L]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 3000
triggerall = StateType != A && power >= 1000
trigger1 = Command = "Tri_Blade_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Blade_M
[State -1, Tri_Blade_M]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 3001
triggerall = StateType != A && power >= 2000
trigger1 = Command = "Tri_Blade_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Blade_H
[State -1, Tri_Blade_H]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 3002
triggerall = StateType != A && power >= 3000
trigger1 = Command = "Tri_Blade_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Hatchete_L
[State -1, Tri_Hatchete_L]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 4000
triggerall = StateType = A && power >= 1000
trigger1 = Command = "Tri_Edge_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Hatchete_M
[State -1, Tri_Hatchete_M]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 4001
triggerall = StateType = A && power >= 2000
trigger1 = Command = "Tri_Edge_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Tri_Hatchete_H
[State -1, Tri_Hatchete_H]
triggerall = var(7) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 4002
triggerall = StateType = A && power >= 3000
trigger1 = Command = "Tri_Edge_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Hyper_Cannon_L
[State -1, Hyper_Cannon_L]
triggerall = Var(59) < 1
type = ChangeState
value = 6000
triggerall = StateType != A && power >= 1000
trigger1 = Command = "Hyper_Cannon_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Hyper_Cannon_M
[State -1, Hyper_Cannon_M]
triggerall = Var(59) < 1
type = ChangeState
value = 6001
triggerall = StateType != A && power >= 2000
trigger1 = Command = "Hyper_Cannon_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Hyper_Cannon_H
[State -1, Hyper_Cannon_H]
triggerall = Var(59) < 1
type = ChangeState
value = 6002
triggerall = StateType != A && power >= 3000
trigger1 = Command = "Hyper_Cannon_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Electron_Cannon_L
[State -1, Electron_Cannon_L]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1800,1400), 1400)
triggerall = StateType != A
trigger1 = Command = "Electron_Cannon_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Electron_Cannon_M
[State -1, Electron_Cannon_M]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1801,1401), 1401)
triggerall = StateType != A
trigger1 = Command = "Electron_Cannon_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Electron_Cannon_H
[State -1, Electron_Cannon_H]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1802,1402), 1402)
triggerall = StateType != A
trigger1 = Command = "Electron_Cannon_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Death_Pheno_L
[State -1, Death_Pheno_L]
triggerall = Var(59) < 1
triggerall = numhelper(1930) < 1
type = ChangeState
value = 1900
triggerall = StateType != A
trigger1 = Command = "Death_Pheno_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Death_Pheno_M
[State -1, Death_Pheno_M]
triggerall = Var(59) < 1
triggerall = numhelper(1930) < 1
type = ChangeState
value = 1901
triggerall = StateType != A
trigger1 = Command = "Death_Pheno_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Death_Pheno_H
[State -1, Death_Pheno_H]
triggerall = Var(59) < 1
triggerall = numhelper(1930) < 1
type = ChangeState
value = ifelse((var(8)=1&&random>750),1904,1902)
triggerall = StateType != A
trigger1 = Command = "Death_Pheno_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Reverie_Sword_L
[State -1, Reverie_Sword_L]
triggerall = Var(59) < 1
type = ChangeState
value = 1200
triggerall = StateType != A
trigger1 = Command = "Reverie_Sword_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Reverie_Sword_M
[State -1, Reverie_Sword_M]
triggerall = Var(59) < 1
type = ChangeState
value = 1201
triggerall = StateType != A
trigger1 = Command = "Reverie_Sword_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Reverie_Sword_H
[State -1, Reverie_Sword_H]
triggerall = Var(59) < 1
type = ChangeState
value = 1202
triggerall = StateType != A
trigger1 = Command = "Reverie_Sword_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Flamma_Cannon_L
[State -1, Flamma_Cannon_L]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1800,1500), 1500)
triggerall = StateType != A
trigger1 = Command = "Flamma_Cannon_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Flamma_Cannon_M
[State -1, Flamma_Cannon_M]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1801,1501), 1501)
triggerall = StateType != A
trigger1 = Command = "Flamma_Cannon_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Flamma_Cannon_H
[State -1, Flamma_Cannon_H]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1802,1502), 1502)
triggerall = StateType != A
trigger1 = Command = "Flamma_Cannon_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Chakra_Wave_L
[State -1, Chakra_Wave_L]
triggerall = Var(59) < 1
type = ChangeState
value = 1000
triggerall = StateType != A
trigger1 = Command = "Chakra_Wave_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Chakra_Wave_M
[State -1, Chakra_Wave_M]
triggerall = Var(59) < 1
type = ChangeState
value = 1001
triggerall = StateType != A
trigger1 = Command = "Chakra_Wave_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Chakra_Wave_H
[State -1, Chakra_Wave_H]
triggerall = Var(59) < 1
type = ChangeState
value = 1002
triggerall = StateType != A
trigger1 = Command = "Chakra_Wave_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Jamming_Ghost_L
[State -1, Jamming_Ghost_L]
Triggerall = numhelper(1680) = 0 && numhelper(1605) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 1600
triggerall = StateType != A
trigger1 = Command = "Jamming_Ghost_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Jamming_Ghost_M
[State -1, Jamming_Ghost_M]
Triggerall = numhelper(1680) = 0 && numhelper(1605) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 1601
triggerall = StateType != A
trigger1 = Command = "Jamming_Ghost_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Jamming_Ghost_H
[State -1, Jamming_Ghost_H]
Triggerall = numhelper(1680) = 0 && numhelper(1605) = 0
triggerall = Var(59) < 1
type = ChangeState
value = 1602
triggerall = StateType != A
trigger1 = Command = "Jamming_Ghost_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Dragon's_Roar_L
[State -1, Dragon's_Roar_L]
triggerall = Var(59) < 1
triggerall = var(5) = 0
type = ChangeState
value = 1700
triggerall = StateType != A
trigger1 = Command = "Dragon's_Roar_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Dragon's_Roar_M
[State -1, Dragon's_Roar_M]
triggerall = Var(59) < 1
triggerall = var(5) = 0
type = ChangeState
value = 1701
triggerall = StateType != A
trigger1 = Command = "Dragon's_Roar_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Dragon's_Roar_H
[State -1, Dragon's_Roar_H]
triggerall = Var(59) < 1
triggerall = var(5) = 0
type = ChangeState
value = 1702
triggerall = StateType != A
trigger1 = Command = "Dragon's_Roar_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Fortune_Seal
[State -1, Fortune_Seal]
triggerall = var(5) = 0
triggerall = Var(59) < 1
triggerall = numhelper(1760) = 0
triggerall = numhelper(1762) = 0
triggerall = !numhelper(1790)
triggerall = !numhelper(1791)
triggerall = !numhelper(1732)
triggerall = !numhelper(1795)
type = ChangeState
value = 1750
triggerall = StateType != A
trigger1 = Command = "Fortune_Seal"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Air_Chakra_Wave_L
[State -1, Air_Chakra_Wave_L]
triggerall = Var(59) < 1
type = ChangeState
value = 1100
triggerall = StateType = A
trigger1 = Command = "Chakra_Wave_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Air_Chakra_Wave_M
[State -1, Air_Chakra_Wave_M]
triggerall = Var(59) < 1
type = ChangeState
value = 1101
triggerall = StateType = A
trigger1 = Command = "Chakra_Wave_M"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Air_Chakra_Wave_H
[State -1, Air_Chakra_Wave_H]
triggerall = Var(59) < 1
type = ChangeState
value = 1102
triggerall = StateType = A
trigger1 = Command = "Chakra_Wave_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Glace_Cannon_L
[State -1, Glace_Cannon_L]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1800,1300), 1300)
triggerall = StateType != A
trigger1 = Command = "Glace_Cannon_L"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Glace_Cannon_M
[State -1, Glace_Cannon_M]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1801,1301), 1301)
triggerall = StateType != A
trigger1 = Command = "Glace_Cannon_M"
trigger1 = ctrl
ignorehitpause = 1


;---------------------------------------------
;Glace_Cannon_H
[State -1, Glace_Cannon_H]
triggerall = Var(59) < 1
type = ChangeState
value = ifelse((random <= 250), ifelse((var(6)=0),1802,1302), 1302)
triggerall = StateType != A
trigger1 = Command = "Glace_Cannon_H"
trigger1 = ctrl
ignorehitpause = 1

;---------------------------------------------
;Super Jump
[State -1, Super Jump]
type = ChangeState
value = 7000
triggerall = Var(59) < 1
triggerall = numhelper(1795) < 1
triggerall = Command = "SJ" || Command = "SJ" && Command = "holdfwd" || Command = "SJ" && Command = "holdback"
trigger1 = StateType = S || StateType = C
trigger1 = ctrl
trigger2 = stateno = [197,198]
trigger2 = time > 0

;---------------------------------------------------------------------------
;Forward Wakeup Roll
[State -1, Forward Wakeup Roll]
type = ChangeState
triggerall = Var(59) < 1
value = 5155
triggerall = (stateno = 5110) && time >= 5
trigger1 =  Life
trigger1 = command = "Forward Wakeup Roll"

;---------------------------------------------------------------------------
;Backward Wakeup Roll
[State -1, Backward Wakeup Roll]
type = ChangeState
triggerall = Var(59) < 1
value = 5156
triggerall = (stateno = 5110) && time >= 5
trigger1 = life
trigger1 =  command = "Backward Wakeup Roll"

;---------------------------------------------------------------------------
;Ultimate Guard
[State -1, Ultimate]
type = ChangeState
value = 700
triggerall = numhelper(1795) < 1
triggerall = life
triggerall = command = "Ultimate" || (var(26) = [1,2]) && command = "Ultimate1" 
Trigger1 = StateType = S
Trigger1 = StateType != A
Trigger1 = ctrl
trigger2 = stateno = [150,153]
ignorehitpause = 1

;---------------------------------------------------------------------------
;Pursuit Attack
[State -1, Pursuit Attack]
type = ChangeState
value = 1080
triggerall = !numhelper(720)
triggerall = movetype = I
triggerall = command = "Pursuit Attack"
triggerall = p2statetype = L || (enemynear, stateno =[5030,5035])||(enemynear, stateno = [5050,5110])
triggerall = (enemynear, stateno != 5040)||(enemynear, stateno != [5200,5201])
triggerall = (enemynear,vel y >= 0)
Trigger1 = StateType != A
trigger2 = StateNo = 40
ignorehitpause = 1

;---------------------------------------------------------------------------
; Dive Kick
[State -1, Dive Kick]
type = ChangeState
value = 680
triggerall = Var(59) < 1
Triggerall = statetype = A
triggerall = command = "a" && command = "holddown"
trigger1 = stateno != 7001 && stateno != 109 && time >= 20
trigger1 = ctrl
trigger2 = stateno = 7001 && time > 0
trigger3 = stateno = 109 && time > 0
trigger4 = Stateno = 690 && time > 5
ignorehitpause = 1


;===========================================================================
;---------------------------------------------------------------------------
; Run Fwd
[State -1, Run Fwd]
type = ChangeState
triggerall = Var(59) < 1
value = 100
triggerall = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = [197,198]

;---------------------------------------------------------------------------
; Run Back
[State -1, Run Back]
type = ChangeState
triggerall = Var(59) < 1
value = 105
triggerall = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = [197,198]

;---------------------------------------------------------------------------
[State -1, Toss-Up]
type = ChangeState
triggerall = Var(59) < 1
value = 800
triggerall = command = "z"||command = "y"
triggerall = command = "holdfwd"||command = "holdback"
triggerall = p2bodydist X <= 30
triggerall = (p2statetype != A)
triggerall = p2movetype != H
triggerall = stateno != 100
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = [197,198]
trigger2 = time >= ifelse(((prevstateno=[200,470])),9,20)


;===========================================================================
;---------------------------------------------------------------------------
; Taunt
[State -1, Taunt]
type = ChangeState
triggerall = Var(59) < 1
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl
Value = 195

;-----------------------------------------------
;Bluff
[State -1, Bluff]
Type = ChangeState
triggerall = (var(59) = 0)
triggerall = var(26) = 0 || var(26) = 3
triggerall = (prevstateno != [197,198])
trigger1 = command = "Bluff"
trigger1 = command = "holddown" || command = "holdfwd" || command = "holdback"
Trigger2 = Command = "Bluff"
trigger2 = command != "holddown" || command != "holdfwd" || command != "holdback"
value = ifelse((command="holdfwd"||command="holdback"),197,198)
Triggerall = ctrl
Triggerall = StateType != A

;---------------------------------------------------------------------------
; Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = Var(59) < 1
triggerall = command = "x" && command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Medium Punch
[State -1, Stand Medium]
type = ChangeState
value = 210
triggerall = Var(59) < 1
triggerall = command = "y" && command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = 220
triggerall = Var(59) < 1
triggerall = command = "z" && command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Light Kick
[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = Var(59) < 1
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Standing Medium Kick
[State -1, Standing Medium Kick]
type = ChangeState
value = 240
triggerall = Var(59) < 1
triggerall = command = "b"
trigger1 = statetype = S
trigger1 = ctrl


;---------------------------------------------------------------------------
; Standing Strong Kick
[State -1, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = Var(59) < 1
Triggerall = numhelper(290) = 0 || numhelper(291) = 0
triggerall = command = "c"
trigger1 = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl


;---------------------------------------------------------------------------
; Crouching Light Punch
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = Var(59) < 1
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Medium Punch
[State -1, Crouching Medium Punch]
type = ChangeState
value = 410
triggerall = Var(59) < 1
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Strong Punch
[State -1, Crouching Strong Punch]
type = ChangeState
value = 420
triggerall = Var(59) < 1
triggerall = command = "z"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Light Kick
[State -1, Crouching Light Kick]
type = ChangeState
value = 430
triggerall = Var(59) < 1
triggerall = command = "a"
triggerall = command = "holddown" && command != "holdfwd"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Medium Kick
[State -1, Crouching Medium Kick]
type = ChangeState
value = 440
triggerall = Var(59) < 1
triggerall = command = "b"
triggerall = command = "holddown" && Command != "holdfwd"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 450
triggerall = Var(59) < 1
Triggerall = numhelper(290) = 0 || numhelper(291) = 0
triggerall = command = "c"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching High Kick
[State -1, Crouching High Kick]
type = ChangeState
value = 460
triggerall = Var(59) < 1
triggerall = command = "a"
triggerall = command = "holddown" && command = "holdfwd"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Launch Kick
[State -1, Launch Kick]
type = ChangeState
value = 470
triggerall = Var(59) < 1
triggerall = command = "b"
triggerall = command = "holddown" && command = "holdfwd"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Light Punch
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = Var(59) < 1
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Medium Punch
[State -1, Jump Medium Punch]
type = ChangeState
value = 610
triggerall = Var(59) < 1
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Strong Punch
[State -1, Jump Strong Punch]
type = ChangeState
value = 620
triggerall = Var(59) < 1
triggerall = command = "z"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = 630
triggerall = Var(59) < 1
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Medium Kick
[State -1, Jump Medium Kick]
type = ChangeState
value = 640
triggerall = Var(59) < 1
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Strong Kick
[State -1, Jump Strong Kick]
type = ChangeState
value = 650
triggerall = Var(59) < 1
Triggerall = numhelper(290) = 0 || numhelper(291) = 0
triggerall = command = "c"
trigger1 = statetype = A
trigger1 = ctrl





