; 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 = 145
power = 14256
;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 = 0
;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 = 1           ;Horizontal scaling factor.
yscale = 1           ;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 = 256    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;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  = 4.75      ;Walk forward
walk.back = -3.175     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-13    ;Neutral jumping velocity (x, y)
jump.back = -5.5    ;Jump back Speed (x, y)
jump.fwd = 5       ;Jump forward Speed (x, y)
airjump.down = -13.25
airjump.up = -13.5
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**
run.up = 0.01953125, 0.71875

[Movement]
airjump.num = 0
airjump.height = 35 
yaccel = .44 
stand.friction = .85 
crouch.friction = .82 
stand.friction.threshold = 2
crouch.friction.threshold = .05
air.gethit.groundlevel = 25
air.gethit.groundrecover.ground.threshold = -20
air.gethit.groundrecover.groundlevel = 10 
air.gethit.airrecover.threshold = -1
air.gethit.airrecover.yaccel = .35
air.gethit.trip.groundlevel = 15
down.bounce.offset = 0, 20
down.bounce.yaccel = .4
down.bounce.groundlevel = 12
down.friction.threshold = .05 

;---------------------------------------------------------------------------
; 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)  - 

;---------------------------------------------------------------------------
; 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

;---------------------------------------------------------------------------
; Stand Light Punch far
; CNS difficulty: easy
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = AttackDist
trigger1 = 1
value = ifelse(Enemy, StateType = A, 0, 256)

[State 200, 1]
type = HitDef
trigger1 = Time = 5
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 6, 6 
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit
pausetime = 12, 12                ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -76
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = Low              ;Type: High, Low, Trip (def: Normal)
ground.hittime  = 18
ground.slidetime = 10*(facing = -1) + 3001
air.hittime = 15
fall.recovertime = 10*(facing = -1) + 3001
airguard.velocity = 10*(facing = -1) + 3001,1
ground.cornerpushveloff = 0
kill = 0

[State 200, 1]
type = ChangeAnim
trigger1 = NumTarget
trigger1 = Target, Life < 2
trigger1 = MoveContact
trigger1 = Target, StateNo = 5055
value = anim
elem = animelemno(0)
ignorehitpause = 1

[State 200, 1]
type = VarSet
trigger1 = MoveContact = 1
var(56) = 11

[State 200, 1]
type = VarSet
trigger1 = MoveContact = 1
var(55) = 1

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

;---------------------------------------------------------------------------
; Stand Light Punch far hit-2
; CNS difficulty: easy
[Statedef 201]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = AttackDist
trigger1 = 1
value = ifelse(Enemy, StateType = A, 0, 256)

[State 200, 1]
type = HitDef
trigger1 = Time = 5
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 6, 6 
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit
pausetime = 10, 10                ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -76
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = Low              ;Type: High, Low, Trip (def: Normal)
ground.hittime  = 18
ground.slidetime = 10*(facing = -1) + 3002
air.hittime = 15
fall.recovertime = 10*(facing = -1) + 3002
airguard.velocity = 10*(facing = -1) + 3002,1
ground.cornerpushveloff = 0
kill = 0

[State 200, 1]
type = ChangeAnim
trigger1 = NumTarget
trigger1 = Target, Life < 2
trigger1 = MoveContact
trigger1 = Target, StateNo = 5055
value = anim
elem = animelemno(0)
ignorehitpause = 1

[State 200, 1]
type = VarSet
trigger1 = MoveContact = 1
var(56) = 11

[State 200, 1]
type = VarSet
trigger1 = MoveContact = 1
var(55) = 2

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


;---------------------------------------------------------------------------
; Stand Light Punch close
; CNS difficulty: easy
[Statedef 205]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 205                       ;Change animation (Def: no change)
poweradd = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = AttackDist
trigger1 = 1
value = ifelse(Enemy, StateType = A, 0, 256)

[State 200, 1]
type = HitDef
trigger1 = Time = 5
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 6, 6 
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit
pausetime = 8, 8                ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -76
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = Low              ;Type: High, Low, Trip (def: Normal)
ground.hittime  = 13
ground.slidetime = 10*(facing = -1) + 3001
air.hittime = 15
fall.recovertime = 10*(facing = -1) + 3001
airguard.velocity = 10*(facing = -1) + 3001,1
ground.cornerpushveloff = 0
kill = 0

[State 200, 1]
type = ChangeAnim
trigger1 = NumTarget
trigger1 = Target, Life < 2
trigger1 = MoveContact
trigger1 = Target, StateNo = 5055
value = anim
elem = animelemno(0)
ignorehitpause = 1

[State 200, 1]
type = VarSet
trigger1 = StateNo = 200
trigger1 = MoveContact = 1
var(56) = 11

[State 200, 1]
type = VarSet
trigger1 = StateNo = 200
trigger1 = MoveContact = 1
var(55) = 1

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

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

[Statedef 100]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 100

[State 100, 7]
type = PlayerPush
trigger1 = Time > 3
value = 0

[State 100, 0]
type = VelSet
trigger1 = Time = 4
X = 11.5
Y = -5

[State 100, 0]
type = VelAdd
trigger1 = Time > 4
X = -0.4375
Y = 0.46875

[State 100, 2]
type = StateTypeSet
trigger1 = Time = 4
statetype = A

[State 100, 1]
type = ChangeState
trigger1 = Time > 5
trigger1 = Pos Y + Vel Y >= 0
value = 101

[Statedef 101]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 101

[State 101, 0]
type = PosSet
trigger1 = 1
Y = 0

[State 101, 0]
type = CtrlSet
trigger1 = Time > 7
value = 1

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

[Statedef 105]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 105

[State 105,0]
type = VelSet
trigger1 = Time = 4
X = -9
Y = -5

[State 100, 2]
type = StateTypeSet
trigger1 = Time = 4
statetype = A

[State 105,0]
type = VelAdd
trigger1 = Time > 4
X = 0.25
Y = .5

[State 100, 1]
type = ChangeState
trigger1 = Time > 4
trigger1 = Pos Y + Vel Y >= 0
value = 106

[Statedef 106]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0,0
anim = 106

[State 101, 0]
type = PosSet
trigger1 = 1
Y = 0

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