;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
facep2 = 1



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

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[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 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 0.0]
type = VarSet
trigger1 = Time = 0
trigger1 = var(1) = 1
v = 8
value = 0

[State 40, 0.1]
type = VarSet
trigger1 = command = "holdfwd"
trigger1 = var(8) != 2
trigger1 = var(1) = 1
v = 8
value = 1

[State 40, 0.2]
type = VarSet
trigger1 = command = "holdback"
trigger1 = var(8) != -2
trigger1 = var(1) = 1
v = 8
value = -1

;[State 40, 0.1b]
;type = VarSet
;trigger1 = Time = 0
;trigger1 = command = "holdfwd"
;trigger1 = command = "longjump"
;trigger1 = var(1) = 1
;v = 8
;value = 2

;[State 40, 0.2b]
;type = VarSet
;trigger1 = Time = 0
;trigger1 = command = "holdback"
;trigger1 = command = "longjump"
;trigger1 = var(1) = 1
;v = 8
;value = -2

;[State 40, 4]
;type = ChangeState
;triggerall = AnimTime = 0
;triggerall = var(1) = 1
;trigger1 = var(8) != 0
;trigger1 = var(8) != 1
;trigger1 = var(8) != -1
;trigger1 = command = "holdup"
;trigger2 = command != "holdup"
;value = 2041

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

;---------------------------------------------------------------------------
; JUMP_UP (short)
[Statedef 2041]
type    = A
physics = A
velset = 0, -6.4
ctrl = 1


[State 2041, 2] ; Shadows off
type = Afterimage
trigger1 = Time = 14
time = 0

[State 2041, -0.1] ;Holding up?
type = VelSet
trigger1 = Time = 0
trigger1 = command = "holdup"
y = -8.6

[State 2041, 0.1]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = 1
x = 3.2

[State 2041, 0.1b]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = 2
x = 4.4

[State 2041, 0.2]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = -1
x = -3.2

[State 2041, 0.2b]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = -2
x = -4.4

[State 2041, 1.1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X = 0
trigger1 = command = "holdup"
value = 41

[State 2041, 1.2] ;Short
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X = 0
trigger1 = command != "holdup"
value = 2041

[State 2041, 2.1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X > 0
trigger1 = command = "holdup"
value = 41

[State 2041, 2.2] ;Short
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X > 0
trigger1 = command != "holdup"
value = 2041

[State 2041, 3.1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X < 0
value = 41

[State 2041, 2.2] ;Short
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Vel X < 0
trigger1 = command != "holdup"
value = 2041

;---------------------------------------------------------------------------
; RUN_FWD Starting
[Statedef 100]
type    = S
physics = S
anim = 100
ctrl = 0
velset = 0

[State 105, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 101

;---------------------------------------------------------------------------
; RUN_FWD Dashing
[Statedef 101]
type    = A
physics = A
anim = 101
ctrl = 0
velset = 0

[State 101, SFX]
type = PlaySnd
trigger1 = time = 0
value = S0,27

[State 105, Veladd]
type = Veladd
trigger1 = Time = 0
x = 6.5
y = -3.8

[State 105, 1]
type = Velmul
trigger1 = Time > 10
x = .92

[State 105, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 107

;---------------------------------------------------------------------------
; RUN Back (charging)
[statedef 105]
type = S
physics = S
ctrl = 0
anim = 105

[State 105, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 106

; RUN_BACK
[Statedef 106]
type    = A
physics = N
ctrl = 0
anim = 106

[State 101, SFX]
type = PlaySnd
trigger1 = time = 0
value = S0,27

[state haha]
type = gravity
trigger1 = 1

[State 105, Veladd]
type = Veladd
trigger1 = Time = 0
x = -6.5
y = -3.8

[State 105, 1]
type = Velmul
trigger1 = Time > 10
x = .92

[State 105, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 6
value = 107

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 107]
type    = S
physics = S
anim = 47
velset = 0,0

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

[State 52, 0]
type       = PlaySnd
trigger1   = Time = 0
value      = S0,16
persistent = 0

[State 106, 2]
type = ChangeState
trigger1 = Time = 4
value = 0
ctrl = 1

; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N
velset = 0,0,0

;[State 5120, 0] ; Sneak Roll Backwards for Back
;type = ChangeState
;triggerall = time = 0 && var(1) = 1
;triggerall = anim != 5111
;trigger1 = command = "holddownback"
;trigger2 = command = "holdback"
;value = 5122

;[State 5120, 1] ; Sneak Roll Forwards for Back
;type = ChangeState
;triggerall = time = 0 && var(1) = 1
;triggerall = anim != 5111
;trigger1 = command = "holddownforward"
;trigger2 = command = "holdfwd"
;value = 5123

;[State 5120, 0] ; Sneak Roll Backwards for Up
;type = ChangeState
;triggerall = time = 0 && var(1) = 1
;triggerall = anim = 5111
;trigger1 = command = "holddownback"
;;trigger2 = command = "holdback"
;value = 5124

;[State 5120, 1] ; Sneak Roll Forwards for Up
;type = ChangeState
;triggerall = time = 0 && var(1) = 1
;triggerall = anim = 5111
;trigger1 = command = "holddownforward"
;trigger2 = command = "holdfwd"
;value = 5125

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

[State 5120, 1b] ;Get up anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = 5111
value = 5121

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

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

[State 5120, 6] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

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

; HIT_GETUP (backward)
[Statedef 5122]
type    = L
movetype= I
physics = N
ctrl = 0
velset = 0,0,0

[State 5120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 5122

[State 5121, 2]
type = Veladd
trigger1 = animelem = 4
x = -8

[State 5121, 3]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 5121, 5]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5121, 6] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5121, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5121, 7]
type = ChangeState
trigger1 = Time = 35
value = 11
ctrl = 1

; HIT_GETUP (backward)
[Statedef 5124]
type    = L
movetype= I
physics = N
ctrl = 0
velset = 0,0,0

[State 5120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 5124

[State 5121, 2]
type = Veladd
trigger1 = animelem = 7
x = -8

[State 5121, 3]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

[State 5121, 5]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5121, 6] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5121, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5121, 7]
type = ChangeState
trigger1 = Time = 35
value = 11
ctrl = 1

; HIT_GETUP (forward)
[Statedef 5123]
type    = L
movetype= I
physics = N
ctrl = 0
velset = 0,0,0

[State 5120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 5123

[State 5122, 2]
type = Veladd
trigger1 = animelem = 6
x = 8

[State 5122, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 1

[State 5122, 5]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5122, 6] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5122, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5122, 7]
type = ChangeState
trigger1 = Time = 35
value = 11
ctrl = 1

; HIT_GETUP (forward)
[Statedef 5125]
type    = L
movetype= I
physics = N
ctrl = 0
velset = 0,0,0

[State 5120, 1]
type = ChangeAnim
trigger1 = time = 0
value = 5125

[State 5122, 2]
type = Veladd
trigger1 = animelem = 4
x = 8

[State 5122, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 1

[State 5122, 5]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5122, 6] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5122, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5122, 7]
type = ChangeState
trigger1 = Time = 35
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; JUMP_LAND
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, 0]
type       = PlaySnd
trigger1   = Time = 0
value      = S0,16
persistent = 0

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

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

[State 52, 3]
type = CtrlSet
trigger1 = Time >= 3
value = 1

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

[State 52, 4]
type = ChangeState
trigger1 = command = "holddown"
value = 11
ctrl = 1

[State 52, 4]
type = ChangeState
trigger1 = command = "holdback"
value = 20
ctrl = 1

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

[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, 3] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0 && gethitvar(animtype) = [4,5]
value = anim

[State 5000, 4] ;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
value = a

[State , Explod0]
type = Explod
trigger1 = anim = 5002 && animelem = 2 && random >= 500
anim = 12001
pos = -29, -71
facing = 1
bindtime = -1
scale = 1, 1
sprpriority = 5
shadow = -1,-1,-1
ownpal = 1
ignorehitpause = 1
persistent = 0

[State , Explod0]
type = Explod
trigger1 = anim = 5012 && animelem = 3 && random >= 500
anim = 12001
pos = -23, -61
facing = 1
vfacing = -1
bindtime = -1
scale = 1, 1
sprpriority = 5
shadow = -1,-1,-1
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 5000, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5001 ;HITG_SLIDE

[State 5000, 6]
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

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

[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

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

[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 >= 30
type = ChangeState
value = 5105

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

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
trigger1 = time = 0
value = 5100

[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.25

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

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

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

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
;value = F7, 0 ;Hit ground
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)
channel = 3

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

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

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

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5106]
type    = L
movetype= H
physics = N
velset = -1.2,-4.5

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
trigger1 = time = 0
value = 5160

;[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 = .6

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

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

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

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

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

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = C
movetype= H
physics = S
anim = 5200
velset = -2,0

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

;[State 5201, 2]
;type = VelSet
;trigger1 = Time = 0
;x = -.15
;y = -3.5

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

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

[State 5201, 4]
type = NotHitBy
trigger1 = animtime = 0
value = SCA
time = 5



[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

[state haha]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

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

[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 && var(5) = 0 && var(7) = 0 && gethitvar(animtype) = [4,5]
value = anim

[State 5010, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5011 ;HITC_SLIDE

[State 5010, 6]
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

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



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

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151

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

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



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

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 153

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

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



[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

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

[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 && gethitvar(animtype) = [4,5]
trigger1 = anim != 5030
value = anim

[State , Explod0]
type = Explod
trigger1 = anim = 5022 && animelem = 1 && random >= 500
anim = 12001
pos = -12, -49
facing = 1
bindtime = -1
scale = 1, 1
sprpriority = 5
shadow = -1,-1,-1
ownpal = 1
ignorehitpause = 1
persistent = 0

[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

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

[state 5210, 0]
type = changeanim
trigger1 = time = 3
value = 5210


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

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

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

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

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

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

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

[State 5210, 2] ;Go up
type = null; VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = -2

[State 5210, 2] ;Go down
type = null;VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = 1.5

;[State 5210, 2] ;Go fwd
;type = VelMul
;trigger1 = Time = 4
;trigger1 = Command = "holdfwd"
;x = 1

;[State 5210, 2] ;Go back
;type = VelAdd
;trigger1 = Time = 4
;trigger1 = Command = "holdback"
;x = -1

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

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

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
y = .35

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