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

; これはKFMの定数と状態のファイルです。
; このファイルの中には注釈が散らされているので、CNSを習いたいお方は
; 読んでみたらいいです。

[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1000
;Amount of power stocks to have (divided by 1000). Defaults to 3000
power = 3000
;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.3           ;Horizontal scaling factor.
yscale = 0.3           ;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 = 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)

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

[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

[Statedef -2]

[State -2]
type = LifeAdd
triggerall = !ishelper && gametime%60 = 0
trigger1 = numhelper(99988)=1 && numhelper(99788)=1
trigger1 = helper(99988),gethitvar(fall.damage) && !helper(99788),gethitvar(fall.damage)
value = -5
ignorehitpause = 1

[State -2]
type = Helper
triggerall=!Ishelper
trigger1= numhelper(99988)=0 && roundstate < 2
stateno = 99988
name = "senkai"
ID = 99988
helpertype=player
pos = 0,0
postype = p1
size.xscale = 1
size.yscale = 1
ownpal = 0
keyctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Helper
triggerall=!Ishelper
trigger1= numhelper(99788)=0 && roundstate < 2
stateno = 99988
name = "senkai"
ID = 99788
helpertype=player
pos = 0,0
postype = p1
size.xscale = 1
size.yscale = 1
ownpal = 0
keyctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = SelfState
trigger1 = ishelper && stateno != 99988
value = 99988
ignorehitpause = 1

[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

[Statedef 99988]
type = U
movetype = A
physics = U
hitdefpersist = 1
movehitpersist = 1
ctrl = 0
anim = 7777

[state  ]
type = NothitBy
trigger1 = !ishelper
value = SCA,AA,AT,AP
Time = -1
ignorehitpause=1

[state ]
type = HitDef
trigger1 = ishelper
attr = SCA, AA, AP, AT
damage = 0
pausetime = 0,0
numhits = 1
affectteam = E
ground.type = none
guardflag = MAF
sparkno = -1
ignorehitpause=1

[State ]
type = Null
trigger1 = 1
ignorehitpause = 1