; Blank'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 = 80
;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                                          1
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 = 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 = -1     ;Number of pixels to vertically offset the shadow
draw.offset = 0,1    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 4     ;Walk forward
walk.back = -4     ;Walk backward
run.fwd  = 5, 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

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


;---------------------------------------------------------------------------
; 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, 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
movetype= A
physics = S
juggle  = 4
poweradd= -2000
ctrl = 0
velset = 0,0
anim = 195
sprpriority = 2

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

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

[State 195, PlaySnd]
type = PlaySnd
trigger1 = Animelem = 1
value = S8,0

[State 195, 3]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 350
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 0
ground.hittime  = 25
ground.velocity = -15
air.velocity = -2.5,-4


;---------------------------------------------------------------------------
; Punch 1
[StateDef 200]
type = S
movetype= A
physics = S
juggle  = 5
velset = 4,0
ctrl = 0
anim = 200
poweradd = 25
sprpriority = 2

[State 200, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S7,4
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0
;abspan =
;ignorehitpause =
;persistent =

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = 5, -30
hitsound = 5, 0
guardsound = 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 200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Punch 2
[StateDef 201]
type = S
movetype= A
physics = S
juggle  = 5
velset = 4,0
ctrl = 0
anim = 201
poweradd = 25
sprpriority = 2

[State 201, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S7,4
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0

[State 201, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = 5, -30
hitsound = 5, 0
guardsound = 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 201, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Punch 3
[StateDef 202]
type = S
movetype= A
physics = S
juggle  = 15
velset = 4,0
ctrl = 0
anim = 202
poweradd = 25
sprpriority = 2

[State 202, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S7,2
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0

[State 202, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 25
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 10, 10
sparkno = 0
sparkxy = 5, -30
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4, -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12
fall = 1

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

;-------------------------------------------------
; Air tirachinas (The shot)
[Statedef 209]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 209
sprpriority = 2

[State 209, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S0,1
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0

[State 209,2]
type = helper
trigger1 = AnimElem = 2
name = "Air Kunai Throw"
id = 210
pos = 0,0
postype = p1
stateno = 210
helpertype = normal
ownpal = 0
keyctrl = 0

[State 209, 1]
type = Velset
trigger1 = AnimElem = 1
y = -3

;-------------------------------------------
;Air pachinko (The pachinko)
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 5
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 8

[State 210, 1]
type = VelAdd
Trigger1 = 1
x = 3.3
y = 2

[State 210, 4]
type = SprPriority
trigger1 = 1
value = 4

[State 210, 3]
type = ScreenBound
trigger1 = 1
value =  0

[State 210, ***]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 210,***]
type = HitDef
trigger1 = Time = 0
attr = A, NP
damage = 13, 1
animtype = Light
guardflag = MA
hitflag = MAF
priority = 1, Hit
pausetime = 8, 10
sparkno = 0
sparkxy = 5, -30
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 20
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 212, AfterImage]
type = AfterImage
trigger1 = AnimElem = 1
time = 100
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 12,12,12
palcontrast = 109,97,69
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1

[State 210, 3]
type = destroyself
trigger1 = movecontact
trigger2 = frontedgedist < -50


;---------------------------------------------------------------------------
[Statedef 703]
type = S
movetype= A
physics = S
juggle = 1
velset = 0,0
ctrl = 0
anim = 703
poweradd = -3000
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Animelem = 1
value = S21,0


[State 703,2]
type = helper
trigger1 = AnimElem = 13
name = "helper1"
id = 703
pos = -0,1
postype = p1
stateno = 630
helpertype = normal
ownpal = 0
keyctrl = 1

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

[State 703, superpause]
type = superpause
trigger1 = AnimElem = 1
time = 88
darken = 2
unhittable = 1
movetime = 88

;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
;---------------------------------------------------------------------------
;Shoot
[Statedef 630]
type    = S
movetype= A
physics = N
juggle = 15
airjuggle = 15
poweradd= -3000
velset = 6,0
anim = 630
ctrl = 0
sprpriority = 15

[State 630, 1]
type = hitdef
trigger1 = time = 0
attr = S, SP
hitflag = MAF
animtype  = hard
damage  = 450
guardflag = MAF
pausetime = 0,30
sparkno = S4005
guard.sparkno = S4005
sparkxy = -10,-5
hitsound   = S5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 9
ground.velocity = -2,0
air.velocity = -4,-2
air.fall = 1
palfx.time = 40
palfx.mul	= 150,150,0
palfx.add	= 255,50,0
palfx.sinadd = 255,100,0,4

[State 630, 2]
type = AfterImage
trigger1 = time = 0
time = 10
length = 10
palcolor = 256
palinvertall = 0
palbright = 30,30,30
palcontrast = 255,108,69
palpostbright = 0,0,0
paladd = 50,10,25
palmul = .65,.65,.75
timegap = 60
trans = add1


;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 640]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 150
ctrl = 0
anim = 640
sprpriority = 2

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

[State 640, 3]
type = HitDef
trigger1 = Animelem = 2
trigger2 = Animelem = 3
attr = S, NA
damage    = 15
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = -0
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;dial impac
[Statedef 225]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 225
sprpriority = -1

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

[State 225, veladd]
type = veladd
trigger1 = animelem = 4
x = 5

[State 225, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 350
guardflag = MA
pausetime = 1,6
sparkno = 1
sparkxy = -10,-30
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5, -3.5
air.velocity = -2.5,-4
fall = 1

[State 225, velset]
type = velset
trigger1 = animelem = 8
x = 0

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

;---------------------------------------------------------------------------
;Hamer
[Statedef 350]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= -1000
ctrl = 0
anim = 350
sprpriority = 2

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

[State 350, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 450
animtype  = Medium
hitflag = MAF || D
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-20
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -3,-4

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

;---------------------------------------------------------------------------
;Shoot 
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd = -1200
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

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

[State 1010, 2]
type = Helper 
trigger1 = animelem = 8
triggerall = palno != 7
helpertype = normal
pos = 15,-25
postype = p1
stateno = 1005
size.xscale = .50
size.yscale = .50

[State 1010, Fire Ace]
type = Helper 
trigger1 = animelem = 8
triggerall = palno = 7
helpertype = normal
pos = 15,-25
postype = p1
stateno = 1006

[State 1005, 3]
type = AfterImage
trigger1 = time = 0
time = 20
length = 7
palcolor = 256
palinvertall = 0
palbright = 30,30,30
palcontrast = 255,108,69 
palpostbright = 0,0,0
paladd = 50,10,25
palmul = .65,.65,.75
timegap = 1
trans = add1

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

;-----------------------------------------------------------------------
;throw
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 1
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 1000                      ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = 0                   ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

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

[State 1000,***]
type = AssertSpecial
trigger1 =1
flag = noautoturn


[State 1000,2]
type = helper
trigger1 = AnimElem = 3
name = "helper1"
id = 1001
pos = 10,-30
postype = p1
stateno = 1001
helpertype = normal
ownpal = 1
keyctrl = 1

[State 1000, 4];←成功したときの残像
type = AfterImage
trigger1 =AnimElem = 1
time = 10
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 12,12,12
palcontrast = 225,225,225
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1

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

;---------------------------------------------------------------------------
;shuriken
[Statedef 1001]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 10
ctrl = 0
velset = 0,0
anim = 1001
sprpriority = 8

[State 1001, 1];←とりあえず加速させてる
type = VelSet
Trigger1 = 1
x = 10

[State 1001, 4]
type = SprPriority
trigger1 = 1
value = 4

[State 1001, 3]
type = ScreenBound
trigger1 = 1
value =  0
;movecamera =

[State 1001,***]
type = HitDef
trigger1 = Time = 0
attr = A, NP                     ;立ち状態で、通常の攻撃(ｓは立ち、ｎは通常、aは攻撃を表す)
damage = 50, 0                   ;ダメージ量（左が当たった時、右はガードした時）
animtype = Light                 ;当てた時の相手のポーズ（light/midium/hard/back）から選択
guardflag = MA                   ;ガードできる状態（ｍaは全ての状態でガード可能）
hitflag = MAF                    ;当てる事のできる条件
priority = 3, Hit                ;攻撃の優先権（0弱い　4通常　7強い
pausetime = 5, 10                ;攻撃が当たった時の硬直時間（左が自分、右が相手）
sparkno = 0                      ;ヒットエフェクトのスプライトステート（無ければ0）
sparkxy = -5, -25               ;ヒットエフェクトを表示する場所（相手の座標で）
hitsound = S200, 5                  ;ヒットした時の音（ｓ*,*にすると自分の音を使う）
guardsound = 6, 0                ;ガードした時の音（同上）
ground.type = High               ;相手のくらった場所（High：頭、体, Low：足, Trip：足払い）
ground.slidetime = 5             ;相手が後にすべる時間
ground.hittime  = 20             ;コンボが繋がる時間（高くしすぎない事）
ground.velocity = -4             ;地上で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
airguard.velocity = -1.9,-.8     ;空中で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
air.type = High                  ;空中で相手がくらった場所（上と同じ）
air.velocity = -1.4,-3           ;空中で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
air.hittime = 12                 ;空中でコンボが繋がる時間

[State 1001, 5]
type = ChangeState
trigger1 = MoveGuarded = 1
value = 1002
ctrl = 0

[State 1001, Override]
type = HitOverride
triggerall = alive
trigger1 = 1
attr = SCA,AP,AA
slot = 7
time = -1


[State 1001, NotHitby]
type = NotHitBy
trigger1 = 1
value = ,AT

[State 1001, 5]
type = ChangeState
trigger1 = movehit = 1
value = 1002
ctrl = 0



[State 1001, 3]
type = destroyself
trigger1 = time = 200

[Statedef 1002]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
sprpriority = 8

[State 1002, 3]
type = destroyself
trigger1 = 1


;--------------------------------------------------------------------------
;Fire Ball
; CNS difficulty: medium
[Statedef 1005]
type    = S
movetype= A
physics = N
juggle = 15
airjuggle = 15
poweradd= 100
velset = 6,0
anim = 4001
ctrl = 0
sprpriority = 15

[State 1005, 1]
type = hitdef
trigger1 = time = 0
attr = S, SP
hitflag = MAF
animtype  = hard
damage  = 200
guardflag = MAF
pausetime = 0,10
sparkno = S4005
guard.sparkno = S4005
sparkxy = -10,-5
hitsound   = S5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 9
ground.velocity = -2,0
air.velocity = -4,-2
air.fall = 1
palfx.time = 40
palfx.mul	= 150,150,0
palfx.add	= 255,50,0
palfx.sinadd = 255,100,0,4

[State 1005, 2]
type = AfterImage
trigger1 = time = 0
time = 50
length = 10
palcolor = 256
palinvertall = 0
palbright = 30,30,30
palcontrast = 255,108,69 
palpostbright = 0,0,0
paladd = 50,10,25
palmul = .65,.65,.75
timegap = 1
trans = add1

[State 1005, 3]
type = destroyself
trigger1 = movecontact
trigger2 = frontedgedist < -100
;---------------------------------------------------------------------------
;Hammer Midium
[Statedef 919]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 919
sprpriority = 2

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

[State 919, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 50
animtype  = Medium
hitflag = MAF || D
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-20
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -3,-4

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

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

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

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

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

