[Remap]
c = y
z = b
b = c
y = z

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

[Command]
name = "DU"
command = D,U
time = 16
buffer.time = 7

[Command]
name = "FBx"
command = F,B, x
time = 16
buffer.time = 7


[Command]
name = "sp1"
command = B,F,a
time = 22
buffer.time = 21

[Command]
name = "BFz"
command = B,F,y
time = 22
buffer.time = 21



[Command]
name = "sp3"
command = D,F,y
time = 32
buffer.time = 21







;-[Finishers]----------------------------------------------------

[Command]
name = "DDDD"
command = D,D,D,D
time = 50



[Command]
name = "FFFF"
command = F,F,F,F
time = 50



[Command]
name = "BBBB"
command = B,B,B,B
time = 50
;buffer.time = 14


[Command]
name = "friend"
command = c,c,c,c
time = 50



[Command]
name = "babality"
command = ~60a
time = 50



[Command]
name = "animality"
command = B,B,F,F
time = 50



[Command]
name = "mercy"
command = D,D,D,~c
time = 50
buffer.time = 14

[Command]
name = "harakiri"
command =
time = 30

[Command]
name = "stage"
command = /$D,x
time = 40

[Command]
name = "stage"
command = D,D,D,y
time = 40
buffer.time = 14

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

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

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = c+z
time = 1
buffer.time = 12

[Command]
name = "recovery"
command = /c,z
time = 1
buffer.time = 12

[Command]
name = "recovery"
command = /z,c
time = 1
buffer.time = 12

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1
buffer.time = 7

[Command]
name = "down_b"
command = /$D,b
time = 1
buffer.time = 7

[Command]
name = "down_x"
command = /$D,x
time = 1
buffer.time = 7

[Command]
name = "down_y"
command = /$D,y
time = 1
buffer.time = 7

;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

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

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

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

[Command]
name = "combo a"
command = a
time = 1
buffer.time = 3

[Command]
name = "combo b"
command = b
time = 1
buffer.time = 3

[Command]
name = "combo x"
command = x
time = 1
buffer.time = 3

[Command]
name = "combo y"
command = y
time = 1
buffer.time = 3

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

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

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

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

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

[Command]
name = "run"  ;Required (do not remove)
command = /c
time = 1

[Command]
name = "blok"  ;Required (do not remove)
command = /z
time = 1

;---------------------------------------------------------------------------
; 2. State entry
; --------------
; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]
;===========================================================================
;-----------------------------------

[State -1, IA]
type = VarSet
v = 50
value = 1
trigger1 = Var(50) != 1
triggerall = enemy,var(17) != 1
trigger1 = AIlevel > 0

[State -3, can not see]
type = varset
trigger1 = var(50) = 1 && AILevel = 0
v = 50
value = 0
ignorehitpause = 1
persistent = 1

[State -1, stage]
type = selfstate
triggerall = roundstate = 2
triggerall = statetype = S || statetype = C
triggerall = ctrl||(stateno = [10,12])
triggerall = p2bodydist x < 10 && p2stateno = 9010 && numhelper(6969) > 0
trigger1 = var(50) = 0 && command = "stage"
trigger2 = var(50) = 1 && random%30 < AILevel && AILevel > 1+random%2
trigger2 = time > 21-AILevel
value = 4000

; Stand Block
[State -1, Block]
type = ChangeState
value = 120
triggerall = command = "blok"
triggerall = ctrl && stateno != 180
trigger1 = statetype = S
trigger2 = statetype = C && stateno != 10
triggerall = stateno != [120,140]
triggerall = Var(50) != 1


;correr
[State -1, RunMk]
type = ChangeState
value = 107
trigger1 = command = "run"
trigger1 = command = "holdfwd"
trigger1 = command != "holddown"
trigger1 = command != "holdup"
trigger2 = stateno = [200,201] 
trigger3 = stateno = [220,221] 
triggerall = var(47) > 0
triggerall = var(50) = 0
triggerall = stateno != 107 && stateno != 10 && stateno != 180
triggerall = statetype = S
triggerall = ctrl

;---------------------------------------;
;	-	 specials	 -	;
;---------------------------------------;

[State -1]
type = ChangeState
value = 200 +20*(p2bodydist x > 18 ||abs(p2dist y) < 18)
triggerall = var(50) = 1 && p2life > 2
trigger1 = ctrl = 1 || stateno = 107
triggerall = statetype = S
triggerall = p2stateno != 5120 && p2stateno != 1310
triggerall = roundstate = 2
triggerall = abs(p2dist y) > 5 && abs(p2dist y) < 90 && p2bodydist x < 25 && random%6 < AILevel
triggerall = p2statetype = A && p2movetype = H
triggerall = time > 7-AILevel && AILevel > 1+random%3

[State -1, anti aerial]
type = selfState
value = 2111+(random%3 = 0)
triggerall = var(50) = 1 && random%21 < AILevel
trigger1 = ctrl = 1
trigger1 = prevstateno = 2002 && p2statetype = A && p2movetype = H && enemy,gethitvar(yvel) < -10
triggerall = roundstate = 2
triggerall = time > 7-AILevel && AILevel > 1+random%3

[State -1, iainuki]
type = selfState
value = ifelse(p2dist x > 60, 107, (2001+100*(random%2)))
triggerall = var(50) = 1 && random%12 < AILevel
trigger1 = ctrl = 1
trigger1 = p2stateno = 1310 && p2movetype = H
triggerall = roundstate = 2
triggerall = time > 3-AILevel && AILevel > 1+random%3

;-------------------------------------
[State -1, flying kick]
type = ChangeState
value = 1500
trigger1 = command = "BFz"
triggerall = statetype = S
triggerall = ctrl||(stateno = [200,201])||(stateno = [220,221])||stateno = 229||stateno = 111||stateno = 157
triggerall = roundstate = 2
trigger1 = command != "run"
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = ifelse(p2statetype != A, 1, (abs(p2dist y) < 12)) || movehit
trigger2 = p2statetype != L && p2statetype != C && p2bodydist x > 30 && p2bodydist x < 160 && !inguarddist
trigger2 = var(50) = 1 && p2stateno != 5120 && random%28 < AILevel && p2stateno != 620 && p2stateno != [120,159]
trigger2 = p2stateno != 21239 || enemy,vel x < 0
trigger2 = p2stateno = 107||(p2stateno = [0,20])||enemy,movecontact > 1||p2stateno = 21239||movehit||stateno = 621
trigger2 = p2life > 1 || (p2stateno = 9010 && enemy,time > 60)
trigger2 = time > 7-AILevel && AILevel > 1+random%3 && var(51) > 0 && random%3 = 0
trigger3 = stateno = 111&&time > 11-AILevel&&p2bodydist x < 140
trigger3 = (var(11) = 0 && random%8 = 0)||random%90 = 0
trigger3 = (p2stateno != [120,159])||random%12 > AILevel
trigger4 = stateno = 157&&anim = 0&&random%12 = 0
trigger4 = p2bodydist x < 120&&p2statetype != C

[State -1, kapkan];me
type = ChangeState
value = 1600
trigger1 = command = "FBx"
triggerall = statetype = S
triggerall = ctrl
triggerall = roundstate = 2
trigger1 = command != "run"
trigger1 = var(50) = 0


[State -1, kapkan];ai
type = ChangeState
value = 1600
triggerall = statetype = S
triggerall = ctrl
triggerall = roundstate = 2
triggerall = p2stateno!=1640 && numhelper(1610)=0 && p2movetype!=H
trigger2 = p2bodydist x =[10, 100]
trigger2 = var(50) = 1 && random%21 < AILevel && random%3 > 0
trigger3 = stateno = 111&&time > 11-AILevel&&p2bodydist x < 30
trigger3 = (var(11) = 0 && random%4 = 0)||random%90 = 0
trigger3 = (p2stateno != [120,159])||random%12 > AILevel
trigger1 = stateno = 157&&anim = 0&&random%4 = 0
trigger1 = p2bodydist x < 20&&p2statetype != C


[State -1]; VANDAM - me
type = ChangeState
value = 1400
triggerall = p2stateno != 1303; && ctrl
triggerall = statetype = S||statetype = C||statetype=A
triggerall = command = "DU"
triggerall = roundstate = 2
triggerall = numexplod(1992) = 0
triggerall = command != "run"
triggerall = var(50) = 0 || random%6 > AILevel
trigger1 = ctrl
trigger4 = (stateno = [620,621])
trigger3 = stateno = 1510  && movecontact; <>KIK KIK
trigger2 = stateno = 1101;up kik


[State -1]; VANDAM - ai
type = ChangeState
value = 1400
triggerall = p2stateno != 1303; && ctrl
triggerall = statetype = S||statetype = C||statetype=A
triggerall = roundstate = 2
triggerall = numexplod(1992) = 0
trigger1 = ctrl = 1 
trigger1 = var(50) = 1 && p2stateno != 32 && p2stateno != 1413
trigger1 = random%14 < AILevel || (random%8 < AILevel && numhelper(1700) > 0)
trigger1 = p2bodydist x > 12 && p2bodydist x < 70 && abs(p2dist y) > 32 && abs(p2dist y) < 190 && p2movetype != A
trigger1 = time > 14-2*AILevel
triggerall = AILevel > 2+random%3

trigger3 = stateno = 1510 && movecontact>5; <>KIK KIK
trigger2 = stateno = 1101 && time> 4;up kik


[State -1]; fireball
type = ChangeState
value = 1000
trigger1 = command = "sp1"
triggerall = (statetype = S&&ctrl)||(stateno = [10,12])||(stateno = [200,201])||(stateno = [220,221])||stateno = 229||stateno = 111||stateno = 157
triggerall = numexplod(1444) = 0
triggerall = roundstate = 2
trigger1 = command != "run"
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = p2statetype != L && inguarddist = 0 && p2stateno != 1000
trigger2 = p2bodydist x > 90 || (stateno = 200 && movehit > 3)
trigger2 = (p2statetype = C&&p2bodydist x > 180)||(p2statetype = S)||(p2movetype = H && movehit && abs(p2dist y) > 30)
trigger2 = p2stateno != 5120 && var(50) = 1 && random%60 < AILevel
trigger2 = p2life > 1
trigger2 = time > 21-3*AILevel && var(51) > 0 && random%3 = 0
trigger2 = (ctrl && enemy,numexplod(118) = 0)|| AILevel > 2+random%3
trigger2 = p2name != "motaro"
trigger3 = stateno = 111&&time > 11-AILevel&&p2bodydist x > 60
trigger3 = (var(11) = 0 && random%8 = 0)||random%90 = 0
trigger4 = stateno = 157&&anim = 0&&random%8 = 0
trigger4 = p2bodydist x > 50&&p2statetype != C&&p2statetype != A




;UP KIK
;---------------------------------------;;---------------------------------------;
[State -1]
type = ChangeState
value = 1100
trigger1 = command = "sp3"
triggerall = (statetype = S&&ctrl)||(stateno = [10,12])||(stateno = [200,201])||(stateno = [220,221])||stateno = 229||stateno = 111||stateno = 157
;triggerall = numexplod(1444) = 0
;triggerall = numexplod(1992) = 0
triggerall = roundstate = 2
trigger1 = command != "run"
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = p2statetype != C && p2statetype != L && p2bodydist x > 12 && p2bodydist x < 120
trigger2 = p2stateno != 5120 && var(50) = 1  && p2statetype != C;&& p2movetype != A
trigger2 = p2stateno = 50||p2stateno = 52||p2stateno = 20||enemy,moveguarded > 2||p2statetype = A
trigger2 = random%32 < AILevel ;&& p2movetype != H
trigger2 = p2life > 1 && random%3 > 0
trigger2 = time > 21-3*AILevel
trigger2 = (ctrl && p2stateno = 50)|| AILevel > 2+random%3
trigger3 = stateno = 111&&time > 11-AILevel&&p2bodydist x < 70&&enemy,numhelper(7003) = 0
trigger3 = (var(11) = 0 && random%8 = 0)||random%90 = 0
trigger3 = (p2stateno != [120,159])||random%12 > AILevel
trigger4 = stateno = 157&&anim = 0&&random%8 = 0
trigger4 = p2bodydist x < 70&&p2statetype != C
trigger5 =  p2movetype = H &&  p2statetype =A && p2bodydist x < 120  &&time > 11-3*AILevel &&  var(50) != 0




;---------------------------------------;
;	-	 Fatalities!!!	 -	;
;---------------------------------------;

[State -1,mercy]
type = ChangeState
value = 3997
triggerall = ctrl = 1||(stateno = [10,12])
triggerall = RoundNo >= 3
triggerall = numexplod(3800) = 0
triggerall = p2stateno = 9010
triggerall = statetype = S || statetype = C
trigger1 = command = "mercy"
triggerall = p2bodydist X >= 100
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%21 < AILevel && AILevel > 1+random%2
trigger2 = random + 600 < life || random%6 > AILevel

;---------------------------------------;
;	-	 Fatality 1	 -	;
;---------------------------------------;
;--------- - Uppercut Decap - ----------;
;---------------------------------------;
[State -1,fatal]
type = ChangeState
value = 3000
triggerall = p2bodydist X <222; 10
trigger1 = command = "DDDD"
triggerall = p2stateno = 9010
triggerall = (statetype = S&&ctrl)||(stateno = [10,12])||(stateno = [120,131])||stateno = 47||stateno=40
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%40 < AILevel && AILevel > 1+random%2




;	-	 Fatality 2	;---------------------------------------; -	;

[State -1,fatal]
type = ChangeState
value = 3100
triggerall = p2bodydist X <160; 10
trigger1 = command = "FFFF"
triggerall = p2stateno = 9010
triggerall = statetype = S||statetype = C
triggerall = ctrl = 1||stateno = 10
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%30 < AILevel && AILevel > 1+random%2


; Fatality 3;---------------------------------------;

[State -1,fatal]
type = ChangeState
value = 3200
triggerall = p2bodydist X <222; 10
trigger1 = command = "BBBB"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1||stateno = 10
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%30 < AILevel && AILevel > 1+random%2


;---------------------------------------;
;	-BABALITY, Mazafaka!	 -	;
;---------------------------------------;
[State -1,fatal]
type = ChangeState
value = 3600
triggerall = p2bodydist X = (30,300]
trigger1 = command = "babality"
triggerall = p2stateno = 9010
triggerall = statetype = S||statetype = C
triggerall = ctrl = 1||stateno = 10
trigger1 = var(50) = 0
trigger2 = enemy,time > 90
trigger2 = var(50) = 1 && random%76 < AILevel && gametime%2 = 0 && AILevel > 1+random%2

;---------------------------------------;
;	-	 Friendship?	 -	;
;---------------------------------------;
[State -1,fatal]
type = ChangeState
value = 3700
triggerall = p2bodydist X = (22,300]
trigger1 = command = "friend"
triggerall = p2stateno = 9010
triggerall = statetype = S||statetype = C
triggerall = ctrl = 1||stateno = 10
;triggerall = var(54) = 0; never blocked
trigger1 = var(50) = 0
trigger2 = enemy,time > 90
trigger2 = var(50) = 1 && random%76 < AILevel && gametime%2 = 0 && AILevel > 1+random%2

;---------------------------------------;
;	-	 Animality	 -	;
;---------------------------------------;
[State -1,fatal]
type = ChangeState
value = 3800
triggerall = p2bodydist X < 60
trigger1 = command = "animality"
;triggerall = numexplod(3800) = 1
triggerall = p2stateno = 9010
triggerall = statetype = S||statetype = C
triggerall = ctrl = 1||stateno = 10
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%28 < AILevel && AILevel > 1+random%2

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

; THROW

[State -1, 90932]
type = selfState
value = 24
triggerall = p2bodydist X <= 1 && backedgebodydist > 30
triggerall = command = "a"
trigger1 = ctrl = 1
triggerall = p2statetype = S || p2statetype = C || p2stateno = 5120
triggerall = statetype = S 
triggerall = p2name != "shao kahn"
triggerall = p2name != "kintaro"
triggerall = p2name != "goro"
triggerall = p2name != "motaro"
triggerall = enemy,numexplod(24) = 0

;-----------------------------------------;
;	- KOMBOS -	;
;-----------------------------------------;

;roundhouse
[State -1]
type = Changestate
value = 240
triggerall = command = "y"
triggerall = command = "holdback"
trigger1 = statetype = S
trigger1 = ctrl = 1 && stateno != 180

;-----------------------------------------;
;	- KOMBOS -	;
;-----------------------------------------;

;K O M B O
[State -1, knee]
type = ChangeState
value = 2001
anim = 2030
triggerall = p2bodydist X <= 3
triggerall = roundstate = 2
triggerall = statetype = S 
triggerall = ctrl = 1
triggerall = Vel Y = 0 
triggerall = p2statetype = S || p2statetype = C 
trigger1 = command = "y" || command = "b"
trigger1 = var(50) = 0 


[State -1, elbow]
type = ChangeState
value = 2001
anim = 2001
triggerall = p2bodydist X <= 3
triggerall = statetype = S
triggerall = ctrl = 1
triggerall = Vel Y = 0 
triggerall = p2statetype = S 
triggerall = roundstate = 2
trigger1 = command = "x"
trigger1 = var(50) = 0

[State -1, AI combo]
type = ChangeState
value = 2001
triggerall = p2bodydist X <= 3
triggerall = roundstate = 2
triggerall = statetype = S 
triggerall = ctrl = 1
triggerall = Vel Y = 0 
triggerall = p2statetype = C || p2statetype = S
triggerall = var(50) = 1 ;|| random%6 > AILevel
trigger1 = random%2 = 0 
trigger2 = var(50) = 1
trigger2 = random%20 < AILevel && p2statetype = S
trigger2 = p2life > 2 || (p2stateno = 9010 && enemy,time > 30 && random%30 < AILevel&& AILevel > 1+random%2)
trigger2 = p2stateno != 120
trigger2 = time > 7-AILevel
;------------------------------------------------------------------------------------------


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

;Sweep
[State -1]
type = Changestate
value = 245
trigger1 = command = "b"
trigger1 = command = "holdback"
trigger1 = statetype = S && stateno != 180
trigger1 = ctrl = 1 && p2dist x > 60

[State -1, Duck LK]
type = ChangeState
value = 400
triggerall = command = "down_b"
;triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1; && stateno != 10
triggerall = Vel Y = 0

[State -1, Duck HK]
type = ChangeState
value = 410
triggerall = command = "down_y"
;triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1; && stateno != 10
triggerall = Vel Y = 0

[State -1, Duck LP]
type = ChangeState
value = 420
triggerall = command = "down_a"
;triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1; && stateno != 10
triggerall = Vel Y = 0

[State -1, MKUppercut]
type = ChangeState
value = 430
triggerall = command = "down_x"
;triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1; && stateno != 10
triggerall = Vel Y = 0


;Jump Kick
[State -1, NKick]
type = ChangeState
value = 600
triggerall = statetype = A
triggerall = ctrl = 1
triggerall = Vel X = 0 
trigger1 = command = "y"
trigger2 = command = "b"


;Jump Punch
[State -1, Punch]
type = ChangeState
value = 610
triggerall = statetype = A
triggerall = ctrl = 1
trigger1 = command = "a"
trigger2 = command = "x"
triggerall = var(50) = 0

;Jump Side kick
[State -1, SideKick]
type = ChangeState
value = 620
triggerall = statetype = A
triggerall = ctrl = 1
triggerall = Vel X != 0 
triggerall = var(50) = 0
trigger1 = command = "y"
trigger2 = command = "b"

;LP
[State -1, Stand SPunch1]
type = ChangeState
value = 220
triggerall = command = "a"
triggerall = command != "holddown"
triggerall = Vel Y = 0 && stateno != 180
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = var(50) = 0 || (p2life > 2 && random%12 > AILevel)

;HP
[State -1, Stand LPunch1]
type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = Vel Y = 0 && stateno != 180
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = var(50) = 0 || (p2life > 2 && random%12 > AILevel)

;High Kick
[State -1]
type = ChangeState
value = 210
triggerall = command = "y"
triggerall = command != "holddown"
triggerall = Vel Y = 0 && stateno != 180
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(50) = 0 || (p2life > 2 && random%12 > AILevel)

;Low Kick
[State -1]
type = ChangeState
value = 225
triggerall = command = "b"
triggerall = command != "holddown"
triggerall = Vel Y = 0 && stateno != 180
trigger1 = statetype = S
trigger1 = ctrl = 1
trigger1 = var(50) = 0 || (p2life > 2 && random%12 > AILevel)

;--------AIIIIIIIIII
[State -1, RunMk]
type = ChangeState
value = 107
trigger1 = var(50) = 1 && p2bodydist x > 2 && random%30 < AILevel
triggerall = var(47) > 10 
triggerall = stateno != 107 && enemy,numhelper(7003) = 0 && inguarddist = 0
triggerall = statetype = S
triggerall = ctrl && p2stateno != [32,33]
triggerall = roundstate = 2 && p2stateno != 9010 && p2life > 1
trigger1 = p2movetype = H || (p2stateno = [120,159]) || random%12 > AILevel
triggerall = time > 3-AILevel

[State -1, thhep]
type = selfState
value = 24
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = statetype = S
triggerall = p2bodydist X <= 1 && backedgebodydist > 30
triggerall = roundstate = 2
triggerall = enemy,numexplod(24) = 0
triggerall = random%14 < AILevel
triggerall = p2statetype = S || p2statetype = C || p2stateno = 5120
trigger1 = p2stateno = [0,431] 
trigger2 = p2stateno = 52
trigger3 = p2stateno != 5120 && random%7 = 0
triggerall = time > 3-AILevel

[State -1, sweepdfs]
type = ChangeState
value = 245
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = random%14 < AILevel
triggerall = statetype = S
triggerall = p2dist x > 60 && p2bodydist X <= 70
triggerall = roundstate = 2
triggerall = p2stateno != 245
trigger1 = (p2stateno = [0,120))||(p2stateno = [200,240])||p2stateno = 430
trigger1 = random%7 = 0
trigger2 = p2stateno = 130 && enemy,time > 3
triggerall = time > 3-AILevel

[State -1, sweep defense]
type = ChangeState
value = 40
triggerall = Var(50) = 1
triggerall = ctrl && random%3 > 0
triggerall = random%8 < AILevel
triggerall = statetype = S
trigger1 = p2bodydist X <= 80 && backedgedist > 40
triggerall = roundstate = 2
trigger1 = p2bodydist x > 40
trigger1 = p2stateno = 245
trigger2 = p2bodydist x < 12 && p2stateno = 24

[State -1, sweep defense]
type = ChangeState
value = 400
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = random%8 < AILevel
triggerall = statetype = S || statetype = C
triggerall = p2bodydist X <= 40
triggerall = roundstate = 2 && random%3 > 0
triggerall = p2bodydist x > 10
trigger1 = p2stateno = 245
trigger1 = time > 3-AILevel

[State -1, uuppercut rh]
type = ChangeState
value = 430 - 190*(statetype != C&& random%2 = 0&&p2statetype != C&&p2stateno!= 430)
triggerall = ctrl && random%3 > 0
triggerall = roundstate = 2
triggerall = Var(50) = 1
trigger1 = p2bodydist x >= 0+10*(enemy,vel x > 0)
triggerall = random%8 < AILevel
trigger1 = p2bodydist X <= 20+10*(enemy,vel x > 0)
trigger1 = p2statetype = A
trigger1 = p2movetype != A
trigger1 = abs(p2dist y) > 40 && enemy,vel y > 0
triggerall = statetype = S || statetype = C
trigger2 = p2stateno = 9010 && enemy,time > 60
trigger2 = p2bodydist X <= 10
trigger3 = enemy,moveguarded > 3 || gethitvar(guarded) > 3
trigger3 = p2bodydist X <= 30 && p2statetype != C
trigger4 = p2bodydist x >= 0
trigger4 = p2bodydist X <= 20
trigger4 = enemy,anim = 430
triggerall = time > 3-AILevel

[State -1, blllccl]
type = ChangeState
value = 120
triggerall = Var(50) = 1
trigger1 = p2Movetype = A
trigger1 = p2BodyDist X < 52 + 10*(random%8 < AILevel)
trigger2 = stateno = 5120
trigger2 = p2BodyDist X < 52 + 10*(random%8 < AILevel)
trigger3 = inguarddist
triggerall = p2statetype != C
triggerall = ctrl = 1
triggerall = statetype != A && enemy,p2dist x > 0
triggerall = roundstate = 2 && prevstateno != 120
triggerall = random%8 < AILevel
triggerall = time > 3-AILevel

[State -1, blllccl]
type = ChangeState
value = 131
triggerall = Var(50) = 1
trigger1 = p2stateno = [245,246]
trigger1 = p2BodyDist X < 100 && random%3 > 0
triggerall = ctrl = 1 || stateno = [120,150]
triggerall = hitover
triggerall = statetype = C || statetype = S
triggerall = roundstate = 2
triggerall = random%6 < AILevel
triggerall = time > 3-AILevel
anim = 10+111*(stateno != 130)

[State -1, AI Jump Kick]
type = ChangeState
value = 620 -ifelse(vel x = 0, 10+10*(random%2 = 0||random%14 > AILevel), 10*(random%4 > 0&&p2statetype != A))
triggerall = Var(50) = 1
triggerall = statetype = A
triggerall = ctrl = 1
trigger1 =  pos y < var(57)-20 || vel y < 0
triggerall = p2life > 2
triggerall = roundstate = 2
trigger1 = p2dist X > 0 && p2statetype != L
triggerall = p2bodydist X < 70
triggerall = random%8 < AILevel
triggerall = time > 12-AILevel

[State -1, weep]
type = ChangeState
value = 220-20*((ctrl&&random%2 = 0&&p2bodydist x < 10)||(stateno = [200,201])) + 1*(stateno = 200||stateno = 220)
trigger1 = ctrl = 1
trigger2 = (stateno = [200,201]) || (stateno = [220,221])
trigger2 = time > 9 && time < 12
triggerall = Var(50) = 1
triggerall = (p2stateno = [200,241])||(p2stateno = [5000,5001])||p2movetype != A||backedgebodydist < 6
triggerall = statetype = S && p2statetype = S
triggerall = p2bodydist X <= 20
triggerall = ctrl || movecontact
triggerall = roundstate = 2
triggerall = ifelse(((p2stateno != [200,201])&&(p2stateno != [220,221])), 1, (enemy,time > 10))
triggerall = random%6 < AILevel || movecontact
triggerall = p2bodydist x > 3 && p2life > 1
triggerall = random%8 < AILevel
triggerall = time > 3-AILevel
