; 功夫人的中文化cns文档。
; 由MKII翻译。

; 这篇文章里有很多注释，对cns的学习有一定的参考作用
;
; 注意：
; p1指玩家，p2指敌人
; y坐标（纵向）里，负数指向上，正数指向下，0为地平线
; 不区分大小写

[Data]
;起始HP
life = 1000

;攻击力（数值高更强）
attack = 100

;防御力（数值高更强）
defence = 100

;最高气槽值
power = 5000

;倒地时增加防御力百分比
fall.defence_up = 50

;倒地后爬起需要的时间
liedown.time = 60

;Juggle点数
airjuggle = 15

;默认的打击火花号
sparkno = 2

;默认的防御火花号
guard.sparkno = 40

;设为1的话KO时会有回音
KO.echo = 0

;音量调节 (负数声音减小)
volume = 0

;变量号大于以下数值的变量在局与局之间不会被清零。整数变量一共有60个，变量号为0至59。
;此外还有40个浮点变量，变量号为0至39.如果不写以下两行，那么所有的变量都会被清零。
;另外，你需要改变common1.cns里的state 5900来决定每一场之间清零与否。
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1           ;横向缩放比例
yscale = 1           ;纵向缩放比例
ground.back = 15     ;人物宽度 (地面上，中心到后方距离)
ground.front = 16    ;人物宽度 (地面上，中心到前方距离)
air.back = 12        ;人物宽度 (空中，中心到后方距离)
air.front = 12       ;人物宽度 (空中，中心到前方距离)
height = 60          ;人物高度(对手需要跳多高才能跳过)
attack.dist = 160    ;默认攻击距离
proj.attack.dist = 90 ;默认飞行道具攻击距离
proj.doscale = 0     ;如果值为1，则缩放飞行道具
head.pos = -5, -90   ;头部的大概位置
mid.pos = -5, -60    ;身体中部的大概位置
shadowoffset = 0     ;人物阴影的纵向偏移量
draw.offset = 0,0    ;人物图像的纵向偏移量 (x, y). 推荐 0,0

[Velocity]
walk.fwd  = 1.2      ;前进速度
walk.back = -1.2     ;后退速度
run.fwd  = 4.6, 0    ;跑步速度 (x, y)
run.back = -4.5,-3.8 ;后跃速度 (x, y)
jump.neu = 0,-8.4    ;跳速度 (x, y)
jump.back = -2.5,-6  ;后跳速度 (x, y)
jump.fwd = 2.5,-6    ;前跳速度 (x, y)
runjump.back = -2.55,-8.1 ;跑跳速度 (可选)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;二段跳速度 (可选)
airjump.fwd = 2.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;地面受身速度 (x, y) **MUGEN 1.0专用**
air.gethit.airrecover.mul = .5,.2     ;空中受身速度系数 (x, y) **MUGEN 1.0专用**
air.gethit.airrecover.add = 0,-4.5    ;空中受身速度偏移 (x, y) **MUGEN 1.0专用**
air.gethit.airrecover.back = -1       ;按后按键时空中受身速度增加量 **MUGEN 1.0专用**
air.gethit.airrecover.fwd = 0         ;按前按键时空中受身速度增加量 **MUGEN 1.0专用**
air.gethit.airrecover.up = -2         ;按上按键时空中受身速度增加量 **MUGEN 1.0专用**
air.gethit.airrecover.down = 1.5      ;按下按键时空中受身速度增加量 **MUGEN 1.0专用**

[Movement]
airjump.num =  0      ;空中跳跃次数 (可选)
airjump.height = 35   ;空中跳跃时离地最小距离 (可选)
yaccel = .44          ;重力加速度
stand.friction = .85  ;站立时摩擦系数
crouch.friction = .82 ;下蹲时摩擦系数
stand.friction.threshold = 2          ;如果人物站立时速度小于这个数值，停止人物移动 **MUGEN 1.0专用**
crouch.friction.threshold = .05       ;如果人物下蹲时速度小于这个数值，停止人物移动 **MUGEN 1.0专用**
air.gethit.groundlevel = 25           ;当人物的Y坐标大于这个数值时，人物落地 **MUGEN 1.0专用**
air.gethit.groundrecover.ground.threshold = -20 ;当人物的Y坐标小于这个数值时，人物可以受身 **MUGEN 1.0专用**
air.gethit.groundrecover.groundlevel = 10   ;当人物的Y坐标小于这个数值时，人物可以受身落地 **MUGEN 1.0专用**
air.gethit.airrecover.threshold = -1  ;当人物的纵向速度大于这个数值时，人物可以受身 **MUGEN 1.0专用**
air.gethit.airrecover.yaccel = .35    ;人物受身时重力加速度 **MUGEN 1.0专用**
air.gethit.trip.groundlevel = 15      ;当人物在被绊倒的state里，Y坐标大于这个数值时，人物落地 **MUGEN 1.0专用**
down.bounce.offset = 0, 20            ;人物弹地时的坐标偏移量 (x, y) **MUGEN 1.0专用**
down.bounce.yaccel = .4               ;人物弹地时的重力加速度 **MUGEN 1.0专用**
down.bounce.groundlevel = 12          ;在人物弹地时，当人物的Y坐标大于这个数值时，人物落地 **MUGEN 1.0专用**
down.friction.threshold = .05         ;如果人物倒地时速度小于这个数值，停止人物移动 **MUGEN 1.0专用**

;默认语言下的胜利台词 (optional)  **MUGEN 1.0专用**
;如果包括这一段，默认语言必须为英语
[Quotes]
; 每种语言最多可以有100个胜利台词 (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?"

;其他语言的胜利台词 (optional)
;可以不加入其他语言的胜利台词，也可以加入任意多个
;标识符开头必须用ISO 639-1标准来标识语(中文的标识符为zh)，例如 "[zh.Quotes]".
;在mugen.cfg里调整语言选项
[zh.Quotes]
victory1 = "如果不能接下我的功夫掌的话，你连一点机会都没有！"
victory2 = "功夫火候不够，修行十年再来吧。"
victory3 = "你看着很眼熟，你上过电视吗？"
victory4 = "你的招数太容易预判了。哦，你想学功夫掌？对新人来说是不是有点太难了。"
victory5 = "刚才的作为热身运动挺不错的啊。"
victory6 = "我要挑战的是远超你的水平的强者。"
victory7 = "什么！我的女朋友在另外一个庙里？"

;---------------------------------------------------------------------------
; 变量表:
; 这是功夫人用的变量列表。
; 记录下你用的变量可以减少你的工作量。
; var(1)  - 在kfm.cmd里使用，检测可否取消 (每帧更新)
; var(2)  - 在功夫投里使用 (state 800)，记录是否按了前按键
;           (从state 800到state 810都有使用).


;---------------------------------------------------------------------------
; 时间到判负
; CNS难度：基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; 胜利后姿势判定
; CNS难度：基本
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; 胜利姿势1-鞠躬
; CNS难度：基本
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

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

[state 190]
type = playsnd
trigger1 = animelem = 6
value = S0,48
volume = 255

[state 195]
type = Explod
trigger1 = animelem = 2
anim = 181
postype = p1
pos = 0,0
sprpriority = 4

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

;---------------------------------------------------------------------------
; 开场
; CNS难度：基本
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 1] ;冻结动画直到PreIntro结束
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

[state 195]
type = Explod
trigger1 = time = 63
anim = 191
postype = p1
pos = 0,0
sprpriority = 5
ownpal = 1

[State 191, 2] ;在这个Assert结束后播放"round 1, fight"
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3] ;结束后转移到站立state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; 挑拨
; CNS难度：初级
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 变量]
type = VarSet
trigger1 = Time = 0
v = 6
value = 0

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

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

;---------------------------------------------------------------------------
; 站轻拳-远
; CNS难度：初级
[Statedef 200]
type    = S                      ;状态: S-站立, C-蹲, A-空中, L-倒地
movetype= A                      ;招式种类: A-攻击, I-非攻击, H-受击
physics = S                      ;物理: S-站立, C-蹲, A-空中
;常用的控制器:
velset = 0,0                     ;设定速度 (x,y) (不写这行则不改变速度)
ctrl = 0                         ;设定可控与否 (不写这行则不改变ctrl)
anim = 200                       ;改变动作 (不写这行则不改变anim)
sprpriority = 3                  ;设定p1的贴图优先度到2 (在前面)

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = MA
guard.sparkno = s7060
pausetime = 11,11
sparkno = s-1
sparkxy = -5,-70
hitsound = s10,0
guardsound = S120,3
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -5
air.velocity = -2.4,-2

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 601
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 75, -65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s0,79

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = movecontact = 1
trigger1 =  NUMhelper(2000) = 0
stateno = 2000
id = 2000
name = "ying"
pos = -10,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 站轻拳-近
; CNS难度：初级
[Statedef 205]
type    = S                      ;状态: S-站立, C-蹲, A-空中, L-倒地
movetype= A                      ;招式种类: A-攻击, I-非攻击, H-受击
physics = S                      ;物理: S-站立, C-蹲, A-空中
;常用的控制器:
velset = 0,0                     ;设定速度 (x,y) (不写这行则不改变速度)
ctrl = 0                         ;设定可控与否 (不写这行则不改变ctrl)
anim = 205                       ;改变动作 (不写这行则不改变anim)
sprpriority = 2                  ;设定p1的贴图优先度到2 (在前面)

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = MA
guard.sparkno = s7060
pausetime = 8,8
sparkno = s-1
sparkxy = -10,-70
hitsound = s10,0
guardsound = S120,3
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -3
air.velocity = -2.4,-2

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 601
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 40, -95
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,8

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 站重拳
; CNS难度：初级
; 注意width控制器，他让功夫人的物理判定框（pushbox）更大，这样他离敌人不会太近。
; 在MUGEN里用Ctrl-C来查看地面上他脚附近的红色判定条。
; 这个state的sprpriority（贴图优先度）是-1, 而不是一般用的2， 这样功夫人一开始会层叠在对方后方。
; [State 210, 4]里的SprPriority控制器在功夫人的胳膊伸出去的时候带到前头。
; 为了在这时暂停动作，在[State 210, 3]有一个ChangeAnim控制器检测有没有击中敌人，然后转到下一个动作元素。
; (注意elem=6这个参数). 如果要看效果的话，删除这个控制器作比较（打人会软绵绵的）。
[Statedef 210]
type = S
physics = S
movetype = A
anim = 210
velset = 0,0
ctrl = 0
sprpriority = 2 

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype = hard
damage = 30,10
hitflag = MAF
guardflag = MA
guard.sparkno = s7060
pausetime = 13,16
guard.pausetime = 11,11
sparkno = s-1
sparkxy = -10,-55
hitsound = s10,11
guardsound = S120,3
ground.type = High
ground.slidetime = 21
ground.hittime = 23
ground.velocity = -4
air.velocity = -3.5,-3

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
animtype = hard
damage = 50,10
hitflag = MAF
guardflag = MA
guard.sparkno = s7060
pausetime = 13,16
guard.pausetime = 11,11
sparkno = s-1
sparkxy = -10,-70
hitsound = s10,11
guardsound = S120,3
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -4
air.velocity = -3.5,-3

[State 打击火花]
type = Explod
triggerall =  stateno = 210
trigger1 = movehit
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 65,-60
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 打击火花]
type = Explod
triggerall = movehit
trigger1 = AnimElem = 5
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 70,-70
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,11

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 站轻脚-远
; CNS难度：初级
[Statedef 230]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = L
guard.sparkno = s7060
pausetime = 11,11
sparkno = s-1
sparkxy = -10,-27
hitsound = s9,2
guardsound = S120,3
ground.type = low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -4
air.velocity = -3.4,-3

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 631
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 65, -35
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s0,79

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = movecontact = 1
trigger1 =  NUMhelper(2000) = 0
stateno = 2000
id = 2000
name = "ying"
pos = -10,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 站轻脚-近
; CNS难度：初级
[Statedef 235]
type = S
movetype = A
physics = S
ctrl = 0
velset = 0,0
anim = 235
sprpriority = 2

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = M
guard.sparkno = s7060
pausetime = 11,11
sparkno = s-1
sparkxy = -10,-70
hitsound = s9,2
guardsound = S120,3
ground.type = low
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -4
air.velocity = -3.4,-3

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 631
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 55,-70
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,8

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 站重脚
; CNS难度：初级
[Statedef 240]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 3

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 6 || AnimElem = 7
trigger1 = movecontact = 0
attr = S, NA
animtype = hard
damage = 60,10
hitflag = MAF
guardflag = H
guard.sparkno = s7060
pausetime = 8,8
sparkno = s-1
sparkxy = 10,-80
hitsound = s9,4
guardsound = S120,3
ground.type = High
ground.slidetime = 22
ground.hittime = 22
ground.velocity = -5.5
air.velocity = -3,10

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 241
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 85,-95
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,9

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = movecontact = 1
trigger1 =  NUMhelper(2001) = 0
stateno = 2001
id = 2001
name = "ying"
pos = -60,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------
;站重脚P2
;---------------------
[Statedef 241]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State 屏幕震动]
type = EnvShake
trigger1 = Time = 0
time = 15
freq = 40
ampl = 12

[State 转入]
type = ChangeAnim
Trigger1 = Time = 0
value = 5030

[State 飞行速度]
type = Hitvelset
trigger1 = time = 0
x = 1
y = 1

[State 速度]
type = VelAdd
Trigger1 = time >= 5
y = .65

[state 转入]
type = SelfState
triggerall = time >= 10
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; CD
; CNS难度：初级
[Statedef 300]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 300
sprpriority = 2

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype = hard
getpower = 0,0
damage = 100,20
hitflag = MAF
guardflag = M
guard.sparkno = s7060
pausetime = 17,17
sparkno = s-1
sparkxy = 10,-82
hitsound = s9,4
guardsound = S120,3
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -3,-5
air.velocity = -2,-7
fall = 1
fall.recover = 0
envshake.ampl = 12
envshake.freq = 40
envshake.time = 20

[State 打击火花]
type = Explod
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 25,-110
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,4

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;刚CD
[statedef 310]
type = S
movetype = A
physics = S
anim = 300
velset = 0
ctrl = 0
poweradd = -1000

[state 颜色]
type = envcolor
trigger1 = time = 0
value = 255,255,255
time = 5
under = 1

[state 暂停]
type = pause
trigger1 = time = 0
time = 10

[state 无敌]
type = nothitby
trigger1 = 1
value = sca

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype = hard
getpower = 0,0
damage = 100,20
hitflag = MAF
guardflag = M
guard.sparkno = s7060
pausetime = 17,20
sparkno = s-1
sparkxy = 10,-82
hitsound = s9,4
guardsound = S120,3
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -3.5,-5
air.velocity = -2.6,-4
fall = 1
fall.recover = 0
envshake.ampl = 12
envshake.freq = 40
envshake.time = 20

[State 打击火花]
type = Explod
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 25,-110
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,4

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------
;特殊技
;---------------------
[Statedef 320]
type = S
physics = S
movetype = A
anim = 320
velset = 0,0
ctrl = 0

[State 防推挤]
type = Width
trigger1 = 1
edge = 50,0

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
animtype = hard
damage = 40,10
hitflag = MAF
guardflag = M
guard.sparkno = s7060
pausetime = 9,10
sparkno = s-1
sparkxy = 0,-50
hitsound = s10,11
guardsound = S120,3
ground.type = high
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -.1
air.velocity = -.3,-.3
EnvShake.time = 15
EnvShake.ampl = 5

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 11
attr = S, NA
animtype = hard
damage = 50,10
hitflag = MA
guardflag = H
guard.sparkno = s7060
pausetime = 10,11
sparkno = s-1
sparkxy = 0,-70
hitsound = s9,4
guardsound = S120,3
ground.type = low
ground.slidetime = 25
ground.hittime = 25
ground.velocity = -5.5
air.type = Low
air.velocity = -3,15
air.hittime = 12
air.fall = 1
envshake.ampl = 5
envshake.freq = 40
envshake.time = 20

[State 打击火花]
type = Explod
triggerall = stateno = 320
trigger1 = movehit
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 65,-55
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 打击火花]
type = Explod
triggerall = movehit
trigger1 = AnimElem = 11
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 70,-50
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 0
value = S200,1

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 21
value = S200,4

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

;---------------------------------------------------------------------------
; 蹲轻拳
; CNS难度：初级
; 一个简单的下蹲攻击.HitDef的guardflag被设为L，表示只能用蹲防来防御这个攻击，而不是站防或者空防。
; slidetime和hittime最好设置的小一点，这样对手硬直不会过长。
; 对于所有的下蹲攻击，记得设置attr参数为下蹲。比如这里的"C, NA"代表"下蹲, 普通攻击"。
; HitDef的priority设为3而不是默认的4，这样攻击优先度会低一些。
; 当两个人物的攻击判定框重合时，功夫人会被击中，而不是互杀。
[Statedef 400]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 400
sprpriority = 2

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype = light
damage = 30,10
hitflag = M
guardflag = M
guard.sparkno = s7060
pausetime = 13,14
guard.pausetime = 11,11
sparkno = s-1
sparkxy = 0,-45
hitsound = s10,0
guardsound = S120,3
ground.type = low
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -2
air.velocity = -2.4,-2

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 45, -50
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,8

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; 蹲重拳
; CNS难度：初级
; 这是个两段攻击，是由两个HitDef来实现的，每一个HitDef对应每一段攻击的那一帧。
; 注意第一段不可以可以被空防，因为guardflag是M。
; 第二段的guardflag是MA，所以这个攻击可以被站防和空防。
[Statedef 410]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 410
sprpriority = 3

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击状态]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
animtype = hard
damage = 60,10
hitflag = M
guardflag = M
guard.sparkno = S7060
pausetime = 14,19
guard.pausetime = 11,11
sparkno = s-1
sparkxy = 0,-45
hitsound = s10,11
guardsound = S120,3
ground.type = low
ground.slidetime = 17
ground.hittime = 17
ground.velocity = -6.8
air.velocity = -3.6,-2

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 55,-45
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,11

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = movecontact = 1
trigger1 =  NUMhelper(2001) = 0
stateno = 2001
id = 2001
name = "ying"
pos = -50,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; 蹲轻脚
; CNS难度：初级
[Statedef 430]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 430
sprpriority = 2

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype = light
damage = 30,10
hitflag = M
guardflag = L
guard.sparkno = s7060
pausetime = 9,9
sparkno = s-1
sparkxy = -10,-10
hitsound = s9,2
guardsound = S120,3
ground.type = low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -4
air.velocity = -3.4,-2

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 55,-5
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s0,79

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; 蹲重脚
; CNS难度：初级
; 这个攻击的ground.type参数被设为trip，所以对方被击中时会进入绊倒的动画。
; 注意这个攻击的hitflag是MAFD，表示倒地的对手也可以被击中。
[Statedef 440]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 440
sprpriority = 2

[State 防推挤]
type = Width
trigger1 = 1
edge = 40,0

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 6
attr = C, NA
animtype = hard
damage = 60,10
hitflag = M
guardflag = L
guard.sparkno = s7060
pausetime = 12,13
sparkno = s-1
sparkxy = 10,-10
hitsound = s10,11
guardsound = S120,3
ground.type = Trip
ground.slidetime = 20
ground.hittime = 15
ground.velocity = -1.5,-4
guard.velocity = -5
air.velocity = -2.4,-2
fall = 1
fall.recover = 0
envshake.time = 10
envshake.ampl = 5
envshake.freq = 50

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 65,-10
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,11

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; 跳轻拳
; CNS难度：初级
[Statedef 600]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 600
sprpriority = 2

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = H
guard.sparkno = s7060
pausetime = 8,8
sparkno = s-1
sparkxy = 0,-70
hitsound = s9,0
guardsound = S120,3
ground.type = high
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -5
air.velocity = -3,-4

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 601
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 45,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,8

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

;---------------------
;跳轻拳(P2)
;---------------------
[statedef 601]
type    = A
movetype= H
physics = N
poweradd = 0
VelSet = 0,0
ctrl = 0
sprpriority = -2
facep2 = 1

[state 转入]
type = changeAnim2
Trigger1 = Time = 0
value = 601

[State 速度]
type = VelSet
trigger1 = time = 12
x = -1
y = -4
ignorehitpause = 1
persistent = 0

[State 转入]
type = ChangeState
trigger1 = time >= 15
value = 602
ctrl = 0

;---------------------
;跳轻拳(P2)
;---------------------
[statedef 602]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = -1
facep2 = 1

[state 转入]
type = changeAnim2
Trigger1 = Time = 0
value = 602

[State 速度]
type = VelAdd
trigger1 = Vel Y < 8
y = 0.6
ignorehitpause = 1
persistent = 1

[State 速度]
type = VelSet
trigger1 = Vel Y >= 8
y = 8
ignorehitpause = 1
persistent = 1

[State 转入]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; 跳重拳
; CNS难度：初级
[Statedef 610]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 610
sprpriority = 2

[State 攻击判定]
type = HitDef
trigger1 = Time = 0
attr = A, NA
animtype = hard
damage = 60,10
hitflag = MAF
guardflag = HA
guard.sparkno = s7060
pausetime = 12,17
sparkno = s-1
sparkxy = 0,-70
hitsound = s10,11
guardsound = S120,3
ground.type = high
ground.slidetime = 25
ground.hittime = 25
ground.velocity = -4
air.velocity = -1.6,-1.5

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 601
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 45,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,11

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

;---------------------------------------------------------------------------
; 跳轻脚
; CNS难度：初级
[Statedef 630]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 630
sprpriority = 2

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
animtype = light
damage = 30,10
hitflag = MAF
guardflag = HA
guard.sparkno = s7060
pausetime = 9,9
sparkno = s-1
sparkxy = 0,-70
hitsound = s9,3
guardsound = S120,3
ground.type = high
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -4
air.velocity = -2,-3

[State 转入]
type = TargetState
triggerall = NumTarget
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 631
ignorehitpause = 1
persistent = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 35,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s0,79

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,0

;---------------------
;跳轻脚(P2)
;---------------------
[statedef 631]
type    = A
movetype= H
physics = N
poweradd = 0
VelSet = 0,0
ctrl = 0
sprpriority = -2
facep2 = 1

[state 转入]
type = changeAnim2
Trigger1 = Time = 0
value = 631

[State 速度]
type = VelSet
trigger1 = time = 12
x = -1
y = -4
ignorehitpause = 1
persistent = 0

[State 转入]
type = ChangeState
trigger1 = time >= 15
value = 602
ctrl = 0

;---------------------
;跳重脚-选择
;---------------------
[statedef 620]
type = A
ctrl = 0

[State 随机]
type = changestate
Trigger1 = P2statetype = A
value = 645

[State 随机]
type = changestate
Trigger1 = P2statetype != A
value = 640

[state 归零]
type = changestate
trigger1 = animtime = 0
value = 650

;---------------------------------------------------------------------------
; 跳重脚
; CNS难度：初级
[Statedef 640]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 640
sprpriority = 2

[State 攻击判定]
type = HitDef
trigger1 = Time = 0
attr = A, NA
animtype = hard
damage = 60,10
hitflag = MAF
guardflag = HA
guard.sparkno = s7060
pausetime = 12,17
sparkno = s-1
sparkxy = 0,-70
hitsound = s10,11
guardsound = S120,3
ground.type = high
ground.slidetime = 25
ground.hittime = 25
ground.velocity = -4
air.velocity = -1.6,-1.5

[State 攻击判定]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p2
pos = 5,-90
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,9

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

;---------------------------------------------------------------------------
; 跳重脚
; CNS难度：初级
[Statedef 645]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 645
sprpriority = 3

[State 攻击判定]
type = HitDef
trigger1 = animelem = 6
attr = A, NA
damage = 60,10
guardflag = HA
priority = 4
pausetime = 12,13
sparkno = s-1
guard.sparkno = s7060
sparkxy = -15,-60
hitsound = s10,4
guardsound = s120,3
animtype = Hard
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = -3,10
air.velocity = -3,10
p2stateno = 903
envshake.ampl = 12
envshake.freq = 40
envshake.time = 20

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 40,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 人物声音]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 400 
value = s1,9

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,1

[State 影子helper]
type = Helper
triggerall = moveHIT 
triggerall = var(6) = 1
trigger1 =  TIME = 15
trigger1 =  NUMhelper(2005) = 0
stateno = 2005
id = 2005
name = "ying"
pos = -10,-200
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

;---------------------------------------------------------------------------
; 跳CD
; CNS难度：初级
[Statedef 650]
type    = A
movetype= A
physics = A
ctrl = 0
anim = 650
sprpriority = 2

[State 攻击判定]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
animtype = hard
damage = 80,20
hitflag = MAF
guardflag = HA
guard.sparkno = s7060
pausetime = 17,17
sparkno = s-1
sparkxy = -10,-55
hitsound = s10,4
guardsound = S120,3
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-3
air.velocity = -8,4
fall = 1
fall.recover = 0
envshake.ampl = 12
envshake.freq = 40
envshake.time = 20

[State 打击火花]
type = Explod
trigger1 = movehit = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 60,-43
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 挥击音效]
type = PlaySnd
trigger1 = Time = 1
value = S200,4

;---------------------------------------------------------------------------
; 闪避-前
[Statedef 700]
type = S
physics = S
movetype = I
anim = 700
velset = 0,0
ctrl = 0
sprpriority = -1

[State 转向]
type = ChangeState
trigger1 = PrevStateNo = [100,101]
trigger1 = Time = 0
trigger1 = P2Dist X < 0
value = 710

[State 暂停]
type = Pause
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
time = 10
movetime = 10

[State 闪屏]
type = EnvColor
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
value = 255,255,255
time = 4
under = 1

[State 闪屏]
type = EnvColor
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
value = 255,255,255
time = 4
under = 1

[State 减气]
type = PowerAdd
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
value = -1000

[State 减气]
type = PowerAdd
triggerall = time = 0
trigger1 = (prevstateno = [200,320])
value = -500

[State 防推挤]
type = PlayerPush
trigger1 = 1
value = 0

[State 无敌]
type = NotHitBy
trigger1 = 1
value = SCA

[State 残影]
type = AfterImage
trigger1 = AnimElem = 1, = 1
time = 15
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 0,0,0
palcontrast = 128,128,128
palmul = 1,1,1

[State 移动]
type = VelSet
triggerall = !(PrevStateNo = 150 || PrevStateNo = 152)
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(6) < 0
x = 4.5 + (PrevStateNo = [100,101])

[State 移动]
type = VelSet
triggerall = !(PrevStateNo = 150 || PrevStateNo = 152)
trigger1 = AnimElem = 6
x = 0

[State 移动]
type = VelSet
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(6) < 0
x = 4.5

[State 移动]
type = VelSet
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = AnimElem = 6
x = 0

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = AnimElem = 1
trigger1 =  NUMhelper(2020) = 0
stateno = 2020
id = 2020
name = "ying"
pos = 0,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 闪避-后
[Statedef 710]
type = S
physics = S
movetype = I
anim = 710
velset = 0,0
ctrl = 0
sprpriority = -1

[State 转向]
type = ChangeState
trigger1 = PrevStateNo = [100,101]
trigger1 = Time = 0
trigger1 = P2Dist X < 0
value = 700

[State 暂停]
type = Pause
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
time = 10
movetime = 10

[State 闪屏]
type = EnvColor
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
value = 255,255,255
time = 4
under = 1

[State 减气]
type = PowerAdd
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = Time = 0
value = -1000

[State 减气]
type = PowerAdd
triggerall = Time = 0
trigger1 = (prevstateno = [200,320])
value = -500

[State 防推挤]
type = PlayerPush
trigger1 = 1
value = 0

[State 无敌]
type = NotHitBy
trigger1 = 1
value = SCA

[State 残影]
type = AfterImage
trigger1 = AnimElem = 1, = 1
time = 15
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 0,0,0
palcontrast = 128,128,128
palmul = 1,1,1

[State 速度]
type = VelSet
triggerall = !(PrevStateNo = 150 || PrevStateNo = 152)
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(6) < 0
x = -4.5

[State 速度]
type = VelSet
triggerall = !(PrevStateNo = 150 || PrevStateNo = 152)
trigger1 = AnimElem = 6
x = 0

[State 速度]
type = VelSet
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(6) < 0
x = -4.5

[State 速度]
type = VelSet
triggerall = PrevStateNo = 150 || PrevStateNo = 152
trigger1 = AnimElem = 6
x = 0

[State 影子helper]
type = Helper
triggerall = var(6) = 1
trigger1 = AnimElem = 1
trigger1 =  NUMhelper(2020) = 0
stateno = 2020
id = 2020
name = "ying"
pos = 0,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
supermovetime = 999

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------
;二段跳
;---------------------
[Statedef 720]
type    = A                      
movetype= I                      
physics = N                     
velset = 0,-5                     
ctrl = 1
anim = 720                      
sprpriority = 2          

[State 速度]
type = VelSet
trigger1 = time = 1
trigger1 = command = "/6"
trigger1 = command != "/4"
x = 3
ignorehitpause = 1
persistent = 0

[State 速度]
type = VelSet
trigger1 = time = 1
trigger1 = command = "/4"
trigger1 = command != "/6"
x = -3
ignorehitpause = 1
persistent = 0

;---------------------------------------------------------------------------
;记录跳跃次数
[State 0, Varadd]
type = Varadd
trigger1 = time = 1
v = 5
value = 1
ignorehitpause = 1
persistent = 0

[State 状态变更]
type = StateTypeSet
trigger1 = time = 8
physics = A         ;A,C,S,N
ignorehitpause = 1
persistent = 1

;---------------------
;高跳
;---------------------
[Statedef 730]
type     = S
movetype = I
physics  = S
velset   = 0,0
anim     = 730
ctrl     = 0
sprpriority = 2

[State 无敌]
type = NotHitBy
trigger1 = 1
value = SCA

[State 防推挤]
type = PlayerPush
trigger1 = 1
value = 0

[state 状态变更]
type = StateTypeSet
trigger1 = AnimElem = 3
statetype = A
movetype = I
physics = N

[State 音效]
type = PlaySnd
trigger1 = AnimElem = 1
value = s3,2

[state 速度]
type = VelSet
Trigger1 = AnimElem = 3
x = 3
y = -7

[State 速度]
type = Veladd
Trigger1 = time >= 15
y = 0.65

[State 转入]
type = ChangeState
Trigger1 = AnimElem = 3,>0
trigger1 = (Vel Y > 0) && (Pos Y >= 0)
value = 52

;---------------------------------------------------------------------------
; 功夫投-尝试
; CNS难度：中级-上级
; 投技并不难写，但是有的时候会很繁杂。（翻译这个魂淡文本也是）
; 投技的HitDef需要特殊写法。关键的两个参数是p1stateno和p2stateno。
; 如果HitDef击中了，攻击者会进入p1stateno，受击者会进入p2stateno。
; 关于p2stateno特别的地方是受击者会进入p1的cns文档里写的state。
; 无论p2是谁，他都会进入这个文档(kfm.cns)里声明的state820，直到投技结束。
; （在MUGEN里进入debug模式看p2的状态号，黄色的状态号表明在其他人物的state里。
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

; 注意hitflag参数里的'-'符号，这代表只能击中不在受击状态（被击中或者防御中）。
; 这样就无法用投技去投一个已经被击中的敌人。
; priority务必设为1或2，这样不会覆盖敌方的普通攻击。
; 相杀参数务必设为miss或dodge，否则会出现毛病。
;
; 注意：有的时候（比如KOF的指令投）要求可以打中受击硬直中德敌人，但是不能打中防御硬直中的敌人
; 这时候写两个hitdef，第一个是当对方不在防御状态时触发，hitflag不带减号，第二个当对方在防御状态时触发，hitflag带减号
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;属性: 站立，普通投
hitflag = M-          ;能击中地面上非受击状态的敌人
priority = 1, Miss    ;低优先度，必须为miss或dodge
sparkno = -1          ;没有火花
p1sprpriority = 1     ;p1的位图在p2之前
                      ;p2的sprpriority默认是0
p1facing = 1
p2facing = 1          ;强制让对方面对我方
p1stateno = 810       ;成功的话p1转到810
p2stateno = 820       ;成功的话p2转到kfm的cns里的820
guard.dist = 0        ;这样对方不能转到防御state
fall = 1              ;强制对方落地

[State 归零]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 功夫投-扔对方的过程
; 在这个state里，功夫人通过把对方绑定到合适的便宜量来做出投的效果。
; 举例来说，[State 810, Bind 1]把对方绑定到前方28像素的地方，就是功夫人伸出的手的位置。
; 务必在想放开对方之前一直用TargetBind控制器把对方绑定住。
; 这在如果对方有受击判定框（Clsn2）的时候尤其重要。
; 每当人物被击中，这个人物绑定的人物会进入下落状态，如果对方没有被绑定，就会卡在被投的位置。
; 注意对方生命减少是由TargetLifeAdd控制器做到的， 当功夫人放手时一个TargetState控制器把对方转到821里。
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0

[State 音效]
type = PlaySnd
trigger1 = Time = 0
value = S10,8

[State 音效]
type = PlaySnd
trigger1 = animelem = 9
value = S200,1

[State 音效]
type = PlaySnd
trigger1 = TIME = 31
value = s9,4

[State 震屏]
type = EnvShake
trigger1 = animelem = 9
ampl = 20
freq = 40
time = 10

[State 推挤]
type = Width
trigger1 = 1
edge = 80,0

[State 抓取火花]
type = Explod
trigger1 = Time = 0
anim = 7100
postype = P1
pos = 62,-73
sprpriority = 15
ownpal = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 图层]
type = sprpriority
trigger1 = animelem = 1
value = 3

[State 图层]
type = sprpriority
trigger1 = animelem = 2
value = 2

[State 107, 2]
type = sprpriority
trigger1 = animelem = 9
value = 2

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = animelem = 9
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 90,-50
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.35,0.35
trans = addalpha
alpha = 256, 256

[State 转向]
type = turn
trigger1 = Animelem = 3
value = 1

[State 位置]
type = targetbind
trigger1 = animelem = 1
postype = p1
pos = 50,0

[State 位置]
type = targetbind
trigger1 = animelem = 2
postype = p1
pos = 45,0

[State 位置]
type = targetbind
trigger1 = animelem = 3
postype = p1
pos = -40,0

[State 位置]
type = targetbind
trigger1 = animelem = 4
postype = p1
pos = 0,0

[State 位置]
type = targetbind
trigger1 = animelem = 5
postype = p1
pos = 10,0

[State 位置]
type = targetbind
trigger1 = animelem = 6
postype = p1
pos = 25,0

[State 位置]
type = targetbind
trigger1 = animelem = 7
postype = p1
pos = 30,0

[State 位置]
type = targetbind
trigger1 = animelem = 8
postype = p1
pos = 60,0

[State 位置]
type = targetbind
trigger1 = animelem = 9
postype = p1
pos = 70,0

[State 转入]
type = targetstate
trigger1 = animelem = 9
value = 821

[State 音效]
type = PlaySnd
trigger1 = p2stateno = 815
value = S0,42
persistent = 0

[State 归零]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 功夫投(P2)
[Statedef 820]
type = A
physics = N
movetype = H
velset = 0,0
ctrl = 0

[State 图层]
type = sprpriority
trigger1 = animelem = 1
value = -1

[State 图层]
type = sprpriority
trigger1 = animelem = 2
value = 3

[State 转入]
type = Changeanim2
trigger1 = Time = 0
value = 811

[State 转向]
type = turn
trigger1 = Animelem = 3
value = 1

;---------------------------------------------------------------------------
; 功夫投(P2)
[Statedef 821];憡庤儌乕僔儑儞
type = A
physics = N
movetype = H
ctrl = 0
velset = 0,0
sprpriority = -1

[State 速度]
type = VelSet
trigger1 = time = 4
x = -6
y = -3

[State 速度]
type = VelAdd
trigger1 = Time > 8
y = .5

[State 转入]
type = Changeanim2
trigger1 = Time = 0
value = 805

[State 转入]
type = changeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 822

;---------------------------------------------------------------------------
; 功夫投(P2)
[Statedef 822]
type = S
physics = N
movetype = H
ctrl = 0
velset = 0,0

[State 坐标]
type = PosSet
trigger1 = time = 0
y = 0

[State 速度]
type = Velset
trigger1 = time = [0,10]
x = -2.8

[State 特效]
type = makedust
trigger1 = time = [0,26]
postype = p2
pos = 30,0

[State 速度]
type = Velset
trigger1 = time = [10,17]
x = -.8

[State 速度]
type = Velset
trigger1 = time = [18,26]
x = -.1

[State 速度]
type = Velset
trigger1 = time = 27
x = 0

[State 转入]
type = Changeanim2
trigger1 = Time = 0
value = 812

[State 速度]
type = Changeanim2
trigger1 = Time = 19
value = 813

[state 状态变更]
type = StateTypeSet
trigger1 = Time = 32
statetype = S

[State 转入]
type = SelfState
trigger1 = life = 0
trigger1 = Time = 42
value = 5150

[State 转入]
type = selfState
trigger1 = Time = 43
trigger1 = alive
value = 5120

;---------------------
;P2
;---------------------
[Statedef 903]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State 转入]
type = ChangeAnim
Trigger1 = Time = 0
value = 5030

[State 飞行速度]
type = Hitvelset
trigger1 = time = 0
x = 1
y = 1

[State 速度]
type = VelAdd
Trigger1 = time >= 5
y = .65

[state 转入]
type = SelfState
triggerall = time >= 10
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; 重载common1.cns里的state（用同样的state号）
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; 每一帧执行[Statedef -2]
;---------------------------------------------------------------------------
[Statedef -2]

[state helper]
type = Helper
trigger1 = numhelper(9999) = 0
id = 9999
name = "连击修正"
sprpriority = 1
pos = 0,0
postype = p1
stateno = 9999
helpertype = normal
pausemovetime = 99999999
supermovetime = 99999999
keyctrl = 0 
ownpal = 0

[state 连击修正]
type = AttackMulSet
trigger1 = 1            ;伤害修正开关，= 1开启，= 0关闭   默认开启
value = helper(9999),fvar(15)

[State 格挡]
type = helper
triggerall = stateno = 1050
trigger1 = time = [10,30]
stateno = 1059
id = 1059
name = "dun"
pos = 20,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
PERSISTENT = 1
ignorehitpause = 1

[State 格挡]
type = helper
triggerall = stateno = 1075
trigger1 = time >= 6
trigger1 =  NUMhelper(1079) = 0
stateno = 1079
id = 1079
name = "dun"
pos = 20,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
PERSISTENT = 1
ignorehitpause = 1

;Explod部分
[State 打击火花]
type = Explod
ownpal = 1
trigger1 = projhit1000 = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p2
pos = 15,-10
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
facing = -1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = projhit1001 = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p2
pos = 15,-10
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
facing = -1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = projhit1355 = 1
anim = 7000
sprpriority = 20
supermovetime = 9999
postype = p2
pos = 0,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
facing = -1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = projhit1357 = 1
anim = 7001
sprpriority = 20
supermovetime = 9999
postype = p2
pos = 0,-65
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
facing = -1
scale = 0.4,0.4
trans = addalpha
alpha = 256, 256

[State 二次跳跃限制]
type = VarSet
trigger1 = statetype != A
v = 5
value = 0
ignorehitpause = 1
persistent = 1

;音效部分
[State 音效停止]
type = StopSnd
trigger1 = stateno != 100
channel = 2

[State 音效停止]
type = StopSnd
trigger1 = stateno != 1860
channel = 3

;---------------------------------------------------------------------------
; 在自己的state里每一帧执行(statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]


[State -3, コマンドを入れたらVarをON]
Type = VarSet
Trigger1 = Command = "jump" ;残影跳的指令，一般是269，247这些的，一会给出指令
Trigger1 = Ctrl
Trigger1 = StateType = S
Trigger2 = PrevStateNo = 100
Trigger2 = Command = "holdfwd" ;之前的动作为跑步，并且按住前，才可出现残影跳
V = 3
Value = 1

[State -3, sysvarを引継ぐ] ;出现了残影跳以后，需要继续赋值
Type = VarSet
Trigger1 = Var(3) = 1 ;出现了残影跳
Trigger1 = StateNo = 40 ;ジャンプする前のステート
Trigger1 = AnimTime = 0 ;ジャンプ方向を決めるsysvarがリセットされる寸前
var(3) = ifelse(sysvar(1)=0, 2, ifelse(sysvar(1)=1, 3, 4)) ;利用sysvar来判断赋值，上跳赋值为2，前为3，后为4

[State -3, varをOFFにするステート] ;跳出去以后还原var(3) = 0
Type = VarSet
TriggerAll = Time = 2
Trigger1 = StateNo = 50
Trigger2 = StateNo != [40,59]
V = 3
Value = 0 ;还原

[State -3, 前にボタンを押してたら前にも加速] ;残影前跳加速
Type = VelAdd
Trigger1 = var(3) = 3
Trigger1 = StateNo = 50
x = 2.1

[State -3, 後ろなら後ろに加速] ;残影后跳加速
Type = VelAdd
Trigger1 = var(3) = 4
Trigger1 = StateNo = 50
x = -2.1

[State -3, 垂直ジャンプにveladdを使って上に加速] ;残影上跳加速
Type = VelAdd
Trigger1 = var(3) = 2
Trigger1 = StateNo = 50
y = -2.1

[State -3, 成功したときの残像]
type = AfterImage
Trigger1 = var(3) >= 1
Trigger1 = stateno = 50
time = 25
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 0,0,0
palcontrast = 128,128,128
palmul = 1,1,1

