
;---------------------- Integer variable list ----------------------

; var(0):= 33700
; var(1):= 31000 - 僈乕僪僠僃僢僋僿儖僷乕, 32000 - 旘傃摴嬶姶抦僿儖僷乕, 35000 - 記憶検出ヘルパー, 33700, 999, -1 - 不要删除下面这行。语法标准要求CMD文件必须包括这行。

;---------------------- Float variable list ----------------------

; fvar(0):= 33700, 9999 - 连击修正
; fvar(5):= 33700
;fvar(15):= 33700, 9999 - 连击修正
;fvar(21):= -1 - 不要删除下面这行。语法标准要求CMD文件必须包括这行。
;fvar(22):= -1 - 不要删除下面这行。语法标准要求CMD文件必须包括这行。
;fvar(37):= -1 - 不要删除下面这行。语法标准要求CMD文件必须包括这行。


; 功夫人的中文化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 = 9999

;默认的打击火花号
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.3;2.5     ;前进速度
walk.back = -1.3;-2.5     ;后退速度
run.fwd  = 7, 0    ;跑步速度 (x, y)
run.back = -4.5,-3.8 ;后跃速度 (x, y)
jump.neu = 0,-8.4    ;跳速度 (x, y)
jump.back = -2.55    ;后跳速度 (x, y)
jump.fwd = 2.5       ;前跳速度 (x, y)
runjump.back = -2.55,-8.1 ;跑跳速度 (可选)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-9.4      ;.
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 ]
type = changestate
trigger1 = MatchOver = 1
value = 183

[state a]
type = ChangeState
trigger1 = PrevStateNo = 1055
value = 184

[state 180,斈梡]
type = changestate
trigger1 = time = 0
value = 181+random%2

;---------------------------------------------------------------------------
;获胜1
[statedef 181]
type = s
ctrl = 0
anim = 181
velset = 0,0
facep2 = 1

[state 181,彑棙億乕僘]
type = assertspecial
trigger1 = animtime <0
trigger1 = time <(55+415)
flag = roundnotover

[state 音效]
type = playsnd
trigger1 = time = 55
value = 181,0
channel = 0

;---------------------------------------------------------------------------
;获胜2
[statedef 182]
type=s
ctrl=0
anim=182
velset=0,0

[state 彑棙億乕僘]
type=assertspecial
trigger1=animtime<0
flag=roundnotover

;---------------------------------------------------------------------------
;获胜3
[statedef 183]
type = s
ctrl = 0
anim = 183
velset = 0,0
facep2 = 1

[state 移动]
type = velset
trigger1 = animelem = 4
x = -1.3

[State 0]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1

[state 声音]
type = playsnd
trigger1 = animelemtime(1) = 3
value = S820,0

[state 彑棙億乕僘]
type=assertspecial
triggerall = time >= 50
trigger1 =  backEdgebodydist >= -80
flag=roundnotover

;---------------------------------------------------------------------------
;获胜4
[statedef 184]
type = A
ctrl = 0
anim = 184
velset = 0,0
facep2 = 1

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

[State 0]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1

[State 瞬移图像]
type = Explod
trigger1 = animelem = 1
anim = 1250
id = 1215
sprpriority = 20
supermovetime = 9999
postype = p1
pos = 0,-60
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ontop = 1
ownpal = 1
scale = 0.45,0.45

[State 黑雾音效]
type = Playsnd
trigger1 = animelem = 1
value = S1000,2

[State 断言]
type = AssertSpecial
trigger1 = time = [0,150]
flag = roundnotover

;---------------------------------------------------------------------------
; 开场判定
[statedef 190]
type = s
ctrl = 0
velset = 0,0

[State 特开]
type = ChangeState
trigger1 = p2name = "Mr.Kyo_1.1" || p4name = "Mr.Kyo_1.1"
value = 193

[State 特开]
type = ChangeState
trigger1 = p2name = "Iori Clone-42" || p4name = "Iori Clone-42"
value = 194

[State 特开]
type = ChangeState
trigger1 = p2name = "Kyo Clone-57" || p4name = "Kyo Clone-57"
value = 196

[state 转入]
type = changestate
trigger1 = time = 0
value = 192

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

;---------------------------------------------------------------------------
; 开场1
; CNS难度：基本
[statedef 192]
type = s
ctrl = 0
anim = 192
velset = 0,0

[state 动作]
type = changeanim
trigger1 = roundstate = 0
value = anim

[state 开场断言]
type = assertspecial
trigger1 = 1
flag = intro

[state 声音]
type = playsnd
trigger1 = animelemtime(1) = 30
value = 191,0
channel = 0

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

;---------------------------------------------------------------------------
; 开场：MY kyo
; CNS难度：基本
[statedef 193]
type = s
ctrl = 0
anim = 193
velset = 0,0

[state 动作]
type = changeanim
trigger1 = roundstate = 0
value = anim

[state 开场断言]
type = assertspecial
trigger1 = 1
flag = intro

[state 声音]
type = playsnd
trigger1 = animelemtime(1) = 30
value = 170,0
channel = 0

[State 握拳音效]
type = Playsnd
trigger1 = animelem = 12
trigger2 = animelem = 16
value = 1,3

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

;---------------------------------------------------------------------------
; 开场：Iori 42
; CNS难度：基本
[statedef 194]
type = s
ctrl = 0
anim = 194
velset = 0,0

[state 动作]
type = changeanim
trigger1 = roundstate = 0
value = anim

[state 开场断言]
type = assertspecial
trigger1 = 1
flag = intro

[state 声音]
type = playsnd
trigger1 = animelemtime(1) = 295
value = 820,0
channel = 0

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

;---------------------------------------------------------------------------
; 开场：Kyo 57
; CNS难度：基本
[statedef 196]
type = s
ctrl = 0
anim = 196
velset = 0,0

[state 动作]
type = changeanim
trigger1 = roundstate = 0
value = anim

[state 开场断言]
type = assertspecial
trigger1 = 1
flag = intro

[state 声音]
type = playsnd
trigger1 = animelemtime(1) = 140
value = 820,0
channel = 0

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

;---------------------------------------------------------------------------
;挑衅
[Statedef 195]
type = S
movetype = I
physics = S
anim = 197
velset = 0
ctrl = 0

[State 可移动]
type = ctrlset
triggerall = AnimElem = 30
triggerALL = !VAR(59)
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
value = 1

[State 声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 195,0

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



;---------------------------------------------------------------------------
; 5A
; CNS难度：初级
[statedef 200]
type = s
movetype = a
physics = s
velset = 0,0
ctrl = 0
anim = 200

[state 挥击声音]
type = playsnd
trigger1 = animelemtime(2) = 0
value = 300,0

[state 攻击判定]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = 28
animtype = Light
getpower = 50
givepower = 15
guardflag = MA
hitflag = MAF
pausetime = 0,2
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-90
hitsound = S5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 14
ground.velocity = -2.5;-5
air.velocity = -2,-2.5
air.fall = 1
fall = 0
fall.recover = 0
p1sprpriority = 2
p2sprpriority = 0

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

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

;---------------------------------------------------------------------------
;近5C
[statedef 210]
type = S
movetype = A
physics = S
anim = 210
velset = 0
ctrl = 0
facep2 = 1

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,1

[state 攻击]
type = Hitdef
trigger1 = animelemtime(4) = 0
attr = S,NA
animtype = Medium
damage = 80,5
hitflag = MAF
guardflag = M
pausetime  = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-76
hitsound = S5,2
guardsound = S6,0
ground.type = High
ground.slidetime = 5
ground.hittime = 27
air.hittime = 12
ground.velocity = -4
air.velocity = -2.5,-4
getpower = 50,10
p1sprpriority = 0
p2sprpriority = 0
envshake.time = 10
envshake.ampl = 5
envshake.freq = 50

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

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

;---------------------------------------------------------------------------
;远5C-幻魔刻冲
[statedef 215]
type = S
movetype = A
physics = S
anim = 215
velset = 0
ctrl = 0
facep2 = 1

[State 移动]
type = PosAdd
Trigger1 = AnimElem = 1,>0
Trigger1 = AnimElem = 5,<0
x = 6

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,1

[state 攻击]
type = Hitdef
trigger1 = animelemtime(6) = 0
attr = S,NA
damage = 80,5
animtype = light
guardflag = HA
hitflag = MAF
priority = 4,hit
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-76
hitsound = S5,2
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 27
ground.velocity = -4,0
airguard.velocity = -1.9,.8
air.type = high
air.velocity = -4,1
air.hittime = 12
getpower = 50,10
p1sprpriority = 2
p2sprpriority = 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 = 40,-90
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

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

;---------------------------------------------------------------------------
;5B
[statedef 230]
type = S
movetype = A
physics = S
anim = 230
velset = 0
ctrl = 0

[State 挥空声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,0

[state 攻击]
type = HitDef
trigger1 = animelemtime(4) = 0
attr = S,NA
animtype = Medium
damage = 40,5
hitflag = MAF
guardflag = MA
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-37
hitsound = S5,1
guardsound = S6,0
ground.type = low
ground.slidetime = 5
ground.hittime = 15
ground.velocity = -5
air.velocity =-2.5,-3.5
getpower = 25,5
p1sprpriority = 2
p2sprpriority = 0

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

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

;---------------------------------------------------------------------------
;近5D
[statedef 240]
type = S
movetype = A
physics = S
anim = 240
velset = 0
ctrl = 0
facep2 = 1

[State 挥击音效]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(3) = 0
attr = S,NA
damage = 80,5
animtype = light
hitflag = MAF
guardflag = L
priority = 3,hit
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-40
hitsound = S5,3
guardsound = S6,0
ground.type = low
ground.slidetime = 5
ground.hittime = 27
ground.velocity = -2,0
airguard.velocity = -1.9,-0.8
air.velocity = -2,0
air.hittime = 12
getpower = 50,10
p1sprpriority = 2
p2sprpriority = 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 = 40,-30
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

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

;---------------------------------------------------------------------------
;远5D
[statedef 245]
type = S
movetype = A
physics = S
anim = 245
velset = 0
ctrl = 0
facep2 = 1

[State 移动]
type = PosAdd
Trigger1 = AnimElem=1,>0
Trigger1 = AnimElem=3,<0
x = 5

[State 挥击音效]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,1

[State 攻击]
type = Hitdef
trigger1 = animelem = 3
attr = S,NA
animtype = hard
damage = 78,7
getpower = 80,35
givepower = 35,15
guardflag = MA
hitflag = MAF
pausetime = 10,15
sparkno = -1
sparkxy = -10,-80
hitsound = s5,3
guard.sparkno = S7050
guardsound = s6,0
ground.type = high
ground.slidetime = 10
ground.hittime = 27
ground.velocity = -9,0
air.velocity = -9,-2
fall = 0
air.fall = 1
fall.recover = 0
p1sprpriority = 2
p2sprpriority = 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 = 50,-90
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

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

;---------------------------------------------------------------------------
; 2A
; CNS难度：初级
[statedef 400]
type = C
movetype = A
physics = C
anim = 400
velset = 0
ctrl = 0
facep2 = 1

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,0

[state 攻击]
type = HitDef
trigger1 = animelemtime(2) = 0
attr = C,NA
damage = 40,5
priority = 3
animtype = Light
hitflag = MAF
guardflag = M
pausetime = 5,5
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-42
hitsound = S5,0
guardsound = S6,0
ground.type = low
ground.slidetime = 4
ground.hittime = 15
ground.velocity = -2
air.velocity = -1.5,-3
getpower = 45,45
air.fall = 1
fall = 0
fall.recover = 0
p1sprpriority = 2
p2sprpriority = 0

[State 打击火花]
type = Explod
ownpal = 1
trigger1 = movehit = 1
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 = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;2C
[statedef 410]
type = C
movetype = A
physics = C
anim = 410
velset = 0
ctrl = 0
facep2 = 1

[State 0, PlayerPush]
type = PlayerPush;PlayerPush
trigger1 = var(50) = 3
value = 0

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(4) = 0
attr= C,NA
damage = 80,5
animtype = Medium
hitflag = MAF
guardflag = M
pausetime = 17,17
sparkno = -1
guard.sparkno = S7050
sparkxy  = -10,-55
hitsound  = S5,2
guardsound  =  S6,0
ground.type = low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -4
air.velocity = -3,-4
getpower = 91,91
p1sprpriority = 2
p2sprpriority = 0

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

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

;---------------------------------------------------------------------------
;2B
[statedef 430]
type = C
movetype = A
physics = C
anim = 430
velset = 0
ctrl = 0
facep2 = 1

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = 300,0

[state 攻击]
type = HitDef
trigger1 = animelemtime(3) = 0
attr = C,NA
damage = 40,5
animtype = Light
hitflag = MAF
guardflag = l
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-8
hitsound = S5,2
guardsound = S6,0
ground.type = low
ground.slidetime = 4
ground.hittime = 12
ground.velocity = -2.5
air.velocity = -2,-3
getpower = 45,45
p1sprpriority = 2
p2sprpriority = 0

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

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

;---------------------------------------------------------------------------
;2D
[statedef 440]
type = C
movetype = A
physics = C
anim = 440
velset = 0
ctrl = 0

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = S300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(4) = 0
attr = C,NA
damage = 80,5
hitflag = MAF
guardflag = l
pausetime = 12,12
sparkno = -1
guard.sparkno = S7050
sparkxy = -5,-10
hitsound = S5,3
guardsound = S6,0
ground.type = trip
ground.slidetime = 10
ground.hittime = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1
getpower = 91,91
p1sprpriority = 2
p2sprpriority = 0

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

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

;---------------------------------------------------------------------------
; 9A
; CNS难度：初级
[statedef 600]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(2) = 0
attr = A,NA
damage = 40,5
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-30
hitsound = S5,0
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 5
ground.velocity = -4
air.velocity = -1.3,-3
getpower = 45,45

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

;---------------------------------------------------------------------------
;9C
[statedef 610]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,1

[state 610,攻击]
type = HitDef
trigger1 = animelemtime(2) = 0
attr = A,NA
damage = 80,10
guardflag = HA
priority = 4
pausetime = 10,10
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-30
hitsound = S5,2
guardsound = S6,0
animtype = Med
ground.type = high
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -5
air.velocity = -3,-4
getpower = 91,91

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

;---------------------------------------------------------------------------
;9B
[statedef 630]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,0

[state 攻击]
type = HitDef
trigger1=animelemtime(2)=0
attr = A,NA
damage = 40,5
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-30
hitsound = S5,0
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 5
ground.velocity = -4
air.velocity = -1.3,-3
getpower = 45,45

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

;---------------------------------------------------------------------------
;9D
[statedef 640]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0
facep2 = 1

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 2
value = 300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(2) = 0
attr = A,NA
damage = 80,5
guardflag = HA
priority = 4
pausetime = 10,10
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-30
hitsound = S5,3
guardsound = S6,0
animtype = Med
ground.type = high
ground.slidetime = 15
ground.hittime = 28
ground.velocity = -5
air.velocity = -3,-4
getpower = 91,91

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

;---------------------------------------------------------------------------
;9CD
[statedef 650]
type = A
movetype = A
physics = A
anim = 620
ctrl = 0
FACEP2 = 1

[State 挥击声音]
type = PlaySnd
trigger1 = AnimElem = 1
value = S300,1

[state 攻击]
type = HitDef
trigger1 = animelemtime(2)=0
attr = A,NA
damage = 80,5
guardflag = HA
animtype = light
hitflag = MAF
priority = 3,hit
pausetime = 15,15
sparkno = -1
guard.sparkno = S7050
sparkxy = -10,-30
hitsound = S5,4
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 10
ground.velocity = -11;-5,-3
air.velocity = -15,3
air.hittime = 20
fall = 1
fall.recover = 0
id = 650
getpower = 50,10
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 = 75,-55
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.45,0.45
trans = addalpha
alpha = 256, 256

;---------------------------------------------------------------------------
;CD
[statedef 350]
type = S
movetype = A
physics = S
anim = 350
velset = 0
ctrl = 0

[state 挥击声音]
type = playsnd
trigger1 = time = 1
value = 320,0

[state 攻击]
type = Explod
trigger1 = time = 1
anim = 351
id = 350
pos = 10,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
sprpriority = 2
supermovetime = 9999
ownpal = 1
removeongethit = 1

[state 攻击]
type = HitDef
trigger1 = animelemtime(4) = 0
attr = S,NA
damage = 120,15
animtype = light
hitflag = MAF
guardflag = MA
priority = 3,hit
pausetime = 15,15
sparkno = 4128
guard.sparkno = 42
sparkxy = -10,-76
hitsound = S5,4
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 10
ground.velocity = -11,-3
air.type = high
air.velocity = -11,-3
air.hittime = 12
fall = 1
fall.recover = 0
p2facing = 1
id = 350
getpower = 50,10
envshake.time = 10
envshake.ampl = 5
envshake.freq = 50

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

;---------------------------------------------------------------------------
;刚CD
[statedef 351]
type = S
movetype = A
physics = S
anim = 350
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 = animtime != 0
trigger1 = animelemtime(5) < 0
value = sca

[state 科技音效]
type = playsnd
trigger1 = time = 1
value = 320,0

[state 图片]
type = explod
trigger1 = time = 1
anim = 351
id = 350
pos = 10,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
sprpriority = 2
ownpal = 1
removeongethit = 1

[state 攻击]
type = HitDef
trigger1 = animelemtime(4) = 0
attr = S,NA
damage = 120,15
animtype = light
hitflag = maf
guardflag = ma
priority = 3,hit
pausetime = 15,15
sparkno = 4128
guard.sparkno = 42
sparkxy = -10,-76
hitsound = S5,4
guardsound = S6,0
ground.type = high
ground.slidetime = 5
ground.hittime = 10
ground.velocity = -11;-5,-3
air.type = high
air.velocity = -5,-3
air.hittime = 12
fall = 1
fall.recover = 0
p2facing = 1
id = 350
envshake.time = 10
envshake.ampl = 5
envshake.freq = 50

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

;---------------------------------------------------------------------------
; 投技(尝试)—邪骸喰刹
; 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
ctrl = 0
anim = 800
velset = 0

[state 攻击]
type = HitDef
trigger1 = time = 0
attr = S,NT
hitflag = M-
priority = 1,miss
sparkno = 9
sparkxy = -15,-100
hitsound = S9999,0
p1facing = 1
p2facing = 1
p1stateno = 801
p2stateno = 810
numhits = 0
guard.dist = 0
fall = 1
id = 800

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

;---------------------
; 邪骸喰刹-过程
;---------------------
[Statedef 801]
type    = S
movetype= A
physics = N
anim = 801
velset = 0
sprpriority = 1

[State 抓取火花]
type = Explod
ownpal = 1
trigger1 = time = 3
anim = 7100
sprpriority = 20
postype = p1
pos = 49,-105
bindtime = 1
ignorehitpause = 1
persistent = 0
under = 0
ownpal = 1
scale = 0.5,0.5
trans = addalpha
alpha = 256, 256

[State 砸地特效]
type = Explod
trigger1 = AnimElem = 14
anim = 1160
postype = p2
pos = 20,12
scale = 0.3,0.3
sprpriority = 4
bindtime = 1
ownpal = 1

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

[State 改变距离]
type = Width
trigger1 = Time = 0
edge = 80,0
value = 80,0

[State 抓取音效]
type = PlaySnd
trigger1 = AnimElem = 3
value = S800,0

[State 丢出音效]
type = PlaySnd
trigger1 = AnimElem = 11
value = S800,1

[State 人物层数]
type = Sprpriority
trigger1 = AnimElem = 11
value = 2

[State 扣血]
type = TargetLifeAdd
trigger1 = AnimElem = 14
value = -135*(1 + fvar(35))

[State 砸地音效]
type = PlaySnd
trigger1 = AnimElem = 14
value = S800,4

[State 震屏]
type = EnvShake
trigger1 = AnimElem = 14
time = 20
ampl = -6
freq = 90
phase = 90

[State 面朝向]
type = Turn
trigger1 = AnimTime = 0

[State 位置]
type = PosAdd
trigger1 = Backedgebodydist < 10
Trigger1 = animelem = 12
X = 40

[State 移动]
type = TargetBind
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 4, < 0
pos = 45,0

[State 移动]
type = TargetBind
trigger1 = AnimElem = 4, >= 0
trigger1 = AnimElem = 9, < 0
pos = 45,-114

[State 移动]
type = TargetBind
trigger1 = AnimElem = 9, >= 0
trigger1 = AnimElem = 10, < 0
pos = 48,-114

[State 移动]
type = TargetBind
trigger1 = AnimElem = 10, >= 0
trigger1 = AnimElem = 11, < 0
pos = 37,-123

[State 移动]
type = TargetBind
trigger1 = AnimElem = 11, >= 0
trigger1 = AnimElem = 12, < 0
pos = 35,-125

[State 移动]
type = TargetBind
trigger1 = AnimElem = 12, >= 0
trigger1 = AnimElem = 13, < 0
pos = 0,-130

[State 移动]
type = TargetBind
trigger1 = AnimElem = 13, >= 0
trigger1 = AnimElem = 14, < 0
pos = -39,-95

[State 移动]
type = TargetBind
trigger1 = AnimElem = 14, >= 0
trigger1 = AnimElem = 15, < 0
pos = -42,-10

[State 移动]
type = TargetState
trigger1 = AnimElem = 15
value = 811

[State 位置]
type = PosAdd
trigger1 = AnimTime = 0
x = 7

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

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

[State 1无敌]
type = NotHitBy
trigger1 = 1
value = SCA, NA, SA, NP, SP, NT, ST

[State P2号]
type = ChangeAnim2
trigger1 = Time = 0
value = 810

[State 屏幕检测]
type = ScreenBound
trigger1 = 1
movecamera = 1,0

;---------------------
; 邪骸喰刹-P2过程
;---------------------
[Statedef 811]
type    = A
movetype = H
physics = N
ctrl = 0
velset = 3.8,-5

[State P2号]
type = ChangeAnim2
trigger1 = Time = 0
value = 811

[State 速度]
type = veladd
trigger1 = 1
y = .45

[State P2回到自己号]
type = SelfState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 5100


;--------------------------------
; 前闪避
;--------------------------------
[Statedef 820]
type = S
physics = N
velset = 0,0
anim = 820
ctrl = 0
sprpriority = -1

[State 无敌]
type = NotHitBy
trigger1 = 1
value = ,AA, AP
time = 7

[State 无敌]
type = NotHitBy
trigger1 = Time = 0
value2 = ,AT
time = 25

[State 速度]
type = VelSet
trigger1 = AnimElem = 2
x = 5.5

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

[State 停止]
type = VelSet
trigger1 = AnimElem = 9
x = 0

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

[State 残影]
type = Afterimage
trigger1 = AnimElem = 2
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

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

;--------------------------------
; 前闪避（耗气）
;--------------------------------
[Statedef 821]
type = S
physics = N
velset = 0,0
anim = 820
poweradd = -1000
ctrl = 0
sprpriority = -1

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

[State 无敌]
type = Pause
trigger1 = Time = 0
time = 6
movetime = 6

[State 820, 8]
type = VelSet
trigger1 = AnimElem = 2
x = 5.5

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

[State 停止]
type = VelSet
trigger1 = AnimElem = 9
x = 0

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

[State 残影]
type = Afterimage
trigger1 = AnimElem = 2
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

[State 背景色]
type = BGPalFX
trigger1 = Time = 0
time = 4
add = 255,255,255

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

;--------------------------------
; 后闪避
;--------------------------------
[Statedef 825]
type = S
physics = N
velset = 0,0
anim = 825
ctrl = 0
sprpriority = -1

[State 无敌]
type = NotHitBy
trigger1 = 1
value = ,AA, AP
time = 7

[State 无敌]
type = NotHitBy
trigger1 = Time = 0
value2 = ,AT
time = 25

[State 速度]
type = VelSet
trigger1 = AnimElem = 2
x = -5.8

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

[State 停止]
type = VelSet
trigger1 = AnimElem = 9
x = 0

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

[State 残影]
type = Afterimage
trigger1 = AnimElem = 2
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

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

;--------------------------------
; 后闪避（耗气）
;--------------------------------
[Statedef 826]
type = S
physics = N
velset = 0,0
poweradd = -1000
anim = 825
ctrl = 0
sprpriority = -1

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

[State 无敌]
type = Pause
trigger1 = Time = 0
time = 6
movetime = 6

[State 速度]
type = VelSet
trigger1 = AnimElem = 2
x = -6.8

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

[State 停止]
type = VelSet
trigger1 = AnimElem = 9
x = 0

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

[State 音效]
type = Afterimage
trigger1 = AnimElem = 2
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

[State 背景色]
type = BGPalFX
trigger1 = Time = 0
time = 4
add = 255,255,255

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

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

[State 音效]
type = PlaySnd
trigger1 = AnimElem >= 1
trigger1 = Random <= 350
value = 820,0
channel = 0

[State 无敌]
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA
time = 5

[State 防推挤]
type = PlayerPush
trigger1 = AnimElemTime(1) > 0
value = 0

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

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 840]
type     = S
movetype = A
physics  = S
anim     = 840
velset   = 0,0
sprpriority = 2

[State 位移]
type = VelSet
trigger1 = animelem = 18
x = 8

[State 位移结束]
type = VelSet
trigger1 = animelem = 20
x = 0

[State 打击定义]
type = HitDef
trigger1 = animelem = 20
attr = S,HT
hitflag = MAF     
damage = 60 
priority = 7,Hit
guard.sparkno = s-1
sparkno = s-1
sparkxy = -25, -65
hitsound = s3,4
guardsound = s-1,0
p1sprpriority = 1     
p2sprpriority = 0  
pausetime = 3, 999
guard.pausetime = 3, 10
p1facing = 1          
p2facing = 1         
p2stateno = 850
guard.dist = 0        
fall = 1     
kill = 0

[State 打击火花]
type = Explod
trigger1 = movehit = 1
anim = 7055
pos = 30,-35
postype = p2  ;p2,front,back,left,right
scale = 0.45,0.45
under = 0
ontop = 1
pausemovetime = 999
supermovetime = 999    

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

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 841]
type = S
movetype = A
physics = S
anim = 841
velset = 0
ctrl = 0
sprpriority = 2

[State 裙子音效]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1000,1

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

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 842]
type = S
physics = N
velset = 0,0
anim = 825
ctrl = 0
sprpriority = -1

[State 无敌]
type = NotHitBy
trigger1 = 1
value = ,AA, AP
time = 7

[State 无敌]
type = NotHitBy
trigger1 = Time = 0
value2 = ,AT
time = 25

[State 速度]
type = VelSet
trigger1 = AnimElem = 2
x = -4

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

[State 停止]
type = VelSet
trigger1 = AnimElem = 9
x = 0

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

[State 残影]
type = Afterimage
trigger1 = AnimElem = 2
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

[State 归零]
type = ChangeState
trigger1 = time >= 23
value = 843

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 843]
type = S
movetype = A
physics = S
anim = 310
velset = 0,0
ctrl = 0

[State 移动]
type = PosAdd
Trigger1 = AnimElem=1,>0
Trigger1 = AnimElem=4,<0
x = 15

[State 残影]
type = Afterimage
trigger1 = time = 0
time = 9
length = 8
palbright = 40,40,40
palcontrast = 250,250,250
palpostbright = -80,-80,-80
timegap = 1
framegap = 3
trans = add1

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

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

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 844]
type    = S
movetype= A
physics = S
ctrl = 0
velset = 0,0
anim = 844
sprpriority = 3

[State 脸朝向]
type = Turn
trigger1 = AnimElem = 2

[State Helper]
type = Helper
trigger1 = time = 53
ID = 6020
postype = p1
pos = 0,-70
Stateno = 6020
supermovetime = 9999
pausemovetime = 9999
keyctrl = 0
ownpal = 1

[State 光圈音效]
type = Playsnd
trigger1 = time = 53
value = S3200,10

[State 光圈音效]
type = Playsnd
trigger1 = time = 53
value = S3200,11

[State 光圈音效]
type = Playsnd
trigger1 = time = 53
value = S3200,12

[state 攻击]
type = Hitdef
trigger1 = time = 54
ID = 3210
attr = ,HA
animtype = Medium
damage = 0,5
hitflag = MAF
guardflag = HA
pausetime  = 0,13
sparkno = -1
guard.sparkno = S7050
hitsound = S-1,0
guardsound = S-1,0
ground.type = High
ground.slidetime = 0
ground.hittime = 20
ground.velocity = 0
air.velocity = 0,0
p2stateno = 851
envshake.time = 18
envshake.freq = 120
envshake.ampl = 4
kill = 0

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

;---------------------
;拆投-对应Thunder
;---------------------
[Statedef 845]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 845
sprpriority = 2

[State 裙子音效]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 12
trigger3 = AnimElem = 22
trigger4 = AnimElem = 32
value = S1,2

[State 飞道]
type = Projectile
trigger1 = AnimElem = 9
trigger2 = AnimElem = 29
projID = 1450
projanim = 1455
projscale = 0.3,0.3
projremove = 0
projremovetime = -1
velocity = 17,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projmisstime = 1
projpriority = 99
projsprpriority = 3
offset = 80,-80
postype = p1
attr = S, SP
damage = 50,5
animtype = Hard
guardflag = M
hitflag = MAF
pausetime = 0,8
guard.pausetime = 0,12
hitsound = S5,6
guardsound = S6,0
sparkxy = 15,-10
sparkno = -1
guard.sparkno = s7050
ground.type = high
ground.slidetime = 25
ground.hittime = 23
ground.velocity = -5.5
air.velocity = -4,-6
Projedgebound = 70
ignorehitpause = 1
air.fall = 1
fall = 0
fall.recover = 0
envshake.time = 8
envshake.freq = 120
envshake.ampl = 5
envshake.phase = 120
fall.envshake.time = 0
supermovetime = 9999
kill = 0

[State 攻击]
type = Projectile
trigger1 = AnimElem = 18
trigger2 = AnimElem = 38
projID = 1450
projanim = 1455
projscale = 0.3,0.3
projremove = 0
projremovetime = -1
velocity = 17,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projmisstime = 1
projpriority = 99
projsprpriority = 3
offset = 120,-80
postype = p1
attr = S, SP
damage = 40,5
animtype = Hard
guardflag = M
hitflag = MAF
pausetime = 0,17
guard.pausetime = 0,12
hitsound = S5,6
guardsound = S6,0
sparkxy = 15,-10
sparkno = -1
guard.sparkno = s7050
ground.type = high
ground.slidetime = 25
ground.hittime = 23
ground.velocity = -5.5
air.velocity = -4,-6
Projedgebound = 70
ignorehitpause = 1
air.fall = 1
fall = 0
fall.recover = 0
envshake.time = 8
envshake.freq = 120
envshake.ampl = 5
envshake.phase = 120
fall.envshake.time = 0
kill = 0

[State 攻击]
type = Projectile
trigger1 = AnimElem = 20
projID = 1450
projanim = 1455
projscale = 0.25,0.25
projremove = 0
projremovetime = -1
velocity = 17,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projmisstime = 1
projpriority = 99
projsprpriority = 3
offset = 120,-67
postype = p1
attr = S, SP
damage = 10,3
animtype = Hard
guardflag = M
hitflag = MAF
pausetime = 0,17
guard.pausetime = 0,12
hitsound = S5,6
guardsound = S6,0
sparkxy = 15,-10
sparkno = -1
guard.sparkno = s7050
ground.type = high
ground.slidetime = 25
ground.hittime = 23
ground.velocity = -5.5
air.velocity = -4,-6
Projedgebound = 70
ignorehitpause = 1
air.fall = 1
fall = 0
fall.recover = 0
envshake.time = 8
envshake.freq = 120
envshake.ampl = 5
envshake.phase = 120
fall.envshake.time = 0
kill = 0

[State 攻击]
type = Projectile
trigger1 = AnimElem = 40
projID = 1450
projanim = 1455
projscale = 0.25,0.25
projremove = 0
projremovetime = -1
velocity = 17,0
remvelocity = 0,0
accel = 0,0
projhits = 1
projmisstime = 1
projpriority = 99
projsprpriority = 3
offset = 120,-67
postype = p1
attr = S, SP
damage = 10,3
animtype = Hard
guardflag = M
hitflag = MAF
pausetime = 0,17
guard.pausetime = 0,12
hitsound = S5,6
guardsound = S6,0
sparkxy = 15,-10
sparkno = -1
guard.sparkno = s7050
ground.type = high
ground.slidetime = 25
ground.hittime = 23
ground.velocity = -5.5
air.velocity = -4,-6
Projedgebound = 70
ignorehitpause = 1
air.fall = 1
fall = 0
fall.recover = 0
envshake.time = 8
envshake.freq = 120
envshake.ampl = 5
envshake.phase = 120
fall.envshake.time = 0
p2stateno = 852
kill = 0

[State Helper]
type = Helper
trigger1 = time = 115
ID = 6030
postype = p1
pos = 0,-70
Stateno = 6030
supermovetime = 9999
pausemovetime = 9999
keyctrl = 0
ownpal = 1

[State 光圈音效]
type = Playsnd
trigger1 = time = 115
value = S3200,10

[State 光圈音效]
type = Playsnd
trigger1 = time = 115
value = S3200,11

[State 光圈音效]
type = Playsnd
trigger1 = time = 115
value = S3200,12

[State 归零]
type = ChangeState
trigger1 = P2dist X <15
value = 846

[State 归零]
type = ChangeState
trigger1 = time >= 200
value = 0
ctrl = 1

;---------------------
;拆投-对应Thunder
;---------------------
[statedef 846]
type = S
movetype = A
physics = S
ctrl = 0
anim = 800
velset = 0

[State 闪屏]
type = Envcolor
trigger1 = time = 0
ignorehitpause = 1
value = 255, 255, 255
time = 7
under = 0

[state 声音]
type = playsnd
trigger1 = time = 0
value = S820,0

[state 攻击]
type = HitDef
trigger1 = time = 0
attr = ,NT
hitflag = MAF
priority = 1,miss
sparkno = 9
sparkxy = -15,-100
hitsound = S9999,0
p1facing = 1
p2facing = 1
p1stateno = 801
p2stateno = 810
numhits = 0
guard.dist = 0
fall = 1
id = 800

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

;---------------------
;拆投-对应Thunder(p2)
;---------------------
[Statedef 850]
type     = S
movetype = H
physics  = N
velset = 0,0
sprpriority = 1

[State 屏幕震动]
type = EnvShake
trigger1 = Time = 0
time = 15
freq = 15
ampl = -10
phase = 22

[State 位移]
type = VelSet
trigger1 = animelem = 1
x = -2

[State 位移结束]
type = VelSet
trigger1 = animelem = 7
x = 0

[state P2号]
type = ChangeAnim2
Trigger1 = Time = 0
value = 850

[state 结束移动]
type = velset
trigger1 = pos y >= 0
y = 0

[state fall值还原]
type = Hitfallset
trigger1 = 1
value = 0

[state P2坐标]
type = posset
trigger1 = 1
y = 0

[State 定义在站立]
type = StateTypeSet
trigger1 = Pos Y = 0
statetype = S

[State 回到自身号]
type = SelfState
trigger1 = Animtime = 0
value = 2101
ctrl = 1

;---------------------
;拆投-对应Thunder(p2)
;---------------------
[Statedef 851]
type    = S
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State is]
type = destroySelf
trigger1 = ishelper

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

[State fa]
type = hitfallSet
trigger1 = time = 0
value = 0

[state -2]
type = Posset
Trigger1 = Time = 0
y = 0

[State 52, 1]
type = VelSet
trigger1 = time = 0
y = 0

[State 1830]
type = ChangeAnim2
Trigger1 = Time = 0
value = 851

[State 1830]
type = SelfState
trigger1 = Animtime = 0
value = 0
ctrl = 1

;---------------------
;拆投-对应Thunder(p2)
;---------------------
[Statedef 852]
type    = S
movetype= H
physics = N
velset = 0,0
sprpriority = 0

[State is]
type = destroySelf
trigger1 = ishelper

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

[State fa]
type = hitfallSet
trigger1 = time = 0
value = 0

[state -2]
type = Posset
Trigger1 = Time = 0
y = 0

[State 52, 1]
type = VelSet
trigger1 = time = 0
y = 0

[State 52, 1]
type = VelSet
trigger1 = time >= 50
x = 10

[State 1830]
type = ChangeAnim2
Trigger1 = Time = 0
value = 852

[State 1830]
type = SelfState
trigger1 = Animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; 功夫掌
; CNS难度：中级
; 这个有点像普通攻击，但是有一些差别。
; 这个state里有两个HitDef，一个在对手靠近时触发（用p2bodydist检测）,
; 另外一个在对手比较远的时候触发。这两个版本的主要区别是近版本的有一个fall=1参数，
; 这样对手被击中后会倒地。其他的细微区别是伤害和对手的速度等等。
; "attr = S, SA"代表这是一个站立的特殊攻击（必杀技）。
; 请务必把所有的HitDef的属性正确设置。

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

;---------------------------------------------------------------------------
[Statedef -2]
;---------------------------------------------------------------------------

[State -2, guarding sound]
type = PlaySnd
trigger1 = Stateno = 160 && time = 1
trigger2 = stateno = 161 && time = 1
trigger3 = Stateno = 162 && time = 1
value = S0,123;128
persistent = 0

[State 音效]
type = StopSnd
trigger1 = Stateno != 3110
channel = 2

[State 音效]
type = StopSnd
trigger1 = stateno != 3310
channel = 5

[State 音效]
type = StopSnd
trigger1 = stateno != 3910
channel = 6

[State 特效删除]
type = removeExplod
trigger1 = stateno != 1020
id = 166

[State 特效删除]
type = removeExplod
trigger1 = stateno != [3900,3910]
id = 3930

[State 特效删除]
type = removeExplod
trigger1 = stateno != 3910
id = 3935

;---------------------
;肾虚开关（ 1;开  0;关 ）
;---------------------
[State 肾虚]
type = ChangeState  
value = 4000
triggerall = 0             ;开关
triggerall =! (stateno=5900&&ctrl=0)
triggerall =! (stateno=[3200,3299])
triggerall =! (stateno=[3400,3999])
triggerall =! (stateno=[800,899])
triggerall =! (stateno=[170,196])
triggerall =! (stateno=[1000,1050])
triggerall = roundstate = 2
trigger1 = statetype = S
trigger1 = movetype != H
trigger1 = helper(9998),var(25) = [(10001-(ceil((helper(9998),var(51))*(1+(helper(9998),fvar(10)))))),10001]
trigger1 = gametime%60 = 0
ignorehitpause = 1

[state helper]
type = Helper
trigger1 = numhelper(9998) = 0
id = 9998
name = "肾虚记录"
sprpriority = 1
pos = 0,0
postype = p1
stateno = 9998
helpertype = normal
pausemovetime = 99999999
supermovetime = 99999999
keyctrl = 0 
ownpal = 0

[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 = helper
triggerall = stateno = 1020
trigger1 = movetype = I
trigger1 =  NUMhelper(1022) = 0
stateno = 1022
id = 1022
name = "ZHAO"
pos = 0,0
postype = P1
helpertype = normal
keyctrl = 0
ownpal = 1
PERSISTENT = 1
ignorehitpause = 1

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

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

[state 砸地特效]
type = explod
trigger1 = p2stateno = 1045
trigger1 = enemy,time = 1
trigger1 = p2movetype = H
postype = p2
anim = 1160
pos = 0,-5
scale = 0.3,0.3
sprpriority = 4
bindtime = 1
ownpal = 1

[State 砸地音效]
type = PlaySnd
trigger1 = p2stateno = 1043
trigger1 = enemy,time = 1
value = S800,4

; [Statedef -3]
;---------------------------------------------------------------------------
[Statedef -3]

;每当功夫人跳跃落地或者后跃时播放的声音
[State 音效]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

[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
length = 12
Palcolor = 0
PalContrast = 110,110,225
PalAdd      =  0,0,85
trans = add1
TimeGap  = 1
FrameGap = 4
ignorehitpause = 1


