[Command]
Name = "SUPER"
Command = $D, DF, F, D, DF, F, x
time = 36
[Command]
Name = "SUPER"
Command = $D, DF, F, D, DF, F, y
time = 36
[Command]
Name = "SUPER"
Command = $D, DF, F, D, DF, F, z
time = 36
[Command]
Name = "waza1_light"
Command = ~D, DF, F, x
Time = 20
[Command]
Name = "waza1_middle"
Command = ~D, DF, F, y
Time = 20
[Command]
Name = "waza1_hard"
Command = ~D, DF, F, z
Time = 20
[Command]
Name = "waza2_light"
Command = ~D, DF, F, a
Time = 20
[Command]
Name = "waza2_middle"
Command = ~D, DF, F, b
Time = 20
[Command]
Name = "waza2_hard"
Command = ~D, DF, F, c
Time = 20

[Command]
Name = "waza3_light"
Command = F, ~D, DF, x
Time = 20
[Command]
Name = "waza3_middle"
Command = F, ~D, DF, y
Time = 20
[Command]
Name = "waza3_hard"
Command = F, ~D, DF, z
Time = 20

[Command]
Name = "WAZA4"
Command = ~D, DB, B, a
Time = 20
[Command]
Name = "WAZA4"
Command = ~D, DB, B, b
Time = 20
[Command]
Name = "WAZA4"
Command = ~D, DB, B, c
Time = 20

[Command]
Name = "FF"
Command = F, F
[Command]
Name = "BB"
Command = B, B

[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 = "fwd"
Command = F
Time = 1
[Command]
Name = "back"
Command = B
Time = 1
[Command]
Name = "up" 
Command = U
Time = 1
[Command]
Name = "down"
Command = D
Time = 1

[Command]
Name = "holda"
Command = /$a
Time = 1
[Command]
Name = "holdb"
Command = /$b
Time = 1
[Command]
Name = "holdc"
Command = /$c
Time = 1

[Command]
Name = "holdfwd"
Command = /$F
Time = 1
[Command]
Name = "holdback"
Command = /$B
Time = 1
[Command]
Name = "holdup" 
Command = /$U
Time = 1
[Command]
Name = "holddown"
Command = /$D
Time = 1

[Command]
Name = "recovery"
Command = a+b+c+x+y+z+s
Time = 0
[StateDef -1]
[State -1]
Type = ChangeState
Value = 2000
Triggerall = Command = "SUPER"
Triggerall = Power >= 1000
Trigger1 = StateType != A
Trigger1 = Ctrl
Trigger2 = Stateno = 200 && Movehit
Trigger3 = Stateno = 210 && Movehit
Trigger4 = Stateno = 300 && Movehit
Trigger5 = Stateno = 310 && Movehit
[State -1]
Type = ChangeState
Value = 1200
Triggerall = Command = "WAZA4"
Trigger1 = StateType != A
Trigger1 = Ctrl
Trigger2 = Stateno = 200 && Movehit
Trigger3 = Stateno = 210 && Movehit
Trigger4 = Stateno = 300 && Movehit
Trigger5 = Stateno = 310 && Movehit

[State -1]
Type = ChangeState
Trigger1 = (Command="waza3_light"||Command="waza3_middle"||Command="waza3_hard") && (StateType!=A||Var(13)) && (Ctrl||(Time<2&&StateNo=[200,399])||Var(6)>0||(Var(12)=-2&&MoveType=H&&HitShakeOver&&Pos Y<=0)) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="waza3_light", 1100, IFelse(Command="waza3_middle", 1101, 1102))
[State -1]
Type = ChangeState
Trigger1=(Command="waza1_light"||Command="waza1_middle"||Command="waza1_hard")&&!NumProjID(1)&&(StateType!=A||Var(13))&&(Ctrl||(Time<2&&StateNo=[200,399])||Var(6)>0||(Var(12)=-2&&MoveType=H&&HitShakeOver&&Pos Y<=0))&&Var(30)!=1&&RoundState=2
Value = IFelse(Command="waza1_light", 1000, IFelse(Command="waza1_middle", 1001, 1002))
[State -1]
Type = ChangeState
Trigger1=(Command="waza2_light"||Command="waza2_middle"||Command="waza2_hard")&&!NumProjID(1)&&(StateType!=A||Var(13))&&(Ctrl||(Time<2&&StateNo=[200,399])||Var(6)>0||(Var(12)=-2&&MoveType=H&&HitShakeOver&&Pos Y<=0))&&Var(30)!=1&&RoundState=2
Value = IFelse(Command="waza2_light", 1050, IFelse(Command="waza2_middle", 1051, 1052))
[State -1]
Type = ChangeState
Trigger1 = StateNo = 20 && (Command="y"||Command="z") && P2BodyDist X<(38*Const(Size.XScale)) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="y", 504, 500)
[State -1]
Type = ChangeState
Trigger1 = (Command="x"||Command="y"||Command="z") && P2Dist X < (60*Const(Size.XScale)) && StateType = S && (Ctrl||(Var(12)=-2&&MoveType=H&&HitShakeOver)) && Var(10) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="x",201,IFelse(Command="y", 211,221))
[State -1]
Type = ChangeState
Trigger1 = (Command="x"||Command="y"||Command="z"||Command="a"||Command="b"||Command="c") && StateType = S && (Ctrl||(Var(12)=-2&&MoveType=H&&HitShakeOver)) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="x",200,IFelse(Command="y", 210,IFelse(Command="z",220,IFelse(Command="a",230,IFelse(Command="b",240,250)))))
[State -1]
Type = ChangeState
Trigger1 = (Command="x"||Command="y"||Command="z"||Command="a"||Command="b"||Command="c") && StateType = C && (Ctrl||(Var(12)=-2&&MoveType=H&&HitShakeOver)) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="x", 300, IFelse(Command="y", 310, IFelse(Command="z", 320, IFelse(Command="a", 330, IFelse(Command="b", 340, 350)))))
[State -1]
Type = ChangeState
Trigger1 = (Command="x"||Command="y"||Command="z"||Command="a"||Command="b"||Command="c") && StateType = A && (Ctrl||(Var(12)=-2&&MoveType=H&&HitShakeOver&&Pos Y<=0)) && Var(30) != 1 && RoundState = 2
Value = IFelse(Command="x",400,IFelse(Command="y",410,IFelse(Command="z",420,IFelse(Command="a",430,IFelse(Command="b",440,450)))))

;---------------------------------------------------------------------------
; CPU AI System
;---------------------------------------------------------------------------
; Random AI
[State -1, Random]
type = VarRandom
trigger1 = Ctrl
trigger1 = AILevel > 0
trigger1 = RoundState = 2
ignorehitpause = 1
v = 33
range = 0,100

[State -1, VarSet]
type = VarSet
trigger1 = AILevel <= 0
trigger2 = RoundState != 2
ignorehitpause = 1
v = 33
value = 0

;---------------------------------------------------------------------------
; [SAGAT AI SYSTEM]
;---------------------------------------------------------------------------
; Tiger Shot High
[State -1, State]
type = ChangeState
value = 1002
triggerall = RoundState = 2
triggerall = NumHelper(1000) <= 0
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
triggerall = P2MoveType != H
trigger1 = P2BodyDist X > 100
trigger1 = Var(33) >= 70
trigger1 = Var(33) < 80
trigger1 = Ctrl

; Tiger Shot Low
[State -1, State]
type = ChangeState
value = 1052
triggerall = RoundState = 2
triggerall = NumHelper(1000) <= 0
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
triggerall = P2MoveType != H
trigger1 = P2BodyDist X > 100
trigger1 = Var(33) >= 80
trigger1 = Var(33) < 90
trigger1 = Ctrl

; Tiger Uppercut
[State -1, State]
type = ChangeState
value = 1102
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
triggerall = P2MoveType != H
trigger1 = P2BodyDist X > 25
trigger1 = P2BodyDist X < 50
trigger1 = Var(33) >= 90
trigger1 = Var(33) < 100
trigger2 = P2StateType = A
trigger2 = P2BodyDist X > 25
trigger2 = P2BodyDist X < 150
trigger2 = EnemyNear, Vel Y > 0
trigger2 = EnemyNear, Pos Y < 0

; Stand Medium Punch
[State -1, State]
type = ChangeState
value = 210
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
trigger1 = P2BodyDist X <= 50
trigger1 = Var(33) >= 10
trigger1 = Var(33) < 20
trigger1 = Ctrl

; Stand Strong Punch
[State -1, State]
type = ChangeState
value = 220
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
trigger1 = P2BodyDist X <= 50
trigger1 = Var(33) >= 20
trigger1 = Var(33) < 30
trigger1 = Ctrl

; Stand Light Kick
[State -1, State]
type = ChangeState
value = 230
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
trigger1 = P2BodyDist X <= 50
trigger1 = Var(33) >= 30
trigger1 = Var(33) < 50
trigger1 = Ctrl

; Crouch Light Punch
[State -1, State]
type = ChangeState
value = 300
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType != A
triggerall = P2StateType != L
triggerall = P2BodyDist X <= 75
trigger1 = P2StateNo >= 200
trigger1 = P2StateNo < 300
trigger1 = Var(33) > 0
trigger1 = Var(33) < 50
trigger2 = Var(33) >= 60
trigger2 = Var(33) < 70

; Jump Light Kick
[State -1, State]
type = ChangeState
value = 430
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType = A
triggerall = P2StateType != L
triggerall = P2BodyDist X <= 100
trigger1 = Var(33) >= 0
trigger1 = Var(33) < 10
trigger2 = Var(33) >= 30
trigger2 = Var(33) < 40

; Jump Medium Kick
[State -1, State]
type = ChangeState
value = 440
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType = A
triggerall = P2StateType != L
triggerall = P2BodyDist X <= 100
trigger1 = Var(33) >= 10
trigger1 = Var(33) < 20
trigger2 = Var(33) >= 40
trigger2 = Var(33) < 50

; Jump Strong Kick
[State -1, State]
type = ChangeState
value = 450
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = AILevel > 0
triggerall = StateNo < 120
triggerall = StateType = A
triggerall = P2StateType != L
triggerall = P2BodyDist X <= 100
trigger1 = Var(33) >= 20
trigger1 = Var(33) < 30
trigger2 = Var(33) >= 50
trigger2 = Var(33) < 60

;---------------------------------------------------------------------------
; [GUARD AI SYSTEM]
;---------------------------------------------------------------------------
; Crouch Guard
[State -1, Guard]
type = ChangeState
value = 131
triggerall = Ctrl
triggerall = AILevel > 0
triggerall = StateNo < 160
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = P2Dist X <= 100
trigger1 = EnemyNear, MoveType = A
trigger1 = EnemyNear, HitDefAttr = C, AA, AP

; Stand Guard
[State -1, Guard]
type = ChangeState
value = 130
triggerall = Ctrl
triggerall = AILevel > 0
triggerall = StateNo < 160
triggerall = RoundState = 2
triggerall = StateType != A
triggerall = P2Dist X <= 100
trigger1 = P2StateType = A
trigger1 = EnemyNear, MoveType != H
trigger2 = EnemyNear, MoveType = A
trigger2 = EnemyNear, HitDefAttr = S, AA, AP
trigger3 = P2StateNo >= 1000
trigger3 = P2StateNo < 3000
trigger3 = P2MoveType != H
trigger3 = P2MoveType = A

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