; これはカンフーマンのＣＮＳファイルです。
; コメントを参考にしてＣＮＳを理解してください

; これはKFMの定数と状態のファイルです。
; 絶対記入し、削除はしないでください。
[Data]
  ;体力ゲージの初期値
life = 1200
  ;攻撃力（これ以上に設定すると強くなる）
attack = 100
  ;防御力（これ以上に設定すると強くなる）
defence = 100
  ;コンボをくらっている時にあがる防御力
fall.defence_up = 70
  ;倒れてから起上がるまでのフレーム数
liedown.time = 11
  ;空中でどれだけコンボが繋がるか（高くすると無限コンボになるので注意）
airjuggle = 15
  ;hitdefで設定していない時の基本ヒットスパークナンバー
sparkno = 2
  ;設定してない時のガードナンバー
guard.sparkno = 40
  ;KOした時に声にエコーをかけるか（１でＯＮ）
KO.echo = 0
 volume = 0
  IntPersistIndex = 58
FloatPersistIndex = 40

[Size]
xscale = 1           ;水平方向の縮尺（通常１）
yscale = 1           ;垂直方向の縮尺（通常１）
ground.back = 15     ;キャラの幅(後方,地上)
ground.front = 16    ;キャラの幅(前方,地上)
air.back = 12        ;キャラの幅(後方,空中)
air.front = 12       ;キャラの幅(前方,空中)
height = 125          ;キャラの高さ
attack.dist = 320    ;攻撃をした時相手がガード体制に入る最低距離
proj.attack.dist = 320;攻撃をした時相手がガード体制に入る最低距離（飛び道具）
proj.doscale = 0     ;上で設定した縮尺を飛び道具にも適用するか（１でＯＮ）   
head.pos = 0, -118   ;頭の大体の座標
mid.pos = -4, -86    ;体の中心の大体の座標
shadowoffset = 0     ;影の垂直方向のオフセット
draw.offset = 0,0    ;使用しない

[Velocity]
walk.fwd  = 3.4      ;前進の速度
walk.back = -3.4     ;後退の速度
run.fwd  = 6.2130434, 0    ;前ダッシュの速度（ホップする時はyを-にする）
run.back = -6.5,-1.8 ;後ダッシュの速度（ホップする時はyを-にする）
jump.neu = 0,-9.8    ;垂直ジャンプの速度
jump.back = -4.05,2    ;後ジャンプの速度
jump.fwd = 4.0,2       ;前ジャンプの速度
runjump.back = -2.55,-8.1 ;後ダッシュしながらのジャンプ速度(オプション)
runjump.fwd = 4,-8.1      ;前ダッシュしながらのジャンプ速度(オプション)
airjump.neu = 0,-8.1      ;２段ジャンプ以降の垂直ジャンプの速度(オプション)
airjump.back = -2.55      ;２段ジャンプ以降の後ジャンプの速度(オプション)
airjump.fwd = 2.5         ;２段ジャンプ以降の前ジャンプの速度

[Movement]
airjump.num = 0      ;空中でジャンプする回数
airjump.height = 35  ;空中でジャンプする最低限の高さ
yaccel = .57         ;重力
stand.friction = .85  ;立ち状態の摩擦係数
crouch.friction = .82 ;屈み状態の摩擦係数

;---------------------------------------------------------------------------
; ステイトの解説
; [Statedef STATENO]
; type = ?      S/C/A/L  Ｓ：立ち/Ｃ：屈み/Ａ：空中/Ｌ：ダウン
; movetype = ?  I/A/H    Ｉ：通常状態/Ａ：攻撃状態/Ｈ：ダメージをくらってる状態
; physics = ?   S/C/A/N  Ｓ：立ち/Ｃ：屈み/Ａ：空中/Ｎ：無し
; juggle = ?             その攻撃に使うジャグル数
;

;---------------------------------------------------------------------------
; フロントステップ
[Statedef 100]
type    = S
physics = N
anim = 100
sprpriority = 1

[State 290, 1]
type = poweradd
triggerall = time = 0
trigger1 = prevstateno = 150
trigger2 = prevstateno = 151
value = -500

[State -2, a];点滅
type = palfx
triggerall = time = 0
trigger1 = prevstateno = 150
trigger2 = prevstateno = 151
time = 1
add = 255,255,255
mul = 255,255,255
color = 1
ignorehitpause = 1

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

[State 100, 1]
type = VelSet
trigger1 = animelem = 3;1
x = 8;const(velocity.run.fwd.x)

[State 100, 1]
type = VelSet
trigger1 = animelem = 5
x = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command = "holdfwd"
trigger1 = animelem = 5,>=0
value = 101

[State 100, 4]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; commonより ダッシュ
[Statedef 101]
type    = S
physics = S
anim = 101
sprpriority = 1

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0




;---------------------------------------------------------------------------
; commonより ダッシュ
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1

[State 191, 3]
type = null;PlaySnd
trigger1 = Time= 0
value = 100, 0
loop = 1
channel = 1

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0
;---------------------------------------------------------------------------
; ステップ
[Statedef 101]
type    = S
physics = S
ctrl = 0
anim = 101
velset = 0,0

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 102

; 空中
[Statedef 102]
type    = A
physics = A
ctrl = 1
anim = 102
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = 7.5
y = -3.8

[State 105, 2]
type = null;CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -5
value = 103


; 着地
[Statedef 103]
type    = S
physics = N
ctrl = 0
anim = 103
velset = 0,0

[State 106, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; commonより バックステップ
[Statedef 105]
type    = S
physics = S
ctrl = 0
anim = 104
velset = 0,0

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 106

; 空中
[Statedef 106]
type    = A
physics = A
ctrl = 1
anim = 105
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = -7.5
y = -3.8

[State 105, 2]
type = null;CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -5
value = 107


; 着地
[Statedef 107]
type    = S
physics = N
ctrl = 0
anim = 106
velset = 0,0

[State 106, 1]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; タイムオーバーで負けた時
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

[state a]
type = changeanim
trigger1 = time = 0
trigger1 = var(1) = 1
value = 171

;---------------------------------------------------------------------------
; 勝った動作１
[Statedef 180]
type = S

[State 180, 1]
type = VarRandom
trigger1 = Time = 0
trigger1 = var(1) = 0
v = 2
range = 0,1

[State 180, 1]
type = ChangeState
trigger1 = var(58)=1;var(2) = 0
;trigger1 = var(1) = 0
value = 10181

[State 180, 1]
type = ChangeState
trigger1 = var(58)=2;var(2) = 0
;trigger1 = var(1) = 0
value = 6180

[State 180, 1]
type = ChangeState
trigger1 = Var(2) = 1
trigger1 = var(1) = 0
value = 183


[State 180, 1]
type = VarRandom
trigger1 = Time = 0
trigger1 = var(1) = 1
v = 2
range = 0,2

[State 180, 1]
type = ChangeState
trigger1 = var(2) = 0
trigger1 = var(1) = 1
value = 184

[State 180, 1]
type = ChangeState
trigger1 = var(2) = 1
trigger1 = var(1) = 1
value = 186

[State 180, 1]
type = ChangeState
trigger1 = var(2) = 2
trigger1 = var(1) = 1
value = 187


;---------------------------------------------------------------------------
; 勝った動作[天上天下]
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 191, 3];天上天下
type = PlaySnd
trigger1 = time = 50
value = 181,0

[State 1000, 5]
type = Explod
trigger1 = animelem = 1
anim = 182
id = 182
sprpriority = -5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
removetime = -1
under = 0


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

[State 181, 4]
type = AssertSpecial
trigger1 = time = [0,170]
flag = roundnotover

;---------------------------------------------------------------------------
; 勝った動作[下の下だな]
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 191, 3]
type = PlaySnd
trigger1 = animelem = 7
value = 190,1

[State 191, 3]
type = PlaySnd
trigger1 = animelemtime(57) = 12
value = 182,0


[State 181, 4]
type = AssertSpecial
trigger1 = time = [0,220]
flag = roundnotover

;---------------------------------------------------------------------------
; 勝った動作[我より、優れる者は無し]
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

[State 191, 3];我より、優れる者は無し
type = PlaySnd
trigger1 = animelem = 9
value = 184,0

[State 1000, 5];足元
type = Explod
trigger1 = animelem = 1
anim = 185
id = 185
sprpriority = -5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
removetime = -1
under = 0

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

[State 181, 4]
type = AssertSpecial
trigger1 = time = [0,180]
flag = roundnotover



;---------------------------------------------------------------------------
; 勝った動作[血]
[Statedef 186]
type = S
ctrl = 0
anim = 186
velset = 0,0

[State 191, 3];斬る
type = PlaySnd
trigger1 = animelem = 5
value = 240,0

[State 1000, 5];出血
type = Explod
trigger1 = animelem = 3
anim = 187
id = 185
sprpriority = 2
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
under = 0

[State 3040, 7];画面フラッシュ
type = EnvColor
trigger1 = animelem = 5
persistent = 0
ignorehitpause = 1
time = 2
value = 255,255,255
under = 1

[state a]
type = lifeadd
trigger1 = animelem = 5
value = -200
kill = 0

[state a]
type = poweradd
trigger1 = animelem = 5
value = 1000

[State 1000, 5];足元
type = Explod
trigger1 = animelem = 5
anim = 185
id = 185
sprpriority = -5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
removetime = -1
under = 0

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

[State 181, 4]
type = AssertSpecial
trigger1 = time = [0,180]
flag = roundnotover


;---------------------------------------------------------------------------
; 勝った動作[我、ガイアと共にあり]
[Statedef 187]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 191, 3];効果音
type = PlaySnd
trigger1 = animelem = 6
value = 190,1

[State 191, 3];我
type = PlaySnd
trigger1 = animelem = 6
value = 187,0

[State 191, 3];ガイアと共にあり
type = PlaySnd
trigger1 = animelem = 23
value = 187,1

[State 1000, 5];足元
type = Explod
trigger1 = animelem = 6
anim = 185
id = 185
sprpriority = -5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
removetime = -1
under = 0





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

[State 181, 4]
type = AssertSpecial
trigger1 = time = [0,180]
flag = roundnotover

;---------------------------------------------------------------------------
; 通常登場
[Statedef 190]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 3]
type = PlaySnd
trigger1 = Time= 1
value = 160, 0
channel = 2;(1:ダッシュ音)

[state a]
type = changestate
trigger1 = time = 1
trigger1 = var(1) = 1
value = 192



[State 191, 3];倒してみせよ
type = PlaySnd
trigger1 = animelem = 11
value = 190,0

[State 191, 3];火柱
type = PlaySnd
trigger1 = animelem = 13
value = 190,1

[State 191, 3];火柱
type = PlaySnd
trigger1 = animelem = 14
value = 190,2


[State 1000, 5]
type = Explod
trigger1 = animelemtime(11) = 1
anim = 191
id = 191
sprpriority = 5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
under = 0



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

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


;---------------------------------------------------------------------------
; オロチ登場
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0


[State 191, 3];さなぎをやぶり
type = PlaySnd
trigger1 = animelem = 10
value = 193,0

[State 191, 3];蝶は舞う
type = PlaySnd
trigger1 = animelem = 27
value = 193,1

[State 191, 3];火柱
type = PlaySnd
trigger1 = animelem = 27
value = 193,2

[State 191, 3];火柱
type = PlaySnd
trigger1 = animelem = 29
value = 190,2


[State 1000, 5]
type = Explod
trigger1 = animelem = 27
anim = 191
id = 191
sprpriority = 5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
under = 0



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

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



;---------------------------------------------------------------------------
; 挑発の動作
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 191, 3];
type = changeanim
trigger1 = time = 0
trigger1 = var(1) = 1
value = 196

[State 191, 3];我のみを尊ぶ
type = PlaySnd
trigger1 = animelem = 3
trigger1 = var(1) = 0
value = 195,0

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

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

