; Common state file for M.U.G.E.N beta 2002.04.14
;
; System variables usage
; ----------------------
; Var name    Type   Purpose
; --------    ----   -------
; sysvar(0)   Temp   Set by state 5081 (HITL_SLIDE) to 1 to prevent
;                    showing ground hit frame in state 5110 (HIT_LIEDOWN).
;                    Used by guarding states.
; sysvar(1)   Temp   Used by state 40 (Jump Start) amd 45 (Air Jump Start)
;                    to keep track of which way to jump.
;                    Used by state 5100 and 5110 to remember downward
;                    velocity of player just before hitting the ground.
;                    Used in state 5080 for storing the anim # to display.

; The following states have special handling within MUGEN, and should be
; overridden with caution:
; Jump Start (40): airjumping bookkeeping at time = 0
; All guard states (120-155): guard handling throughout state
; Hit_trip, shaking (5070): defence increases at time = 0
; Hit_bounce (5100): defence increases at time = 0, player becomes
;                    invincible if within 10 ticks of getting up
; Hit_liedown (5110): player changes to get-up state (5120) when ready
; Hit_getup (5120): player's defence is restored to normal at time = 0
; Hitfall_recover (5200): player's defence is restored at time = 0
; Hitfall_airrecover (5210): player's defence is restored at time = 0

;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = CtrlSet
Trigger1 = PrevStateNo = 950
Trigger1 = Time = 1
Value = 1

[State -1]
Type = VarSet
TriggerAll = Ctrl
TriggerAll = Var(58) != 0
Trigger1 = Time = 0
V = 58
Value = 0

[State -1]
Type = ChangeState
TriggerAll = Ctrl
TriggerAll = Var(58) = 0
TriggerAll = RoundState = 2
Trigger1 = PrevStateNo = [10010,10011]
Value = 11

[State -1]
Type = ChangeState
TriggerAll = Ctrl
TriggerAll = Var(58) = 0
TriggerAll = RoundState = 2
Trigger1 = PrevStateNo = 10020
Value = 20

[State 0, 1]
type = ChangeAnim
trigger1 = PrevStateNo = [19,20]
trigger1 = Anim = [20,21]
trigger1 = Time = 0
value = Anim+5

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5 && Anim != [25,26]
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

[State -1]
Type = ChangeAnim
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
TriggerAll = P2Dist X < 0
Trigger1 = Anim = 0
Value = 5

[State -1]
Type = ChangeAnim
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Anim != 0 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 0

[State -1]
Type = Turn
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
TriggerAll = P2Dist X < 0
Trigger1 = Anim = 5

[State -1]
Type = PlayerPush
Trigger1 = Var(58) = [1,2]
Value = 0

[State -1]
Type = ChangeState
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Command = "holddown"
Value = 10010

[State -1]
Type = ChangeState
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Command = "holdfwd" || Command = "holdback"
Value = 10020

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
sprpriority = 0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
trigger2 = Anim != 6 && Anim != 11
value = 11

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Walk(AI)
[Statedef 19]
type    = S
physics = S
Ctrl = 1
sprpriority = 0

[State 20, 1]
type = VelSet
Trigger1 = Var(59) = [0,3]
Trigger1 = P2StateType != L
Trigger2 = Var(59) = 4
Trigger2 = P2StateType != L
Trigger3 = Var(59) > 0
Trigger3 = P2StateType = L
Trigger3 = P2BodyDist X >= 60
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
Trigger1 = Var(59) = [0,3]
Trigger1 = P2StateType != L
Trigger2 = Var(59) > 0
Trigger2 = P2StateType = L
Trigger2 = P2BodyDist X <= 30
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 = P2StateType != L
Trigger1 = P2BodyDist X < 0
Trigger2 = P2StateType = L
Trigger2 = P2BodyDist X = [30,60]
Value = 0
Ctrl = 1
IgnoreHitPause = 1

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = 1
Value = 0
Ctrl = 1
IgnoreHitPause = 1

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 = P2StateType != L
Trigger2 = P2StateType = L
Value = 19
Ctrl = 1
IgnoreHitPause = 1

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;---------------------------------------------------------------------------
; Jump Start(AI)
[Statedef 39]
type    = S
physics = S
ctrl = 0
velset = 0,0
sprpriority = 1
Facep2 = 1

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = VarSet
Trigger1 = (PrevStateNo = [200,259])
Trigger2 = (PrevStateNo = [400,429])
Trigger3 = PrevStateNo = 905 || PrevStateNo = 1700 || PrevStateNo = 1750 || PrevStateNo = 2700
V = 10
Value = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 1]
type = VarSet
triggerall = SysVar(3) = 0
triggerall = P2StateNo != 5120
triggerall = Time = 0
Trigger1 = P2MoveType = H 
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X = [-30,-20]
Trigger2 = P2MoveType != H
Trigger2 = P2BodyDist X = [0,80]
Trigger3 = P2MoveType != H
Trigger3 = P2BodyDist X > 80
sysvar(1) = 0

[State 40, 2]
type = VarSet
triggerall = Time = 0
Trigger1 = P2MoveType = H 
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X > -20
trigger2 = SysVar(3) = [1,2]
Trigger3 = P2MoveType != H
Trigger3 = P2BodyDist X = [0,80]
Trigger4 = P2MoveType != H
Trigger4 = P2BodyDist X > 80
Trigger5 = P2StateNo = 5120
sysvar(1) = 1

[State 40, 3]
type = VarSet
triggerall = SysVar(3) = 0
triggerall = P2StateNo != 5120
triggerall = Time = 0
Trigger1 = P2MoveType = H 
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X < -30
Trigger2 = P2MoveType != H
Trigger2 = P2BodyDist X = [0,80]
Trigger3 = P2MoveType != H
Trigger3 = P2BodyDist X > 80
Trigger4 = P2MoveType != H
Trigger4 = PrevStateNo = [200,499]
sysvar(1) = -1

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = sysvar(1) = 0
value = 40

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
triggerall = SysVar(3) = 0
trigger1 = sysvar(1) = 1
value = 41

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
triggerall = SysVar(3) = 0
trigger1 = sysvar(1) = -1
value = 42

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
triggerall = SysVar(3) = 1
trigger1 = sysvar(1) = 1
value = 43

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = SysVar(3) = 10
trigger1 = sysvar(1) = 0
value = 44

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5];慜僴僀僕儍儞僾帪
type = VelSet
trigger1 = sysvar(1) = 1
trigger1 = SysVar(3) = 1
trigger1 = AnimTime = 0
x = 6.75
y = const(velocity.jump.y)

[State 40, 5];僯儏乕僩儔儖僴僀僕儍儞僾帪
type = VelSet
trigger1 = sysvar(1) = 0
trigger1 = SysVar(3) = 10
trigger1 = AnimTime = 0
x = 0
y = const(velocity.jump.y)-3.2

[State -1]
Type = VarSet
Trigger1 = AnimTime = 0
V = 11
Value = Var(11)+100

[State -2]
Type = VarSet
Trigger1 = AnimTime = 0
V = 12
Value = Var(12)*2

[State -1]
Type = HitBy
Trigger1 = SysVar(3) = 0
Trigger1 = Time = 0
Value = SCA, AA,AP,ST,HT
Value2 = CA, NT
Time = IfElse(SysVar(1)=-1,5,4)

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10042
ID = 10042
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10040
ID = 10040
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10041
ID = 10041
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Helper
Trigger1 = SysVar(1) = 0
Trigger1 = SysVar(3) = 10
Trigger1 = AnimTime = -1
StateNo = 10043
ID = 10043
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
ctrl = 0
velset = 0,0
sprpriority = 1

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 = Time = 0
Value = 0
Ctrl = 1
IgnoreHitPause = 1

[State -1]
Type = VarSet
Trigger1 = (PrevStateNo = [200,259])
Trigger2 = (PrevStateNo = [400,429])
Trigger3 = PrevStateNo = 905 || PrevStateNo = 1700 || PrevStateNo = 1750 || PrevStateNo = 2700
V = 10
Value = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
triggerall = Time = 0
trigger1 = SysVar(3) = 0
trigger1 = p2dist X < 0 && command = "holdback" || p2dist X >= 0 && command = "holdfwd"
trigger2 = SysVar(3) = 1
sysvar(1) = 1

[State 40, 3]
type = VarSet
triggerall = Time = 0
trigger1 = SysVar(3) = 0
trigger1 = p2dist X < 0 && command = "holdfwd" || p2dist X >= 0 && command = "holdback"
sysvar(1) = -1

[State -1]
Type = Turn
TriggerAll = Time = 0
Trigger1 = P2Dist X < 0

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = sysvar(1) = 0
value = 40

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = SysVar(3) = 0
trigger1 = sysvar(1) = 1
value = 41

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = SysVar(3) = 0
trigger1 = sysvar(1) = -1
value = 42

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = SysVar(3) = 1
trigger1 = sysvar(1) = 1
value = 43

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = SysVar(3) = 10
trigger1 = sysvar(1) = 0
value = 44

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5];慜僴僀僕儍儞僾帪
type = VelSet
trigger1 = sysvar(1) = 1
trigger1 = SysVar(3) = 1
trigger1 = AnimTime = 0
x = 6.75
y = const(velocity.jump.y)

[State 40, 5];僯儏乕僩儔儖僴僀僕儍儞僾帪
type = VelSet
trigger1 = sysvar(1) = 0
trigger1 = SysVar(3) = 10
trigger1 = AnimTime = 0
x = 0
y = const(velocity.jump.y)-3.2

[State -1]
Type = VarSet
Trigger1 = AnimTime = 0
V = 11
Value = Var(11)+100

[State -2]
Type = VarSet
Trigger1 = AnimTime = 0
V = 12
Value = Var(12)*2

[State -1]
Type = HitBy
Trigger1 = SysVar(3) = 0
Trigger1 = Time = 0
Value = SCA, AA,AP,ST,HT
Value2 = CA, NT
Time = IfElse(SysVar(1)=-1,5,4)

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10042
ID = 10042
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10040
ID = 10040
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = SysVar(1) = 1
Trigger1 = SysVar(3) = 1
Trigger1 = AnimTime = -1
Anim = 10041
ID = 10041
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Helper
Trigger1 = SysVar(1) = 0
Trigger1 = SysVar(3) = 10
Trigger1 = AnimTime = -1
StateNo = 10043
ID = 10043
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;慜僴僀僕儍儞僾
[Statedef 41]
Type    = U
Physics = U

[State -1] 
Type = VarSet
Trigger1 = Time = 0
sysvar(3) = 1

[State -1]
Type = VarSet
Trigger1 = StateType = A
V = 12
Value = 0

[State -1]
Type = VarSet
TriggerAll = Var(40) < 91
TriggerAll = Time = 0
Trigger1 = PrevStateNo = [920,923]
IgnoreHitPause = 1
V = 40
Value = 91

[State -1]
Type = VarAdd
TriggerAll = Var(57)%10 != [2,3]
TriggerAll = Time = 0
Trigger1 = PrevStateNo = [920,923]
IgnoreHitPause = 1
FV = 11
Value = -0.40

[State -1, AI] 
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 = SysVar(3) = 1
Trigger1 = StateType != A
Value = 39

[State -1] 
Type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = SysVar(3) = 1
Trigger1 = StateType != A
Value = 40

[State -1] 
Type = ChangeState
Trigger1 = SysVar(3) = 1
Trigger1 = StateType = A
Value = 45

;---------------------------------------------------------------------------
;僯儏乕僩儔儖僴僀僕儍儞僾
[Statedef 42]
Type    = U
Physics = U

[State -1] 
Type = VarSet
Trigger1 = Time = 0
sysvar(3) = 10

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 12
Value = 0

[State -1, AI] 
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 = SysVar(3) = 10
Trigger1 = StateType != A
Value = 39

[State -1] 
Type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = SysVar(3) = 10
Trigger1 = StateType != A
Value = 40

;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = VarSet
TriggerAll = Var(40) < 91
TriggerAll = Time = 0
Trigger1 = PrevStateNo = [920,923]
IgnoreHitPause = 1
V = 40
Value = 91

[State -1]
Type = VarAdd
TriggerAll = Var(57)%10 != [2,3]
TriggerAll = Time = 0
Trigger1 = PrevStateNo = [920,923]
IgnoreHitPause = 1
FV = 11
Value = -0.40

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 11
Value = Var(11)+1

[State -1]
Type = VarSet
Trigger1 = Command = "holdup" || Command = "holddown" || Command = "holdfwd" || Command = "holdback"
V = 51
Value = 2
IgnoreHitPause = 1

[State 45, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
TriggerAll = Var(59) <= 0
TriggerAll = SysVar(1) = 0
Trigger1 = P2Dist X >= 0
trigger1 = command = "holdfwd"
Trigger2 = P2Dist X < 0
trigger2 = command = "holdback"
trigger3 = SysVar(3) = 1
sysvar(1) = 1

[State 45, 5]
type = VarSet
TriggerAll = Var(59) <= 0
TriggerAll = SysVar(1) = 0
trigger1 = SysVar(3) = 0
Trigger1 = P2Dist X >= 0
trigger1 = command = "holdback"
trigger2 = SysVar(3) = 0
Trigger2 = P2Dist X < 0
trigger2 = command = "holdfwd"
sysvar(1) = -1

[State 45, 3]
type = VarSet
TriggerAll = Var(59) > 0
triggerall = SysVar(3) = 0
Trigger1 = P2MoveType = H
Trigger1 = P2StateType = A
Trigger1 = P2BodyDist X = [-25,-15]
trigger1 = Time = 0
Trigger2 = P2MoveType != H
trigger2 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
TriggerAll = Var(59) > 0
Trigger1 = P2MoveType = H 
Trigger1 = P2StateType = A
trigger1 = Time = 0
Trigger1 = P2BodyDist X > -15
trigger2 = SysVar(3) = 1
Trigger3 = P2MoveType != H
trigger3 = Time = 0
trigger4 = var(10) = 1
trigger5 = P2MoveType = H
trigger5 = P2StateNo = [120,155]
sysvar(1) = 1

[State 45, 5]
type = VarSet
TriggerAll = Var(59) > 0
triggerall = SysVar(3) = 0
triggerall = var(10) = 0
Trigger1 = P2MoveType = H 
Trigger1 = P2StateType = A
trigger1 = Time = 0
Trigger1 = P2BodyDist X < -25
Trigger2 = P2MoveType != H
trigger2 = Time = 0
Trigger3 = P2MoveType = A
Trigger3 = PrevStateNo = [600,699]
trigger3 = Time = 0
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 0
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State -1]
Type = Explod
TriggerAll = SysVar(3) = 0
Trigger1 = Time = 0
Anim = 10050
ID = 10050
Postype = P1
Pos = 0,-10
Ownpal = 1
Scale = 0.5,0.5
SprPriority = 4
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Helper
TriggerAll = SysVar(3) = 1
Trigger1 = Time = 0
StateNo = 10051
ID = 10051
Postype = P1
Pos = -10,-20
Ownpal = 1
SprPriority = 4
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 45, 7]
type = ChangeState
trigger1 = Time = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State -1]
Type = VelSet
Trigger1 = PrevStateNo = 45
Trigger1 = Time = 0
Trigger1 = P2Dist X < 0
X = -Vel X

[State -1]
Type = Turn
Trigger1 = PrevStateNo = 45
Trigger1 = Time = 0
Trigger1 = P2Dist X < 0

[State -1]
Type = VarSet
Trigger1 = Var(11)/100%10 = 1
Trigger1 = Time = 3
V = 11
Value = Var(11)-100

[State -1];僴僀僕儍儞僾帪
Type = PlaySnd
Triggerall = Time = 0
Trigger1 = SysVar(3) = 1 || SysVar(3) = 10
Trigger1 = PrevStateNo = [39,40]
Value = s40,0
Channel = 8

[State -1];僴僀僕儍儞僾帪
Type = PlaySnd
Triggerall = Time = 0
Trigger1 = SysVar(3) = 1
Trigger1 = sysvar(1) = 1
Trigger1 = PrevStateNo = 45
Value = s40,0
Channel = 8
IgnoreHitPause = 1

[State -1]
Type = VelAdd
Trigger1 = Time = 0
Trigger1 = SysVar(3) = 1
Trigger1 = sysvar(1) = 1
Trigger1 = PrevStateNo = 45
X = 1.4
Y = -2.0
IgnoreHitPause = 1

[State -1]
Type = VelAdd
Trigger1 = sysvar(1) = 1
Trigger1 = Const(velocity.airjump.fwd.x) < Vel X
Trigger1 = PrevStateNo = 45
Y = -.04
IgnoreHitPause = 1

[State -1]
Type = Helper
Trigger1 = Var(0)%10 = 0
Trigger1 = Time >= 1
Trigger1 = Const(velocity.airjump.fwd.x) < Vel X
Trigger1 = sysvar(1) = 1
Trigger1 = PrevStateNo = 45
StateNo = 855
ID = 855
Ownpal = 1
Keyctrl = 0
SprPriority = -5
Persistent = 1

[State 50, 1]
type = Null;VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 1]
type = VelAdd
trigger1 = Time = [12,26]
trigger1 = Vel X <= 2.6
trigger1 = sysvar(1) = 0
trigger1 = command != "holdup"
trigger1 = command = "holdfwd"
x = .2

[State 50, 1]
type = VelAdd
trigger1 = Time = [12,26]
trigger1 = Vel X >= -2.6
trigger1 = sysvar(1) = 0
trigger1 = command != "holdup"
trigger1 = command = "holdback"
x = -.2

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((sysvar(1))=0, 60, ifelse((sysvar(1))=1, 61, 62))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = PosFreeze
Trigger1 = PrevStateNo = 950
Trigger1 = Time = [0,1]

[State -1]
Type = CtrlSet
Trigger1 = PrevStateNo = 950
Trigger1 = Time = 1
Value = 1

[State -1]
Type = ChangeAnim
Trigger1 = PrevStateNo = 950
Trigger1 = Anim != 60
Value = 60
Elem = 9

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
velset = 0,0
ctrl = 0

[State -1]
Type = NotHitBy
Trigger1 = Var(57)%10 = 2
Trigger1 = PrevStateNo = 870
Trigger1 = Time = 0
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 15

[State -1]
Type = VarSet
Trigger1 = Var(2)/1000%10 != 0
Trigger1 = Var(57)%10 != 3
Trigger1 = PrevStateNo = [610,619]
V = 9
Value = 1

[State -1]
Type = VarSet
Trigger1 = Var(2)/1000%10 != 0
Trigger1 = Var(57)%10 != 3
Trigger1 = PrevStateNo = [620,699]
V = 9
Value = 2

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 11
Value = 0

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 12
Value = 0

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 10052
ID = 10052
PosType = P1
Pos = 0,0
Ownpal = 1
Scale = 0.5,0.5
SprPriority = 0
IgnoreHitPause = 1
RemoveTime = -2
RemoveOnGetHit = 1

[State -1]
Type = PlaySnd
Trigger1 = Time = 0
Value = s40, 1

[State -1]
Type = CtrlSet
Trigger1 = PrevStateNo = [920,923]
Trigger1 = Var(2)/100%10 != 0
Value = 1

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = CtrlSet
Trigger1 = PrevStateNo != 970
Trigger1 = PrevStateNo != [920,923]
Trigger1 = PrevStateNo != [820,839]
Trigger1 = PrevStateNo != 870
Trigger1 = PrevStateNo != 760
Trigger1 = PrevStateNo != [610,699]
Trigger1 = PrevStateNo != [110,119]
Trigger1 = PrevStateNo != [1000,1099]
Trigger1 = PrevStateNo != [2000,2099]
Trigger1 = PrevStateNo != [1250,1299]
Trigger1 = PrevStateNo != [1500,1599]
Trigger1 = PrevStateNo != 2500
Trigger1 = Time = 0
Trigger2 = (PrevStateNo = [110,119]) && Time = 9
Trigger3 = (PrevStateNo = [610,619]) && Time = 1
Trigger4 = (PrevStateNo = [620,699]) && Time = 2
Trigger5 = PrevStateNo = 760 && Time = 11
Trigger6 = (PrevStateNo = [820,839]) && Time = 13
Trigger7 = (PrevStateNo = [920,923]) && Time = 13
Trigger8 = PrevStateNo = 870 && Time = 13
Trigger9 = PrevStateNo = 970 && Time = 13
Trigger10 = (PrevStateNo = [1000,1049]) && Time = 13
Trigger11 = (PrevStateNo = [1050,1099]) && Time = 6
Trigger12 = PrevStateNo = 2000 && Time = 13
Trigger13 = PrevStateNo = 2050 && Time = 6
Trigger14 = (PrevStateNo = [1250,1299]) && Time = 2
Trigger15 = PrevStateNo = 1500 && Time = 2
Trigger16 = PrevStateNo = 1550 && Time = 6
Trigger17 = PrevStateNo = 2500 && Time = 4
Value = 1

[State -1]
Type = Turn
Trigger1 = P2Dist X < 0

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = sysvar(1) = 0
value = 47

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = sysvar(1) = 1
value = 48

[State 50, 2]
type = ChangeAnim
triggerall = Time = 0
trigger1 = sysvar(1) = -1
value = 49

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State -1]
Type = VarSet
Trigger1 = Time = 0
sysvar(3) = 0

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
ctrl = 0
sprpriority = 1

[State -1]
type = PlaySnd
trigger1 = AnimElem = 3
value = s110, 0

[State -1]
Type = VarRandom
Trigger1 = AnimElem = 3
V = 1
Range = 0,2
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 0
Trigger1 = AnimElem = 3
Value = s100, 0
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 1
Trigger1 = AnimElem = 3
Value = s100, 1
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = AnimElem = 3
Anim = 10102
ID = 10102
Postype = P1
Pos = 28,5
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = AnimElem = 3
Anim = 10100
ID = 10100
Postype = P1
Pos = 28,5
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = AnimElem = 3
Anim = 10101
ID = 10101
Postype = P1
Pos = 28,5
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 100, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 100, 1]
type = VelSet
trigger1 = Time = [8,17]
x = 9

[State 100, 1]
type = VelSet
trigger1 = Time = [18,19]
x = 7

[State 100, 1]
type = VelSet
trigger1 = Time = [20,21]
x = 5

[State 100, 1]
type = VelSet
trigger1 = Time = [22,23]
x = 4

[State 100, 1]
type = VelSet
trigger1 = Time = [24,25]
x = 3

[State 100, 1]
type = VelSet
trigger1 = Time = [26,27]
x = 2

[State 100, 1]
type = VelSet
trigger1 = Time = [28,29]
x = 1

[State 100, 1]
type = VelSet
trigger1 = Time = 30
x = 0

[State 100, 4]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN2 (land)
[Statedef 101]
type    = S
physics = S
ctrl = 0
anim = 101

[State 101, 2]
type = VelSet
trigger1 = Time = [0,1]
x = 2.9

[State 101, 2]
type = VelSet
trigger1 = Time = [2,3]
x = 2.4

[State 101, 2]
type = VelSet
trigger1 = Time = [4,5]
x = 1.9

[State 101, 2]
type = VelSet
trigger1 = Time = [6,7]
x = 1.4

[State 101, 2]
type = VelSet
trigger1 = Time = [8,9]
x = 0.9

[State 101, 4]
type = VelSet
trigger1 = AnimElem = 4
x = 0

[State 101, 5]
type = ChangeState
trigger1 = animtime= 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = S
ctrl = 0
anim = 105
sprpriority = 1

[State -1]
Type = NotHitBy
Trigger1 = Time <= 15
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 1

[State -1]
type = PlaySnd
trigger1 = AnimElem = 2
value = s30, 1

[State -1]
Type = VarRandom
Trigger1 = AnimElem = 2
V = 1
Range = 0,1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 0
Trigger1 = AnimElem = 2
Value = s105, 0
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = StateTypeSet
trigger1 = AnimElem = 2
StateType = A

[State -1]
type = StateTypeSet
trigger1 = AnimElem = 11
StateType = S

[State -1]
type = PlaySnd
trigger1 = AnimElem = 11
value = s40, 1

[State 100, 1]
type = VelSet
trigger1 = Time = [1,2]
x = -5

[State 100, 1]
type = VelSet
trigger1 = Time = [3,13]
x = -6

[State 100, 1]
type = VelSet
trigger1 = Time = 14
x = -4

[State 100, 1]
type = VelSet
trigger1 = Time = 25
x = 0

[State 100, 1]
type = PosAdd
trigger1 = Time = [3,4]
Y = -3

[State 100, 1]
type = PosAdd
trigger1 = Time = [5,6]
Y = -2

[State 100, 1]
type = PosAdd
trigger1 = Time = [7,9]
Y = -1

[State 100, 1]
type = PosAdd
trigger1 = Time = [10,12]
Y = 1

[State 100, 1]
type = PosAdd
trigger1 = Time = [13,14]
Y = 2

[State 100, 1]
type = PosAdd
trigger1 = Time = [15,16]
Y = 3

[State 105, 3]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type    = S
physics = S
anim = 106

[State -1]
type = PlaySnd
trigger1 = Time = 1
value = s0, 0

[State 106, 1]
type = VelSet
trigger1 = Time >= 0
x = -2.5

[State 106, 2]
type = VelSet
trigger1 = Time >= 7
x = -1

[State 106, 3]
type = VelSet
trigger1 = Time >= 13
x = -0.5

[State 106, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 6]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 嬻拞慜僟僢僔儏
[Statedef 110]
Type    = A
Physics = A
Anim    = 110
Ctrl    = 0
VelSet  = 0,0

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 1

[State -1]
type = PlaySnd
trigger1 = Time = 3
value = s110, 0

[State -1]
Type = VarRandom
Trigger1 = AnimElem = 2
V = 1
Range = 0,2
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 0
Trigger1 = AnimElem = 2
Value = s110, 1
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 1
Trigger1 = AnimElem = 2
Value = s110, 2
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = AnimElem = 2
Anim = 10110+Random%3
ID = 111
Postype = P1
Pos = 35,-55
Scale = 0.5,0.5
VFacing = IfElse(Random%2=0,1,-1)
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
Removetime = -2
Removeongethit = 1

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 11
Value = Var(11)+10

[State -1, VelSet]
Type = VelSet
Trigger1 = Time = [0,3]
X = 0
Y = 0

[State -1, VelSet]
Type = VelSet
Trigger1 = Time = [4,18]
X = 7
Y = 0

[State -1, VelSet]
Type = VelSet
Trigger1 = Time > 19
X = 2.5

[State -1, CtrlSet]
Type = CtrlSet
Trigger1 = Time >= IfElse(Var(57)/10%10=4,5,10)
Value = 1

;---------------------------------------------------------------------------
; 嬻拞屻僟僢僔儏
[Statedef 115]
Type    = A
Physics = A
Anim    = 115
Ctrl    = 0
VelSet  = 0,0

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = -1

[State -1]
type = PlaySnd
trigger1 = Time = 2
value = s110, 0

[State -1]
Type = VarRandom
Trigger1 = AnimElem = 2
V = 1
Range = 0,1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = PlaySnd
Trigger1 = Var(1) = 0
Trigger1 = AnimElem = 2
Value = s115, 0
Channel = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = AnimElem = 2
Anim = 10110+Random%3
ID = 116
Postype = P1
Pos = -40,-55
Scale = 0.5,0.5
Facing = -1
VFacing = IfElse(Random%2=0,1,-1)
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
Removetime = -2
Removeongethit = 1

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 11
Value = Var(11)+10

[State -1, VelSet]
Type = VelSet
Trigger1 = Time = [0,2]
X = 0
Y = 0

[State -1, VelSet]
Type = VelSet
Trigger1 = Time = [3,4]
X = -3.5

[State -1, VelSet]
Type = VelSet
Trigger1 = Time = 3
Y = -2.4

[State -1, CtrlSet]
Type = CtrlSet
Trigger1 = Time >= IfElse(Var(57)/10%10=4,5,11)
Value = 1

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 2]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0 && statetype = S
physics = S

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = A
StateType = S
Physics = S

[State 120, 3]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0 && statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = C
StateType = C
Physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = 1
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S
ctrl = 1

[State -1]
Type = Explod
TriggerAll = Time = 0
Trigger1 = PrevStateNo = 132
Trigger2 = PrevStateNo = 155
Anim = 10052
ID = 10052
PosType = P1
Pos = 0,0
Ownpal = 1
Scale = 0.5,0.5
SprPriority = 0
IgnoreHitPause = 1
RemoveTime = -2
RemoveOnGetHit = 1

[State -1]
Type = PlaySnd
TriggerAll = Time = 0
Trigger1 = PrevStateNo = 132
Trigger2 = PrevStateNo = 155
Value = s40, 1

[State 130, 1]
type = ChangeAnim
trigger1 = Anim = [130,132]
trigger2 = Anim = [150,153]
value = 130

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != [130,132]
trigger1 = Anim != 21
value = 21

[State -1]
Type = VelSet
Trigger1 = Anim = 21
X = Const(velocity.walk.back.x)

[State 130, Hi to Lo]
type = ChangeState
TriggerAll = Var(59) <= 0
trigger1 = command = "holddown"
value = 131

[State -1, AI]
type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = EnemyNear,MoveType = A
Trigger1 = P2StateType = C
Value = 131

[State 130, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
TriggerAll = Anim != 21
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State 130, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
TriggerAll = Anim = 21
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 0+(Command = "holdback")*20

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = Anim != 21
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 140

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = Anim = 21
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 0

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C
ctrl = 1

[State 130, 1]
type = ChangeAnim
trigger1 = Anim = [130,132]
trigger2 = Anim = [150,153]
value = 131

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != [130,132]
trigger1 = Anim != 11
value = 11

[State 131, Lo to Hi]
type = ChangeState
TriggerAll = Var(59) <= 0
trigger1 = command != "holddown"
value = 130

[State -1, AI]
type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = EnemyNear,MoveType = A
Trigger1 = P2StateType = A
Value = 130

[State 131, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
TriggerAll = Anim != 11
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State 131, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
TriggerAll = Anim = 11
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 11

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = Anim != 11
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 140

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
TriggerAll = Anim = 11
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 11

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N
ctrl = 1

[State 50, 1]
type = VelAdd
trigger1 = Vel Y = [-4,6]
trigger1 = Vel X >= -2.6
trigger1 = sysvar(1) = 0
trigger1 = Anim = 60
trigger1 = command != "holdup"
trigger1 = command = "holdback"
x = -.2

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State -1]
Type = VelSet
Trigger1 = Anim = 110
Trigger1 = AnimElem = 7 , <= 0
Y = 0

[State -1]
Type = VelSet
Trigger1 = Anim = 110
Trigger1 = AnimElem = 7
X = 2.5

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
TriggerAll = Var(59) <= 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State -1, AI]
Type = ChangeState
TriggerAll = Var(59) > 0
Trigger1 =! InguardDist
Trigger1 = NumHelper(25000) > 0
Trigger1 =! Helper(25000),InguardDist
Value = 140

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 50, 1]
type = VelAdd
trigger1 = Vel Y = [-4,6]
trigger1 = Vel X <= 2.6
trigger1 = sysvar(1) = 0
trigger1 = Anim = 60
trigger1 = command != "holdup"
trigger1 = command = "holdfwd"
x = .2

[State 50, 1]
type = VelAdd
trigger1 = Vel Y = [-4,6]
trigger1 = Vel X >= -2.6
trigger1 = sysvar(1) = 0
trigger1 = Anim = 60
trigger1 = command != "holdup"
trigger1 = command = "holdback"
x = -.2

[State -1]
Type = VelSet
Trigger1 = Anim = 110
Trigger1 = AnimElem = 7 , <= 0
Y = 0

[State -1]
Type = VelSet
Trigger1 = Anim = 110
Trigger1 = AnimElem = 7
X = 2.5

[State 140, 1]
type = ChangeAnim
triggerall = Time = 0
trigger1 = StateType = A
trigger1 = Anim = [120,159]
trigger2 = StateType != A
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State -1]
Type = VarAdd
Trigger1 = Var(42)/10%10 != 0
Trigger1 = Time = 0
IgnoreHitPause = 1
V = 42
Value = -10

[State -1]
Type = VarSet
TriggerAll = Time = 0
Trigger1 = PrevStateNo != [150,159]
Trigger1 = Var(42)%10 = [1,6]
Trigger2 = PrevStateNo = [150,159]
Trigger2 = Var(42)%10 = [1,2]
IgnoreHitPause = 1
V = 42
Value = 18

[State -1]
Type = Explod
Trigger1 = Var(42)/10%10 = 1
Trigger1 = Time = 0
Anim = 10130
ID = 10130
Postype = P1
Pos = 15,-60
Random = 30,30
Ownpal = 1
SprPriority = 4
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = Command = "214z"
Trigger1 = FVar(29) >= IfElse(Var(57)%10=2,1000,500) || Var(13) = [1,5]
value = 930

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = StateType != A
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
Trigger1 = Command = "abc" || Command = "x"
IgnoreHitPause = 1

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = A
StateType = S
Physics = S

[State 150, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = C
StateType = C
Physics = C

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

[State -1]
type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = Command = "214z"
Trigger1 = FVar(29) >= IfElse(Var(57)%10=2,1000,500) || Var(13) = [1,5]
value = 930

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = StateType != A
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
Trigger1 = Command = "abc" || Command = "x"

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
trigger3 = Ctrl
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger2 = Var(42)/10%10 = 1
trigger2 = Time = GetHitVar(ctrltime)-2
value = 1

[State 151, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = C
StateType = C
Physics = C

[State 151, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = A
StateType = S
Physics = S

[State -1]
Type = NotHitBy
Trigger1 = HitOver
Trigger2 = Ctrl
Value = , NT,ST,HT
Time = 6

[State 151, 4]
type = ChangeState
trigger1 = HitOver
Trigger2 = Ctrl
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State -1]
Type = VarAdd
Trigger1 = Var(42)/10%10 != 0
Trigger1 = Time = 0
IgnoreHitPause = 1
V = 42
Value = -10

[State -1]
Type = VarSet
TriggerAll = Time = 0
Trigger1 = PrevStateNo != [150,159]
Trigger1 = Var(42)%10 = [1,6]
Trigger2 = PrevStateNo = [150,159]
Trigger2 = Var(42)%10 = [1,2]
IgnoreHitPause = 1
V = 42
Value = 18

[State -1]
Type = Explod
Trigger1 = Var(42)/10%10 = 1
Trigger1 = Time = 0
Anim = 10130
ID = 10130
Postype = P1
Pos = 15,-35
Random = 30,30
Ownpal = 1
SprPriority = 4
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = Command = "214z"
Trigger1 = FVar(29) >= IfElse(Var(57)%10=2,1000,500) || Var(13) = [1,5]
value = 930

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = StateType != A
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
Trigger1 = Command = "abc" || Command = "x"
IgnoreHitPause = 1

[State -1]
Type = ChangeAnim
Trigger1 = Anim != 150
Trigger1 = Anim != 151
Trigger1 = Anim != 153
Value = 151
IgnoreHitPause = 1

[State -1]
Type = ChangeAnim
Trigger1 = Anim = 150
Trigger1 = Anim != 153
Value = 153
IgnoreHitPause = 1

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 152, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = C
StateType = C
Physics = C

[State 152, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = A
StateType = S
Physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C

[State -1]
Type = ChangeAnim
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 152
Trigger1 = Anim = 151
Trigger2 = Anim = 153
Trigger2 = Time = GetHitVar(SlideTime) || HitOver
Value = 151
IgnoreHitPause = 1

[State -1]
Type = ChangeAnim
TriggerAll = Time = 0
Trigger1 = Anim = 150 || Anim = 153
Value = 153
IgnoreHitPause = 1

[State -1]
type = ChangeState
TriggerAll = Var(59) <= 0
Trigger1 = Command = "214z"
Trigger1 = FVar(29) >= IfElse(Var(57)%10=2,1000,500) || Var(13) = [1,5]
value = 930

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = StateType != A
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
Trigger1 = Command = "abc" || Command = "x"

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
trigger3 = Ctrl
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger2 = Var(42)/10%10
trigger2 = Time = GetHitVar(ctrltime)-2
value = 1

[State 153, Hi to Lo]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = C
StateType = C
Physics = C

[State 153, Lo to Hi]
type = StateTypeSet
TriggerAll = Var(59) <= 0
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(59) > 0
TriggerAll = StateType != A
Trigger1 = P2StateType = A
StateType = S
Physics = S

[State -1]
Type = NotHitBy
Trigger1 = HitOver
Trigger2 = Ctrl
Value = , NT,ST,HT
Time = 6

[State 153, 4]
type = ChangeState
trigger1 = HitOver
Trigger2 = Ctrl
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State -1]
Type = VarAdd
Trigger1 = Var(42)/10%10 != 0
Trigger1 = Time = 0
IgnoreHitPause = 1
V = 42
Value = -10

[State -1]
Type = VarSet
TriggerAll = Time = 0
Trigger1 = PrevStateNo != [150,159]
Trigger1 = Var(42)%10 = [1,6]
Trigger2 = PrevStateNo = [150,159]
Trigger2 = Var(42)%10 = [1,2]
IgnoreHitPause = 1
V = 42
Value = 18

[State -1]
Type = Explod
Trigger1 = Var(42)/10%10 = 1
Trigger1 = Time = 0
Anim = 10130
ID = 10130
Postype = P1
Pos = 15,-60
Random = 30,30
Ownpal = 1
SprPriority = 4
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger2 = Var(42)/10%10
trigger2 = Time = GetHitVar(ctrltime)-2
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State -1]
Type = NotHitBy
Trigger1 = HitOver
Trigger1 =! Ctrl
Value = , NT,ST,HT
Time = 6

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; DRAWGAME (Time over)
[Statedef 175]
type = S
ctrl = 0
velset = 0,0

[State 175, 1] ; If no anim, use go to lose state.
type = ChangeState
trigger1 = Time = 0
trigger1 = !SelfAnimExist(175)
value = 170

[State 175, 2]
type = ChangeAnim
trigger1 = Time = 0
value = 175

[State 175, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 190, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(190)
value = 190

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191

;---------------------------------------------------------------------------
; INTRO (override this state to give character an intro)
[Statedef 191]
type = S
ctrl = 0

[State 191, 1]
type = ChangeState
trigger1 = Time = 0
value = 0

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type    = S
movetype= H
physics = S

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State -1]
Type = NotHitBy
Trigger1 = HitOver
Value = , NT,ST,HT
Time = 6

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
value = 0
ctrl = 1

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5011 ;HITC_SLIDE

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type    = C
movetype= H
physics = C

[State 5011, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5011, 2]
type = ChangeAnim
Trigger1 = Anim = [5020,5022]
trigger1 = AnimTime = 0
value = 5025 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State -1]
Type = NotHitBy
Trigger1 = HitOver
Value = , NT,ST,HT
Time = 6

[State 5011, 6]
type = ChangeState
trigger1 = HitOver
value = 11
ctrl = 1

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type    = A
movetype= H
physics = N

[State 5040, 1]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
TriggerAll = Var(59) <= 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command != "holddown" && Command != "holdup"
trigger1 = Command = "fwd" || Command = "back" || Command = "holdfwd" || Command = "holdback"
trigger2 = Command != "holddown" && Command != "holdfwd" && Command != "holdback"
trigger2 = Command = "up" || Command = "holdup"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = ChangeState
TriggerAll = Var(59) <= 0
triggerall = Pos Y < -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery" || Command = "a" || Command = "b" || Command = "c" || Command = "x" || Command = "y" || Command = "z"
value = 5210 ;HITFALL_AIRRECOVER

[State -1, AI]
Type = ChangeState
Value = 5200
TriggerAll = Pos Y = [-20,0]
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Var(59) = 1
Trigger1 = P2MoveType != A
Trigger2 = Var(59) = 1
Trigger2 = P2MoveType = A
Trigger2 = InguardDist
Trigger3 = Var(59) = 2
Trigger3 = P2MoveType != A
Trigger4 = Var(59) = 2
Trigger4 = P2MoveType = A
Trigger4 = InguardDist
Trigger5 = Var(59) = 3
Trigger5 = P2MoveType != A
Trigger6 = Var(59) = 3
Trigger6 = P2MoveType = A
Trigger6 = InguardDist
Trigger7 = Var(59) = 4
Trigger7 = P2MoveType != A
Trigger8 = Var(59) = 4
Trigger8 = P2MoveType = A
Trigger8 = InguardDist

[State -1, AI]
Type = ChangeState
Value = 5210
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Var(59) = 1
Trigger1 = P2MoveType != A
Trigger2 = Var(59) = 1
Trigger2 = P2MoveType = A
Trigger2 = InguardDist
Trigger3 = Var(59) = 2
Trigger3 = P2MoveType != A
Trigger4 = Var(59) = 2
Trigger4 = P2MoveType = A
Trigger4 = InguardDist
Trigger5 = Var(59) = 3
Trigger5 = P2MoveType != A
Trigger6 = Var(59) = 3
Trigger6 = P2MoveType = A
Trigger6 = InguardDist
Trigger7 = Var(59) = 4
Trigger7 = P2MoveType != A
Trigger8 = Var(59) = 4
Trigger8 = P2MoveType = A
Trigger8 = InguardDist

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type    = A
movetype= H
physics = N
velset = 0,0

[State -1]
Type = DestroySelf
Trigger1 = IsHelper
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = GetHitVar(HitShakeTime) = [0,1]
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x" || Var(57)%10 = 2 && Var(13) = 3
IgnoreHitPause = 1

[State 5070, 1]
type = ChangeAnim 
trigger1 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 5071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

[State -1, VarSet]
Type = VarSet
Trigger1 = 1
FV = 39
Value = 1

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N

[State -1] ;Recover near ground
type = ChangeState
TriggerAll = Var(59) <= 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command != "holddown" && Command != "holdup"
trigger1 = Command = "fwd" || Command = "back" || Command = "holdfwd" || Command = "holdback"
trigger2 = Command != "holddown" && Command != "holdfwd" && Command != "holdback"
trigger2 = Command = "up" || Command = "holdup"
value = 5200 ;HITFALL_RECOVER

[State -1]; Recover in mid air
type = ChangeState
TriggerAll = Var(59) <= 0
triggerall = Pos Y < -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery" || Command = "a" || Command = "b" || Command = "c" || Command = "x" || Command = "y" || Command = "z"
value = 5210 ;HITFALL_AIRRECOVER

[State -1, AI]
Type = ChangeState
Value = 5200
TriggerAll = Pos Y = [-20,0]
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Var(59) = 1
Trigger1 = P2MoveType != A
Trigger2 = Var(59) = 1
Trigger2 = P2MoveType = A
Trigger2 = InguardDist
Trigger3 = Var(59) = 2
Trigger3 = P2MoveType != A
Trigger4 = Var(59) = 2
Trigger4 = P2MoveType = A
Trigger4 = InguardDist
Trigger5 = Var(59) = 3
Trigger5 = P2MoveType != A
Trigger6 = Var(59) = 3
Trigger6 = P2MoveType = A
Trigger6 = InguardDist
Trigger7 = Var(59) = 4
Trigger7 = P2MoveType != A
Trigger8 = Var(59) = 4
Trigger8 = P2MoveType = A
Trigger8 = InguardDist

[State -1, AI]
Type = ChangeState
Value = 5210
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Var(59) = 1
Trigger1 = P2MoveType != A
Trigger2 = Var(59) = 1
Trigger2 = P2MoveType = A
Trigger2 = InguardDist
Trigger3 = Var(59) = 2
Trigger3 = P2MoveType != A
Trigger4 = Var(59) = 2
Trigger4 = P2MoveType = A
Trigger4 = InguardDist
Trigger5 = Var(59) = 3
Trigger5 = P2MoveType != A
Trigger6 = Var(59) = 3
Trigger6 = P2MoveType = A
Trigger6 = InguardDist
Trigger7 = Var(59) = 4
Trigger7 = P2MoveType != A
Trigger8 = Var(59) = 4
Trigger8 = P2MoveType = A
Trigger8 = InguardDist

[State -1]
Type = Explod
Trigger1 =! Alive
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 15
Anim = 15102
ID = 15102
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 =! Alive
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 15
Anim = 15100
ID = 15100
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 =! Alive
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 15
Anim = 15101
ID = 15101
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 =! Alive
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 15
Anim = 15105
ID = 15105
Postype = P1
Pos = 0,0
Scale = 0.5,0.5
Ownpal = 1
SprPriority = -5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
type = ChangeState
value = 5110

[State -1, VarSet]
Type = VarSet
Trigger1 = 1
FV = 39
Value = 1

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5081 ;HITL_SLIDE

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

[State -1, VarSet]
Type = VarSet
Trigger1 = 1
FV = 39
Value = 1

[State -1]
Type = ChangeState
Value = 860
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y >= -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

[State -1]
Type = ChangeState
Value = 870
TriggerAll = Var(59) <= 0
TriggerAll = Var(57)%10 != 4 && (Var(13) = [1,5]) || Var(57)%10 = 2 && FVar(29) = 2000 || Var(57)%10 = 4 && Var(13) != [6,9]
TriggerAll = Var(46) = 0
TriggerAll = Pos Y < -10
TriggerAll = Alive
Trigger1 = Command = "abc" || Command = "x"

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type    = L
movetype= H
physics = C

[State 5081, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5081, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5081, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5081, 4]
type = ChangeState
trigger1 = HitOver
value = 5110 ;HIT_LIEDOWN

[State -1, VarSet]
Type = VarSet
Trigger1 = 1
FV = 39
Value = 1

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State -1, EnvShake]
Type = EnvShake
Trigger1 = Time = 0
Time = 10
Freq = 80
Ampl = 4

[State -1]
Type = PlaySnd
Trigger1 = Time = 0
Value = s5100, 0

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15102
ID = 15102
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15100
ID = 15100
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15101
ID = 15101
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15105
ID = 15105
Postype = P1
Pos = 0,0
Scale = 0.5,0.5
Ownpal = 1
SprPriority = -5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeState
Trigger1 = Anim = 5070
Trigger1 = PrevStateNo != 5071
Value = 5110

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = Null;GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = Null;PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5110;01

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

[State -1, VarSet]
Type = VarSet
Trigger1 = Anim = 5101
FV = 39
Value = 2

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 0]
type = ChangeAnim
triggerall = Time = 0
trigger1 = Anim = 5101
trigger1 = SelfAnimExist(5171 + (anim % 10))
value = 5171

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0 && Anim != 5171
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State -1]
Type = HitFallVel
Trigger1 = Time = 0

[State -1, VarSet]
Type = VarSet
Trigger1 = Anim = 5101
FV = 39
Value = 2

[State -1]
Type = PlaySnd
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 5071
Value = s5100, 0

[State -1, EnvShake]
Type = EnvShake
TriggerAll = Time = 0
Trigger1 = PrevStateNo = 5071
Time = 10
Freq = 80
Ampl = 4

[State -1]
Type = Explod
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 5071
Anim = 15102
ID = 15102
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 5071
Anim = 15100
ID = 15100
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 5071
Anim = 15101
ID = 15101
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Trigger1 = PrevStateNo = 5071
Anim = 15105
ID = 15105
Postype = P1
Pos = 0,0
Scale = 0.5,0.5
Ownpal = 1
SprPriority = -5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = FVar(39) = 2
value = 5171

[State -1, VarSet]
Type = VarSet
Trigger1 = Time = 0
FV = 39
Value = 0

[State 5110, 0]
type = ChangeAnim
persistent = 0
triggerAll = FVar(39) != 2
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = Anim = [5070,5079]
trigger2 = Anim = 5171;PrevStateNo = 5101
value = 5111

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
triggerAll = FVar(39) != 2
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerAll = FVar(39) != 2
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerAll = FVar(39) != 2
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = FVar(39) = 2
value = 5171

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = Null;PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
;value = F7, 0 ;Hit ground
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = Null;GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = [-1,0]
value = SCA
time = 2+IfElse(Var(57)%10=4,6,0)

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = [-1,0]
value2 = , NT,ST,HT
time = 8

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = PrevStateNo != 5950
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
triggerall = PrevStateNo != 5950
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
triggerall = PrevStateNo != 5950
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
triggerall = PrevStateNo != 5950
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; 嶍傝KO
[Statedef 5950]
Type    = L
MoveType= H
Physics = N
VelSet = 0,0
SprPriority = -3

[State -1]
Type = NotHitBy
Trigger1 = 1
Value = SCA
Time = 1

[State -1]
Type = ChangeAnim
Trigger1 =! HitOver
Value = 5010

[State -1]
Type = ChangeAnim
Trigger1 = HitOver
Trigger1 = Anim != 5950
Value = 5950

[State -1]
Type = ChangeState
Trigger1 = Anim = 5950
Trigger1 = AnimElem = 6
Value = 5150

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type    = A
movetype= I
physics = N

[State -1]
Type = VarSet
Trigger1 = Time = 0
sysvar(1) = -1

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = A
movetype= I
physics = N
anim = 5200

[State -1]
Type = Helper
TriggerAll = Var(0)%10 = 0
Trigger1 = Time = 0
StateNo = 8000
ID = 8000
PosType = P1
Pos = 0,-40
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15102
ID = 15102
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15100
ID = 15100
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15101
ID = 15101
Postype = P1
Pos = 0,0
Ownpal = 1
SprPriority = 3
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Explod
Trigger1 = Time = 0
Anim = 15105
ID = 15105
Postype = P1
Pos = 0,0
Scale = 0.5,0.5
Ownpal = 1
SprPriority = -5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 5201, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201 3] ;Go up
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0
trigger1 = Command != "holdfwd"
trigger1 = Command != "holdback"
x = -.25
y = -3.8

[State 5201, 3] ;Go fwd
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0
trigger1 = Command = "holdfwd"
x = 5.5
y = -4.8

[State 5201, 3] ;Go back
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 0
trigger1 = Command = "holdback"
x = -4
y = -4.8

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 0
trigger1 = P2BodyDist X != [-60,60]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-60,60]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-60,60]
x = -.25
y = -3.8

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 0
trigger1 = P2BodyDist X != [-60,60]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-60,60]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-60,60]
x = 5.5
y = -4.8

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 0
trigger1 = P2BodyDist X != [-60,60]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-60,60]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-60,60]
x = -4
y = -4.8

[State -1]
type = VelAdd
triggerAll = Time >= 17
trigger1 = Vel X = [3.1,5.5]
x = -.6

[State -1]
type = VelAdd
triggerAll = Time >= 17
trigger1 = Vel X = [-4.0,-2.5]
x = .5

[State 5201, 4]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 20

[State 5201, 4]
type = NotHitBy
triggerall = Time = 0
trigger1 = Vel X = [2.0,6.0]
trigger2 = Vel X = [-4.5,-2.0]
value = SCA
time = 24

[State -1]
Type = PlayerPush
Trigger1 = 1
Value = 0

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 19
add = 96,96,96 ;256,256,256
sinadd = 96,96,96,3

[State 5201, 7]
type = VelAdd
trigger1 = Time >= 1
y = .42

[State 5201, 8] ;Land on ground
type = ChangeState
trigger1 = Time >= 2
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMP_LAND
ctrl = 1

;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State -1]
Type = VarSet
Trigger1 = Time = 0
sysvar(1) = -1

[State -1]
Type = Helper
TriggerAll = Var(0)%10 = 0
Trigger1 = Time = 0
StateNo = 8000
ID = 8000
PosType = P1
Pos = 0,-60
Ownpal = 1
SprPriority = 5
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 19
add = 96,96,96 ;256,256,256
sinadd = 96,96,96,3

[State 5210, 1]
type = PosFreeze
trigger1 = Time = 0
value = 1

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5210, 1] 
type = VelMul
trigger1 = Time = 1
x = .8
y = .8

[State 5210, 1]
type = VelAdd
trigger1 = Time = 1
y = -4.5

[State 5210, 1] 
type = VelMul
trigger1 = Time = 1
trigger1 = Vel Y > 0
y = .5

[State 5210, 1]
type = VelAdd
trigger1 = Time = 1
trigger1 = Vel Y > -3
y = -2

[State 5210, 1]
type = VelAdd
trigger1 = Time = 1
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 1
trigger1 = Command != "holdfwd"
trigger1 = Command != "holdback"
y = -5.6

[State 5210, 2] ;Go fwd
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 1
trigger1 = Command = "holdfwd"
x = 2.6
y = -8.8

[State 5210, 2] ;Go back
type = VelSet
TriggerAll = Var(59) <= 0
trigger1 = Time = 1
trigger1 = Command = "holdback"
x = -2.6
y = -8.8

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 1
trigger1 = P2BodyDist X != [-60,60]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-60,60]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-60,60]
y = -5.6

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 1
trigger1 = P2BodyDist X != [-80,80]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-80,80]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-80,80]
x = 2.6
y = -8.8

[State -1, AI]
type = VelSet
TriggerAll = Var(59) > 0
triggerAll = Time = 1
trigger1 = P2BodyDist X != [-80,80]
Trigger2 = EnemyNear,MoveType != A
trigger2 = P2BodyDist X = [-80,80]
Trigger3 = EnemyNear,MoveType = A
trigger3 = P2BodyDist X = [-80,80]
x = -2.6
y = -8.8

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 19

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 18
value = 1

[State 5210, 5]
type = StateTypeSet
trigger1 = Time = 1
Physics  = A

[State 5210, 5] ;Land on ground
type = ChangeState
trigger1 = Time > 1
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMP_LAND
ctrl = 1

;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
type = S
ctrl = 0
anim = 5300
velset = 0,0

[State 5500, 1] ;Use continue animation if available
type = ChangeAnim
trigger1 = time = 0
trigger1 = SelfAnimExist(5500)
value = 5500

;---------------------------------------------------------------------------
; 僈乕僪僽儗僀僋
[Statedef 5310]
Type     = U
MoveType = I
Physics  = N
Ctrl     = 0
VelSet   = 0,0

[State -1]
Type = EnvShake
Trigger1 = Time = 0
Time  = 10
Ampl  = 10
Freq  = 60

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [0,19]
X = 4
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [2,19]
X = -4
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [20,39]
X = 3
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [22,39]
X = -3
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [40,59]
X = 2
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [42,59]
X = -2
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [60,79]
X = 1
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = StateType != A
Trigger1 = Time = [62,79]
X = -1
Persistent = 4

[State -1]
Type = VelSet
Trigger1 = StateType = A
Trigger1 = Time = 0
X = -0.25
Y = -4

[State -1]
Type = VelAdd
Trigger1 = StateType = A
Trigger1 = Time > 0
Y = .1

[State -1]
Type = PlaySnd
TriggerAll = SelfAnimExist(5310) && AuthorName = "嘓" || SelfAnimExist(5310) && AuthorName = "YoungKirei & Take.K"
Trigger1 = Time = 0
Value = s5310, 1+Random%3
Channel = 1
IgnoreHitPause = 0
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5310) && AuthorName = "嘓" || SelfAnimExist(5310) && AuthorName = "YoungKirei & Take.K"
TriggerAll = SelfAnimExist(5002)
TriggerAll = StateType = S
Trigger1 = Time <= 70
Value = 5310

[State -1]
Type = ChangeAnim
TriggerAll =! SelfAnimExist(5310)
TriggerAll = SelfAnimExist(5002)
TriggerAll = StateType = S
Trigger1 = Time <= 60
Value = 5002

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5320) && AuthorName = "嘓" || SelfAnimExist(5320) && AuthorName = "YoungKirei & Take.K"
TriggerAll = SelfAnimExist(5022)
TriggerAll = StateType = C
Trigger1 = Time <= 70
Value = 5320

[State -1]
Type = ChangeAnim
TriggerAll =! SelfAnimExist(5320)
TriggerAll = SelfAnimExist(5022)
TriggerAll = StateType = C
Trigger1 = Time <= 60
Value = 5022

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5007)
TriggerAll = Anim = 5002
Trigger1 = AnimTime = 0
Value = 5007

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5027)
TriggerAll = Anim = 5022
Trigger1 = AnimTime = 0
Value = 5027

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5030)
TriggerAll = StateType = A
Trigger1 = Time = 0
Value = 5030

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5061)
TriggerAll = StateType = A
Trigger1 =! SelfAnimExist(5030)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Value = 5061

[State -1]
Type = ChangeAnim
TriggerAll =! SelfAnimExist(5061)
TriggerAll = SelfAnimExist(5035)
TriggerAll = StateType = A
Trigger1 =! SelfAnimExist(5030)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Value = 5035

[State -1]
Type = ChangeAnim
TriggerAll =! SelfAnimExist(5061)
TriggerAll = SelfAnimExist(5050)
TriggerAll = StateType = A
Trigger1 =! SelfAnimExist(5030)
Trigger1 =! SelfAnimExist(5035)
Trigger1 = Time = 0
Trigger2 =! SelfAnimExist(5035)
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Trigger3 =! SelfAnimExist(5030)
Trigger3 = Anim = 5035
Trigger3 = AnimTime = 0
Value = 5050

[State -1]
Type = SelfState
Trigger1 = StateType != A
Trigger1 = Time = 90
Value = IfElse(StateType=S,0,11)
Ctrl = 1

[State -1]
Type = StateTypeSet
Trigger1 = (Vel Y > 0) && (Pos Y >= 0)
MoveType = H
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = HitFallSet
Trigger1 = (Vel Y > 0) && (Pos Y >= 0)
Value = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = SelfState
Trigger1 = (Vel Y > 0) && (Pos Y >= 0)
Value = 5100

;---------------------------------------------------------------------------
; 暻扏偒晅偗丂侾
[Statedef 5600]
Type     = A
MoveType = H
Physics  = N
Ctrl     = 0
VelSet   = 0,0

[State -1]
Type = PosSet
Trigger1 = Pos Y > 0
Y = 0
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = HitFallSet
Trigger1 = 1
Value = 0
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = OffSet
Trigger1 = Time >= 0
X = 1
Persistent = 4

[State -1]
Type = OffSet
Trigger1 = Time >= 2
X = -1
Persistent = 4

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5030)
Trigger1 = 1
Value = 5030

[State -1]
Type = ChangeState
Trigger1 = GetHitVar(HitShakeTime) = 0
Value = 5601

;---------------------------------------------------------------------------
; 暻扏偒晅偗丂俀
[Statedef 5601]
Type     = A
MoveType = H
Physics  = N
Ctrl     = 0
VelSet   = 0,0

[State -1]
Type = PlayerPush
Trigger1 = Time >= 0
Value = 0
IgnoreHitPause = 1
Persistent = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Width
Trigger1 = 1
Edge = 0,-Const(Size.Air.Back)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1] 
Type = VelSet
Trigger1 = Time = 0
X = -11

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5030)
Trigger1 = Time = 0
Value = 5030

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5035)
Trigger1 =! SelfAnimExist(5030)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Value = 5035

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5050)
Trigger1 =! SelfAnimExist(5030)
Trigger1 =! SelfAnimExist(5035)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Trigger3 = Anim = 5035
Trigger3 = AnimTime = 0
Value = 5050

[State -1]
Type = ScreenBound
Trigger1 = Time <= 25
Value = 1
MoveCamera = 1,1

[State -1]
Type = ScreenBound
Trigger1 = Time > 25
Value = 1
MoveCamera = 0,1

[State -1]
Type = ChangeState
TriggerAll = Time = [0,11]
TriggerAll = BackEdgeDist <= 0
Trigger1 = 1
Value = 5602

[State -1]
Type = ChangeState
TriggerAll = Time >= 12
TriggerAll = BackEdgeDist <= 0
Trigger1 = 1
Value = 5603

;---------------------------------------------------------------------------
; 暻扏偒晅偗丂俁
[Statedef 5602]
Type     = A
MoveType = H
Physics  = N
Ctrl     = 0
VelSet   = 0,0

[State -1]
Type = Width
Trigger1 = Time = [0,6]
Edge = -Const(Size.Air.Front),-Const(Size.Air.Back)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Width
Trigger1 = Time >= 7
Trigger1 = Const(Size.Air.Back)-(Time-7) > 0
Edge = 0,-Const(Size.Air.Back)+(Time-7)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = HitFallSet
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= -30
Trigger2 = Vel Y > 4
Value = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = SelfState
TriggerAll = Vel Y > 0
TriggerAll = Pos Y >= -30
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Command != "holddown" && Command != "holdup"
Trigger1 = Command = "fwd" || Command = "back" || Command = "holdfwd" || Command = "holdback"
Trigger2 = Command != "holddown" && Command != "holdfwd" && Command != "holdback"
Trigger2 = Command = "up" || Command = "holdup"
Value = 5200

[State -1]
Type = SelfState
TriggerAll = Vel Y > 4
TriggerAll = Pos Y < -30
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Command = "recovery" || Command = "a" || Command = "b" || Command = "c" || Command = "x" || Command = "y" || Command = "z"
Value = 5210

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5030)
Trigger1 = Time = 0
Value = 5030

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5035)
Trigger1 =! SelfAnimExist(5030)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Value = 5035

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5050)
Trigger1 =! SelfAnimExist(5030)
Trigger1 =! SelfAnimExist(5035)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Trigger3 = Anim = 5035
Trigger3 = AnimTime = 0
Value = 5050

[State -1]
Type = EnvShake
Trigger1 = Time = 0
Time  = 10
Ampl  = 5
Freq  = 90

[State -1]
Type = VelSet
Trigger1 = Time = 5
X = 1.0
Y = -6.6

[State -1]
Type = VelAdd
Trigger1 = Time >= 6
Y = .48

[State -1]
Type = SelfState
Trigger1 = (Vel Y > 0) && (Pos Y >= 0)
Value = 5100

;---------------------------------------------------------------------------
; 暻扏偒晅偗丂係
[Statedef 5603]
Type     = A
MoveType = H
Physics  = N
Ctrl     = 0
VelSet   = 0,0

[State -1]
Type = Width
Trigger1 = Time = [0,6]
Edge = -Const(Size.Air.Front),-Const(Size.Air.Back)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = Width
Trigger1 = Time >= 7
Trigger1 = Const(Size.Air.Back)-(Time-7) > 0
Edge = 0,-Const(Size.Air.Back)+(Time-7)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = SelfState
TriggerAll = Pos Y >= -20
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Command != "holddown" && Command != "holdup"
Trigger1 = Command = "fwd" || Command = "back" || Command = "holdfwd" || Command = "holdback"
Trigger2 = Command != "holddown" && Command != "holdfwd" && Command != "holdback"
Trigger2 = Command = "up" || Command = "holdup"
Value = 5200

[State -1]
Type = SelfState
TriggerAll = Time >= 6
TriggerAll = Pos Y < -20
TriggerAll = Alive
TriggerAll = CanRecover
Trigger1 = Command = "recovery" || Command = "a" || Command = "b" || Command = "c" || Command = "x" || Command = "y" || Command = "z"
Value = 5210

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5030)
Trigger1 = Time = 0
Value = 5030

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5035)
Trigger1 =! SelfAnimExist(5030)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Value = 5035

[State -1]
Type = ChangeAnim
TriggerAll = SelfAnimExist(5050)
Trigger1 =! SelfAnimExist(5030)
Trigger1 =! SelfAnimExist(5035)
Trigger1 = Time = 0
Trigger2 = Anim = 5030
Trigger2 = AnimTime = 0
Trigger3 = Anim = 5035
Trigger3 = AnimTime = 0
Value = 5050

[State -1]
Type = EnvShake
Trigger1 = Time = 0
Time  = 10
Ampl  = 5
Freq  = 90

[State -1]
Type = VelSet
Trigger1 = Time = 5
X = 1.0
Y = -6.6

[State -1]
Type = VelAdd
Trigger1 = Time >= 6
Y = .48

[State -1]
Type = HitFallSet
TriggerAll = Time = 6
Trigger1 = 1
Value = 1
IgnoreHitPause = 1
Persistent = 0
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -1]
Type = SelfState
Trigger1 = (Vel Y > 0) && (Pos Y >= 0)
Value = 5100

;---------------------------------------------------------------------------
; 奐枊慜峴摦梡
[StateDef 10010]
Type    = C
Physics = C
Anim = 10

[State -1]
Type = PlayerPush
Trigger1 = Var(58) = [1,2]
Value = 0

[State -1]
Type = VelMul
Trigger1 = Time = 0
X = .75

[State -1]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 10011

[State -1]
Type = ChangeState
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Command = "holdfwd" || Command = "holdback"
Value = 10020

;---------------------------------------------------------------------------
; 奐枊慜峴摦梡
[StateDef 10011]
Type    = C
Physics = C
Anim = 11
SprPriority = 0

[State -1]
Type = PlayerPush
Trigger1 = Var(58) = [1,2]
Value = 0

[State -1]
Type = VarSet
Trigger1 = Time = 0
V = 2
Value = 0

[State -1]
Type = ChangeAnim
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
TriggerAll = P2Dist X < 0
Trigger1 = Anim = 11
Value = 6

[State -1]
Type = ChangeAnim
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Anim = 6 && AnimTime = 0
Value = 11

[State -1]
Type = Turn
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
TriggerAll = P2Dist X < 0
Trigger1 = Anim = 6

[State -1]
Type = ChangeState
Trigger1 = Command != "holddown"
Value = 10012

;---------------------------------------------------------------------------
; 奐枊慜峴摦梡
[StateDef 10012]
Type    = S
Physics = S
Anim = 12

[State -1]
Type = PlayerPush
Trigger1 = Var(58) = [1,2]
Value = 0

[State -1]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0

[State -1]
Type = ChangeState
TriggerAll =! Ctrl
TriggerAll = Var(58) = [1,2]
TriggerAll = RoundState = 2
Trigger1 = Command = "holdfwd" || Command = "holdback"
Value = 10020

;---------------------------------------------------------------------------
; 奐枊慜峴摦梡
[StateDef 10020]
Type    = S
Physics = S
SprPriority = 0

[State -1]
Type = PlayerPush
Trigger1 = Var(58) = [1,2]
Value = 0

[State -1]
Type = Turn
Trigger1 = P2Dist X < 0

[State -1]
Type = VelSet
Trigger1 = Command = "holdfwd"
X = Const(velocity.walk.fwd.x)

[State -1]
Type = VelSet
Trigger1 = Command = "holdback"
X = Const(velocity.walk.back.x)

[State -1]
Type = ChangeAnim
TriggerAll = Vel X > 0
Trigger1 = Anim != 20 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 20

[State -1]
Type = ChangeAnim
TriggerAll = Vel X < 0
Trigger1 = Anim != 21 && Anim != 5
Trigger2 = Anim = 5 && AnimTime = 0
Value = 21

[State -1]
Type = ChangeState
Trigger1 = Command != "holdfwd" && Command != "holdback"
Value = 0
