 
; KFM's constants and state file.
; There are comments scattered through this file, so you may like to
; take a look if would like to learn more about the cns.

[Data]
;Amount of life to start with
life = 1000 ;attack power (more is stronger)
attack = 100 ;defensive power (more is stronger)
defence = 100 ;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50 ;Time which player lies down for, before getting up
liedown.time = 60 ;Number of points for juggling
airjuggle = 15 ;Default hit spark number for HitDefs
sparkno = 2 ;Default guard spark number
guard.sparkno = 40 ;1 to enable echo on KO
KO.echo = 0 ;Volume offset (negative for softer)
;volume = 0 
;Variables with this index and above will not have their values
;reset to 0 between rounds or matches. There are 60 int variables,
;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
;If omitted, then it defaults to 60 and 40 for integer and float
;variables repectively, meaning that none are persistent, i.e. all
;are reset. If you want your variables to persist between matches,
;you need to override state 5900 from common1.cns.
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 0.85           ;Horizontal scaling factor.
yscale = 0.85           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 1     ;Set to 1 to scale projectiles too
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y). Recommended 0,0

[Velocity]
walk.fwd  = 2.4      ;Walk forward
walk.back = -2.2     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-8.4    ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5      ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**

[Movement]
airjump.num = 1       ;Number of air jumps allowed (opt)
airjump.height = 35   ;Minimum distance from ground before you can air jump (opt)
yaccel = .44          ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching
stand.friction.threshold = 2          ;If player's speed drops below this threshold while standing, stop his movement **MUGEN 1.0**
crouch.friction.threshold = .05       ;If player's speed drops below this threshold while crouching, stop his movement **MUGEN 1.0**
air.gethit.groundlevel = 25           ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -20 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 10   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -1  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = .35    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 15      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 20            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = .4               ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 12          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .05         ;If the player's speed drops below this threshold while lying down, stop his movement **MUGEN 1.0**

;Default language victory quotes (optional).  **MUGEN 1.0**
;If this section is included, the default language victory quotes must be in English.
;[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
;victory1 = "You must defeat Tu Shou to stand a chance."
;victory2 = "You need a lot of training. Come back in ten years."
;victory3 = "You look familiar. Did I see you on TV?"
;victory4 = "Your moves are too predictable. You want to learn Kung Fu Palm? It's not for novices."
;victory5 = "That was a good workout."
;victory6 = "I want to challenge more skilled fighters."
;victory7 = "What do you mean my girlfriend is in another temple?"

;Alternate language victory quotes (optional).
;0 or more alternate language sections may be added, preceded by the
;ISO 639-1 code followed by a ".", e.g. "[ja.Quotes]".
;See language setting in mugen.cfg.
;[ja.Quotes]
;victory1 = "カンフー突き手を破らぬ限り、お前に勝ち目はない！"
;victory2 = "十年早いんだぞ"
;victory3 = "お前は見覚えがあるな。テレビにでも…？"
;victory4 = "お前の動きは見破りやすすぎる。　なに、カンフー突き手が覚えたいんだと？　素人には無理だぞ"
;victory5 = "ふー。　いい汗だった"
;victory6 = "もっと強い相手に挑戦したい"
;victory7 = "なんだと！彼女はここにもいないと？"

;---------------------------------------------------------------------------
; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).
; var(3)  - Air Mantis Height 
; var(9)  - P2 X BodyDistance 
; var(35) - Ultra Blade Hits Enemy = 1

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[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
; CNS difficulty: basic
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 0]
type = AssertSpecial
trigger1 = Time = [0,100]
flag = RoundNotOver

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

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[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, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

 
;---------------------------------------------------------------------------
;Standing 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, VelMul, corrida]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8 

[State 200, whoosh]
type = playsnd
trigger1 = animelem = 3
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[State 200, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 25
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkxy = -10, -60
guard.sparkno = s7955
sparkno = s7960
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
;hitsound = s8000,0
guardsound = s8500,0 ;6,0
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
envshake.time = 1
envshake.ampl = 1

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

;---------------------------------------------------------------------------
;Light Swing Punch 
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
anim = 205
poweradd = 35
sprpriority = 2

[State 205, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 200, whoosh]
type = playsnd
trigger1 = animelem = 3
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[State 205, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S,NA
damage = 38,1
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,14
guard.sparkno = s7955
sparkno = s7960
sparkxy = -10,-60
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -6
air.type = Low
air.hittime = 15
air.velocity = -6,-5
envshake.time = 1
envshake.ampl = 1

[State 205, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1






;---------------------------------------------------------------------------
;Standing Medium Punch
[StateDef 210]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 210
poweradd = 20
sprpriority = 2

[State 210, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 200, whoosh]
type = playsnd
trigger1 = animelem = 3
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[State 210, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 35
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkxy = -10,-60 
sparkno = s7965
guard.sparkno = s7950
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
guardsound = s8500,0 ;6,0
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
envshake.time = 1
envshake.ampl = 1

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



;---------------------------------------------------------------------------
;Forward + Y
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
anim = 212
poweradd = 35
sprpriority = 2

[State 212, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 200, whoosh]
type = playsnd
trigger1 = animelem = 3
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[State 212, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S,NA
damage = 38,1
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,14
sparkno = s7965
sparkxy = -10,-60
guard.sparkno = s7950
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -6
air.type = Low
air.hittime = 15
air.velocity = -6,-5
envshake.time = 1
envshake.ampl = 1

[State 212, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;Standing Heavy Punch
[StateDef 220]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 220
poweradd = 20
sprpriority = 2

[State 220, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 220, voice]
type = playsnd
trigger1 = animelem = 4
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 220, whoosh]
type = playsnd
trigger1 = animelem = 4
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 220, stop voice]
type = stopsnd
trigger1 = movehit
channel = 0


[State 220, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 42
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965 
guard.sparkno = s7950
sparkxy = -10, -60
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -12
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
envshake.time = 2
envshake.ampl = 2

[State 220, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Standing Heavy Punch
[StateDef 225]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 225
poweradd = 20
sprpriority = 2

[State 225, width1]
type = width
trigger1 = animelemtime(1) >= 0 && animelemtime(10) < 0
player = 63, -63
ignorehitpause = 1 

[State 225, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 220, voice]
type = playsnd
trigger1 = animelem = 2
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))
channel = 0

[State 220, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))

[State 220, stop voice]
type = stopsnd
trigger1 = movehit
channel = 0


[State 225, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 42
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10, -60
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = -15
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
envshake.time = 2
envshake.ampl = 2

[State 225, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Back + Heavy Punch
[StateDef 228]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 228
poweradd = 20
sprpriority = 2

[State 228, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8


[State 220, voice]
type = playsnd
trigger1 = animelem = 2
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))
channel = 0

[State 220, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))


[State 228, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 42
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10, -60
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
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
envshake.time = 2
envshake.ampl = 2

[State 228, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; Standing Heavy Punch
[StateDef 229]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 229
poweradd = 20
sprpriority = 2

[State 229, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8


[State 220, voice]
type = playsnd
trigger1 = animelem = 2
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))
channel = 0

[State 220, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 0, 1))


[State 229, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 42
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10, -60
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
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
envshake.time = 2
envshake.ampl = 2

[State 229, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;---------------------------------------------------------------------------------------------
;Standing light kick
[StateDef 230]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 230
poweradd = 20
sprpriority = 2

[State 230, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 230, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 230, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 25
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkxy = -10, -40
guard.sparkno = s7955
sparkno = s7960
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
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 230, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------------------------
;light knee
[Statedef 235]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 235
poweradd = 20
sprpriority = 2

[State 235, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8


[State 230, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))


[State 235, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 29
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10, -70
guard.sparkno = s7950
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
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 235, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;---------------------------------------------------------------------------------------------
;Standing medium kick
[StateDef 240]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 240
poweradd = 20
sprpriority = 2

[State 240, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 310, voice]
type = playsnd
trigger1 = animelem = 2
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 310, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 310, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0


[State 240, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 35
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10,-68
guard.sparkno = s7950
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
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 240, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

 
;---------------------------------------------------------------------------------------------
;Standing strong Kick
[Statedef 250]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 250
poweradd = 20
sprpriority = 2

[State 250, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 330, voice]
type = playsnd
trigger1 = animelem = 2
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 330, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 330, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0


[State 250, HitDef]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage = 45
animtype = heavy
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
sparkxy = -10, -70
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -11
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 250, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------------------------
;Close standing strong Kick
[Statedef 259]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
anim = 259
poweradd = 55
sprpriority = 2

[State 259, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8

[State 259, voice]
type = playsnd
trigger1 = animelem = 4
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 259, whoosh]
type = playsnd
trigger1 = animelem = 4
value = 4, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))


[State 259, HitDef]
type = HitDef
trigger1 = animelem = 4  || AnimElem = 9
attr = S,NA
damage = 55,1
animtype = Hard;High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,14
sparkno = s7965
sparkxy = -10, -70
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 13
ground.hittime = 13
ground.velocity = -8,0
air.type = Low
air.hittime = 5
air.velocity = -7,0

[State 259, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

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




;---------------------------------------------------------------------------
;Crouching light punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning
;     KFM will get hit instead of trading hits with his opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 8
ctrl = 0
anim = 400
sprpriority = 2

[State 400, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[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, -60
guard.sparkno = s7955
sparkno = s7960
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 9
ground.velocity = -4
air.velocity = -1.5,-3

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

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

;---------------------------------------------------------------------------
;Crouching medium punch
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 410
sprpriority = 2

[State 410, voice]
type = playsnd
trigger1 = animelem = 3
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 410, effect]
type = playsnd
trigger1 = animelem = 3
value = 4, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 410, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = s7965
guard.sparkno = s7950
sparkxy = -10,-55
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4
air.velocity = -3,-4

;This is the second hit, triggered on the 4th element of animation.
[State 410, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -10,-83
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -7
air.velocity = -3,-4

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


;---------------------------------------------------------------------------------------------
;Crouching strong punch
[StateDef 420]
type = C
movetype= A
physics = C
juggle  = 1
velset = 0,0
ctrl = 0
anim = 420
poweradd = 20
sprpriority = 2

[State 420, voice]
type = playsnd
trigger1 = animelem = 3
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 420, effect]
type = playsnd
trigger1 = animelem = 3
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 420, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 420, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8


[State 420, HitDef]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage = 35
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8, 10
sparkno = s7965
guard.sparkno = s7950 
sparkxy = -10, -53
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 40
ground.velocity = 1, 0
air.velocity = 1,-3
airguard.velocity = -6,0
yaccel = 0.43+(enemynear,const(movement.yaccel)/2)

[State 420, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 11
ctrl = 1


;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 11
ctrl = 0
anim = 430
sprpriority = 2


[State 430, whoosh]
type = playsnd
trigger1 = animelem = 2
value = 3, ifelse(random < 333, 1, ifelse(random < 500, 0, 2))


[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 28
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12 
guard.sparkno = s7955
sparkno = s7960
sparkxy = -10,-8
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 22

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

;---------------------------------------------------------------------------
;Crouch medium Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 35
ctrl = 0
anim = 440
sprpriority = 2


[State 460, voice]
type = playsnd
trigger1 = animelem = 2
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 460, effect]
type = playsnd
trigger1 = animelem = 2
value = 4, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))


[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = s7965
guard.sparkno = s7950
sparkxy = -5,-10
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 17
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

;---------------------------------------------------------------------------------------------
;Crouching strong kick
[StateDef 450]
type = C
movetype= A
physics = C
juggle  = 1
velset = 0,0
ctrl = 0
anim = 450
poweradd = 20
sprpriority = 2

[State 450, VelMul]
type = VelMul
trigger1 = !time
trigger1 = PrevStateNo = 100
x = .8


[State 450, voice]
type = playsnd
trigger1 = animelem = 3
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))
channel = 0

[State 450, effect]
type = playsnd
trigger1 = animelem = 3
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 450, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 450, 1]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage = 40
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,14
sparkno = s7965
sparkxy = -10, -30
guard.sparkno = s7950
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = s8500,0 ;6,0
ground.type = Trip
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 450, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 11
ctrl = 1

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

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 5
ctrl = 0
anim = 600
sprpriority = 2

[State 600, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 600, voice]
type = playsnd
trigger1 = animelem = 1
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 600, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 7,8
guard.sparkno = s7955
sparkno = s7960
sparkxy = -10,-58
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 8
ground.velocity = -4
air.velocity = -1.3,-3
air.hittime = 14

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

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


[State 610, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 610, whoosh]
type = playsnd
trigger1 = animelem = 1
value = 4, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 610, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 72
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s7965
guard.sparkno = s7950
sparkxy = -10,-55
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 14
ground.velocity = -6
air.velocity = -3,-4
;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 620
sprpriority = 2

[State 620, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 620, whoosh]
type = playsnd
trigger1 = animelem = 1
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 620, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 620, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 72
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s7965 
guard.sparkno = s7950
sparkxy = -10,-55
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 14
ground.velocity = -6
air.velocity = -3,-4

;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 10
ctrl = 0
anim = 630
sprpriority = 2


[State 630, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 630, voice]
type = playsnd
trigger1 = animelem = 1
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 630, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 26
guardflag = HA
priority = 3
pausetime = 8,8
guard.sparkno = s7955
sparkno = s7960
sparkxy = -5,-35
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -4
air.velocity = -2,-3
air.hittime = 14

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


[State 640, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 0, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 640, voice]
type = playsnd
trigger1 = animelem = 1
value = 3, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 640, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0
[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s7965
guard.sparkno = s7950
sparkxy = -10,-40
hitsound = s13, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4

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

[State 650, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 1, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 650, whoosh]
type = playsnd
trigger1 = animelem = 1
value = 5, ifelse(random < 333, 0, ifelse(random < 500, 1, 2))

[State 650, stop voice]
type = stopsnd
trigger1 = movehit = 1
channel = 0


[State 650, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s7965 
guard.sparkno = s7950
sparkxy = -10,-40
hitsound = s14, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4

;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, voice]
type = playsnd
trigger1 = animelem = 1
channel = 0
value = 0, 2
 

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2 
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

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

;---------------------------------------------------------------------------
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0


[State 810, Holding fwd?]
type = VarSet
trigger1 = Time = 0
var(2) = command = "holdfwd"

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

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 800, 0

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

[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0
edge = 60,0

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

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

[State 810, holdfwd - Turn 6] ;If was holding fwd before, turn now
type = Turn
trigger1 = var(2)
trigger1 = AnimElem = 6

[State 810, holdfwd - Pos 6] ;If was holding fwd before, move a little
type = PosAdd
trigger1 = var(2)
trigger1 = AnimElem = 6
x = -37

[State 810, holdfwd - Turn Target 6] ;If was holding fwd before, turn target too
type = TargetFacing
trigger1 = var(2)
trigger1 = AnimElem = 6
value = -1

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

[State 810, Bind 7]
type = TargetBind
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
pos = 25, -75

[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0
pos = 15, -90

[State 810, Bind 9]
type = TargetBind
trigger1 = AnimElemTime(9) >= 0 && AnimElemTime(10) < 0
pos = -5, -96

[State 810, Bind 10]
type = TargetBind
trigger1 = AnimElemTime(10) >= 0 && AnimElemTime(11) < 0
pos = -14, -90

[State 810, Bind 11]
type = TargetBind
trigger1 = AnimElem = 11
pos = -50, -50

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

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

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

[State 810, Pos 15]
type = PosAdd
trigger1 = AnimElem = 15
x = -10

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

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

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


[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

;--------------------------------------------------------------------------- 
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 2.8,-7
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

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


;---------------------------------------------------------------------------
;=================================Specials==================================
;---------------------------------------------------------------------------
;Jungle Leap A
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1001
ctrl = 0
sprpriority = 2
 
[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 8
x = 2.6
y = -3.5
  
[State 1000, VelMul]
type = VelMul
trigger1 = Time > 42
x = 0.99
y = 1

[State 1000, VelAdd]
type = VelAdd
trigger1 = Time > 30
y = .29
 
[State 1000, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 9
statetype = A       ;S,A,C,L 
physics = N         ;A,C,S,N 



[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 0
guardsound = s15, 1
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6] ;Opponent not near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 4
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -7
air.velocity = -4,-2.5

[State 1200, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0 
value = 1210

;---------------------------------------------------------------------------
;Air Jungle Leap
[Statedef 1010]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1011
ctrl = 0
sprpriority = 2

[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 8
x = 2.26
y = -3.5
  
[State 1000, VelMul]
type = VelMul
trigger1 = Time > 58
x = 0.99
y = 1

[State 1000, VelAdd]
type = VelAdd
trigger1 = Time > 58
y = .22
 
[State 1000, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 12
statetype = A       ;S,A,C,L 
physics = A         ;A,C,S,N 

[State 1010, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 0
guardsound = s15, 1
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1010, 6] ;Opponent not near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 4
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -7
air.velocity = -4,-2.5


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


;-------------------------------------------------------------------------------------------------
;Flip Kick
[Statedef 1100]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1101
ctrl = 0
sprpriority = 2

[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 8
x = 8.5 
  
[State 1000, VelMul]
type = VelMul
trigger1 = Time > 30
x = 0.99 
 
[State 1200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 1109
ID = 1109
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)


[State 1100, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s12, ifelse(random < 333, 0, ifelse(random < 500, 1, 2)) 
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1101
trigger1 = animtime = 0 
value = 47 

[State 0, VelSet]
type = Veladd
trigger1 = anim = 1101
trigger1 = animelem >= 14
trigger1 = vel x > 0
x = -1  

[State 0, VelSet]
type = VelSet
trigger1 = anim = 47
trigger1 = animelem = 1 
x = 0  

[State 0, PosSet]
type = PosSet
trigger1 = anim = 47
trigger1 = animelem = 1 
y = 0 

[State 1010, 7]
type = ChangeState
trigger1 = anim = 47
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;-------------------------------------------------------------------------------------------------
;Jungle Leap C
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 4,-2
anim = 1201
ctrl = 0
sprpriority = 2
 
[State 1200, Eyaah!]
type = PlaySnd
trigger1 = animelem = 6
value = S6,1 

[State 1100, VelSet]
type = VelSet
trigger1 = AnimElem = 8
x = 4.26
y = -3.5
  
[State 1102, VelMul]
type = VelMul
trigger1 = Time > 30
x = 0.99
y = 1


[State 1102, VelAdd]
type = VelAdd
trigger1 = Time > 30
y = .22
 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 9
statetype = A       ;S,A,C,L 
physics = N         ;A,C,S,N 


[State 1200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 1209
ID = 1209
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)
  

[State 1200, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 1
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit


[State 1200, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0 
value = 1210

;------------------------------------------------------------------------------------------
;Aterrisagem
[Statedef 1210]
type = S
movetype= I
physics = S
ctrl = 0
anim = 1299
velset = 0,0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 5
statetype = C       ;S,A,C,L
movetype = I        ;I,A,H
physics = C         ;A,C,S,N 

[State 1210, PosSet]
type = PosSet
trigger1 = Time = 0
y = 0

[State 1210, ChangeState]
type = ChangeState  
trigger1 = AnimTime = 0 
value = ifelse(command != "holddown",12,11)
ctrl = 1 


;-------------------------------------------------------------------------------------------------
;Cobra Bite
[Statedef 1500]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1500
ctrl = 0
sprpriority = 2

 
[State 1500, Explod]
type = Explod
trigger1 = animelem = 8
anim = 1509
ID = 1509
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)



[State 1500, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 0
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1500, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

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


;-------------------------------------------------------------------------------------------------
;PressureMove
[Statedef 1600]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 2,0
anim = 1600
ctrl = 0
sprpriority = 2

[State 1600, voice]
type = playsnd
trigger1 = animelem = 4
value = 6,1
channel = 0

[State 1600, whoosh]
type = playsnd
trigger1 = animelem = 14
value = 6,2

[State 1600, stop voice]
type = stopsnd
trigger1 = animelem = 14
trigger2 = movehit = 1
channel = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
statetype = S       ;S,A,C,L 
physics = N         ;A,C,S,N 

[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 4
x = 2.6

[State 1000, VelMul]
type = VelMul
trigger1 = Time > 32
x = 0.80
 
[State 1600, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 0
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1600, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

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



;-------------------------------------------------------------------------------------------------
;Savage Blades
[Statedef 1700]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 1700
ctrl = 0
sprpriority = 2
 
[State 1600, voice]
type = playsnd
trigger1 = animelem = 4
value = 6,1
channel = 0

[State 1600, whoosh]
type = playsnd
trigger1 = animelem = 14
value = 6,2

[State 1600, stop voice]
type = stopsnd
trigger1 = animelem = 14
trigger2 = movehit = 1
channel = 0

[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 3
trigger2 = AnimElem = 9
x = 4.5 
  
[State 1000, VelMul]
type = VelMul
trigger1 = Time > 30
x = 0.90 
  
[State 1700, Explod]
type = Explod
trigger1 = animelem = 4
anim = 1709
ID = 1709
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)



[State 1700, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 0
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1700, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

[State 0, VelSet]
type = Veladd
trigger1 = anim = 1700
trigger1 = animelem >= 15
trigger1 = vel x > 0
x = -1  

[State 0, VelSet]
type = VelSet
trigger1 = anim = 1700
trigger1 = animelem = 17
x = 0  

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



;-------------------------------------------------------------------------------------------------
;Mantis
[Statedef 1800]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 4,0
anim = 1800
ctrl = 0
sprpriority = 2

[State 1800, RAW]
type = PlaySnd
trigger1 = animelem = 6
value = S6,2

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
statetype = S       ;S,A,C,L 
physics = N         ;A,C,S,N 


[State 1000, VelSet]
type = VelSet
trigger1 = AnimElem = 4
x = 5

[State 1000, VelMul]
type = VelMul
trigger1 = Time > 19
x = 0.85
 
[State 1800, Explod]
type = Explod
trigger1 = animelem = 11
anim = 1809
ID = 1809
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)


[State 1800, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 1
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1800, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

[State 0, VelSet]
type = Veladd
trigger1 = anim = 1800
trigger1 = animelem >= 11
trigger1 = vel x > 0
x = -1  

[State 0, VelSet]
type = VelSet
trigger1 = anim = 1800
trigger1 = animelem = 16 
x = 0  

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

;-----------------------------------------------------------------------
;Air Mantis
[Statedef 1810]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 55
velset = 7,0
anim = 1810
ctrl = 0
sprpriority = 2

[State 1800, RAW]
type = PlaySnd
trigger1 = animelem = 6
value = S6,2

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 3    ;fv = 10
value = floor(pos y/-8) 

[State 0, VelSet]
type = VelSet
trigger1 = anim = 1815
trigger1 = animelem >= 5
x = 0   

[State 0, PosAdd]
type = PosAdd
triggerall = anim = 1810
;trigger1 = animelemno(7) >= 1 
trigger1 = pos y < -30  
y = ifelse(var(3) < 7,var(3),6)
[State 0, PosAdd]
type = PosAdd
triggerall = pos y < 0 
triggerall = anim = 1815
trigger1 = animelemno(2)  
trigger2 = animelemno(3)  
trigger3 = animelemno(4)  
y = 10 
[State 0, PosSet]
type = PosSet
triggerall = anim = 1815
trigger1 = animelem >= 5
trigger1 = pos y >= 0
y = 0 
[State 0, StateTypeSet]
type = StateTypeSet
triggerall = anim = 1815
trigger1 = pos y >= 0
trigger1 = statetype != S
statetype = S       ;S,A,C,L
movetype = A        ;I,A,H
physics = S         ;A,C,S,N 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim = 1810
triggerall = animelemno(7)
triggerall = pos y  >= -30
trigger1 = 1
value = 1815 

[State 1800, Explod]
type = Explod
triggerall = anim = 1810
trigger1 = animelem = 7
anim = 1819
ID = 1819
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2 
removeongethit = 1 
ontop = 1
ignorehitpause = 0 
scale = fvar(14),fvar(14)


[State 1810, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7965
guard.sparkno = s7950
hitsound = s14, 1
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 1810, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
sparkno = s7965
guard.sparkno = s7950
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

[State 1810, 5]
type = ChangeState
trigger1 = anim = 1815
trigger1 = Animelem = 10
trigger1 = pos y = 0
value = 0
ctrl = 1
;-------------------------------------------------------------------------------------------------
;ShadowMove
[Statedef 2800]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 6,0
anim = 2800
ctrl = 0
sprpriority = 2

[State 2800, RAW]
type = PlaySnd
trigger1 = animelem = 6
value = S6,2

[State 7200, Sombra]
type = AfterImage
trigger1 = Time = 0
time = 39
length = 16
framegap = 4
palcolor = 0
palbright = 0,0,0
palcontrast = 120,120,120
palpostbright = 0,0,0
trans = none

[State 2800, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
statetype = S       ;S,A,C,L 
physics = N         ;A,C,S,N 


[State 2800, VelSet]
type = VelSet
trigger1 = AnimElem = 4
x = 9.3

[State 2800, VelMul]
type = VelMul
trigger1 = ceil(p2dist x)<= 90
x = 0.85 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim = 2800
triggerall = animelemno(7)
triggerall = ceil(p2dist x)<= 90
trigger1 = 1
value = 2815 

[State 2800, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Med
damage    = 52, 4
priority  = 5
guardflag = MA
pausetime = 4,8
sparkxy = 0,-48
sparkno = s7970
guard.sparkno = s7950
hitsound = s14, 2
guardsound = s15, 1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -3
guard.velocity = -6
air.velocity = -2,-2
airguard.velocity = -4,-4.5
p2facing = 1
forcestand = 1         ;Force p2 into a standing state if hit

[State 2800, 3]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Up
damage    = 55, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = 0,-110
hitsound   = 5,2
sparkno = s7965
guard.sparkno = s7950
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,-9.5
guard.velocity = -6
air.velocity = -1,-7.5
airguard.velocity = -4,-4.5
p2facing = 1
fall = 1                   ;Make p2 fall down
fall.recovertime = 40      ;40 ticks before p2 can recover from fall
yaccel = .4                ;p2 will accelerate down at .4 pixels/sec^2 when falling

[State 2800, VelSet]
type = Veladd
triggerall = vel x > 0
trigger1 = anim = 2815
trigger2 = ceil(p2dist x)<= 90
x = -1  

[State 2800, VelSet]
type = VelSet
trigger1 = anim = 2815
trigger1 = animelem = 5
x = 0  

[State 2800, 5]
type = ChangeState
trigger1 = anim = 2815
trigger1 = Animelem = 10
value = 0
ctrl = 1

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

;-------------------------------------------------------------------------------------------------
;NO MERCY ULTRA
[Statedef 3000]
type    = S
movetype= A
physics = S 
poweradd= -3000
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2
 
[State 3000, VarSet]
type = VarSet
trigger1 = time = 1
v = 35  ;fv = 10
value = 0

[State 1720, width1]
type = width
triggerall = anim = 3000
trigger1 = animelemtime(11) >= 0 && animelemtime(18) < 0 
value = 0, 62
ignorehitpause = 1

[State 3000, Blade]
type = Helper
triggerall = numhelper(3050) =0
trigger1 = animelem = 8 
;helpertype = normal
name = "UltraBlade"
ID = 3050
pos = 55,-65
postype = p1
stateno = 3050
sprpriority = 3
scale = fvar(14),fvar(14)

[State 3200, ChangeStateH]
type = ChangeState
triggerall = numhelper(3050)
triggerall = Time > 21
trigger1 = helper(3050), movehit 
value=3010
ctrl=0

[State 3200, ChangeStateM]
type=ChangeState
trigger1 = anim = 3000
trigger1 = time = 100
trigger2 = animelem >= 8 
trigger2 = helper(3050), movehit = 0
trigger2 = numhelper(3050) = 0
value=0
ctrl=1

;-----------------------------------------------------------------------
;NO MERCY ULTRA
[Statedef 3010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 55
velset = 0,0
anim = 3010
ctrl = 0
sprpriority = 2

[State 3000, Blade]
type = Helper
triggerall = numhelper(3051) =0
trigger1 = Time = 12
;helpertype = normal
name = "RedBeamHelper"
ID = 3090
pos = floor(10*fvar(14)),floor(-103* fvar(14))
postype = p1
stateno = 3051
sprpriority = 6
scale = fvar(14),fvar(14)

[State 3200, ChangeStateM]
type=ChangeState
trigger1 = anim = 3010
trigger1 = time = 129 
value=0
ctrl=1

;--------------------------------------------------------------------
;Ultra Blade 
[Statedef 3050]
type = S
movetype = A
physics = N
anim = 3050
velset = 5,0   
ctrl = 0
 
[State 3050, VelSet]
type = VelSet
trigger1 =  pos y >=0
trigger2 = anim = 7410
trigger3 = anim = 3210
trigger4 = anim = 3211
x = 0
y = 0

[State 3050, PosSet]
type = PosSet
trigger1 =  pos y >=0
y = 0

[State 3050, VarSet]
type = VarSet
trigger1 = movehit
v = 35    ;fv = 10
value = 1


[State 3050, HitDef]
type = HitDef 
triggerall = anim = 3050
triggerall = movehit = 0
triggerall = var(35) != 1
triggerall = root, var(35) = 0
trigger1 = root, stateno = 3000   ;and no move's hit
attr = S, SP
ID = 3050
nochainid = 3050,3210
damage   = 60, 6
animtype = heavy
guardflag = MA
hitflag = MAFD
pausetime = 0,0
sparkxy = 50,0
sparkno = s7972
guard.sparkno = s7908
ground.type = high
ground.slidetime = 15
ground.hittime  = 30
ground.velocity = 0,0
air.velocity = 0,0
air.juggle = 3
sparkno = s9991
hitsound = s14, 2
guardsound = s15, 1
p2stateno = 3005
kill= 0
 
[State 3050]; Bye!]
type = DestroySelf
trigger1 = time = 250 
trigger2 = movehit

;=========================================================================
;-----------------------------------------------------------------------------
;Red Beam - Helper
[Statedef 3051]
type = S
movetype = I
physics = N
anim = 3090
ctrl = 0
velset = 0,0
sprpriority = 6

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3090 
trigger1 = Time = 100 
value = 3099 

[State 0, AngleDraw]
type = AngleDraw
triggerall = P2BodyDist X >10
trigger1 = 1 
scale = (P2BodyDist X+20)/176,1.0 

[State 1205, BindToRoot]
type = BindToRoot
trigger1 = 1 
pos = floor(10.001*root,fvar(14)),floor(-103.001*root,fvar(14)) ;Koa-Devil thanks!

[State 1205, DestroySelf]
type = DestroySelf
trigger1 = anim = 3099
trigger1 = AnimTime = 0 
trigger2 = Root,Anim != 3010 
trigger3 = Root,MoveType != A 
trigger4 = Root,StateNo != 3010

;-----------------------------------------------------------------------
;NO MERCY ULTRA P2a
[Statedef 3005]
type    = S
movetype= A;H
physics = S 
velset = 0,0
anim = 5012
ctrl = 0
sprpriority = 2

[State 3200, Recover]
type=ChangeAnim
triggerall = anim = 5012
trigger1 = animtime = 0
trigger2 = time = 13 
value= 5017 
[State 3200, Dizzy]
type=ChangeAnim
triggerall = anim = 5017
trigger1 = animtime = 0
trigger2 = time > 27 
value= 5300 

[State 0, AngleDraw]
type = AngleDraw  
trigger1 = time > 28
trigger1 = 1.00-((time-27)*0.01)>0.05
scale = 1.00-((time-27)*0.01),1.00-((time-27)*0.01)

[State 0, AngleDraw]
type = AngleDraw  
trigger1 = time > 28 
trigger1 = 1.00-((time-27)*0.01)<=0.05
;trigger1 = (1.00/(ceil(time)-27))<=0.05
scale = 0.05,0.05

[State 3200, ChangeStateM]
type=ChangeState
trigger1 = anim = 0
trigger1 = time = 129 
value=3006
ctrl=1

;-----------------------------------------------------------------------
;NO MERCY ULTRA P2b
[Statedef 3006]
type    = S
movetype= A;H
physics = S 
velset = 0,0 
ctrl = 0
sprpriority = 2

[State 3006, AngleDraw]
type = AngleDraw 
trigger1 = time = 1 
trigger2 = 1 
scale = 0.05,0.05

[State 3006, ChangeStateM]
type=ChangeState
trigger1 = anim = 3010
trigger1 = time = 129 
value=0
ctrl=1



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

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

[Statedef -2]

[State -2, P2Pos X]
type = VarSet
trigger1 =  1
var(9) = ceil( P2BodyDist X+Pos X)

[state - 2, Maya scale] 
type = VarSet
trigger1 = fvar(14) = 0
fv = 14  
value = Const(size.xscale)

[State -2, Clipboard]
type = DisplayToClipboard
trigger1 = 1
text = "Pos X = %d, Pos Y = %d, 14 = %d, P2DistX = %d"
params = floor(Pos X), floor(pos y), var(14), ceil(p2dist x)


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

;-- remove explods --
[State -2, remove 1100]
type = removeexplod
trigger1 = stateno != 1100
id = 1109
;-- remove explods --
[State -2, remove 1200]
type = removeexplod
trigger1 = stateno != 1200
id = 1209
;-- remove explods --
[State -2, remove 1500]
type = removeexplod
trigger1 = stateno != 1500
id = 1509
;-- remove explods --
[State -2, remove 1600]
type = removeexplod
trigger1 = stateno != 1600
id = 1609
;-- remove explods --
[State -2, remove 1700]
type = removeexplod
trigger1 = stateno != 1700
id = 1709
;-- remove explods --
[State -2, remove 1800]
type = removeexplod
trigger1 = stateno != 1800
id = 1809
;-- remove explods --
[State -2, remove 1810]
type = removeexplod
trigger1 = stateno != 1810
id = 1819


;---------------------------------------------------------------------------
; 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
value = 40, 0



;+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
;
;                         ********************
;                                 Maya
;                         ********************
;
;+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
;Height:          5'10"
;Weight:          140lbs.
;Age:             23 years
;
;Story: Made Queen of Amazonia after her part in banishing the Dark Lord
;Gargos. Cast out by her tribe as Gargos returns, Maya must vanquish him
;to regain her throne.
;
;=Colors=
;Red, Blue, Yellow, Black, Magenta, and White
;
;Strenghts: The Combo Bitch is back... wait a minute this is not Orchid!
;Maya is a mirror image of the Orchid of KI. Maya is quick and
;effective. Use her Flip Kick and the Mantis alot! The Jungle leap is
;very annoying so wear it out.
;
;Weakness: Very weak. She is easy to counter once you block her moves.
;
;Overall: [7] Pick Maya and have a good time beating up on your
;opponents.
;
;=Special Moves=
;Combo Breaker: B,F [P/K]
;        
;Air Jungle Leap: F,B [QK]
;Jungle Leap: (B),F [QK/FK]
;Flip Kick: (B),F [MK]
;Air-Combo: F,B [K]
;Pressure Move: F [FK]
;Ultra Breaker: F,DF,D,DB,B,B,F [FK] -+ 6 Bar Blocks +-
;
;Counter Move: B [QP]
;Recovery Move: B,F [QP]
;Cobra Bite: (B),F [QP]
;Savage Blades: (B),F [MP]
;Mantis: (B),F [FP]     
;Air Mantis: F,B [FP] -=Can be done after jungle leap=-
;Throw: F [FP]
;Reversal: B [FP]
;
;=Super Moves=
;
;Super Flip Kicks: F,DF,D,DB,B,F [MK] -+ 3 Bar Blocks +-
;Tree Cutter: F,DF,D,DB,B,F,[FK] -+ 6 Bar Blocks +-
;Lawnmower: F,DF,D,DB,B,F [MP] -+ 3 Bar Blocks +-
;Shadow Move: F,DF,D,DB,B,F [FP] -+ 3 Bar Blocks +-
;
;=Finishers=
;
;Ultimate Elephant: F,DF,D,DB,B,F [QK]
;Ultra Combo: (F),B [FK]
;No Mercy Shrinker: B,DB,D,DF,F,B [QP]
;Assault: (F),B [FP]

;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;*Elephant* - an elephant magically fall on your opponent.
;*Shrinker* - a red ray its emitted from Maya's forehead. The opponent
;             shrinks down in size.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++











