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

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

[Data]
;起始HP
life = 1000

;气条数（1000就是一气）
power = 5000 
   
;攻击力（数值高更强）
attack = 100

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

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

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

;Juggle点数
airjuggle = 15

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

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

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

;音量调节 (负数声音减小)
volumescale = 100

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

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

[Velocity]
walk.fwd  = 3.0      ;前进速度
walk.back = -2.8     ;后退速度
run.fwd  = 6.2, 0    ;跑步速度 (x, y)
run.back = -5,0 ;后跃速度 (x, y)
jump.neu = 0,-10    ;跳速度 (x, y)
jump.back = -3.3   ;后跳速度 (x, y)
jump.fwd = 3.3       ;前跳速度 (x, y)
runjump.back = -2.55,-8.1 ;跑跳速度 (可选)
runjump.fwd  = 4.2,-8.7    ;.
airjump.neu = 0,-6.5      ;.
airjump.back = -2.5      ;二段跳速度 (可选)
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 = .56          ;重力加速度
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专用**

;---------------------------------------------------------------------------
; 变量表:
; 这是功夫人用的变量列表。
; 记录下你用的变量可以减少你的工作量。
; 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 191, playsnd]
type = playsnd
trigger1 = animelem = 2
value = 170,0

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

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

[State 180,]
type = VarRandom
trigger1 = 1
v = 21
range = 0,1

[State 180,]
type = ChangeState
triggerall = !ishelper
trigger1 = NumHelper(8550)
value = 188

[State 180,]
type = ChangeState
triggerall = !ishelper
trigger1 = Time = 1
trigger1 = var(21) = 0
value = 181

[State 180,]
type = ChangeState
triggerall = !ishelper
trigger1 = Time = 1
trigger1 = var(21) = 1
value = ifelse(Random <= 500,182,183)

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

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

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 1
value = 180,5
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 30
value = 180,0
channel = 0

[State 181, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,150]
flag = RoundNotOver

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; 胜利姿势2
; CNS难度：基本
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0
sprPriority = 1

[State 182, 柍揋]
type = NotHitBy
trigger1 = 1
value = SCA

[State 181, 特殊効果]
type = AssertSpecial
trigger1 = animelemtime(21) < 80
flag = RoundNotOver

[state -2, helper]
type = helper
trigger1 = time = 0
trigger1 = !numhelper(185)
ID = 185
pos = ceil(-240),0
postype = p1
stateno = 184
helpertype = normal
name = "イトカツ"
sprpriority = 5
ownpal = 1
keyctrl = 0
Size.ShadowOffset = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 6100, 傾僯儊曄峏]
type = ChangeAnim
trigger1 = numhelper(185)
trigger1 = helper(185),anim = 184
trigger1 = helper(185),animelem = 10
value = 182
elem = 3
persistent = 0

[State 181, playsnd]
type = playsnd
trigger1 = animelem = 2,=20
value = 180,1
channel = 0

[State 181, playsnd]
type = playsnd
trigger1 = animelem = 3
value = 180,2
channel = 0

[State 181, playsnd]
type = playsnd
trigger1 = animelem = 19
value = 180,3
channel = 0

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; 胜利姿势3
; CNS难度：基本
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 182, 柍揋]
type = NotHitBy
trigger1 = 1
value = SCA

[State 181, 特殊効果]
type = AssertSpecial
trigger1 = animelemtime(23) < 80
flag = RoundNotOver

[state -2, helper]
type = helper
trigger1 = animelem = 2
trigger1 = !numhelper(185)
ID = 185
pos = ceil(-240),0
postype = p1
stateno = 186
helpertype = normal
name = "イトカツ"
sprpriority = 2
ownpal = 1
keyctrl = 0
Size.ShadowOffset = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 6100, 傾僯儊曄峏]
type = ChangeAnim
trigger1 = numhelper(185)
trigger1 = helper(185),anim = 186
value = 183
elem = 6
persistent = 0

[State -2, VelSet]
type = VelSet
trigger1 = animelem = 6
x = 4.0

[State -2, VelMul]
type = VelMul
trigger1 = animelemtime(6) >= 0
trigger1 = animelemtime(8) < 0
x = .85

[State -2, VelSet]
type = VelSet
trigger1 = animelem = 8
x = 0

[State 181, playsnd]
type = playsnd
trigger1 = animelem = 3
value = 180,4
channel = 0

[State 181, playsnd]
type = playsnd
trigger1 = animelem = 6
value = 180,5
channel = 0

;---------------------------------------------------------------------------
; 胜利姿势4
; CNS难度：基本
[Statedef 188]
type = S
ctrl = 0
anim = 188
velset = 0,0

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

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 1
value = 180,5
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 38
value = 180,5
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 66
value = 180,0
channel = 0

[State 181, 特殊断言]
type = AssertSpecial
trigger1 = time = [0,200]
flag = RoundNotOver

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

;---------------------------------------------------------------------------
;开场动作判定
[Statedef 190]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 190,]
type = ChangeState
trigger1 = Time = 1
value = ifelse(random<500,191,192)

;---------------------------------------------------------------------------
; 开场1
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0
sprpriority = 0

[State 0, 全力解放]
type = VarSet
trigger1 = RoundNo >= 3
v = 8
value = 1000
ignorehitpause = 1
persistent = 1

[State 191, 傾僯儊曄峏]
type = ChangeAnim
trigger1 = RoundState = 0
value = 191

[state -2, helper]
type = helper
trigger1 = time = 0
ID = 10092
pos = 0,0
postype = p1
stateno = 10092
helpertype = normal
name = "イトカツ"
sprpriority = 2
ownpal = 1
keyctrl = 0
Size.ShadowOffset = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 10000, Explod]
type = Explod
trigger1 = animelem = 3,=3
anim = 10091
pos =  0,0
postype = p1
sprpriority = 1
bindtime = -1
ownpal = 0
scale = 1.1,1.1

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 1,=30
value = 190,0
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 1,=110
value = 190,1
channel = 0

[State 191, 摿庩岠壥]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 僗僥乕僩曄峏]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; 开场2
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0
sprpriority = 0

[State 0, 全力解放]
type = VarSet
trigger1 = RoundNo >= 3
v = 8
value = 1000
ignorehitpause = 1
persistent = 1

[State 191, 傾僯儊曄峏]
type = ChangeAnim
trigger1 = RoundState = 0
value = 192

[state -2, helper]
type = helper
trigger1 = time = 0
ID = 10093
pos = 0,0
postype = p1
stateno = 10093
helpertype = normal
name = "袍子"
sprpriority = 0
ownpal = 0
keyctrl = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[state -2, helper]
type = helper
trigger1 = roundstate = 1
trigger1 = !numhelper(10095)
ID = 10095
pos = ceil(220),ceil(-180)
postype = p1
stateno = 10095
helpertype = normal
name = "白鸽"
sprpriority = 1
ownpal = 1
keyctrl = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)
persistent = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 2
value = 190,2
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 7
value = 190,3
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 17
value = 190,4
channel = 0

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 20
value = 190,5
channel = 0

[State 191, 摿庩岠壥]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 僗僥乕僩曄峏]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

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

[State 195, ctrlset]
type = CtrlSet
triggerall = time = 14
trigger1 = roundstate = 2
value = 1

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 5
value = 195,0
channel = 1

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 16
trigger2 = animelem = 21
value = 195,1

[State 195, 僗僥乕僩曄峏]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 挑拨2
[Statedef 196]
type     = S
movetype = I
physics  = S
anim     = 196
velset   = 0,0
ctrl     = 0
facep2   = 1

[State 191, playsnd]
type = playsnd
trigger1 = animelem = 8
value = 196,0
channel = 0

[State 195, 僗僥乕僩曄峏]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;超重击
[Statedef 300]
type     = S
movetype = A
physics  = S
juggle   = 0
poweradd = 0
ctrl     = 0
velset   = 0,0
anim     = 300
sprpriority = 3

[State 300 , 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
animtype  = Hard
hitflag = MAF
guardflag = L
damage    = 80
priority = 5
pausetime = 13,14
sparkno = s4010
guard.sparkno = s4110
sparkxy = -15,-40
hitsound = S2,6+random%2
guardsound = S3,1
hitflag = MAF
guardflag = MA
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -5,-5
air.velocity = -5,-5
air.animtype = Back
fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 300, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 5
value = 0,3

[State 300, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 7
value = 4,1

[State 300, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;空中超重击
[Statedef 650]
type     = A
movetype = A
physics  = A
juggle   = 0
poweradd = 0
ctrl     = 0
anim     = 650
sprpriority = 3

[State 240 , 1]
type = HitDef
trigger1 = time = 0
attr = A, NA
animtype  = Hard
damage    = 80
priority = 5
pausetime = 11,12
sparkno = s4010
guard.sparkno = s4110
sparkxy = -25,-60
hitsound = S2,6+random%2
guardsound = S3,1
hitflag = MAF
guardflag = MA
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -5,-5
air.velocity = -5,-5
air.animtype = Back
fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 6
value = 0,2

[State 300, 音を鳴らす]
type = PlaySnd
trigger1 = animelem = 8
value = 4,1
;---------------------------------------------------------------------------
;闪避前
[Statedef 700]
type = S
physics = S
anim = 700
sprpriority = -1
poweradd = 0; 0
velset = 0,0
ctrl = 0

;---------------------------------------------------------------------------
;转身
[State 0, 转身]
type = Turn
triggerall = ((enemynear(var(58)),pos X)-pos X)*facing < 0
trigger1 = animelem = 1,=0
ignorehitpause = 1
persistent = 1

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

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
value = S5200,0

[State 700,]
type = SuperPause
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
anim = -1
movetime = 16
time = 16
darken = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, snd]
type = PlaySnd
trigger1 = random%2 = 1
trigger1 = AnimElem = 3
value = s0,2
volumescale = 50

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 2
value = s50,0

[State 0, 保护01]
type = NotHitBy
trigger1 = (helper(40100),var(15) = 0)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 2
ignorehitpause = 1
persistent = 1

[State 0, 保护02]
type = NotHitBy
trigger1 = (helper(40100),var(15) = 1)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 5
ignorehitpause = 1
persistent = 1

[State 0, 记录闪避成功]
type = VarSet
triggerall = !ishelper
triggerall = var(59) >= 1
triggerall = var(18) <= 0
trigger1 = AnimElem = 1,=1
trigger1 = prevstateno = [150,155]
v = 18
value = 65
ignorehitpause = 1
persistent = 0

[State 350, snd]
type = Poweradd
trigger1 = (palno <= 3) && (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = AnimElem = 1
value = -500

[State 1000, AfterImage]
type = AfterImage
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
time = 2
length = 11
timegap = 1
paladd = 60,20,100
PalContrast = 220,200,350
palcolor = 0
framegap = 3

[State 1000, Afterimage]
type = Afterimage
trigger1 = prevstateno != [150,155]
trigger1 = time = 0
time = 2
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
trigger1 = animelem = 7, < 0
time = 2

[State 9520, 51]
type = EnvColor
trigger1 = (helper(40100),var(15) = 0)
trigger1 = animelem = 1
trigger1 = prevstateno = [150,155]
value = 255,255,255
time = 3

[State 705, 1]
type = velset
trigger1 = Time = [7,25]
x = 5

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

;---------------------------------------------------------------------------
;闪避後
[Statedef 710]
type = S
physics = S
anim = 710
poweradd = 0; 0
sprpriority = -1
velset = 0,0
ctrl = 0

;---------------------------------------------------------------------------
;转身
[State 0, 转身]
type = Turn
triggerall = ((enemynear(var(58)),pos X)-pos X)*facing < 0
trigger1 = animelem = 1,=0
ignorehitpause = 1
persistent = 1

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

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
value = S5200,0

[State 700,]
type = SuperPause
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
anim = -1
movetime = 16
time = 16
darken = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, 保护01]
type = NotHitBy
trigger1 = (helper(40100),var(15) = 0)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 2
ignorehitpause = 1
persistent = 1

[State 0, 保护02]
type = NotHitBy
trigger1 = (helper(40100),var(15) = 1)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 5
ignorehitpause = 1
persistent = 1

[State 0, 记录闪避成功]
type = VarSet
triggerall = !ishelper
triggerall = var(59) >= 1
triggerall = var(18) <= 0
trigger1 = AnimElem = 1,=1
trigger1 = prevstateno = [150,155]
v = 18
value = 65
ignorehitpause = 1
persistent = 0

[State 350, snd]
type = PlaySnd
trigger1 = random%2 = 1
trigger1 = AnimElem = 3
value = s0,2
volumescale = 50

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 2
value = s50,0

[State 350, snd]
type = Poweradd
trigger1 = (palno <= 3) && (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = AnimElem = 1
value = -500

[State 1000, AfterImage]
type = AfterImage
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno = [150,155]
trigger1 = time = 0
time = 2
length = 11
timegap = 1
paladd = 60,20,100
PalContrast = 220,200,350
palcolor = 0
framegap = 3

[State 1000, Afterimage]
type = Afterimage
trigger1 = (helper(40100),var(15) = 0)
trigger1 = prevstateno != [150,155]
trigger1 = time = 0
time = 2
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
trigger1 = animelem = 7, < 0
time = 2

[State 9520, 51]
type = EnvColor
trigger1 = (helper(40100),var(15) = 0)
trigger1 = animelem = 1
trigger1 = prevstateno = [150,155]
value = 255,255,255
time = 3

[State 705, 1]
type = velset
trigger1 = Time = [7,25]
x = -5

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

;---------------------------------------------------------------------------
;前冲
[Statedef 712]
type    = S
physics = N
movetype = I
ctrl = 0
sprpriority = -1

;---------------------------------------------------------------------------
;变量使用

[State 0, 变量记录]
type = VarSet
trigger1 = 1
fv = 22
value = 1
ignorehitpause = 1
persistent = 1

;---------------------------------------------------------------------------
;动画改变

[State 0, 动画改变]
type = ChangeAnim
trigger1 = anim != 712
value = 712
ignorehitpause = 1
persistent = 1

;---------------------------------------------------------------------------
;锁血

[State 0, noko防止死亡]
type = AssertSpecial
trigger1 = 1
flag = noko
ignorehitpause = 1
persistent = 1

;---------------------------------------------------------------------------
;锁血

[State 0, 锁血]
type = LifeSet
trigger1 = life < lifemax*0.1
value = lifemax*0.1
ignorehitpause = 1
persistent = 1

[State 0, 锁血]
type = LifeSet
triggerall = palno >= 6
triggerall = Alive
trigger1 = roundstate != 2
value = lifemax*2
ignorehitpause = 1
persistent = 1

;---------------------------------------------------------------------------
;保护

[State 0, 保护]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 10
ignorehitpause = 1
persistent = 1

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

[State 0, 推挤设置]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1

[State 0, Y轴速度修正]
type = VelSet
trigger1 = 1
y = 0
ignorehitpause = 1
persistent = 1

[State 0, 坐标修正]
type = PosSet
trigger1 = 1
y = 0
ignorehitpause = 1
persistent = 1

[State 350, snd]
type = PlaySnd
trigger1 = random%2 = 1
trigger1 = AnimElem = 3,=0
value = s0,2
volumescale = 50

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 2,=0
value = s50,0

[State 1000, Afterimage]
type = Afterimage
trigger1 = AnimElem = 1,=1
time = 2
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 3050, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 0
trigger1 = animelem = 7, < 0
time = 2

[state -2]
type = VelSet
Trigger1 = AnimElem = 2,>=1 && Animelem = 10,<=0
x = 5
ignorehitpause = 1
persistent = 1

[State 712, 3]
type = SelfState
trigger1 = AnimElem = 10,>=5
value = 0
anim = 0
ctrl = 1

;崅?漟P2
[Statedef 5997]
type    = U
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 5000, 7]
type = ChangeState
trigger1 = statetype != A
value = 256

[State 5000, 7]
type = ChangeState
trigger1 = statetype = A
value = 6240

;漟P2慜抲(捛抧晄婲)
[Statedef 5998]
type    = U
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 5000, 7]
type = ChangeState
trigger1 = statetype = S
value = 6000

[State 5000, 7]
type = ChangeState
trigger1 = statetype = C
value = 6010

[State 5000, 7]
type = ChangeState
trigger1 = statetype = A
value = 6020

[State 5000, 7]
type = ChangeState
trigger1 = statetype = L
value = 6080

;漟P2慜抲(捛抧懪婲)
[Statedef 5999]
type    = U
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 5000, 7]
type = ChangeState
trigger1 = statetype = S
value = 6000

[State 5000, 7]
type = ChangeState
trigger1 = statetype = C
value = 6010

[State 5000, 7]
type = ChangeState
trigger1 = statetype = A
value = 6020

[State 5000, 7]
type = ChangeState
trigger1 = statetype = L
value = 6020


;漟P2
[Statedef 6000]
type    = S
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 6001 ;Stand get-hit (knocked back)

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 6030

;---------------------------------------------------------------------------
; Stand get-hit (knocked back)
[Statedef 6001]
type    = S
movetype= H
physics = S

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = selfstate
trigger1 = HitOver
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Crouch get-hit (shaking)
[Statedef 6010]
type    = C
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 6011 ;Crouch get-hit (knocked back)

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 6030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Crouch get-hit (knocked back)
[Statedef 6011]
type    = C
movetype= H
physics = C

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5011, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5011, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5025 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5011, 6]
type = selfstate
trigger1 = HitOver
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Air get-hit (shaking)
[Statedef 6020]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 6030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Air get-hit (knocked away)
[Statedef 6030]
type    = A
movetype= H
physics = N
ctrl = 0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1

[State 5030, 1]
type = ChangeAnim
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

[State 5030, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5030, 3]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 4]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 6040 ;HITA_RECOV

[State 5030, 5]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= Const(movement.air.gethit.groundlevel)
value = 6050 ;HITA_FALL

[State 5030, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 6035 ;Air get-hit (transition)

;---------------------------------------------------------------------------
; Air get-hit (transition)
[Statedef 6035]
type    = A
movetype= H
physics = N

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1


[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 6040 ;Air get-hit (recovering in air, not falling)

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= Const(movement.air.gethit.groundlevel)
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 6050 ;Air get-hit (falling)

;---------------------------------------------------------------------------
; Air get-hit (recovering in air, not falling)
[Statedef 6040]
type    = A
movetype= H
physics = N

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1


[State 5040, 1]
type = ChangeState
trigger1 = !Alive
value = 6050
ctrl = 0

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = selfstate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;Jump land

;---------------------------------------------------------------------------
; Air get-hit (falling)
[Statedef 6050]
type    = A
movetype= H
physics = N

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1


[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, Const720p(4), Const720p(-8))
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, Const(movement.air.gethit.groundlevel))
value = 6100 ;Downed get-hit (hit ground from fall)

;---------------------------------------------------------------------------
; Tripped get-hit (shaking)
[Statedef 6070]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1


[State 5070, 1]
type = ChangeAnim
trigger1 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 6071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; Tripped get-hit (knocked away)
[Statedef 6071]
type    = A
movetype= H
physics = N

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

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper
ignorehitpause = 1


[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.air.gethit.trip.groundlevel)
type = ChangeState
value = 6110

;---------------------------------------------------------------------------
; Downed get-hit (shaking)
[Statedef 6080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 6081 ;Downed get-hit (knocked back)

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 6030 ;Air get-hit (knocked away)

;---------------------------------------------------------------------------
; Downed get-hit (knocked back)
[Statedef 6081]
type    = L
movetype= H
physics = C

[State 5081, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5081, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5081, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5081, 4]
type = ChangeState
trigger1 = HitOver
value = 6110 ;Downed get-hit (lying down)

;---------------------------------------------------------------------------
; Downed get-hit (hit ground from fall)
[Statedef 6100]
type    = L
movetype= H
physics = N

[State 5100, 2004.04.14 behavior]
type = null;VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x < -1
x = -1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 6110 ;Downed get-hit (lying down)

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 6101 ;Downed get-hit (bounce off ground)

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; Downed get-hit (bounce off ground)
[Statedef 6101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = Const(movement.down.bounce.offset.y)

[State 5101, 5]
type = PosAdd
trigger1 = Time = 0
x = Const(movement.down.bounce.offset.x)

[State 5101, 6] ;Acceleration
type = VelAdd
trigger1 = 1
y = Const(movement.down.bounce.yaccel)

[State 5101, 7] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.down.bounce.groundlevel)
type = ChangeState
value = 6110

;---------------------------------------------------------------------------
; Downed get-hit (lying down)
[Statedef 6110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = Selfstate
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 11] ;If just died
type = ChangeState
triggerall = alive
trigger1 = time >= 52
value = 6120

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14] ;Friction
type = VelSet
trigger1 = abs(Vel x) < Const(movement.down.friction.threshold)
persistent = 0
x = 0

[State 5110, 15]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 16]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; Downed get-hit (getting up)
[Statedef 6120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

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

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7]
type = selfstate
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Downed get-hit (lying defeated)
[Statedef 6150]
type    = L
movetype= H
physics = N
sprpriority = -3
ctrl = 0

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = abs(Vel x) < Const(movement.down.friction.threshold)
persistent = 0
x = 0

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

;---------------------------------------------------------------------------
; Air get-hit (fall recovery on ground; still falling)
[Statedef 6200]
type    = A
movetype= H
physics = N

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = Changestate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.air.gethit.groundrecover.groundlevel)
value = 5201

;---------------------------------------------------------------------------
; Air get-hit (fall recovery on ground)
[Statedef 6201]
type    = A
movetype= H
physics = A
anim = 5200

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < Const720p(-20)

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
x = Const(velocity.air.gethit.groundrecover.x)
y = Const(velocity.air.gethit.groundrecover.y)

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

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

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5201, 6]
type = Explod
trigger1 = Time = 0
anim = F60
pos = 0, -floor(vel y)
sprpriority = -10

;---------------------------------------------------------------------------
; Air get-hit (fall recovery in air)
[Statedef 6210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128

[State 5210, 1]
type = PosFreeze
trigger1 = Time < 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < Const720p(-80)

[State 5210, 1.0 behavior 1]
type = VelMul
trigger1 = Time = 4
x = Const(velocity.air.gethit.airrecover.mul.x)
y = Const(velocity.air.gethit.airrecover.mul.y)

[State 5210, 1.0 behavior 2]
type = VelAdd
trigger1 = Time = 4
x = Const(velocity.air.gethit.airrecover.add.x)
y = Const(velocity.air.gethit.airrecover.add.y)

[State 5210, 2002.04.14 behavior 1]
type = null;VelMul
trigger1 = Time = 4
x = .8
y = .8

[State 5210, 2002.04.14 behavior 2]
type = null;VelAdd
trigger1 = Time = 4
x = 0 
y = -4.5

[State 5210, 2002.04.14 behavior 3]
type = null;VelMul
trigger1 = Time = 4
trigger1 = Vel Y > 0
y = .5

[State 5210, 2002.04.14 behavior 4]
type = null;VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -3
y = -2

[State 5210, 2002.04.14 behavior 5]
type = null;VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = Const(velocity.air.gethit.airrecover.up)

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = Const(velocity.air.gethit.airrecover.down)

[State 5210, 2] ;Go fwd
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = Const(velocity.air.gethit.airrecover.fwd)

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = Const(velocity.air.gethit.airrecover.back)

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd
trigger1 = Time >= 4
y = Const(movement.air.gethit.airrecover.yaccel)

[State 5210, 5] ;Land on ground
type = selfstate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;Jump land
ctrl = 1


;氃暻夞淸-Light
[Statedef 6240]
type    = A
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State turn]
type = turn
trigger1 = frontedgedist <= 0

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

[State 1021,0]
type = velset
trigger1 = time = 1
x = -30
y = -.35

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5052

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = !selfAnimExist(5052)
value = 5030

[State 1026, Hit wall]
type = ChangeState
trigger1 = BackEdgeBodyDist <= 5
trigger2 = time >= 300
value = 6245

;?暻
[Statedef 6245]
type = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 1000, EnvColor]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1
under = 1

[State 1000, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 50
freq = 100
ampl = -6

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

[State 1000, Turn]
type = turn
trigger1 = time = 0

[State 1000, VelSet]
type = VelSet
trigger1 = time > 5 && time < 10
x = -8
y = -3.6

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = -1
facing = -1

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F73
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = 8
facing = -1

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 5
value = F5,5

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 0
value = F7,2

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5051

[State 821, 4]
type = changeanim
trigger1 = time = 15
trigger1 = selfAnimExist(5062)
value = 5062

[State 821, 1]
type = VelAdd
Trigger1 = time > 8
y = .55
x = .05

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;氃暻夞淸-Hard
[Statedef 6250]
type    = A
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State turn]
type = turn
trigger1 = frontedgedist <= 0

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

[State 1021,0]
type = velset
trigger1 = time = 1
x = -13
y = -.5

[State 840, 2]
type = AfterImage
trigger1 = time = 5
time = 13
length = 3
PalBright   =   0,  0,  0
PalContrast = 255,255,255
PalAdd      =   0,  0,  0
PalMul      =  1,1,1
FrameGap = 2
ignorehitpause = 1

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5052

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = !selfAnimExist(5052)
value = 5030

[State 1026, Hit wall]
type = ChangeState
trigger1 = BackEdgeBodyDist <= 5
trigger2 = time >= 300
value = 6255

;?暻
[Statedef 6255]
type = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 1000, Pause]
type = Pause
trigger1 = time = [0,13]
trigger1 = helper(99999),var(35) = 0
time = 3

[State 1000, EnvColor]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1
under = 1

[State 1000, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 50
freq = 100
ampl = -10

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

[State 1000, Turn]
type = turn
trigger1 = time = 0

[State 1000, VelSet]
type = VelSet
trigger1 = time > 5&& time < 10
x = -4.8
y = -9.6

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = -1
facing = -1

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F73
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = 8
facing = -1

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 5
value = F5,5

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 0
value = F7,2

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5051

[State 821, 4]
type = changeanim
trigger1 = time = 15
trigger1 = selfAnimExist(5062)
value = 5062

[State 821, 1]
type = VelAdd
Trigger1 = time > 8
y = .5
x = .05

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;182-庴?2
[Statedef 6260]
type     = A
movetype = H
physics  = N
velset   = 0,0

[State 0, DefenceMulSet]
type = DefenceMulSet
trigger1 = 1
value = 1
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = IsHelper

[State 700,]
type = Palfx
trigger1 = time = 0
time = 80
add = 80,-40,-140
mul = 256,256,256
sinadd = 100,100,100,15
invertall = 1
color = 0

[State 1000, VelAdd]
type = VelAdd
trigger1 = 1
x = -3

[State 1028, ChangeAnim]
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5051)
value = 3606

[State 1028, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5051)
value = 5051

[State 1025, ChangeState]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 6261
;-------------------------------------------------------------------------------
;182-庴?3
[Statedef 6261]
type     = A
movetype = H
physics  = N

[State 1026, HitVelSet]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 1026, VelAdd]
type = VelAdd
trigger1 = 1
y = .45

[State 2100,]
type = MakeDust
trigger1 = vel x < 0
spacing = 4

[State 1026, ChangeState]
type = ChangeState
triggerall = Pos Y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 6262

[State 700,]
type = Palfx
trigger1 = (Vel Y > 0) && (Pos Y >= 0)
time = 1
mul = 256,256,256

[State 1026, SelfState]
type = SelfState
trigger1 = (Vel Y > 0) && (Pos Y >= 0)
value = 5100
;-------------------------------------------------------------------------------
;182-庴?4
[Statedef 6262]
type     = A
movetype = H
physics  = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, PosAdd]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, PosFreeze]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

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

[State 1027, ???????]
type = null;Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor(ScreenPos Y) - 50
postype = Back
sprpriority = -1

[State 1027, ???????]
type = null;Explod
trigger1 = Time = 0
anim = F73
pos = 0, floor(ScreenPos Y) - 50
postype = Back
sprpriority = 5

[State 1027, PlaySound]
type = null;PlaySnd
trigger1 = Time = 0
value = F7,4

[State 1027, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 0
value = 3608

[State 1027, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 6263
;-------------------------------------------------------------------------------
;182-庴?5
[Statedef 6263]
type     = A
movetype = H
physics  = N

[State 700,]
type = Palfx
trigger1 = (Vel y > 0) && (Pos y >= 0)
time = 1
mul = 256,256,256

[State 1028, Velset]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Velset]
type = VelSet
trigger1 = Time = 0
x = 4.6

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, VelAdd]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, ChangeAnim]
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, ChangeAnim]
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, SelfState]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;?旘慁鐉-崅
[Statedef 6430]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6431

[Statedef 6431]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5641

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 0
y = -18

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .51

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6432

[Statedef 6432]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;?旘慁鐉-拞
[Statedef 6530]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6531

[Statedef 6531]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5642

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 2.5
y = -10.8

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .615

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6532

[Statedef 6532]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 12
ampl = -6
freq = 90
phase = 90

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;?旘慁鐉-拞
[Statedef 6630]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6631

[Statedef 6631]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5642

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 1.5
y = -13.5

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .62

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6632

[Statedef 6632]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 12
ampl = -6
freq = 90
phase = 90

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;---------------------------------------------------------------------------
; 樤??(?敳???)

[Statedef 6650]
type    = S;A
movetype= H
physics = N
velset  = 0,0

[State 5650, 1]
type = Hitfallset
trigger1 = time = 0
value = 0

[State 5650, 2]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 5650, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5650, 4]
type = ChangeAnim
Trigger1 = 1
value = 5002

[State 5650, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 6651

[Statedef 6651]
type    = S;A
movetype= H
physics = N
velset  = 0,0

[State 5650, 1]
type = ChangeAnim
Trigger1 = Anim = 5002 && AnimTime = 0
value = 5007

[State 5650, 2]
type = SelfState
trigger1 = time = 60
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 樤??(氊敳???)

[Statedef 6655]
type    = S;A
movetype= H
physics = N
velset  = 0,0

[State 5655, 1]
type = Hitfallset
trigger1 = time = 0
value = 0

[State 5655, 2]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 5655, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5655, 4]
type = ChangeAnim
Trigger1 = 1
value = 5012

[State 5655, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 6656

[Statedef 6656]
type    = S;A
movetype= H
physics = N
velset  = 0,0

[State 5655, 1]
type = ChangeAnim
Trigger1 = Anim = 5012 && AnimTime = 0
value = 5017

[State 5655, 2]
type = SelfState
trigger1 = time = 60
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 濱?灄??機?

[Statedef 6660]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5660, 1]
type = Hitfallset
trigger1 = time = 0
value = 0

[State 5660, 2]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 5660, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5660, 4]
type = ChangeAnim2
Trigger1 = Time = 0
value = 5660

[State 5660, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 6661

[Statedef 6661]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5661, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 5661

[State 5661, 2] 
type = SelfState
trigger1 = animtime = 0
value = 5110

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 6690]
type    = L
movetype= H
physics = N

[State 5690, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5690, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5690, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5690, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5690, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5690, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5690, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5690, 6]
type = PosFreeze
trigger1 = 1

[State 5690, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 6691]
type    = L
movetype= H
physics = N

[State 5691, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5691, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5691, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5691, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5691, 5] ;Reduce speed
type = VelMul
trigger1 = time = 0
x = .75

[State 5691, 6] ;Acceleration
type = VelAdd
trigger1 = 1
y = .5

[State 5691, 7] ;Hit ground
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 6692

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 6692]
type    = L
movetype= H
physics = N

[State 5692, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5692, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5692, 2] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = (anim = [5081,5089]) || (anim = [5091,5099])
value = 5110 + (anim % 10)
persistent = 0

[State 5692, 3] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5692, 4] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5692, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5692, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5692, 6]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0

[State 5692, 7] ;For hit up type
type = ChangeAnim
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)
persistent = 0

[State 5692, 8] ;For normal
type = ChangeAnim
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110
persistent = 0

[State 5692, 9] ;If just died
type = SelfState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5692, 10]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5692, ChangeState]
type = ChangeState
trigger1 = prevstateno != 5612 && prevstateno != 5615
trigger1 = Time = 30
trigger2 = prevstateno = 5612
trigger2 = Time = 32
trigger3 = prevstateno = 5615
trigger3 = Time = 30
value = 6693

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 6693]
type    = L
movetype= I
physics = N

[State 5693, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5693, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5693, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5693, 3]
type = NotHitBy
trigger1 = 1
value = SCA

[State 5693, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5693, 5]
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA
time = 1

[State 5693, 6]
type = NotHitBy
trigger1 = AnimTime = 0
value2 = , AT
time = 8

[State 5693, 7]
type = SelfState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;?旘慁鐉-崅
[Statedef 6730]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6731

[Statedef 6731]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5641

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 0
y = -13.4

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .54

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6732

[Statedef 6732]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

[Statedef 6750]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6751

;氃暻夞淸-Light
[Statedef 6751]
type    = A
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State turn]
type = turn
trigger1 = frontedgedist <= 0

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

[State 1021,0]
type = velset
trigger1 = time = 1
x = -18
y = -4.8

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5052

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = !selfAnimExist(5052)
value = 5030

[State 1026, Hit wall]
type = ChangeState
trigger1 = BackEdgeBodyDist <= 5
trigger2 = time >= 300
value = 6755

;?暻
[Statedef 6755]
type = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 1000, EnvColor]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1
under = 1

[State 1000, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 50
freq = 100
ampl = -6

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

[State 1000, Turn]
type = turn
trigger1 = time = 0

[State 1000, VelSet]
type = VelSet
trigger1 = time > 7 && time < 12
x = -10
y = -2.4

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = -1
facing = -1

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F73
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = 8
facing = -1

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 5
value = F5,5

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 0
value = F7,2

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5051

[State 821, 4]
type = changeanim
trigger1 = time = 15
trigger1 = selfAnimExist(5062)
value = 5062

[State 821, 1]
type = VelAdd
Trigger1 = time > 2
y = .2

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

[Statedef 6760]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6761

;氃暻夞淸-Light
[Statedef 6761]
type    = A
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State turn]
type = turn
trigger1 = frontedgedist <= 0

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

[State 1021,0]
type = velset
trigger1 = time = 1
x = -18
y = -4.8

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5052

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = !selfAnimExist(5052)
value = 5030

[State 1026, Hit wall]
type = ChangeState
trigger1 = BackEdgeBodyDist <= 5
trigger2 = time >= 300
value = 6765

;?暻
[Statedef 6765]
type = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 1000, EnvColor]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1
under = 1

[State 1000, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 50
freq = 100
ampl = -6

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

[State 1000, Turn]
type = turn
trigger1 = time = 0

[State 1000, VelSet]
type = VelSet
trigger1 = time > 7 && time < 12
x = -7
y = -2.4

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = -1
facing = -1

[State 1000, Explod]
type = Explod
trigger1 = Time = 0
anim = F73
pos = 320+(ifelse(helper(99999),var(11) = 1,100,0)), floor(ScreenPos Y) - 70
postype = Back
sprpriority = 8
facing = -1

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 5
value = F5,5

[State 1027, PlaySound]
type = PlaySnd
trigger1 = Time = 0
value = F7,2

[State 821, 4]
type = changeanim
trigger1 = time = 0
trigger1 = selfAnimExist(5052)
value = 5051

[State 821, 4]
type = changeanim
trigger1 = time = 15
trigger1 = selfAnimExist(5062)
value = 5062

[State 821, 1]
type = VelAdd
Trigger1 = time > 2
y = .168

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100


;?旘慁鐉-掅
[Statedef 6830]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6831

[Statedef 6831]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5642

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 1.5
y = -13.8

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .5

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6832

[Statedef 6832]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -4
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;偙偺壓丄堦峴埲忋嬻偗傞帠両



;弹地，自定义速度
[Statedef 6890]
type    = A
movetype= H
physics = N
velset = 0,0

[State 52, 1]
type = Hitfallset
trigger1 = 1
value = 1

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

[State 1830]
type = Changestate
trigger1 = HitShakeOver
value = 6891

;受?
[Statedef 6891]
type    = A
movetype= H
physics = N
velset = -2.5,18

[State 52, 1]
type = Hitfallset
trigger1 = 1
value = 1

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

[State 1830]
type = Changestate
trigger1 = Vel Y > 0 && pos y >= 0
value = 6892

;受?
[Statedef 6892]
type    = L
movetype= H
physics = N

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 0
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 0
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 0, FallEnvShake]
type = FallEnvShake
trigger1 = time = 0

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

[State 1830]
type = Changestate
trigger1 = time = 4
value = 6893

;?飛旋轉
[Statedef 6893]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5741

[State 5630, 2]
type = Changestate
trigger1 = time = 4
value = 6894

[Statedef 6894]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5740

[State 5631, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = gethitvar(yaccel)

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5062)
value = 5062

[State 5631, 2]
type = VelSet
trigger1 = Vel Y > 0 && Pos Y >= 0
y = 20

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6100

;?旘慁鐉
[Statedef 6930]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6931

[Statedef 6931]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5642

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing *0
y = -11.5

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .535

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6932

[Statedef 6932]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691



;偙偺壓丄堦峴埲忋嬻偗傞帠両

[Statedef 6950]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6951

[Statedef 6951]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5643

[State 5631, 1]
type = ChangeAnim2
trigger1 = Anim = 5643
trigger1 = vel y > 0
value = 5644

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing *3.6
y = -10

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .55

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6952

[Statedef 6952]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691


;受?
[Statedef 6960]
type    = A
movetype= H
physics = N
velset = 0,0

[State 52, 1]
type = Hitfallset
trigger1 = 1
value = 1

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

[State 1830]
type = Changestate
trigger1 = HitShakeOver
value = 6961

;受?
[Statedef 6961]
type    = A
movetype= H
physics = N
velset = -1.5,18

[State 52, 1]
type = Hitfallset
trigger1 = 1
value = 1

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

[State 1830]
type = Changestate
trigger1 = Vel Y > 0 && pos y >= 0
value = 6962

;受?
[Statedef 6962]
type    = L
movetype= H
physics = N

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 0
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 0
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 0, FallEnvShake]
type = FallEnvShake
trigger1 = time = 0

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

[State 1830]
type = Changestate
trigger1 = time = 4
value = 6963

;?飛旋轉
[Statedef 6963]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5741

[State 5630, 2]
type = Changestate
trigger1 = time = 4
value = 6964

[Statedef 6964]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5740

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing * 0.25
y = -10

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .6

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5062)
value = 5062

[State 5631, 2]
type = VelSet
trigger1 = Vel Y > 0 && Pos Y >= 0
y = 20

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6100


;偙偺壓丄堦峴埲忋嬻偗傞帠両

[Statedef 6970]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6971

[Statedef 6971]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5643

[State 5631, 1]
type = ChangeAnim2
trigger1 = Anim = 5643
trigger1 = vel y > 0
value = 5644

[State 5631, 2]
type = VelSet
trigger1 = Time = 0
x = ifelse(gethitvar(xvel) <= 0,-1,1) * facing *4.8
y = -11.5

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = .47

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6972

[Statedef 6972]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;小击飞
[Statedef 6980]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6981

[Statedef 6981]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5642

[State 5631, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = gethitvar(yaccel)

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6982

[Statedef 6982]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 12
ampl = -6
freq = 90
phase = 90

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 0
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 0
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

;大击飞
[Statedef 6990]
type     = A
movetype = H
physics  = N
VelSet   = 0,0

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

[State 5630, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5640

[State 5630, 2]
type = Changestate
trigger1 = HitShakeOver
value = 6991

[Statedef 6991]
type     = A
movetype = H
physics  = N
velset   = 0,0

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

[State 5631, 1]
type = ChangeAnim2
trigger1 = Time = 0
value = 5643

[State 5631, 1]
type = ChangeAnim2
trigger1 = Anim = 5643
trigger1 = vel y > 0
value = 5644

[State 5631, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5631, 3]
type = VelAdd
trigger1 = Time > 0
y = GetHitVar(yaccel)

[State 5631, 4]
type = ChangeAnim
trigger1 = Vel Y > 0 && Pos Y >= 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 5631, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 6992

[Statedef 6992]
type    = L
movetype= H
physics = N

[State 5632, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5632, EnvShake]
type = EnvShake
trigger1 = Time = 0
time = 15
ampl = -6
freq = 80
phase = 80

[State 5632, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 10]
Type = PlaySnd
Trigger1 = Time = 0
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 8]
Type = GameMakeAnim
Trigger1 = Time = 0
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5632, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069]) && (anim != [5091,5099])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5632, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069]); || (anim = [5091,5099])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5632, 4]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5632, 5]
type = HitFallDamage
trigger1 = Time = 0

[State 5632, 6]
type = PosFreeze
trigger1 = 1

[State 5632, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 6691

[Statedef 24500]
type    = S
movetype= H
physics = N
velset = 0,0
facep2 = 1

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 4500, 1] ;从轻受击到重受击的动作
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),24500,24510) + GetHitVar(animtype)

[State 4500, 2] ;后仰受击
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 24530

[State 4500, 4] ;保持动作
type = ChangeAnim2
trigger1 = Time > 0
value = anim

[State 4500, 5] ;如果被打到空中则设statetype为A
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 4500, FFB Light]
type = ForceFeedback
trigger1 = anim = 24500
trigger2 = anim = 24510
persistent = 0
time = 6
waveform = square

[State 4500, FFB Medium]
type = ForceFeedback
trigger1 = anim = 24501
trigger2 = anim = 24511
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 4500, FFB Hard]
type = ForceFeedback
trigger1 = anim = 24512
trigger2 = anim = 24502
trigger3 = anim = 24530
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[State 4500, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 24501 ;站立受击硬直

[State 4500, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 24710

[Statedef 24501]
type    = S
movetype= H
physics = S

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 4501, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 4501, 2]
type = ChangeAnim2
trigger1 = AnimTime = 0
value = 24505 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 4501, 3] ;停止滑动
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 4501, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 4501, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 4501, 6]
type = SelfState
trigger1 = HitOver
value = 0
ctrl = 1

[Statedef 24510]
type    = C
movetype= H
physics = N
velset = 0,0
facep2 = 1

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 4510, 1] ;从轻受击到重受击的动作
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 24520 + GetHitVar(animtype)

[State 4510, 2] ;后仰受击
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 24530

[State 4510, 4] ;保持动作
type = ChangeAnim2
trigger1 = Time > 0
value = anim

[State 4510, 5] ;如果被打到空中则设statetype为A
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 4510, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 24511 ;下蹲受击硬直

[State 4510, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 24710

[State 4510, FFB Light]
type = ForceFeedback
trigger1 = anim = 24520
persistent = 0
time = 6
waveform = square

[State 4510, FFB Medium]
type = ForceFeedback
trigger1 = anim = 24521
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 4510, FFB Hard]
type = ForceFeedback
trigger1 = anim = 24522
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

[Statedef 24511]
type    = C
movetype= H
physics = C

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 4511, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 4511, 2]
type = ChangeAnim2
trigger1 = AnimTime = 0
value = 24525 + GetHitVar(animtype)

[State 4511, 3] ;停止滑动
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 4511, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 4511, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 4511, 6]
type = SelfState
trigger1 = HitOver
value = 11
ctrl = 1

[Statedef 24710]
type    = A
movetype= H
physics = N
velset = 0,0
facep2 = 1

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 0, 坐标修正]
type = PosSet
trigger1 = time = 0
trigger1 = Pos Y > -2
y = -2
ignorehitpause = 1
persistent = 0

[State 5020, 1]
Type = ChangeAnim2
Trigger1 = Time = 0
Trigger1 = GetHitVar(animType) != [3,5]
value = ifelse((GetHitVar(airType) = 1),24500,24510) + GetHitVar(animType)

[State 5020, 2]
Type = ChangeAnim2
Trigger1 = Time = 0
Trigger1 = GetHitVar(animType) = [3,5]
value = 24530

[state 0]
type = ChangeAnim2
Trigger1 = !HitShakeOver
value = anim

[state 0]
type = VelAdd
Trigger1 = HitShakeOver
Trigger1 = GetHitVar(yaccel) = 0
y = 0.4

[state 0]
type = VelAdd
Trigger1 = HitShakeOver
Trigger1 = GetHitVar(yaccel) != 0
y = GetHitVar(yaccel)

[state 0]
type = HitVelSet
Trigger1 = HitShakeOver
Trigger1 = Animelem = 1,=1
x = 1
y = 1

[state 0]
type = ChangeState
TriggerAll = HitShakeOver
Trigger1 = HitOver
Trigger2 = Vel Y > 0
Trigger2 = Pos Y >= 0
value = 24730

[state 0]
type = ChangeState
TriggerAll = HitShakeOver
Trigger1 = AnimTime = 0
value = 24720

[Statedef 24720]
type    = A
movetype= H
physics = N

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[state 0]
type = ChangeAnim2
Trigger1 = Time = 0
Trigger1 = Anim != [24551,24559] ;Not if in hit up anim
value = 24535

[state 0]
type = VelAdd
Trigger1 = GetHitVar(yaccel) = 0
y = 0.4

[state 0]
type = VelAdd
Trigger1 = GetHitVar(yaccel) != 0
y = GetHitVar(yaccel)

[state 0]
type = ChangeState
Trigger1 = HitOver  ;Hit is over
Trigger2 = AnimTime = 0 ;Anim is over
Trigger3 = Vel Y > 0    ;Hit ground
Trigger3 = Pos Y >= 0
Trigger4 = Time = 0     ;No transition anim
Trigger4 = Anim != 24535
value = 24730 ;HITA_FALL

[Statedef 24730]
type    = A
movetype= H
physics = N

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[state 0] ;Change anim when done with transition
type = ChangeAnim2
Trigger1 = AnimTime = 0
Trigger1 = Anim = 24535
Trigger2 = Time = 0     ;If no transition anim
Trigger2 = Anim != 24535
Trigger2 = (Anim != [24551, 24559]) && (Anim != [24561, 24569])
Trigger2 = Anim != 24590 ;Not if hit off ground anim
value = 24550

[state 0] ;Coming down anim
type = ChangeAnim2
Trigger1 = anim = [24550,24559]
Trigger1 = Vel Y >= 1
value = 24560
persistent = 0

[state 0]
type = VelAdd
Trigger1 = GetHitVar(yaccel) = 0
y = 0.4

[state 0]
type = VelAdd
Trigger1 = GetHitVar(yaccel) != 0
y = GetHitVar(yaccel)

[state 0]
type = ChangeState
Trigger1 = Pos Y >= 0 && Vel Y > 0
value = 24935

[Statedef 24935]
type    = A
movetype= H
physics = N

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[state 0]
Type = VelSet
Trigger1 = Time = 0
Trigger1 = GetHitVar(fall.yvel) = 0
Trigger1 = vel x > 1
x = 1

[State 0]
type = ChangeAnim
trigger1 = time = 0
trigger1 = selfanimexist(5080)
value = 5080

[state 0]
type = ChangeAnim2
Trigger1 = time = 0
trigger1 = !selfanimexist(5080)
value = 5080

[state 0]
type = PosSet
trigger1 = Time = 0
y = 0

[state 0]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 24945

[state 0]
type = VelMul
trigger1 = Time = 0
x = 0.75

[state 0]
type = Explod
trigger1 = Time = 1
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
postype = p1
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)

[state 0]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56))

[state 0]
type = PosFreeze
trigger1 = 1

[state 0]
type = ChangeState
trigger1 = time = 5
value = 24940

[state 0]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

[Statedef 24940]
type    = A
movetype= H
physics = N

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[state 0]
type = ChangeAnim
triggerall = time = 0
trigger1 = SelfAnimExist(5160)
value = 5160

[state 0]
type = ChangeAnim2
triggerall = time = 0
trigger1 = !SelfAnimExist(5160)
value = 5160

[state 0]
type = HitFallVel
trigger1 = Time = 0

[state 0]
type = PosSet
trigger1 = Time = 0
y = Const(movement.down.bounce.offset.y)

[state 0]
type = PosAdd
trigger1 = Time = 0
x = Const(movement.down.bounce.offset.x)

[state 0] 
type = VelAdd
trigger1 = 1
y = Const(movement.down.bounce.yaccel)

[state 0]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= Const(movement.down.bounce.groundlevel)
value = 24945

[Statedef 24945]
type    = L
movetype= H
physics = N

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
ignorehitpause = 1
persistent = 1

[state 0]
type = VelSet
Trigger1 = time = 1
x = (vel X)*0.5

[State 0] ;着地动作(正常)
type = ChangeAnim
Trigger1 = time = 0
trigger1 = anim != 5110
trigger1 = selfanimexist(5110)
value = 5110

[state 0];无着地动作
type = ChangeAnim2
Trigger1 = time = 0
trigger1 = anim != 5110
trigger1 = !selfanimexist(5110)
value = 5110

[State 速度设置]
type = VelSet
trigger1 = !time
y = 0

[state 0]
type = PosSet
Trigger1 = 1
y = 0

[state 0]
type = VelMul
Trigger1 = Time = 0
x = 0.85

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56))

[State 5110, 7]
type = Explod
trigger1 = Time = 0
trigger1 = !SysVar(0)
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0, 0
postype = p1
sprpriority = ifelse (sysvar(1) <= Const720p(56), -10, 10)

[state 0]
type = ChangeState
Trigger1 = Time = 20
value = 24950

[Statedef 24950]
type    = L
movetype= H
physics = N
ctrl = 0

[State 解除无敌]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 3
ignorehitpause = 1
persistent = 1

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
ignorehitpause = 1
persistent = 1

[state 0]
type = VelMul
Trigger1 = 1
x = 0.85

[State 0] 
type = ChangeAnim
Trigger1 = time = 0
trigger1 = anim != 5110
trigger1 = selfanimexist(5110)
value = 5110

[state 0]
type = ChangeAnim2
Trigger1 = time = 0
trigger1 = anim != 5110
trigger1 = !selfanimexist(5110)
value = 5110

[state 0]
type = VelSet
Trigger1 = Time = 0
y = 0

[state 0]
type = SelfState
Trigger1 =!Alive
value = 5150

[state 0]
type = selfState
TriggerAll = alive
Trigger1 = time = 30
value = 5120