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

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

[Command]
name = "sp1"
command = D,F,x
time = 16

[Command]
name = "sp2"
command = ~D,B,a
time = 16

[Command]
name = "sp3"
command = F,F,b
time = 24

[Command]
name = "sp4"
command = F,D,B,b
time = 22

[Command]
name = "sp4"
command = F,DF,D,DB,B,b
time = 22

[Command]
name = "sp4"
command = DF,B,b
time = 22

[Command]
name = "sp4"
command = DF,DB,b
time = 22


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

[Command]
name = "fatal1"
command = F,F,F
time = 40

[Command]
name = "fatal2"
command = D,D,D
time = 40

[Command]
name = "fatal3"
command = B,B,B
time = 40


[Command]
name = "boobality"
command = c,c,a
time = 20

[Command]
name = "ebality"
command = c,c,x
time = 20

[Command]
name = "mercy"
command = D,D,c
time = 30

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

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

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

[Command]
name = "harakiri"
command = a,a,a
time = 40

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

;-| 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 = 
time = 1

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

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

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

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

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

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

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

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

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

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

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

[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]
;===========================================================================
;-[AI]----------------------------------------
;-----------------------------------
[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
triggerall = p2bodydist x < 10 && p2stateno = 9010 && numhelper(6969) > 0
trigger1 = var(50) = 0 && command = "stage"
trigger2 = var(50) = 1 && random%30 < AILevel
value = 4000

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


;---------------------------------------------------------------------------
;correr
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = stateno = 11
trigger1 = command = "run"
value = 11
;elem = 1
;ignorehitpause = 
;persistent = 



[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 = power > 0
triggerall = var(50) = 0
triggerall = stateno != 107
triggerall = statetype = S
triggerall = ctrl

;--[Special Moves]-----------------------------------------------------------

[State -1, purple star]
type = ChangeState
value = 1000
trigger1 = command = "sp1"
triggerall = statetype = S
triggerall = ctrl = 1 || (stateno = [200,201]) || (stateno = [220,221])
trigger1 = command != "run"
triggerall = roundstate = 2
triggerall = var(16) < 2
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = p2statetype != C && p2statetype != L && p2bodydist x > 60 && p2stateno != 1000 && !inguarddist
trigger2 = (p2movetype != H && p2bodydist x > 120)||(p2movetype = H && p2statetype = A && stateno = [200,221])
trigger2 = p2stateno != 5120 && var(50) = 1 && random%21 < AILevel
trigger2 = p2life > 1 || (p2stateno = 9010 && enemy,time > 60)

[State -1, airfire]
type = ChangeState
value = 1710
trigger1 = command = "sp2"
triggerall = (ctrl = 1 && statetype = A) || (stateno = [600,621])
triggerall = roundstate = 2
trigger1 = var(50) = 0 || (random%21 < AILevel && p2statetype = A && p2movetype = H && stateno%10 = 1 && stateno = [600,621])
trigger2 = ifelse(stateno = 621, (random%8 < AILevel), (random%14 < AILevel))
trigger2 = var(50) = 1 && p2bodydist x > 30 && p2bodydist x < 140 && inguarddist = 0
trigger2 = ifelse(stateno = 621, (time > 0), (time > 6 && enemy,numexplod(118) = 0))
trigger2 = p2stateno = 107||stateno = 621||movecontact > 0||p2movetype = H||p2stateno = 5120||(p2stateno = [0,20])
trigger2 = p2life > 1 || (p2stateno = 9010 && enemy,time > 120)

[State -1, drill]
type = ChangeState
value = 1720
trigger1 = command = "sp3"
triggerall = statetype = S || statetype = C
triggerall = ctrl = 1 || (stateno = [200,201]) || (stateno = [220,221])
triggerall = roundstate = 2
triggerall = var(16) < 2
triggerall = numexplod(12000) < 2
trigger1 = command != "run"
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = p2bodydist x > 6 && abs(p2dist y) < 30 && (p2stateno != [120,159]) && (p2stateno != (5050,5120])
trigger2 = var(50) = 1&&p2bodydist x < 150&&random%12 = 0&&p2stateno != 245&&p2stateno != 400&&p2stateno != 420
trigger2 = (p2bodydist x > 25&&p2stateno = [107,431])||enemy,moveguarded > 1||enemy,numexplod(118) > 0||p2stateno = 21239

[State -1, after drill]
type = ChangeState
value = ifelse(p2bodydist x < 25, (220-20*(p2bodydist x < 12 && abs(p2dist x) > 6)), 107)
triggerall = prevstateno = 1720 || p2stateno = 1730
triggerall = statetype = S || statetype = C
triggerall = ctrl = 1 || stateno = 107
triggerall = roundstate = 2 && p2bodydist x < 30
trigger1 = var(50) = 1 && random%12 < AILevel
trigger1 = p2life > 1

[State -1, knockdown]
type = ChangeState
value = 1740
trigger1 = command = "sp4"
triggerall = statetype = S || statetype = C
triggerall = ctrl = 1 || (stateno = [200,201]) || (stateno = [220,221])
triggerall = roundstate = 2
triggerall = var(16) < 2
triggerall = numexplod(1448) = 0 && enemy,numexplod(118) = 0
trigger1 = command != "run"
trigger1 = var(50) = 0 || random%6 > AILevel
trigger2 = p2bodydist x > 40 || movehit > 3
trigger2 = var(50) = 1 && p2bodydist x < 100 && abs(p2dist y) < 100 && random%18 = 0 && (p2stateno != [120,159])
trigger2 = (prevstateno = 1000 && p2movetype = H)||(movehit > 3&&p2statetype = A)||p2statetype = L||(p2stateno = [245,400])

[State -1, jump?]
type = ChangeState
value = ifelse(random%12 > AILevel, 1000, 2111)
triggerall = p2movetype = H && p2statetype = A && enemy,gethitvar(yvel) < -11
triggerall = prevstateno = 2008
triggerall = statetype = S || statetype = C
triggerall = ctrl = 1 || stateno = 107
triggerall = roundstate = 2
trigger1 = var(50) = 1 && random%8 < AILevel

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

[State -1,mercy]
type = ChangeState
value = 3997
triggerall = ctrl = 1
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
trigger2 = random + 600 < life || random%6 > AILevel

;-------------------------------
;finishers
;------------------------------

[State -1,fatal]
type = ChangeState
value = 3000
triggerall = p2bodydist X < 30
trigger1 = command = "fatal1"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%30 < AILevel

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

[State -1,fatal]
type = ChangeState
value = 3100
triggerall = p2bodydist X = (6,40)
trigger1 = command = "fatal2"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%30 < AILevel


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

[State -1,fatal]
type = ChangeState
value = 3200
triggerall = p2bodydist X = (60,160)
trigger1 = command = "fatal3"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = command != "run"
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%40 < AILevel

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

[State -1,boob]
type = ChangeState
value = 3400
triggerall = p2bodydist X< 50
trigger1 = command = "boobality"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%40 < AILevel

[State -1,sex]
type = ChangeState
value = 3450
triggerall = p2bodydist X< 50
trigger1 = command = "ebality"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%40 < AILevel


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

[State -1,babal]
type = ChangeState
value = 3600
triggerall = p2bodydist X = (30,300]
trigger1 = command = "babality"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = var(50) = 0
trigger2 = enemy,time > 90
trigger2 = var(50) = 1 && random%76 < AILevel && gametime%2 = 0


;----------------------------
[State -1,friedship]
type = ChangeState
value = 3700
triggerall = p2bodydist X = (30,280]
trigger1 = command = "friend"
triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
;triggerall = var(54) = 0; never blocked
trigger1 = var(50) = 0
trigger2 = enemy,time > 90
trigger2 = var(50) = 1 && random%76 < AILevel && gametime%2 = 0

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

[State -1,animal]
type = ChangeState
value = 3800
triggerall = p2bodydist X = (90,320)
trigger1 = command = "animality"

triggerall = p2stateno = 9010
triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = var(50) = 0
trigger2 = enemy,time > 60
trigger2 = var(50) = 1 && random%28 < AILevel

;--------------------------;
; --- Stage Fatalities --- ;
;--------------------------;

[State -1, MKPIT1]
type = ChangeState
value = 4300
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10000
triggerall = p2bodydist X <= 5
triggerall = p2name != "motaro"
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKBELLPIT]
type = ChangeState
value = 4302
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2name != "motaro"
triggerall = p2stateno = 9010
triggerall = var(30) = 10001
triggerall = p2bodydist X <= 5
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKPIT3]
type = ChangeState
value = 4304
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10002
triggerall = p2bodydist X <= 5
triggerall = p2name != "motaro"
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKPrison]
type = ChangeState
value = 4306
triggerall = command = "y"
triggerall = command = "holdback"
triggerall = p2stateno = 9010
triggerall = var(30) = 10003
triggerall = p2bodydist X <= 10
triggerall = facing = 1
triggerall = facing != -1
triggerall = p2name != "motaro"
trigger1 = statetype = S
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKBlood]
type = ChangeState
value = 4308
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10004
triggerall = p2name != "motaro"
triggerall = p2bodydist X <= 5
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKpress]
type = ChangeState
value = 4312
triggerall = command = "y"
triggerall = command = "holdback"
triggerall = p2stateno = 9010
triggerall = p2name != "motaro"
triggerall = FrontEdgeDist < 200
triggerall = var(30) = 10008
triggerall = p2bodydist X <= 10
triggerall = facing = 1
triggerall = facing != -1
trigger1 = statetype = S
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKgolden]
type = ChangeState
value = 4314
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2name != "motaro"
triggerall = p2stateno = 9010
triggerall = var(30) = 10012
triggerall = p2bodydist X <= 5
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, Shouse]
type = ChangeState
value = 4316
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10013
triggerall = p2name != "motaro"
triggerall = p2bodydist X <= 5
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, pit2]
type = ChangeState
value = 4318
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10014
triggerall = p2bodydist X <= 10
trigger1 = statetype = C
triggerall = p2name != "motaro"
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKsubway]
type = ChangeState
value = 4320
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = var(30) = 10007
triggerall = p2bodydist X <= 5
triggerall = p2name != "motaro"
triggerall = Numexplod(7878) = 1
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, tomb]
type = ChangeState
value = 4322
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = p2stateno = 9010
triggerall = p2name != "motaro"
triggerall = var(30) = 10015
triggerall = p2bodydist X <= 10
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

;--[MK Holdback, closeup moves]-----------------------------------------------

[State -1]
type = Changestate
value = 240
triggerall = command = "y"
triggerall = command = "holdback"
trigger1 = statetype = S
triggerall = Vel Y = 0
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;Sweep
[State -1]
type = Changestate
value = 245
trigger1 = command = "b"
trigger1 = command = "holdback"
trigger1 = statetype = S
triggerall = Vel Y = 0
trigger1 = ctrl = 1



;--[Regular moves]----------------------------------------------------------------------
; THROW

[State -1, 90932]
type = selfState
value = 24
triggerall = p2bodydist X <= 1
triggerall = command = "a"
trigger1 = ctrl = 1
triggerall = p2statetype != A && p2statetype != L
triggerall = statetype = S 
triggerall = p2name != "shao kahn,"
triggerall = p2name != "kintaro"
triggerall = p2name != "goro"
triggerall = p2name != "motaro"
triggerall = backedgedist > 15
triggerall = enemy,numexplod(24) = 0
triggerall = var(50) = 0

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

[State -1, 2]
type = ChangeState
value = 2101
triggerall = p2bodydist X <= 3
trigger1 = command = "y" || command = "b"
trigger1 = var(50) = 0 || random%6 > AILevel
triggerall = statetype = S 
triggerall = ctrl = 1
triggerall = Vel Y = 0 
triggerall = p2statetype = S || p2statetype = C 
trigger2 = (random%2 = 0 && AILevel < 6)|| p2statetype = C
trigger2 = var(50) = 1 && (p2movetype != A || p2stateno = [200,420])
trigger2 = random%20 < AILevel
trigger2 = p2life > 2
trigger2 = p2stateno != [120,159]
triggerall = roundstate = 2


[State -1, 3]
type = ChangeState
value = 2007
triggerall = p2bodydist X <= 3
trigger1 = command = "x"
trigger1 = var(50) = 0 || random%6 > AILevel
triggerall = statetype = S
triggerall = ctrl = 1
triggerall = Vel Y = 0 
triggerall = p2statetype = S 
trigger2 = var(50) = 1
trigger2 = random%20 < AILevel 
trigger2 = p2life > 2 || (p2stateno = 9010 && enemy,time > 30 && random%30 < AILevel)
trigger2 = p2stateno != [120,159]
triggerall = roundstate = 2




[State -1, Duck LK]
type = ChangeState
value = 400
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, Duck HK]
type = ChangeState
value = 410
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, Duck LP]
type = ChangeState
value = 420
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1
triggerall = Vel Y = 0

[State -1, MKUppercut]
type = ChangeState
value = 430
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl = 1
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
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
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
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
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 = power > 10 
triggerall = stateno != 107 && enemy,numhelper(7003) = 0 && inguarddist = 0 && p2stateno != [26,39]
triggerall = statetype = S
triggerall = ctrl
triggerall = roundstate = 2 && p2stateno != 9010 && p2life > 1
trigger1 = p2movetype = H || (p2stateno = [120,159]) || random%12 > AILevel

[State -1, thhep]
type = selfState
value = 24
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = statetype = S
triggerall = p2bodydist X <= 1 && backedgedist > 15
triggerall = roundstate = 2
triggerall = enemy,numexplod(24) = 0
triggerall = random%20 < AILevel
triggerall = p2statetype != A && p2statetype != L
trigger1 = p2stateno = 11 
trigger2 = p2stateno = 52
trigger3 = p2stateno = 245
trigger4 = p2stateno = 420
trigger5 = p2stateno = 410
trigger6 = p2stateno = 20
trigger7 = p2stateno = 107
trigger8 = p2stateno = [120,159]
trigger9 = p2stateno != 5120 && random%7 = 0
triggerall = p2name != "shao kahn,"
triggerall = p2name != "kintaro"
triggerall = p2name != "goro"
triggerall = p2name != "motaro"
triggerall = p2stateno != 9010 || random%6 > AILevel

[State -1, sweepdfs]
type = ChangeState
value = 245
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = random%25 < AILevel
triggerall = statetype = S
triggerall = p2bodydist X <= 40
triggerall = roundstate = 2
triggerall = p2stateno != 245
trigger1 = p2stateno = 11 
trigger2 = p2stateno = 245
trigger3 = p2stateno = 420
trigger4 = p2stateno = 410
trigger5 = p2stateno = 20
trigger6 = p2stateno = 107
trigger7 = p2stateno = 210
trigger8 = p2stateno = 225
trigger9 = p2stateno = 130
trigger10 = p2stateno = 140
trigger11 = p2stateno = 150

[State -1, anti-air defense]
type = ChangeState
value = 0 + 20*(random%2)
triggerall = Var(50) = 1
triggerall = random%9 < AILevel
triggerall = stateno = 40 && time = 0
trigger1 = p2bodydist X <= 30 && p2stateno = [600,620]
triggerall = roundstate = 2
trigger2 = p2stateno = 9010 && p2bodydist x > 20
ctrl = 1


[State -1, sweep defense]
type = ChangeState
value = 40
triggerall = Var(50) = 1
triggerall = ctrl = 1
triggerall = random%20 < 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%12 < AILevel
triggerall = statetype = S || statetype = C
triggerall = p2bodydist X <= 40
triggerall = roundstate = 2
triggerall = p2bodydist x > 10
trigger1 = p2stateno = 245

[State -1, uuppercuuuut lp]
type = ChangeState
value = 430 - 10*(random%2)
triggerall = ctrl = 1
triggerall = Var(50) = 1
triggerall = p2bodydist x > 2
triggerall = random%18 < AILevel
trigger1 = p2bodydist X <= 10
trigger1 = p2stateno = 0
trigger2 = p2bodydist X <= 10
trigger2 = p2stateno = 200
trigger3 = p2stateno = 620
trigger3 = p2bodydist X <= 40
trigger5 = p2stateno = 2002
trigger5 = p2name = "johnny cage"
trigger6 = p2stateno = 20
trigger6 = p2bodydist X <= 30
trigger7 = p2stateno = 107
trigger7 = p2bodydist X <= 50
trigger8 = p2stateno = 50
trigger8 = p2bodydist X <= 10
trigger9 = p2stateno = 210
trigger9 = p2bodydist X <= 90
trigger10 = p2stateno = 225
trigger10 = p2bodydist X <= 90
trigger11 = p2stateno = 430
trigger11 = p2bodydist X <= 30
trigger11 = stateno = 131
triggerall = statetype = C
triggerall = p2movetype != H
triggerall = roundstate = 2

[State -1, uuppercut hk]
type = ChangeState
value = 430 - 220*(random%2)
triggerall = ctrl = 1
triggerall = Var(50) = 1
triggerall = p2bodydist x > 2
triggerall = random%16 < AILevel
trigger1 = p2bodydist X <= 10
trigger1 = p2stateno = 0
trigger2 = p2bodydist X <= 10
trigger2 = p2stateno = 200
trigger3 = p2stateno = 620
trigger3 = p2bodydist X <= 40
trigger5 = p2stateno = 2002
trigger5 = p2name = "johnny cage"
trigger6 = p2stateno = 20
trigger6 = p2bodydist X <= 30
trigger7 = p2stateno = 107
trigger7 = p2bodydist X <= 50
trigger8 = p2stateno = 50
trigger8 = p2bodydist X <= 10
trigger9 = p2stateno = 210
trigger9 = p2bodydist X <= 90
trigger10 = p2stateno = 225
trigger10 = p2bodydist X <= 90
trigger11 = p2stateno = 430
trigger11 = p2bodydist X <= 30
trigger11 = stateno = 130
triggerall = statetype = S
triggerall = p2movetype != H
triggerall = roundstate = 2

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

[State -1, bllll]
type = ChangeState
value = 120
triggerall = Var(50) = 1
trigger2 = p2bodydist X > 100
trigger2 = p2stateno = 1000
trigger1 = p2Movetype = A
trigger1 = p2BodyDist X < 70 + 10*(random%8 < AILevel)
trigger3 = stateno = 5120
trigger3 = p2BodyDist X < 70 + 10*(random%8 < AILevel)
trigger4 = inguarddist && numexplod(1600) = 0
triggerall = p2statetype != C
triggerall = ctrl = 1
triggerall = statetype = S && enemy,p2dist x > 0
triggerall = roundstate = 2
triggerall = random%12 < AILevel

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

[State -1, blllccl]
type = ChangeState
value = 131
triggerall = Var(50) = 1
trigger1 = p2stateno = [245,246]
trigger1 = p2BodyDist X < 100
trigger2 = p2stateno = [400,420]
trigger2 = p2bodydist x < 30
trigger3 = p2statetype = C && p2movetype = A && inguarddist && p2stateno = [700,2999]
triggerall = ctrl = 1 || stateno = [120,150]
triggerall = hitshakeover
triggerall = statetype = C || statetype = S
triggerall = roundstate = 2
triggerall = random%6 < AILevel


[State -1, AI Jump Kick]
type = ChangeState
value = 620-10*(random%4> AILevel||p2statetype = S)*(p2bodydist x < 70||vel x = 0) -10*(random%4> AILevel||p2statetype = S)*(vel x = 0)
triggerall = Var(50) = 1
triggerall = statetype = A
triggerall = ctrl = 1 && time > 6
triggerall = p2life > 2
triggerall = roundstate = 2
trigger1 = p2bodydist X > 0 && p2bodydist X < 70
triggerall = random%12 < AILevel

[State -1, weep]
type = ChangeState
value = 410
triggerall = ctrl = 1
triggerall = Var(50) = 1
trigger1 = p2stateno = [200,221]
trigger2 = p2stateno = [130,135]
trigger3 = p2stateno = 245
triggerall = statetype = C
triggerall = p2bodydist X <= 10
triggerall = random%12 < AILevel
triggerall = roundstate = 2

[State -1, weep]
type = ChangeState
value = 220-20*((ctrl&&random%2 = 0&&p2bodydist x < 20)||(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 = 130&&ctrl)||(p2stateno = [5000,5001])||p2movetype != A
triggerall = statetype = S && p2statetype = S
triggerall = p2bodydist X <= 24
triggerall = ctrl = 1 || p2stateno != [130,131]
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

[State -1, weep1]
type = ChangeState
value = 400
triggerall = ctrl = 1
triggerall = random%12 < AILevel
triggerall = Var(50) = 1
trigger1 = p2stateno = [200,221]
trigger2 = p2stateno = [130,135]
trigger3 = p2stateno = 245
triggerall = statetype = C
triggerall = p2bodydist X <= 40
triggerall = roundstate = 2

