[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 1
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 15
ground.front = 16
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -5, -90
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.4
walk.back = -2.2
run.fwd  = 7, 0
run.back = -6,-.8
jump.neu = 0,-9.2
jump.back = -3.4
jump.fwd = 3.4
runjump.back = -4,-8.5
runjump.fwd = 4,-8.5

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .48
stand.friction = .85
crouch.friction = .82

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S
ctrl = 0
anim = 180
velset = 0,0

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

[State 195, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 3,3+random%2

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

[State 195, 1]
type = PlaySnd
trigger1 = Time = 1
value = 3,5

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

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 6]
type = ChangeState
trigger1 = AnimTime = 0 
value = 0

;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 195, 1]
type = CtrlSet
trigger1 = Time = 40
value = 1

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

[State 195, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 3,3

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type    = S 
movetype= A 
physics = S
juggle  = 1 
velset = 0,0
ctrl = 0
anim = 200
poweradd = 20
sprpriority = 2

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 23, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkxy = -10, -85
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

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

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

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

[State 210, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,0

[State 210, 2]
type = HitDef
trigger1 = time = 0
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 12,12
sparkxy = -10,-83
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 210, 4]
type = SprPriority
trigger1 = AnimElem = 3
value = 2

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing light kick
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

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

[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 12,12
sparkxy = -10,-90
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = High
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing strong kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 250
sprpriority = 2

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,1

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

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 63
guardflag = MA
pausetime = 12,12
sparkxy = -10,-76
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2

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

;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkxy = -10,-42
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = Low
ground.slidetime = 4
ground.hittime  = 12
ground.velocity = -4
air.velocity = -1.5,-3

[State 400, 3]
type = CtrlSet
trigger1 = Time = 5
value = 1

[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;Crouching strong punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2

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

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,0

[State 410, 2]
type = HitDef
trigger1 = animelem = 4
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkxy = -10,-50
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -3,-4

[State 410, 3]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10,-83
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;Crouching light kick
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

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

[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 28
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkxy = -10,-8
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = Low
ground.slidetime = 6
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 20

[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 70
ctrl = 0
anim = 440
sprpriority = 2

[State 440, 2]
type = PlaySnd
trigger1 = Time = 2
value = 0, 2

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,1

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkxy = -5,-10
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1

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

;---------------------------------------------------------------------------
;Jump Light Punch
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 600
sprpriority = 2

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

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 7,8
sparkxy = -10,-47
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = High
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -4
air.velocity = -1.3,-3

[State 600, 3]
type = CtrlSet
trigger1 = Time = 17
value = 1

;---------------------------------------------------------------------------
;Jump Strong Punch
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 610
sprpriority = 2

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

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,0

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 72
guardflag = HA
priority = 4
pausetime = 12,12
sparkxy = -10,-40
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4

;---------------------------------------------------------------------------
;Jump Light Kick
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

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

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 26
guardflag = HA
priority = 3
pausetime = 8,8
sparkxy = -5,-35
sparkno = s4000
guard.sparkno = s4100
hitsound = s1,0
guardsound = s1,4
ground.type = High
ground.slidetime = 6
ground.hittime  = 6
ground.velocity = -4
air.velocity = -2,-3

;---------------------------------------------------------------------------
;Jump Strong Kick
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 640
sprpriority = 2

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

[State 440, 2]
type = PlaySnd
trigger1 = Time = 1
value = 4,1

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkxy = -10,-50
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,-4

;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sprpriority = 1
p1facing = 1
p2facing = 1
p1stateno = 810
p2stateno = 820
guard.dist = 0
fall = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60
sprpriority = -1

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1,5

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0,3

[State 440, 2]
type = PlaySnd
trigger1 = animelem = 5
value = 4,2

[State 810, Width]
type = Width
trigger1 = AnimElemTime(6) < 0
edge = 60,0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(4) < 0
pos = 30, 0

[State 810, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) < 0
pos = 12, -74

[State 810, Bind 3]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = -17, -50

[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos = -88, -57

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 6
value = -78

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 7
value = 821

[State 810, Turn 12]
type = Turn
trigger1 = AnimElem = 10

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 6,-7
poweradd = 40

[State 821, 1]
type = Gravity
Trigger1 = 1

[State 821, 2]
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200

[State 821, 3]
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;FOCUS ATTACK BY ROLENTO
;Focus Strike - charge state 1
;This state covers the charging aspect of the Focus Strike attack at the start.
[Statedef 900]
type = S
movetype = I
physics = S
juggle = 10
anim = 900
ctrl = 0
poweradd = 0
velset = 0,0
 
; These next two sctrls cover initial charge value and building it up
[State 900, starting value]
type = VarSet
trigger1 = time = 1 && var(20)
fvar(9) = 0
 
[State 900, adding to value]
type = VarAdd
trigger1 = time >= 1
fv = 9
value = 1
persistent = 1
 
; This PalFX sctrl emulates the temporary darkening of the character while charging near the start
[state 901, dark flash]
type = PalFx
trigger1 = time = 10
add = 0,0,0
sinadd = -100,-100,-100,40
time = 16
 
; These change states control dash cancels and moving into the attack portion
[State 900, dash cancel back]
type = ChangeState
trigger1 = time >= 8 && command = "BB"
value = 105
 
[State 900, dash cancel forward]
type = ChangeState
trigger1 = time >= 8 && command = "FF"
value = 100
 
[State 900, stopping early]
type = ChangeState
trigger1 = time >= 8 && command != "hold-b" && command !="hold-y"
value = 902
 
[State 900, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 902
 
;---------------------------------------------
;Focus Strike - charge state 2
;This state covers the charging aspect of the Focus Strike attack if hit
[Statedef 901]
type = S
movetype = I
physics = S
juggle = 10
ctrl = 0
poweradd = 0
velset = 0,0
 
; This part covers the after effects of getting hit from earlier.
[state 901, no more saving hit]
type = varset
trigger1 = time = 1
var(20) = 0
 
[state 901, white flash]
type = PalFx
trigger1 = time = 1
sinadd = 128,128,128,16
time = 8
 
[State 901, life removal]
type = LifeAdd
trigger1 = time = 1 && !var(20)
value = -(gethitvar(damage))
kill = 1
 
; This ctrl changes the animframe back to the last active one
[State 901, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 900
elem = var(22)
 
; This varset is the continuation of charging
[State 901, adding to charge]
type = VarAdd
trigger1 = time >= 1
fv = 9
value = 1
persistent = 1
 
; These change states control dash cancels and moving into the attack portion
[State 901, dash cancel]
type = ChangeState
trigger1 = time >= 8 && command = "BB"
value = 105
 
[State 901, dash cancel forward]
type = ChangeState
trigger1 = time >= 8 && command = "FF"
value = 100
 
[State 901, early release]
type = ChangeState
trigger1 = time >= 8 && command != "hold-b" && command !="hold-y"
value = 902
 
[State 901, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 902
 
;----------------------------------------
;Focus Attack - actual attack
[Statedef 902]
type = S
movetype = A
physics = S
juggle = 10
anim = 901
ctrl = 0
velset = 0,0
 
;PalFX sctrls; the first removes any earlier stuff, and the second the white flash 
;that appears if you have maxed out focus
[state 901, cancel earlier fx flash]
type = PalFx
trigger1 = time = 0
add = 0,0,0
time = 0
 
[state 901, bright flash if maxed out]
type = PalFx
triggerall =FVar(9) = 60
trigger1 = time = 1
add = 128,128,128
sinadd = -128,-128,-128,32
time = 8
 
; The hitdef used depends on the how long you've been charging.
; In case you are wondering why there are 2 versions of each lvl's
; hitdef, the second one has been refined to compensate for hitting
; air opponents.
;lvl 1
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 3 && (FVar(9) = [0,29])
attr = S, NA
damage= 40,0
animtype = Hard
guardflag = M
hitflag = M
priority = 4, Hit
pausetime = 9, 9
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -8.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 2 && (FVar(9) = [0,29])
attr = S, NA
damage= 40,0
animtype = Hard
guardflag = A
hitflag = A
priority = 4, Hit
pausetime = 9, 9
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -6.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
; Counter version of lvl 1: If you counterhit when at this early stage, crumple is possible it seems.
[State 902, 0-30 counter ver]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 2 && (FVar(9) = [0,29])
trigger1 = p2movetype = A && p2statetype !=A
attr = S, NA
damage= 40,0
animtype = Hard
guardflag = M
hitflag = M
priority = 6, Hit
pausetime = 9, 9
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -6.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
p2stateno = 903 ;<-- This is the p2 crumple state
 
;lvl 2
[State 902, 31-59]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 3 && (FVar(9) = [31,59])
attr = S, NA
damage= 60,0
animtype = Hard
guardflag = M
hitflag = M
priority = 4, Hit
pausetime = 11, 11
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -8.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
p2stateno = 903 ;<-- This is the p2 crumple state
 
[State 902, 31-59 b]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 2 && (FVar(9) = [30,59])
attr = S, NA
damage= 60,0
animtype = Hard
guardflag = A
hitflag = A
priority = 5, Hit
pausetime = 11, 11
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
[State 902, 31-59 counter]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = p2movetype = A && p2statetype !=A
trigger1 = AnimElem = 2 && (FVar(9) = [30,59])
attr = S, NA
damage= 60,0
animtype = Hard
hitflag = M
priority = 5, Hit
pausetime = 11, 11
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
p2stateno = 903 ;<-- This is the p2 crumple state
 
;lvl 3 MAX
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 3 && FVar(9) = 60
attr = S, NA
damage= 85,0
animtype = Hard
;guardflag = MA ;<-- Commented out as you will not be blocking this. This will hurt, and you will fall!
hitflag = MAF
priority = 4, Hit
pausetime = 14, 14
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
p2stateno = 903 ;<-- This is the p2 crumple state
 
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 2 && FVar(9) = 60
attr = S, NA
damage= 85,0
animtype = Hard
hitflag = A
priority = 6, Hit
pausetime = 14, 14
sparkxy = -5, -58
sparkno = s4050
guard.sparkno = s4100
hitsound = s1,1
guardsound = s1,4
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 21,21
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
[State 902, fvar reset]
type = VarSet
trigger1 = !AnimTime
fvar(9) = 0
 
;Dash Cancels upon movecontact
[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "FF"
value = 100
 
[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "BB"
value = 105

;Stuff
[State 1000, 1]
type = PlaySnd
trigger1 = time = 1
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = time = 1
value = 4,2
 
[State 902, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
 
;----------------------------------------
;Focus Attack - p2 crumple state
[Statedef 903]
type = S
movetype = H
physics = N
ctrl = 0
velset = 0,0
 
;Fixes the y pos just in case.
[State 903, PosSet]
type = PosSet
trigger1 = 1
y = 0
 
[State 903, Change to custom crumple anim]
type = ChangeAnim2
trigger1 = time = 1
value = 902
 
[State 903, Hitoverride if hit by non-fall move]
type = HitOverride
trigger1 = stateno = 903
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 5020
time = 1
forceair = 1
 
[State 903, Return to their own states]
type = SelfState
trigger1 = anim = 902 && !animtime
value = 5110
ctrl = 1
 
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hadouken Debil
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,0

[State 1001, T1] ;P1
Type = Projectile
trigger1 = animelem = 4
attr = A, SP
animtype  = Heavy
damage    = ifelse(palno>=4,70,90),ifelse(palno>=4,3,5)
guardflag = MA
hitflag = MA
pausetime = ifelse(palno>=4,10,15),ifelse(palno>=4,10,15)
offset = 72,-67
sparkxy = 0,0  
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -10
air.velocity = -3,-4
ProjID = 1000
projanim = 1001
projhitanim = 1002
projremanim = 1002
projcancelanim = 1002
velocity = 3
projpriority = 1
air.fall = 1
air.juggle = 15

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

;---------------------------------------------------------------------------
; Hadouken Fuerte
[Statedef 1050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,0

[State 1001, T1] ;P1
Type = Projectile
trigger1 = animelem = 4
attr = A, SP
animtype  = Heavy
damage    = ifelse(palno>=4,70,90),ifelse(palno>=4,3,5)
guardflag = MA
hitflag = MAP
pausetime = ifelse(palno>=4,10,15),ifelse(palno>=4,10,15)
offset = 72,-67
sparkxy = 0,0  
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -10
air.velocity = -3,-4
ProjID = 1000
projanim = 1001
projhitanim = 1002
projremanim = 1002
projcancelanim = 1002
velocity = 5
projpriority = 1
air.fall = 1
air.juggle = 15

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

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Shoryuken Debil
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

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

[State 1050, 4]
type = HitDef
trigger1 = animelem = 3
attr = S, SA
animtype  = Medium
damage    = ifelse(palno<7,80,50), 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = ifelse(palno<7,1,0)
juggle = 15

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,1

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1101

;------------------
; Shoryuken Debil - salto
[Statedef 1101]
type    = A
movetype= A
physics = N
anim = 1101
hitdefpersist = 1

[State 1050, 4]
type = Velset
trigger1 = time = 0
x = 1
y = -4

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
triggerall = palno >= 4
attr = A, SA
animtype  = Medium
damage    = 30, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1

[State 1051, 3]
type = ChangeState
trigger1 = time = 7
value = 1102

;---------------------------------------------------------------------------
; Shoryuken - cayendo
[Statedef 1102]
type    = A
movetype= I
physics = N
anim = 1102

[State 1055, 1]
type = RemoveExplod
trigger1 = time = 0
ID = 1110

;KEN - fuego
[State 1151, fuego]
type = Explod
triggerall = palno > 6
triggerall = prevstateno = 1151
trigger1 = animelem = 1
anim = 1111
ID = 1111
pos = 0,0
postype = p1
sprpriority = 3
bindtime = -1
ignorehitpause = 1
removetime = -2
removeongethit = 1

[State 1055, 1]
type = Gravity
trigger1 = time >= 0

[State 1055, 6]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1103

;------------------
; Shoryuken - suelo
[Statedef 1103]
type    = S
movetype= I
physics = S
anim = 1103
sprpriority = 1
velset = 0,0

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

[State 1052, 3]
type = CtrlSet
trigger1 = AnimElem = 3, -1
value = 1

[State 1052, 4]
type = PosAdd
trigger1 = AnimElem = 4
x = -15

[State 1052, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Shoryuken Fuerte
[Statedef 1150]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

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

;RYU
[State 1050, 4]
type = HitDef
triggerall = palno < 7
trigger1 = animelem = 3
attr = S, SA
animtype  = Heavy
damage    = 110, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1
air.fall = 1
juggle = 15
air.juggle = 15

;KEN
[State 1050, 4]
type = HitDef
triggerall = palno > 6
trigger1 = animelem = 2
attr = S, SA
animtype  = Medium
damage    = 30, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -.5,-3
guard.velocity = -1
air.velocity = -.5,-3

[State 1050, 4]
type = HitDef
triggerall = palno > 6
trigger1 = animelem = 3
attr = S, SA
animtype  = Medium
damage    = 30, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
hitsound   = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = 2,-7
guard.velocity = -7
air.velocity = 2,-7
palfx.time = 40
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1

;KEN - fuego
[State 1151, fuego]
type = Explod
triggerall = palno > 6
trigger1 = animelem = 3
anim = 1110
ID = 1110
pos = 0,0
postype = p1
sprpriority = 3
bindtime = -1
ignorehitpause = 0
removetime = -1
removeongethit = 1

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,1

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1151

;------------------
; Shoryuken Fuerte - salto
[Statedef 1151]
type    = A
movetype= A
physics = N
anim = 1101
hitdefpersist = 1

[State 1050, vel1]
type = Velset
trigger1 = time = 0
x = 1.5
y = -5.5

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
triggerall = palno > 6
attr = A, SA
animtype  = Medium
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1
air.fall = 1
palfx.time = 40
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1

[State 1051, 3]
type = ChangeState
trigger1 = time = 10
value = 1102

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Tatsumaki Sempuukyaku Debil
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 3,-3
anim = 1200
ctrl = 0
sprpriority = 2

[State 1050, 1]
type = Statetypeset
trigger1 = movetype = H
value = A

[State 1100, CS]
type = ChangeState
trigger1 = AnimTime = 0
value = 1201

;------------------
; Tatsumaki Sempuukyaku Debil - patadas
[Statedef 1201]
type    = A
movetype= A
physics = N
anim = 1201

[State 1050, 1]
type = Statetypeset
trigger1 = movetype = H
value = A

[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2,2

[State 1200, vel1]
type = VelSet
trigger1 = 1
x = 3.5

[State 1200, vel2]
type = VelSet
trigger1 = animelemtime(10) < 0
y = 0

[State 1200, vel2]
type = Gravity
trigger1 = animelemtime(10) >= 0

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 14
trigger6 = AnimElem = 17
value = 0, 3

;RYU
[State 1100, 2]
type = HitDef
triggerall = palno < 7
trigger1 = animelem = 3
trigger2 = animelem = 9 && movehit = 0
attr = A, SA
animtype  = Back
damage    = 105, 10
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1
fall = 1
air.fall = 1
fall.recovertime = 40
yaccel = .4
juggle = 15
air.juggle = 15

[State 1100, 3]
type = HitDef
triggerall = palno < 7
trigger1 = AnimElem = 5 && movehit = 0
trigger2 = animelem = 11 && movehit = 0
attr = A, SA
animtype  = Back
damage    = 105, 10
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1
fall = 1
air.fall = 1
fall.recovertime = 40
yaccel = .4
juggle = 15
air.juggle = 15

;KEN
[State 1100, 2]
type = HitDef
triggerall = palno > 6
trigger1 = animelem = 3
trigger2 = animelem = 9
attr = A, SA
animtype  = Hard
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1

[State 1100, 3]
type = HitDef
triggerall = palno > 6
trigger1 = AnimElem = 5
trigger2 = animelem = 11
attr = A, SA
animtype  = Hard
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; Tatsumaki Sempuukyaku Fuerte
[Statedef 1250]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 3,-3
anim = 1200
ctrl = 0
sprpriority = 2

[State 1050, 1]
type = Statetypeset
trigger1 = movetype = H
value = A

[State 1100, CS]
type = ChangeState
trigger1 = AnimTime = 0
value = 1251

;------------------
; Tatsumaki Sempuukyaku Fuerte - patadas
[Statedef 1251]
type    = A
movetype= A
physics = N
anim = 1250

[State 1050, 1]
type = Statetypeset
trigger1 = movetype = H
value = A

[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2,2

[State 1200, vel1]
type = VelSet
trigger1 = 1
x = 4

[State 1200, vel2]
type = VelSet
trigger1 = animelemtime(25) < 0
y = 0

[State 1200, vel2]
type = Gravity
trigger1 = animelemtime(25) >= 0

[State 1200, pp]
type = PlayerPush
trigger1 = 1
value = 1

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 14
trigger6 = AnimElem = 17
trigger7 = AnimElem = 20
trigger8 = AnimElem = 23
trigger9 = AnimElem = 26
trigger10 = AnimElem = 29
value = 0, 3

;RYU
[State 1100, 2]
type = HitDef
triggerall = palno < 7
trigger1 = animelem = 3
trigger2 = animelem = 9 && movehit = 0
trigger3 = animelem = 15 && movehit = 0
trigger4 = animelem = 21 && movehit = 0
attr = A, SA
animtype  = Heavy
damage    = 120, 10
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1
fall = 1
air.fall = 1
fall.recovertime = 40
yaccel = .4
juggle = 15
air.juggle = 15

[State 1100, 3]
type = HitDef
triggerall = palno < 7
trigger1 = AnimElem = 5
trigger2 = animelem = 11 && movehit = 0
trigger3 = animelem = 17 && movehit = 0
trigger4 = animelem = 23 && movehit = 0
attr = A, SA
animtype  = Heavy
damage    = 120, 10
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1
fall = 1
air.fall = 1
fall.recovertime = 40
yaccel = .4
juggle = 15
air.juggle = 15

;KEN
[State 1100, 2]
type = HitDef
triggerall = palno > 6
trigger1 = animelem = 3
trigger2 = animelem = 9
trigger3 = animelem = 15
trigger4 = animelem = 21
attr = A, SA
animtype  = Hard
damage    = 30, 3
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1

[State 1100, 3]
type = HitDef
triggerall = palno > 6
trigger1 = AnimElem = 5
trigger2 = animelem = 11
trigger3 = animelem = 17
trigger4 = animelem = 23
attr = A, SA
animtype  = Hard
damage    = 30, 3
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Ryu: Air Hadouken Debil
[Statedef 1300]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 100
anim = 1300
ctrl = 0
sprpriority = 2

[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2,0

[State 1200, Vel 1]
type = Velset
trigger1 = Vel X = 0
x = 0

[State 1200, Vel 2]
type = Velset
trigger1 = Vel x > 0
X = 4

[State 1200, Vel 3]
type = Velset
trigger1 = Vel x < 0
X = -4

[State 1001, T1] ;P1
Type = Projectile
trigger1 = animelem = 3
attr = A, SP
animtype  = Heavy
damage    = 90, 5
guardflag = MA
hitflag = MA
pausetime = 10,10
offset = 38,-44
sparkxy = 0,0  
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -10
air.velocity = -3,-4
ProjID = 1000
projanim = 1301
projhitanim = 1302
projremanim = 1302
projcancelanim = 1302
velocity = 3,4
projpriority = 1
air.fall = 1
air.juggle = 15

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; Ryu: Air Hadouken Fuerte
[Statedef 1350]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 100
anim = 1300
ctrl = 0
sprpriority = 2

[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2,0

[State 1200, Vel 1]
type = Velset
trigger1 = Vel X = 0
x = 0

[State 1200, Vel 2]
type = Velset
trigger1 = Vel x > 0
X = 4

[State 1200, Vel 3]
type = Velset
trigger1 = Vel x < 0
X = -4

[State 1001, T1] ;P1
Type = Projectile
trigger1 = animelem = 3
attr = A, SP
animtype  = Heavy
damage    = 90, 5
guardflag = MA
hitflag = MA
pausetime = 10,10
offset = 38,-44
sparkxy = 0,0  
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -10
air.velocity = -3,-4
ProjID = 1000
projanim = 1301
projhitanim = 1302
projremanim = 1302
projcancelanim = 1302
velocity = 4,3
projpriority = 1
air.fall = 1
air.juggle = 15

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Ken: Air Tatsumaki Sempuukyaku Debil
[Statedef 1400]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 100
anim = 1400
ctrl = 0
sprpriority = 2

[State 1200, 1]
type = PlaySnd
trigger1 = time = 0
value = 2,2

[State 1200, Vel 1]
type = Velset
trigger1 = Vel X = 0
x = 0

[State 1200, Vel 2]
type = Velset
trigger1 = Vel x > 0
X = 4

[State 1200, Vel 3]
type = Velset
trigger1 = Vel x < 0
X = -4

[State 1200, Anim]
type = ChangeAnim
trigger1 = animtime = 0
value = 1201

[State 1220, 1]
type = PlaySnd
triggerall = anim = 1201
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 14
trigger6 = AnimElem = 17
value = 0, 3

;KEN
[State 1100, 2]
type = HitDef
triggerall = anim = 1201
trigger1 = animelem = 3
trigger2 = animelem = 9
attr = A, SA
animtype  = Hard
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1

[State 1100, 3]
type = HitDef
triggerall = anim = 1201
trigger1 = AnimElem = 5
trigger2 = animelem = 11
attr = A, SA
animtype  = Hard
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; Ken: Air Tatsumaki Sempuukyaku Fuerte
[Statedef 1450]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 100
anim = 3050
ctrl = 0
sprpriority = 2

[State 1050, 1]
type = Statetypeset
trigger1 = movetype = H
value = A

[State 1200, 1]
type = PlaySnd
trigger1 = time = 0
value = 2,2

[State 1200, Vel 1]
type = Velset
trigger1 = Vel X = 0
x = 0

[State 1200, Vel 2]
type = Velset
trigger1 = Vel x > 0
X = 4

[State 1200, Vel 3]
type = Velset
trigger1 = Vel x < 0
X = -4

[State 1200, Anim]
type = ChangeAnim
trigger1 = animtime = 0
value = 3050

[State 1220, 1]
type = PlaySnd
triggerall = anim = 3050
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 14
trigger6 = AnimElem = 17
trigger7 = AnimElem = 20
trigger8 = AnimElem = 23
trigger9 = AnimElem = 26
trigger10 = AnimElem = 29
trigger11 = AnimElem = 32
trigger12 = AnimElem = 35
value = 0, 3

[State 1100, 2]
type = HitDef
triggerall = anim = 3050
trigger1 = animelem = 3
trigger2 = animelem = 9
trigger3 = animelem = 15
trigger4 = animelem = 21
attr = A, SA
animtype  = Hard
damage    = 30, 3
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -3
air.velocity = -2,-2
airguard.velocity = -3,-1

[State 1100, 3]
type = HitDef
triggerall = anim = 3050
trigger1 = AnimElem = 5
trigger2 = animelem = 11
trigger3 = animelem = 17
trigger4 = animelem = 23
attr = A, SA
animtype  = Hard
damage    = 30, 3
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4200
guard.sparkno = s4100
hitsound = s1,2
guardsound = s1,44
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 6
guard.velocity = 3
air.velocity = 2,-2
airguard.velocity = 3,-1

[State 701, aura]
type = Explod
trigger1 = time = 1
anim = 3051
pos = 0,0
sprpriority = -1
postype = p1
bindtime = -1
ownpal = 1
ID = 700
removetime = 75
removeongethit = 1

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Shinkuu Hadouken (Ryu hyper)
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 191, voz]
type = PlaySnd
trigger1 = time = 0
value = 3,0

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 2, 1
pos = -17, -70
anim = s4500
sound = s6,1
poweradd = -1000

[State 3000, Super B]
type = AfterImage
trigger1 = AnimElem = 2, 1
time = 2

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1 && Time < 60
time = 2

[State 3000, Super D]
type = NotHitBy
trigger1 = AnimElem = 2
value = , NA, SA, AT
time = 12

[State 3000, Super E]
type = NotHitBy
trigger1 = AnimElemTime(2) >= 0 && Time < 30
value2 = C, NA
time = 1

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 3

[State 1000, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 2,0

[State 1001, T1] ;P1
Type = Projectile
trigger1 = animelem = 4
attr = A, HP
animtype  = Heavy
damage    = 50, 5
guardflag = MA
hitflag = MAP
projpriority = 9
projshadow = 0
projhits = 5
projscale = 1.5,1.5
pausetime = 5,5
offset = 72,-67
sparkxy = 0,0  
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 9
ground.hittime  = 20
ground.velocity = -5
air.velocity = -3,-4
ProjID = 1000
projanim = 1001
projhitanim = 1002
projremanim = 1002
projcancelanim = 1002
velocity = 6
air.fall = 1
air.juggle = 15
fall = ifelse(hitcount>3,1,0)
getpower = 0

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

;---------------------------------------------------------------------------
; Shinkuu Tatsumaki Senpuukyaku (Ryu hyper)
[Statedef 3050]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

[State 191, voz]
type = PlaySnd
trigger1 = time = 0
value = 3,0

[State 3050, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 5, -60
anim = s4500
sound = s6,1
poweradd = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2

[State 3050, Super D]
type = NotHitBy
trigger1 = AnimElem = 2
value = , NA, SA, AT
time = 6

[State 1100, CS]
type = ChangeState
trigger1 = AnimTime = 0
value = 3051

;------------------
; Tatsumaki Sempuukyaku Fuerte - patadas
[Statedef 3051]
type    = A
movetype= A
physics = N
anim = 3050

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(1) >= 0
time = 2

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 1
time = 2

[State 1050, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2,2

[State 1200, vel1]
type = VelSet
trigger1 = 1
x = 0

[State 1200, vel2]
type = VelSet
trigger1 = animelemtime(31) < 0
y = 0

[State 1200, vel2]
type = Gravity
trigger1 = animelemtime(31) >= 0

[State 1200, pp]
type = PlayerPush
trigger1 = 1
value = 0

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
trigger3 = AnimElem = 8
trigger4 = AnimElem = 11
trigger5 = AnimElem = 14
trigger6 = AnimElem = 17
trigger7 = AnimElem = 20
trigger8 = AnimElem = 23
trigger9 = AnimElem = 26
trigger10 = AnimElem = 29
trigger11 = AnimElem = 32
trigger12 = AnimElem = 35
value = 0, 3

[State 1100, 2]
type = HitDef
trigger1 = animelem = 3
trigger2 = animelem = 9
trigger3 = animelem = 15
trigger4 = animelem = 21
attr = A, HA
animtype  = Hard
damage    = 25, 5
priority  = 5
guardflag = MA
pausetime = 3,3
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = 15
guard.velocity = 15
air.velocity = 15,-1
airguard.velocity = 15,-1
getpower = 0

[State 1100, 3]
type = HitDef
trigger1 = AnimElem = 5
trigger2 = animelem = 11
trigger3 = animelem = 17
trigger4 = animelem = 23
attr = A, HA
animtype  = Hard
damage    = 25, 3
priority  = 5
guardflag = MA
pausetime = 3,3
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,2
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -15
guard.velocity = -15
air.velocity = -15,-1
airguard.velocity = -15,-1
getpower = 0

[State 1100, final]
type = HitDef
trigger1 = animelem = 27
attr = A, HA
animtype  = Back
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 7,7
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -10,-5
guard.velocity = -6
air.velocity = -10,-5
airguard.velocity = -6,-1
getpower = 0

[State 1100, final2]
type = HitDef
trigger1 = AnimElem = 29
attr = A, HA
animtype  = Back
damage    = 50, 5
priority  = 5
guardflag = MA
pausetime = 7,7
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -10,-5
guard.velocity = -6
air.velocity = -10,-5
airguard.velocity = -6,-1
getpower = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; Shoryureppa (Ken hyper)
[Statedef 3100]
type    = S
movetype= A
physics = S
juggle  = 6
velset = 0,0
anim = 3100
ctrl = 0
sprpriority = 2

[State 191, voz]
type = PlaySnd
trigger1 = animelem = 2
value = 3,1

[State 191, viento]
type = PlaySnd
trigger1 = animelem = 4
trigger2 = animelem = 13
trigger3 = animelem = 22
value = 0,3

[State 191, pies]
type = PlaySnd
trigger1 = animelem = 9
trigger2 = animelem = 18
trigger3 = animelem = 27
value = 40,1

[State 3050, Width]
type = Width
trigger1 = AnimElemTime(1) >= 0
value = 30,0

[State 3050, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 10, -57
anim = s4500
sound = s6,1
poweradd = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
time = 2

[State 3050, Super D]
type = NotHitBy
trigger1 = AnimElem = 1
value = , NA, SA, AT
time = 6

[State 3050, Vel]
type = VelSet
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(30) < 0
x = 5

[State 3050, Vel]
type = VelSet
trigger1 = AnimElemTime(30) >= 0
x = 0

[State 1110, 2]
type = HitDef
trigger1 = animelem = 4
trigger2 = animelem = 13
trigger3 = animelem = 22
attr = S, HA
animtype  = Hard
damage    = 60, 5
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = -10,-60
sparkno = s4250
guard.sparkno = s4150
hitsound   = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -4.5
guard.velocity = -4.5
air.velocity = -4.5,-2
airguard.velocity = -4.5,-2
getpower = 0

;KEN - fuego
[State 1151, fuego]
type = Explod
trigger1 = animelem = 30
anim = 1110
ID = 1110
pos = 0,0
postype = p1
sprpriority = 3
bindtime = -1
ignorehitpause = 0
removetime = -1
removeongethit = 1

[State 3051, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 3101

;------------------
; Shoryureppa (final)
[Statedef 3101]
type    = A
movetype= A
physics = N
anim = 1101
hitdefpersist = 1

[State 1220, 1]
type = PlaySnd
trigger1 = time = 1
value = 0, 3

[State 1050, vel1]
type = Velset
trigger1 = time = 0
x = 1.5
y = -5.5

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Back
damage    = 70, 5
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-85
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1
air.fall = 1
palfx.time = 40
palfx.add = 240,50,0
palfx.mul = 250,224,120
palfx.sinadd = 110,55,85,10
Palfx.color = 0
palfx.invertall = 1
getpower = 0
fall.recover = 0
air.recover = 0

[State 1051, 3]
type = ChangeState
trigger1 = time = 10
value = 1102

;---------------------------------------------------------------------------
; Shippu Jinri Kyaku (Ken hyper)
[Statedef 3150]
type    = S
movetype= A
physics = S
juggle  = 6
anim = 3150
ctrl = 0
sprpriority = 2

[State 191, voz]
type = PlaySnd
trigger1 = time = 0
value = 5,5

[State 3050, vel]
type = VelSet
trigger1 = AnimElemTime(25) < 0
x = 3

[State 3050, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = -9, -33
anim = s4500
sound = s6,1
poweradd = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
time = 2

[State 3050, Super D]
type = NotHitBy
trigger1 = AnimElem = 2
value = , NA, SA, AT
time = 6

[State 1220, PP]
type = PlayerPush
trigger1 = 1
value = 1

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 10
trigger3 = AnimElem = 16
trigger4 = AnimElem = 22
value = 0, 3

[State 1220, Width]
type = Width
trigger1 = AnimElemTime(23) < 0
value = 30,0

[State 191, voz]
type = PlaySnd
trigger1 = animelem = 2
value = 3,2

[State 1020, k1]
type = HitDef
trigger1 = animelem = 4
attr = S, HA
animtype  = Heavy
damage    = 30, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-60
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = Low
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -3
guard.velocity = -3
air.velocity = -3,-1
airguard.velocity = -3, -1
kill = 0

[State 1020, k2]
type = HitDef
trigger1 = animelem = 10
attr = S, HA
animtype  = Heavy
damage    = 30, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-80
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -3
guard.velocity = -3
air.velocity = -3,-1
airguard.velocity = -3, -1
kill = 0

[State 1020, k3]
type = HitDef
trigger1 = animelem = 16
attr = S, HA
animtype  = Heavy
damage    = 30, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-50
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = Low
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -3
guard.velocity = -3
air.velocity = -3,-1
airguard.velocity = -3, -1
kill = 0

[State 1020, k4]
type = HitDef
trigger1 = animelem = 22
attr = S, HA
animtype  = Heavy
damage    = 30, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-80
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -3
guard.velocity = -3
air.velocity = -3,-1
airguard.velocity = -3, -1
p1stateno = 3151
kill = 0

[State 1220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Shippu Jinri Kyaku - Success!!
[Statedef 3151]
type    = S
movetype= A
physics = S
juggle  = 6
anim = 3151
ctrl = 0
velset = 3,0
sprpriority = 2

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
time = 2

[State 1220, Width]
type = Width
trigger1 = AnimElemTime(5) < 0
value = 30,0

[State 1220, 1]
type = PlaySnd
trigger1 = AnimElem = 9
trigger2 = AnimElem = 13
trigger3 = AnimElem = 17
trigger4 = AnimElem = 21
value = 0, 3

[State 1020, k1]
type = HitDef
trigger1 = animelem = 4
attr = S, HA
animtype  = Up
damage    = 30, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-80
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = 3,-4
guard.velocity = -3
air.velocity = 3,-4
airguard.velocity = -3, -1
kill = 0

[State 1220, STS]
type = StatetypeSet
trigger1 = AnimElemTime(5) >= 0
value = A

[State 1220, vel]
type = VelSet
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(22) < 0
x = 0
y = -5

[State 1020, tatsu]
type = HitDef
trigger1 = animelem = 9
trigger2 = animelem = 13
trigger3 = animelem = 17
attr = A, HA
animtype  = Up
damage    = 25, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 10,10
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = 0,-8
guard.velocity = -3
air.velocity = 0,-8
airguard.velocity = -3, -1

[State 1020, final]
type = HitDef
trigger1 = animelem = 21
attr = A, HA
animtype  = Back
damage    = 25, 1
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-65
sparkno = s4250
guard.sparkno = s4150
hitsound = s1,3
guardsound = s1,4
ground.type = High
ground.slidetime = 30
ground.hittime  = 30
ground.velocity = -6,-3
guard.velocity = -3
air.velocity = -6,-3
airguard.velocity = -3, -1
fall = 1
air.fall = 1
fall.recover = 0
air.recover = 0

[State 1220, vel2]
type = Gravity
trigger1 = AnimElemTime(22) >= 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

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

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]

[State -2 , 3];KO
type = PlaySnd 
triggerall = alive != 1
trigger1 = movehit = 1
value = 11,0

[State -2 , 4];mareado
type = PlaySnd 
trigger1 = stateno = 5300
value = 5300,0

;-----------------
; Sonidos estados 5000
[State -2 , 0]
type = PlaySnd 
triggerall = Random < 500
triggerall = Time = 1
trigger1 = anim = 5000 || anim = 5010 || anim = 5020
value = 10,0

[State -2 , 1]
type = PlaySnd 
triggerall = Random < 500
triggerall = Time = 1
trigger1 = anim = 5001 || anim = 5011 || anim = 5021
value = 10,1

[State -2 , 2]
type = PlaySnd 
triggerall = Random < 500
triggerall = Time = 1
trigger1 = anim = 5002 || anim = 5012 || anim = 5022
value = 10,2

;--------------
; Focus attack / Saving Strike code (Part A)
;The later half of this negative coding can be found under statedef -3
[State -2, Focus Attack meter reset when no longer charging]
type = VarSet
trigger1 = (stateno !=[900,901]) && ((stateno=[5000,5099]) && prevstateno != 900)
trigger2 = stateno = [100,105]
fv = 9
value = 0
 
[State -2, life return removed if hit while refilling]
type = VarSet
trigger1 = var(21) && stateno !=901 && movetype = H
var(21) = 0
 
[State -2, Life return if left alone]
type = LifeAdd
trigger1 = (stateno != [901,902]) && var(21) && (Gametime%6)=1
value = 1
absolute = 0
 
[State -2, life return if left alone]
type = VarAdd
trigger1 = (stateno != [901,902]) && var(21) && (Gametime%6)=1
v = 21
value = -1

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
trigger3 = stateno = 1103 ;Shoryuken land
value = 40, 1

[State -3, Running Sound]
type = PlaySnd
;triggerall = Time = 1
triggerall = stateno = 100
trigger1 = animelem = 2
trigger2 = animelem = 5
value = 40, 0

;--------------------------------------
; Focus attack / Saving Strike code (Part B)
;-----------------------------
[state -3, animelem set frame 1]
type = varset
trigger1 = stateno = 900 && time = 1
var(22) = 1
 
[state -3, animelem set frame 2]
type = varset
trigger1 = stateno = 900 && animelem = 2
var(22) = 2
 
[state -3, animelem set frame 3]
type = varset
trigger1 = stateno = 900 && animelem = 3
var(22) = 3
 
[State -3, Change to second state]
type = HitOverride
trigger1 = stateno = 900
attr = SCA,NA,SA,HA,NP,SP,HP
slot = 0
stateno = 901
time = 1
forceair = 0
ignorehitpause = 1
persistent = 1
 
[state -3, varset for first state]
type = varset
trigger1 = stateno = 900
var(20) = 1
 
[state -3, varset for second state]
type = varset
trigger1 = stateno = 901
var(20) = 0
 
[state -3, lost health tally in second state]
type = varset
trigger1 = stateno = 901 && time = 0
var(21) = (gethitvar(damage))
 
[State -3, health removal in second state]
type = LifeAdd
trigger1 = stateno = 901
value = -(gethitvar(damage))
kill = 1