; CNSファイルはカンフーマンの定数（基本データ）と
; 状態（各動作）を記述するものです。
; キャラクターの心臓とも言える部分なのでとても重要です。
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;基本データ部分
[Data]
life              = 1000    ;体力ゲージの最大値を決めます
power             = 3000    ;パワーゲージ最大値（デフォルトは 3000 = Lv.3 になります・オプション）
attack            = 100     ;攻撃力パーセンテージ（デフォルトは 100% になります）
defence           = 100     ;防御力パーセンテージ（デフォルトは 100% になります）
fall.defence_up   = 50      ;一時的に上昇するダウン時の防御力パーセンテージ
liedown.time      = 50      ;倒れてから起き上がるまでの時間
airjuggle         = 16      ;ジャグルポイント限界値　★１
sparkno           = 1       ;デフォルトのヒットスパーク番号（fightfx.airか、キャラのairから呼び出す）
guard.sparkno     = 40      ;デフォルトのガードスパーク番号（fightfx.airか、キャラのairから呼び出す）
KO.echo           = 0       ;ＫＯ時の声にエコーを掛けるかどうか（0=しない・1=する）
volume            = 250      ;キャラの音量　255が最高
intpersistindex   = 0    ;Varを次のラウンドへ持ち越しが可能 (最小=0, 最大=59)  ★２
floatpersistindex = 0     ;FVarを次のラウンドへ持ち越しが可能 (最小=0, 最大=39) ★２

;---------------------------------------------------------------------------
;サイズ設定
[Size]
xscale           = .5        ;キャラ画像の横のスケール
yscale           = .5        ;キャラ画像の縦のスケール
ground.back      = 17       ;キャラの幅（地上後方）
ground.front     = 17      ;キャラの幅（地上前方）
air.back         = 17      ;キャラの幅（空中後方）
air.front        = 17       ;キャラの幅（空中前方）
height           = 60       ;跳び越す相手のためのキャラの高さ
attack.dist      = 160      ;攻撃を出した時に相手がガード体勢に入る最低の距離
proj.attack.dist = 90       ;相手がガード体勢に入る発射物との最低の距離
proj.doscale     = 0        ;xscaleとyscaleが発射物のスケールにも影響するかどうか（0=しない・1=する）
head.pos         = 0, -85  ;BindToTargetの時に必要な頭の座標
mid.pos          = 0, -65  ;BindToTargetの時に必要な体中心の座標
shadowoffset     = 0        ;影の垂直方向の位置
draw.offset      = 0,0      ;キャラ描画表示位置（Ｘ軸,Ｙ軸）

;---------------------------------------------------------------------------
;移動速度設定
[Velocity]
walk.fwd     = 1.85           ;前進歩行速度
walk.back    = -1.8         ;後退歩行速度
run.fwd      = 5.5,0       ;前に走る時の速度（Ｘ軸,Ｙ軸）
run.back     = -3.85,-3.8      ;後ろに走る時の速度（Ｘ軸,Ｙ軸）
jump.neu     = 0,-8.5       ;垂直ジャンプ速度（Ｘ軸,Ｙ軸）
jump.back    = -4           ;後ジャンプ速度
jump.fwd     = 4          ;前ジャンプ速度
runjump.back = -2.55,-8.1   ;後ろに走りながらのジャンプ速度（オプション）
runjump.fwd  = 4.8,-9.5     ;前に走りながらのジャンプ速度（オプション）
airjump.neu  = 0,-7.6       ;空中垂直ジャンプ速度（オプション）
airjump.back = -2.5         ;空中後ジャンプ速度（オプション）
airjump.fwd  = 2.55         ;空中前ジャンプ速度（オプション）

;---------------------------------------------------------------------------
;動作設定
[Movement]
airjump.num     = 0      ;空中ジャンプが出来る回数（オプション）
airjump.height  = 35     ;空中ジャンプするために必要な最低限の高さ（オプション）
yaccel          = .54    ;重力（垂直下降加速度）
stand.friction  = .85    ;立ち状態の摩擦係数
crouch.friction = .85    ;しゃがみ状態の摩擦係数

;====================================================
; ポージング
;---------------------------------------------------------------------------
; タイムオーバー時
; CNS レベル: 基本

[Statedef 170]
type = S
ctrl = 0     ;ここでCtrlSetを簡略化できます。　1=自由に動かせる
anim = 170
velset = 0,0 ;ここでVelSetを簡略化できます。　x方向,y方向 の順

[State 170, 無敵]
type = NotHitBy
trigger1 = 1 ;1にするといかなる条件でも有効で、0にするといかなる条件でも無効
value = SCA  ;※
time = 1

;---------------------------------------------------------------------------
;勝利ポーズ
[Statedef 180]
type = S

[State 180, ステート変更]
type = ChangeState
trigger1 = MatchOver != 1
trigger1 = (100*life/LifeMax) >= 50
value = 181

[State 180, ステート変更]
type = ChangeState
trigger1 = MatchOver != 1
trigger1 = (100*life/LifeMax) < 50
value = 181

[State 180, ステート変更]
type = ChangeState
triggerall = MatchOver = 1 
trigger1 = (100*life/LifeMax) >= 50
value = 183

[State 180, ステート変更]
type = ChangeState
trigger1 = MatchOver = 1
trigger1 = (100*life/LifeMax) < 50
value = 183

;---------------------------------------------------------------------------
; ラウンド勝利1
[Statedef 181]
type = S
ctrl = 0
Anim = 180
velset = 0,0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,180]
trigger2 = NumHelper(10089)
flag = RoundNotOver

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 8
value = s101,13
channel = 5

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

;---------------------------------------------------------------------------
; ラウンド勝利1
[Statedef 182]
type = S
ctrl = 0
Anim = 186
velset = 0,0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,200]
trigger2 = NumHelper(10089)
flag = RoundNotOver

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 4
value = s100,8
channel = 5

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

;---------------------------------------------------------------------------
; 完全勝利1
[Statedef 183]
type = S
ctrl = 0
anim = 185
velset = 0,0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,320]
trigger2 = NumHelper(10089)
flag = RoundNotOver

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 8
value = s100,9
channel = 5
volume = 255

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

;---------------------------------------------------------------------------
; 完全勝利2
[Statedef 184]
type = S
ctrl = 0
Anim = 186
velset = 0,0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,280]
trigger2 = NumHelper(10089)
flag = RoundNotOver

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 4
value = s100,8
channel = 5
volume = 255

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

;---------------------------------------------------------------------------
; 完全勝利2
[Statedef 185]
type = S
ctrl = 0
Anim = 185
velset = 0,0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,280]
flag = RoundNotOver

[State -2, 1]
type = PlaySnd
trigger1 = !time
value = s100,5
channel = 5
volume = 255
[State -2, 1]
type = PlaySnd
trigger1 = time = 140
value = s100,6
channel = 5
volume = 255
[State -2, 1]
type = PlaySnd
trigger1 = animelem = 3
value = s100,18
channel = 4
volume = 255

[State bird]
type=helper
trigger1 = AnimElemtime(3) >= 0
helpertype=normal
stateno=186
ID=186
name="bird"
postype=left
pos= -160+random%150,-20+random%300
facing= 1
ownpal=0
size.xscale=.5
size.yscale=.5
ignorehitpause=1
persistent = 1

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

[State 175, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim != 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 勝利ポーズ　鳥
[Statedef 186]
type = A
physics = N
movetype = I
ctrl = 0
Velset = 0,0
sprpriority = 10
anim = 188

[state -2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1002,1]
type = VelSet
trigger1 = 1
x = 8
y = -6

[State -2, 保護]
Type = SelfState
TriggerAll = IsHelper
Trigger1 = stateno != 186
Value = 186
ignorehitpause = 1

[State Trans]
Type = Trans
trigger1 = 1
Trans = Addalpha
alpha = 256,256

[State a]
type = Explod
triggerall = time <= 70
trigger1 = gametime%5 = 1
anim = 189
id = 188
sprpriority = 16
postype = p1
pos = 0,0
scale = 0.15,0.15
vel = -0.5+ ((random%4)*0.25),-0.5+ ((random%4)*0.25)
bindtime = 1
under = 0
ownpal = 1
persistent = 1
facing=ifelse(random<500,-1,1)
vfacing=ifelse(random<500,-1,1)
removetime= 30
ignorehitpause = 1
trans = add
pausemovetime=65535
supermovetime=65535

[State a]
type = Explod
triggerall = time <= 70
trigger1 = gametime%7 = 1
anim = 189
id = 188
sprpriority = 16
postype = p1
pos = 0,0
scale = 0.25,0.25
vel = -0.25+ ((random%4)*0.25),-0.25+ ((random%4)*0.25)
bindtime = 1
under = 0
ownpal = 1
persistent = 1
facing=ifelse(random<500,-1,1)
vfacing=ifelse(random<500,-1,1)
removetime= 30
ignorehitpause = 1
trans = add
pausemovetime=65535
supermovetime=65535


[State end]
type = DestroySelf
trigger1 = FrontEdgeDist <= -50

;---------------------------------------------------------------------------
;イントロ
;---------------------------------------------------------------------------
[Statedef 190]
type = S
ctrl = 0

[State 190,1]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 190, 2]
type = VarRandom
trigger1 = time = 0
v = 11
range = 0,3

[State 190, 3]
type = ChangeState
trigger1 = Time = 1
value = 191+var(11)


;---------------------------------------------------------------------------
;イントロ１
[Statedef 191]
type = S
Anim = 190
ctrl = 0

[State -2, 1]
type = PlaySnd
trigger1 = anim = 190
trigger1 = Animelem = 6
value = s100,3
channel = 5

[State -2, 1]
type = PlaySnd
trigger1 = anim = 190
trigger1 = Animelem = 7
value = s0,6

;イントロのフラグ
[State 190,1]
type = AssertSpecial
trigger1 = var(59) = 0
trigger1 = time = [0,250]
trigger2 = var(59) != 0
trigger2 = Anim != 0
flag = Intro

[State 77]
type=explod
trigger1= AnimElem = 3
anim=7250
sprpriority=3
postype=p1
pos=0,ceil(-pos y)
facing=ifelse(random<500,-1,1)
random=160,40
trans=addalpha
alpha=192,256
pausemovetime=-1
supermovetime=-1
ownpal=1
[State 77]
type=playsnd
trigger1= AnimElem = 3
value=5,15
channel=1
freqmul= .9 + (random/5000.0)

[State 175, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim != 0
value = 0

;---------------------------------------------------------------------------
;イントロ２
[Statedef 192]
type = S
Anim = 191
ctrl = 0

[State -2, 1]
type = PlaySnd
trigger1 = anim = 191
trigger1 = Animelem = 6
value = s100,3
channel = 5

[State -2, 1]
type = PlaySnd
trigger1 = anim = 191
trigger1 = Animelem = 8
value = s0,6

;イントロのフラグ
[State 190,1]
type = AssertSpecial
trigger1 = var(59) = 0
trigger1 = time = [0,300]
trigger2 = var(59) != 0
trigger2 = Anim != 0
flag = Intro

[State 77]
type=explod
trigger1= AnimElem = 3
anim=7250
sprpriority=3
postype=p1
pos=0,ceil(-pos y)
facing=ifelse(random<500,-1,1)
random=160,40
trans=addalpha
alpha=192,256
pausemovetime=-1
supermovetime=-1
ownpal=1
[State 77]
type=playsnd
trigger1= AnimElem = 3
value=5,15
channel=1
freqmul= .9 + (random/5000.0)

[State 175, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim != 0
value = 0

;---------------------------------------------------------------------------
;イントロ３
[Statedef 193]
type = S
Anim = 192
ctrl = 0

[State -2, 1]
type = PlaySnd
trigger1 = !time
value = s100,3
channel = 5

[State -2, 1]
type = PlaySnd
trigger1 = anim = 192
trigger1 = AnimElem = 13
value = s0,6

;イントロのフラグ
[State 190,1]
type = AssertSpecial
trigger1 = var(59) = 0
trigger1 = time = [0,350]
trigger2 = var(59) != 0
trigger2 = Anim != 0
flag = Intro

[State 77]
type=explod
trigger1= AnimElem = 3
anim=7250
sprpriority=3
postype=p1
pos=0,ceil(-pos y)
facing=ifelse(random<500,-1,1)
random=160,40
trans=addalpha
alpha=192,256
pausemovetime=-1
supermovetime=-1
ownpal=1
[State 77]
type=playsnd
trigger1= AnimElem = 3
value=5,15
channel=1
freqmul= .9 + (random/5000.0)

[State 175, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim != 0
value = 0

;---------------------------------------------------------------------------
;イントロ４
[Statedef 194]
type = S
Anim = 193
ctrl = 0

[State -2, 1]
type = PlaySnd
trigger1 = !time
value = s100,14
channel = 5
[State -2, 1]
type = PlaySnd
trigger1 = anim = 193
trigger1 = time = 145
value = s100,15
channel = 5
[State -2, 1]
type = PlaySnd
trigger1 = anim = 193
trigger1 = time = 300
value = s100,2
channel = 5

[State -2, 1]
type = PlaySnd
trigger1 = time=375
value = s0,6

[State -2]
Type = Helper
trigger1 = !time
StateNo = 195
ID = 194
name = "Nora"
PosType = P1
Pos = 30,0
Ownpal = 1
SprPriority = 2
IgnoreHitPause = 1
Persistent = 0

[State -2]
Type = Helper
trigger1 = !time
StateNo = 196
ID = 194
name = "Rosa"
PosType = P1
Pos = -30,0
Ownpal = 1
SprPriority = 2
IgnoreHitPause = 1
Persistent = 0

;イントロのフラグ
[State 190,1]
type = AssertSpecial
trigger1 = var(59) = 0
trigger1 = time = [0,550]
trigger2 = var(59) != 0
trigger2 = Anim != 0
flag = Intro

[State 77]
type=explod
trigger1= AnimElem = 3
anim=7250
sprpriority=3
postype=p1
pos=0,ceil(-pos y)
facing=ifelse(random<500,-1,1)
random=160,40
trans=addalpha
alpha=192,256
pausemovetime=-1
supermovetime=-1
ownpal=1
[State 77]
type=playsnd
trigger1= AnimElem = 3
value=5,15
channel=1
freqmul= .9 + (random/5000.0)

[State 175, 1]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim != 0
value = 0

;---------------------------------------------------------------------------
;イントロ４(エフェクト)
[Statedef 195]
type = S
Anim = 194
ctrl = 0

[State 1002,1]
type = VelSet
trigger1 = Animelem = 9,>=0
x = -1

[State 45]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
IgnoreHitPause = 1
persistent = 1

[State 10000]
type = destroyself
trigger1 = BackEdgeDist <= -50

;---------------------------------------------------------------------------
;イントロ４(エフェクト)
[Statedef 196]
type = S
Anim = 195
ctrl = 0

[State 1002,1]
type = VelSet
trigger1 = Animelem = 7,>=0
x = -1

[State 45]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
IgnoreHitPause = 1
persistent = 1

[State 10000]
type = destroyself
trigger1 = BackEdgeDist <= -50



;---------------------------------------------------------------------------
; タイムオーバー
[Statedef 170]
type = S
ctrl = 0
anim = 186
velset = 0,0

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 4
value = s100,Ifelse(Matchover,13,11)
channel = 5
volume = 255

[State -2, 1]
type = PlaySnd
trigger1 = Animelem = 13
value = s0,6

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

;---------------------------------------------------------------------------
; ドロー
[Statedef 175]
type = S
ctrl = 0
anim = 175
velset = 0,0

[State -2, 1]
type = PlaySnd
trigger1 = animelem = 4
value = s100,Ifelse(Matchover,12,10)
channel = 5
volume = 255

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




;====================================================
;---------------------------------------------------------------------------
;特殊行動
;---------------------------------------------------------------------------
; ブロッキング

;---立ち---
[Statedef 160]
type=S
physics=S
movetype=I
anim=160
velset=0,0
ctrl=0
sprpriority=2
poweradd=125
facep2=1

[State 160, hb]
type=hitby
trigger1= 1
value=SCA,AT
time=1
[State 160, pause]
type=pause
trigger1= !time
time=15
movetime=15
endcmdbuftime=15
pausebg=0

[State 160, Stop]
type=posfreeze
trigger1= 1
value=1
[State 160, nowalk]
type=varset
trigger1= 1
var(7)=7

[State 160, Snd]
type=playsnd
trigger1= !time
value=103,6
channel=0
[State 160, Snd]
type=playsnd
trigger1= !time
value=7,0

[State 160, blueflash]
type=palfx
trigger1= AnimElem = 2
add= 64, 64, 127
sinadd=-64,-64,-127,60
time=15

[State 160, FX]
type=explod
trigger1= !time
anim=164
sprpriority=5
postype=p1
pos=ceil(25*const(size.xscale)),ceil(-160*const(size.yscale))
pausemovetime=-1
supermovetime=-1
scale=.5,.5
ownpal=1

[State 160, Shake]
type = envshake
trigger1 = !time
time = 8
freq = 60
ampl = -2
phase = 90

[State 160, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1

;---しゃがみ---
[Statedef 161]
type=C
physics=C
movetype=I
anim=161
velset=0,0
ctrl=0
sprpriority=2
poweradd=125
facep2=1

[State 161, hb]
type=hitby
trigger1= 1
value=SCA,AT
time=1
[State 161, pause]
type=pause
trigger1= !time
time=15
movetime=15
endcmdbuftime=15
pausebg=0

[State 161, Stop]
type=posfreeze
trigger1= 1
value=1
[State 161, nowalk]
type=varset
trigger1= 1
var(26)=7

[State 161, Snd]
type=playsnd
trigger1= !time
value=103,6
channel=0
[State 161, Snd]
type=playsnd
trigger1= !time
value=7,0

[State 161, blueflash]
type=palfx
trigger1= AnimElem = 2
add= 64, 64, 127
sinadd=-64,-64,-127,60
time=15

[State 161, FX]
type=explod
trigger1= !time
anim=164
sprpriority=5
postype=p1
pos=ceil(50*const(size.xscale)),ceil(-60*const(size.yscale))
pausemovetime=-1
supermovetime=-1
scale=.5,.5
ownpal=1

[State 161, Shake]
type = envshake
trigger1 = !time
time = 8
freq = 60
ampl = -2
phase = 90

[State 161, End]
type=changestate
trigger1= !animtime
value=11
ctrl=1

;---空中---
[Statedef 162]
type=A
physics=N
movetype=I
anim=162
ctrl=0
sprpriority=2
poweradd=125
facep2=1

[State 162, hb]
type=hitby
trigger1= 1
value=SCA,AT
time=1
[State 162, pause]
type=pause
trigger1= !time
time=15
movetime=15
endcmdbuftime=15
pausebg=0
[State 162, Stop]
type=posfreeze
trigger1= 1
value=1

[State 162, Snd]
type=playsnd
trigger1= !time
value=103,6
channel=0
[State 162, Snd]
type=playsnd
trigger1= !time
value=7,0

[State 161, blueflash]
type=palfx
trigger1= AnimElem = 2
add= 64, 64, 127
sinadd=-64,-64,-127,60
time=15

[State 162, FX]
type=explod
trigger1= !time
anim=164
sprpriority=5
postype=p1
pos=ceil(35*const(size.xscale)),ceil(-170*const(size.yscale))
pausemovetime=-1
supermovetime=-1
scale=.5,.5
ownpal=1
[State 162, Shake]
type=envshake
trigger1= !time
time=0
ampl=0

[State 162, Shake]
type = envshake
trigger1 = !time
time = 8
freq = 60
ampl = -2
phase = 90

[State 162, End]
type=changestate
trigger1= !animtime
value=163
ctrl=1

;---空中・落下---
[Statedef 163]
type=A
physics=N
movetype=I
anim=163
ctrl=1

[State 163, Vel]
type=velset
trigger1= !time
x=ifelse(vel x>2,2,ifelse(vel x<-2,-2,vel x))
y=ifelse(vel y<-2,vel y,-2)

[State 163, 重力]
type=gravity
trigger1= 1

[State 163, 着地]
type=changestate
trigger1= pos y>-vel y
value=52

;---判定ヘルパー---
[Statedef 165]
type=A
physics=N
movetype=I
anim= ifelse(root,statetype=C, 166, ifelse(root,statetype=A, 167, 165))
velset=0,0
ctrl=0
[State 165, NHB]
type=nothitby
trigger1= 1
value=SCA
[State 165, Bind]
type=bindtoroot
trigger1= 1
time=-1

[State 165, Anim]
type=changeanim
triggerall= !time
trigger1= root,var(59)<=0 && root,command="down"
trigger2= root,var(59)>=1 && (root,statetype!=A) && p2statetype=C
value=166
[State 165, Anim]
type=changeanim
triggerall= !time
trigger1= root,var(59)<=0 && root,command="fwd"
trigger2= root,var(59)>=1 && anim!=166
value= ifelse((root,statetype=A), 167, 165)
[State 165, Anim]
type=changeanim
trigger1= anim=165 || anim=167
value= ifelse((root,statetype=A), 167, 165)

[State 165, Disable]
type=varset
trigger1= time>=ifelse((root,statetype=A),7,8)
trigger2= facing!=(root,facing)
trigger3= !(root,ctrl)
trigger3= (root,stateno!=[160,162]) && (root,stateno!=5120)
var(8)=1
[State 165, Disable]
type=varset
triggerall= root,var(59)<=0
trigger1= (root,command="holdback")
trigger2= time<4 && (root,command="holdfwd" + root,command="holddown")>1
trigger3= time>=4 && (root,command="holdfwd" || root,command="holddown")
trigger4= time>=1 && (((anim=165 || anim=167) && root,command="fwd") || (anim=166 && root,command="down"))
var(8)=1
[State 165, Disable]
type=changeanim
trigger1= var(8)=1
value=9999

[State 165, Standing/Air]
type=reversaldef
trigger1= !var(8) && (anim=165 || anim=167)
trigger1= (root,stateno!=5120) || !(root,animtime)
reversal.attr=SCA,AA
p1stateno=166
pausetime=0,0
sparkno=-1
numhits=0

[State 165, Crouching]
type=reversaldef
trigger1= !var(8) && anim=166
reversal.attr=SC,AA
p1stateno=166
pausetime=0,0
sparkno=-1
numhits=0

[State 165, Disable]
type=reversaldef
trigger1= var(8)=1
reversal.attr=
pausetime=0,0
sparkno=-1
numhits=0

[State 165, end]
type=destroyself
trigger1= time>=18
trigger2= (root,movetype!=I)
trigger3= !(root,ctrl) && (root,stateno!=[160,162]) && (root,stateno!=5120)
trigger4= (root,stateno=[160,162]) && (root,time<=1)

;---ブロッキング成功---
[Statedef 166]
movetype=I
ctrl=0

[State 166, Disable]
type=varset
trigger1=1
var(8)=1

[State 166, End]
type=destroyself
trigger1= root,stateno=[160,162]
trigger2= time>=2

;---------------------------------------------------------------------------
; パワーチャージ
[Statedef 700]
type=S
physics=S
movetype=I
anim=700
velset=0,0
ctrl=0

[State 700, power]
type=poweradd
triggerall= power<powermax
trigger1= var(59)<=0 && (command="holda" && command="holdz")
trigger2= var(59)>=1
value=2+ifelse(time<60,0,(time-60)/12)

[State 700, flash]
type=palfx
trigger1= 1
time=1
add=75+ceil(sin(time/6.0*pi)*75),25+ceil(sin(time/6.0*pi)*25),0

[State 700, FX]
type=helper
trigger1= !numhelper(8030)
helpertype=normal
stateno=8030
ID=8030
name="Power Charge"
postype=p1
pausemovetime=65535
supermovetime=65535
ownpal=1
[State 700, FX]
type=helper
trigger1= !numhelper(8031)
helpertype=normal
stateno=8031
ID=8031
name="Particles"
postype=p1
pos = 0,0
pausemovetime=65535
supermovetime=65535
ownpal=1

[State 700, End]
type=changestate
trigger1= power>=powermax || roundstate!=2
trigger2= var(59)<=0 && (command!="holda" || command!="holdz")
trigger3= var(59)>=1 && (inguarddist || p2bodydist x<=120)
value=701
ctrl=1

;---END---
[Statedef 701]
type=S
physics=S
movetype=I
anim=701
velset=0,0
ctrl=1


[State 700, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1

;---------------------------------------------------------------------------
; カウンター
[Statedef 730]
type=S
physics=S
movetype=A
anim=730
velset=0,0
ctrl=0
juggle=0
sprpriority=2
poweradd=-1000
facep2=1

[State 730, NHB]
type=nothitby
trigger1= 1
value=SCA
time=1
[State 730, Stop]
type=posfreeze
trigger1= 1
value=1

[State 730, Snd]
type=playsnd
trigger1= !time
value=101,ifelse(random>250, 14, 13)
channel=0

[State 730, SuperPause FX]
type=helper
trigger1= !time
helpertype=normal
stateno=8050
ID=8050
name="Counter"
postype=p1
pos= 25, -85
supermovetime=255
ownpal=1
[State 730, Super Pause]
type=superpause
trigger1= !time
time=15
movetime=15
p2defmul=1
anim=-1
sound=s7,1
darken=0

[State 730, NHB]
type=nothitby
trigger1= animelemtime(3)<0
value=SCA
time=1
ignorehitpause=1

[State 730, Snd]
type=playsnd
trigger1= animelem=5
value=102,8
channel=0
[State 730, Snd]
type=playsnd
trigger1= animelem=3
value=0,6
[State 730, Snd]
type=playsnd
trigger1= animelem=6
value=0,7

[State 730, Vel]
type = velset
trigger1 = animelem = 6
x = -3.2
[State 730, Vel]
type = velset
trigger1 = animelem = 9
x = 0

[State 730, Explod]
type = Explod
trigger1 = animelem = 6
anim = 226
pos = 35,-44
postype = P1
bindtime = 1
id = 221
ownpal = 1
scale = .5,.5
sprpriority = 10
IgnoreHitPause = 1
PauseMoveTime = 999999999999
[State 730, Explod]
type = Explod
trigger1 = animelem = 6
anim = 227
pos = 35,-96
postype = P1
bindtime = 1
id = 221
ownpal = 1
scale = .5,.5
sprpriority = 10
IgnoreHitPause = 1
PauseMoveTime = 999999999999

[State vel]
type = VarSet
trigger1 = !time
fvar(29) = -3.8
[State vel]
type = VarSet
trigger1 = !time
fvar(30) = -2.8
[State vel]
type = VarSet
trigger1 = !time
fvar(31) = -1.6
[State vel]
type = VarSet
trigger1 = !time
fvar(32) = -9.2
[State Ether]
type=helper
trigger1 = AnimElem = 6
helpertype=normal
stateno=3000
ID=3000
name="ether"
postype=p1
pos= -10,-115
facing= 1
ownpal=1
size.xscale=.5
size.yscale=.5
ignorehitpause=1
persistent = 1
[State Ether]
type=helper
trigger1 = AnimElem = 6
helpertype=normal
stateno=3001
ID=3000
name="ether"
postype=p1
pos= 6,-27
facing= 1
ownpal=1
size.xscale=.5
size.yscale=.5
ignorehitpause=1
persistent = 1

[State 730, HitDef]
type = HitDef
trigger1 = !time
attr = S, NA
damage = ceil(ifelse(fvar(11)*100<7, 7, fvar(11)*100)), 0
animtype = Heavy
guardflag = MA
hitflag = MAF
priority = 5, Hit
getpower = 72*!var(20), 36*!var(20)
givepower = 36, 36
pausetime = ifelse(var(20), 7, 15), ifelse(var(20), 7, 15)
guard.pausetime = ifelse(var(20), 6, 12), ifelse(var(20), 6, 14)
hitsound = s1,6
guardsound = s3,0
sparkno = -1+(0*(var(40) := 4015))
guard.sparkno = -1+(0*(var(41) := 4100))
sparkxy = -1+(0*(var(42) := -15 && var(43) := -68))
ground.type = low
ground.slidetime = 16
ground.hittime = 16
ground.velocity =  ifelse(var(20), -3.5 , -4.2),-7.6
airguard.ctrltime = 2
guard.velocity = -5
air.velocity = -3.5,-5
fall = 1
fall.recovery = 0
envshake.time = 12
envshake.freq = 80
envshake.ampl = -8
yaccel = .36

[State 730, Type]
type=statetypeset
trigger1= animelemtime(7)>=0
movetype=I
[State 730, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1

;---------------------------------------------------------------------------
; エクステンド
;---地上---
[Statedef 740]
type=S
physics=S
movetype=I
anim = 740
velset=0,0
ctrl=0
sprpriority=2
poweradd=-1000

[State 740, Corner Push]
type=varset
trigger1= time=4
fvar(5)= 0
[State 740, Unguardable]
type=varset
trigger1= time=4 && numenemy
trigger1= (enemynear,stateno!=[120,155])
var(17)=30
[State 740, var]
type=varset
trigger1= time>=4
var(20)=180

[State 740, NHB]
type=nothitby
trigger1= !time
value=SCA
time=38
[State 740, Stop]
type=posfreeze
trigger1= 1
value=1

[State 740, Snd]
type=playsnd
trigger1= time=4
value=8,1
channel=0

[State 740, Snd]
type=playsnd
triggerall = prevstateno = [0,199]
trigger1= !time
value=105,0
channel=1
[State 740, Snd]
type=playsnd
triggerall = prevstateno = [200,999]
trigger1= !time
value=105,1
channel=1
[State 740, Snd]
type=playsnd
triggerall = prevstateno = [1000,3999]
trigger1= !time
value=105,2
channel=1

[State 740, SuperPause FX]
type=helper
trigger1= time=4
helpertype=normal
stateno=8060
ID=8060
name="Custom Combo Startup"
postype=p1
pos=0,-70
supermovetime=255
size.xscale=1
size.yscale=1
ownpal=1
bindtime = -1
ignorehitpause = 1
persistent = 0
supermovetime = 99999
pausemovetime = 99999
[State 740, SuperPause]
type=superpause
trigger1 = time = 4
anim = -1
movetime = 26
time = 26
darken=0

[State 740, AfterImage]
type=afterimage
trigger1= !animtime
time=2
timegap=1
framegap=4
length=13
palbright=0,0,0
palcontrast=64,128,192
palpostbright=0,0,0
paladd=0,0,0
palmul=.75,.75,.75
trans=add1

[State 740, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1

;---空中---
[Statedef 745]
type=A
physics=N
movetype=I
anim=745
ctrl=0
sprpriority=2
poweradd=-1000

[State 745, Corner Push]
type=varset
trigger1= time=4
fvar(5)= 0
[State 745, Unguardable]
type=varset
trigger1= time=4 && numenemy
trigger1= (enemynear,stateno!=[120,155])
var(17)=30
[State 745, var]
type=varset
trigger1= time>=4
var(20)=180

[State 745, NHB]
type=nothitby
trigger1= !time
value=SCA
time=38
[State 745, Stop]
type=posfreeze
trigger1= 1
value=1

[State 745, Snd]
type=playsnd
trigger1= time=4
value=8,1
channel=0

[State 740, Snd]
type=playsnd
triggerall = prevstateno = [0,199]
trigger1= !time
value=105,0
channel=1
[State 740, Snd]
type=playsnd
triggerall = prevstateno = [200,999]
trigger1= !time
value=105,1
channel=1
[State 740, Snd]
type=playsnd
triggerall = prevstateno = [1000,3999]
trigger1= !time
value=105,2
channel=1

[State 745, SuperPause FX]
type=helper
trigger1= time=4
helpertype=normal
stateno=8060
ID=8060
name="Custom Combo Startup"
postype=p1
pos=35,-76
supermovetime=255
size.xscale=1
size.yscale=1
ownpal=1
bindtime = -1
ignorehitpause = 1
persistent = 0
supermovetime = 99999
pausemovetime = 99999
[State 745, SuperPause]
type=superpause
trigger1 = time = 4
anim = 9999
movetime = 26
time = 26
darken=0

[State 745, AfterImage]
type=afterimage
trigger1= !animtime
time=2
timegap=1
framegap=4
length=13
palbright=0,0,0
palcontrast=64,128,192
palpostbright=0,0,0
paladd=0,0,0
palmul=.75,.75,.75
trans=add1

[State 745, End]
type=changestate
trigger1= !animtime
value=746
ctrl=1

;---落下---
[Statedef 746]
type=A
physics=N
movetype=I
anim=746
ctrl=1

[State 746, Grav]
type=gravity
trigger1= 1

[State 746, Land]
type=changestate
trigger1= pos y>-vel y
value=52

;---------------------------------------------------------------------------
;緊急回避前
[Statedef 750]
type     = S
movetype = I
physics  = N
velset   = 0,0
anim     = 750
ctrl     = 0
sprpriority = -2

[State 750, power]
type = Poweradd
trigger1 = !time
value = -1000

[State 750, Palfx]
type = palfx
trigger1 = !time
time = 5
add = 230,230,230
trans = Add1

[State 750, AfterImage]
type = AfterImage
trigger1 = AnimElem = 1
time = 15
length = 6
timegap = 3
framegap = 3
palbright = 1, 1, 1
palcontrast = 128, 128, 128
paladd = 0, 0, 0
palmul = 1, 1, 1
trans = Add1

[State 750, Hitby]
type = HitBy
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(3) <= 0
value = SC, NT, ST, HT

[State 750, Vel]
type = VelSet
trigger1 = AnimElem = 2
x = 8
[State 750, Vel]
type = VelSet
trigger1 = AnimElem = 3
x = 0


[State 750, Dust]
type=helper
trigger1= animelem=1
helpertype=normal
stateno=8003
ID=8000
name="Dash Dust"
postype=p1
pausemovetime=255
supermovetime=255
ownpal=1
[State 750, Dust]
type=explod
trigger1= animelem = 3
anim=8002
sprpriority=-3
postype=p1
pos = 30,0
scale=.5,.5
pausemovetime=-1
supermovetime=-1
ownpal=1

[State 750, Snd]
type=playsnd
trigger1= animelem = 3
value=5,2

[State 750, Push]
type = PlayerPush
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
value = 0

[State 750, ChangeState]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;受身
[Statedef 52000]
type     = S
movetype = I
physics  = N
anim     = 5200
ctrl     = 0
sprpriority = 2

[State 5200]
type = Posset
trigger1 = !time
y = 0

[State 200, 音を鳴らす]
type = PlaySnd
trigger1 = !time
value = s5,0

[State 101, Dust]
type=explod
trigger1 = !time
anim=8004
sprpriority=3
postype=p1
pos=0,0
vel=0,0
scale=.5,.5
pausemovetime=-1
supermovetime=-1
ownpal=1

[State 2110, 無敵]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2110, ]
type = Varset
trigger1 = var(59) <= 0
trigger1 = !animtime
trigger2 = var(59) > 0
trigger2 = P2bodydist X >= 91
trigger3 = !time
var(6) = 0

[State 2110, ]
type = Varset
trigger1 = var(59) <= 0
trigger1 = !time
trigger1 = command = "holdback"
trigger2 = var(59) > 0
trigger2 = EnemyNear,AnimTime <= -30 
trigger3 = var(59) > 0
trigger3 = P2bodydist X = [-15,90]
trigger3 = BackEdgeBodyDist <= 30
var(6) = 1

[State 5200]
type = velset
trigger1 = !time
y = 0

[State 2110, 移動量]
type = VelSet
trigger1 = !time
x = Vel X * 0.5
[State 2110, 移動量]
type = VelSet
trigger1 = AnimElem = 2
y = -4.2

[state 300,]
type = Veladd
triggerall = var(6) = 0
trigger1 = AnimElemtime(1) >= 0 && AnimElemtime(2) <= 3
x = .018

[State 2110, 移動量]
type = VelSet
triggerall = var(6) = 1
trigger1 = AnimElemtime(2) >= 0 && AnimElemtime(4) <= 0
x = -5
[state 300,]
type = Veladd
triggerall = var(6) = 1
trigger1 = AnimElemtime(2) >= 3 && AnimElemtime(4) <= 0
x = .2

[State 2110, 相手と重なった時の処理]
type = PlayerPush
trigger1 = AnimElemTime(1) > 0
value = 0

[State 200, Type]
type=statetypeset
trigger1= animelemtime(2)>=0
physics = A

[State 2110, 終了]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

;====================================================
;---------------------------------------------------------------------------
;特殊やられ
;---------------------------------------------------------------------------
; 空中ヒット
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5135, 特殊KO]
type = Changeanim
triggerall = MatchOver = 1
trigger1 = !time
trigger1 = enemynear,stateno = [1000,3999]
value = 7000
persistent = 0

[State 5135, KO]
type=varset
trigger1= anim = 7000
var(58)=1
persistent = 0
[State 5135, KO]
type=varset
trigger1= anim != 7000
var(58)=0
persistent = 0

[State 5035, 1]
type = ChangeAnim
triggerall = !MatchOver
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 >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;HITA_RECOV

[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 >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; 食らい落下
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 特殊KO以外]
type = Changeanim
trigger1 = time = 0
trigger1 = anim != 7000
trigger1 = MatchOver = 1
value = 5050
persistent = 0

[State 5050, 特殊KO]
type = Changeanim
trigger1 = time = 0
trigger1 = anim = 7000
trigger1 = MatchOver = 1
value = 7000
persistent = 0

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = !MatchOver
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
triggerall = !MatchOver
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

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

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
; ダウン
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 特殊KO以外]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim != 5901
trigger1 = MatchOver = 1
value = 5100
persistent = 0

[State 5100, 特殊KO]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim = 7000
trigger1 = MatchOver = 1
value = 7001
persistent = 0

[State 5100,振動]
type = EnvShake
trigger1 = time = 0
time = 10
ampl = 3

[State 103, Dust]
type=explod
trigger1= AnimElem = 3
anim=8005
sprpriority=-3
postype=p1
pos = 30,0
scale=.5,.5
pausemovetime=-1
supermovetime=-1
ownpal=1

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[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 = !MatchOver
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
triggerall = !MatchOver
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 = 5110 ;HIT_LIEDOWN

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

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

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

;---------------------------------------------------------------------------
; ダウン後バウンド中
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 特殊KO以外]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim != 7001
trigger1 = MatchOver = 1
value = 5160
persistent = 0

[State 5101, 特殊KO]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim = 7001
trigger1 = MatchOver = 1
value = 7000
persistent = 0

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = !MatchOver
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 = !MatchOver
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 = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .64

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; ダウン
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, 特殊KO以外]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim != 7000
trigger1 = MatchOver = 1
value = 5170
persistent = 0

[State 5110, 特殊KO]
type = ChangeAnim
trigger1 = time = 0
trigger1 = anim = 7000
trigger1 = MatchOver = 1
value = 7001
persistent = 0

[State 103, Dust]
type=explod
trigger1= AnimElem = 3
anim=8005
sprpriority=-3
postype=p1
pos = 30,0
scale=.5,.5
pausemovetime=-1
supermovetime=-1
ownpal=1

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

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = !MatchOver
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 = !MatchOver
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, 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, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[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))
triggerall = anim != 5904
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]
triggerall = anim != 5904
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

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

[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

;---------------------------------------------------------------------------
; KO
[Statedef 5150]
type=L
movetype=H
physics=N
sprpriority=-3

[State 5050, 特殊KO]
type = Changeanim
trigger1 = !time
trigger1 = var(58) = 1
value = 7001
persistent = 0

[State 277,0]
type = AssertSpecial
trigger1 = time = [0,300]
flag = RoundNotOver

[State 5150, Anim]
type=changeanim
triggerall= anim!=5140
trigger1= roundstate!=2 && !matchover && !(teammode=turns)
value= 5140


[State 5150, Anim]
type=changeanim
trigger1= !time
trigger1 = var(58) = 0
value= 5110

[State 5150, Anim]
type=turn
trigger1= anim=5140 && animelem=2
trigger1= p2dist x<0
persistent=0

[State 5150, Sound]
type= playsnd
trigger1= anim=5140 && animelem=3
value=100,11
channel=0
persistent=0

[State 5150, Vel]
type=velmul
trigger1= 1
x= .85
[State 5150, Vel]
type=velset
trigger1= abs(vel x)<.05
x= 0

[State 5150, NHB]
type= nothitby
trigger1= 1
value=SCA
time=1

;----------------------------------------------------------------------------
;ワイヤーダメージ 真横
[Statedef 23000];相手
type    = A
movetype= H
physics = N
velset = 0,0

[State a]
type = PlayerPush
trigger1 = 1
value = 0

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

[State a]
type = turn
Trigger1 = frontedgedist <= 0
value = 1

[State a]
type = velset
trigger1 = time = 18
x = ifelse((enemynear,facing = facing), 18, -18)
y = -.6

[State a]
type = afterimage
trigger1 = time = 18
time = 15
length = 3
PalBright   =   0,  0,  0
PalContrast = 255,255,255
PalAdd      =   0,  0,  0
PalMul      =  1,1,1
FrameGap = 2
ignorehitpause = 1

[State a]
type = VelAdd
Trigger1 = time > 22
y = .14

[State a]
type = ChangeAnim
trigger1 = !time
value = 5030

[state a]
type = changestate
Trigger1 = backedgedist <= 0
Trigger2 = frontedgedist <= 0
value = 23010

;----------------------------------------------------------------------------
;ワイヤーダメージ 斜め上
[Statedef 23001];相手
type    = A
movetype= H
physics = N
velset = 0,0

[State a]
type = PlayerPush
trigger1 = 1
value = 0

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

[State a]
type = turn
Trigger1 = frontedgedist <= 0
value = 1

[State a]
type = velset
trigger1 = time = 18
x = ifelse((enemynear,facing = facing), 18, -18)
y = -8

[State a]
type = afterimage
trigger1 = time = 18
time = 15
length = 3
PalBright   =   0,  0,  0
PalContrast = 255,255,255
PalAdd      =   0,  0,  0
PalMul      =  1,1,1
FrameGap = 2
ignorehitpause = 1

[State a]
type = VelAdd
Trigger1 = time > 22
y = .14

[State a]
type = ChangeAnim
trigger1 = !time
value = 5030

[state a]
type = changestate
Trigger1 = backedgedist <= 0
Trigger2 = frontedgedist <= 0
value = 23010

;----------------------------------------------------------------------------
;ワイヤーダメージ 真下
[Statedef 23002];相手
type    = A
movetype= H
physics = N
velset = 0,0

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

[State a]
type = turn
Trigger1 = frontedgedist <= 0
value = 1

[State a]
type = velset
trigger1 = time = 18
x = 0
y = 18

[State a]
type = afterimage
trigger1 = time = 18
time = 15
length = 3
PalBright   =   0,  0,  0
PalContrast = 255,255,255
PalAdd      =   0,  0,  0
PalMul      =  1,1,1
FrameGap = 2
ignorehitpause = 1

[State a]
type = VelAdd
Trigger1 = time > 22
y = .14

[State a]
type = ChangeAnim2
trigger1 = !time
value = 23002

[state a]
type = changestate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 23011

;----------------------------------------------------------------------------
[Statedef 23010];相手2
type    = A
movetype= H
physics = N
velset = 0,0

[State a]
type = PlayerPush
trigger1 = 1
value = 0

[State a]
type = ChangeAnim
Trigger1 = !time
value = 5070

[State 536, Shake]
type = EnvShake
trigger1 = !time
time  = 10
ampl  = 8
freq  = 90
phase = 100

[State a]
type = VelSet
Trigger1 = time = 5
y = -7.5
x = 3.2

[State a]
type = VelAdd
Trigger1 = time > 8
y = .5
x = -.06

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

;----------------------------------------------------------------------------
; バウンド
[Statedef 23011]
type    = A
movetype= H
physics = N
velset = 0,0

[State a]
type = ChangeAnim
Trigger1 = !time
value = 5090

[State a]
type = EnvShake
trigger1 = !time
time  = 10
ampl  = 8
freq  = 90
phase = 100

[State a]
type = VelSet
triggerall = prevstateno = 2230
Trigger1 = time = 5
y = -4.2
x = -3.8
[State a]
type = VelSet
triggerall = prevstateno = 23002
Trigger1 = time = 5
y = -5.6
x = -1.2

[State a]
type = VelAdd
Trigger1 = time > 8
y = .32

[State a]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100
;----------------------

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

;永久ヘルパー
[Statedef 222]
 type = A
 movetype = A　　;←ここは必ずmovetype = A（攻撃）にして下さい。　　　　　
physics = N
 velset = 0,0
 ctrl = 0
 Anim = 1058;攻撃判定を持つ物1058のanimtimeをー１にしないでください
SprPriority = 3
 movehitpersist = 1
 hitdefpersist = 1

[State 10000, 1];殴られたり投げられたりしないように設定
type = NotHitBy
trigger1 = 1
value = SCA, NT, ST, HT, NA, SA, HA,NP,SP,HP


[State ,ターゲット取得]
type = HitDef
 trigger1 = IsHelper(222)
 Trigger1=Anim=1058
 attr = ,SA
 sparkno = -1
 hitsound = -1
 hitflag = MAFD
 affectteam = E
 pausetime =15 ,15 ;親変更時にHitPauseTimeが必要になってくるのでこの段階で付けておく

[State 2501,UnGuard];ガード不可設定

Type=assertSpecial

trigger1 = IsHelper(222)
 flag=unGuardable


[State 1058, 3];相手がガードモーションを取り続けないよう movetype を I に
type = statetypeset
 trigger1 = movehit >= 1
 trigger1 = IsHelper(222)
 statetype = S
 movetype = I
 physics = N
 ignorehitpause = 1


[State 1058,1]
 type = reversaldef
 trigger1 = IsHelper(222)
 trigger1 = movehit >= 1;攻撃がヒットした直後から起動します。movecontact や moveguarded なども使えます。
reversal.attr = SCA,AA,AT,AP
 ignorehitpause = 1


 [State 1058,4]; 影消し
Type = AssertSpecial
 trigger1 = IsHelper(222)
 Trigger1 = movehit = 0
 Flag = NoShadow
 IgnoreHitPause = 1


[State 1058,5]; ヒット時透明に
Type = AssertSpecial
 trigger1 = IsHelper(222)
 triggerall = ishelper
 trigger1 = NumTarget
flag = NoShadow
 flag2 = invisible
 IgnoreHitPause = 1


[State 10000]
type = TargetState
triggerall = !ishelper
triggerall = Target,movetype != H
triggerall = Target,stateno != 10001
trigger1 = Root,stateno = 2300
trigger1 = Root,screenpos x >= (var(10)-320)	;必ず攻撃が当たるｘ座標差（前方）　※
trigger1 = Root,screenpos x <= (var(10)+320)	;必ず攻撃が当たるｘ座標差（後方）　※
trigger1 = var(11) >= (240-240)			;必ず攻撃が当たるｙ座標差　※
value = 10001
IgnoreHitPause = 1




 [State 1058,2];毒
type = targetlifeadd
 trigger1 = ishelper(222)
 trigger1 = gametime% 10= 0;gametime;
 Trigger1 = RoundState =2
 value = -20
 kill=1

[State 1058,7]; 無敵に
Type = nothitby
 trigger1 = IsHelper(222)
 triggerall = ishelper
 trigger1 = NumTarget
 Trigger1 = 1
 value = sca
 time = -1

IgnoreHitPause = 1

[State 140, アニメ変更];1058のanimtimeをー１にしないでください
type = ChangeAnim
 trigger1 = time=0
 triggerall = IsHelper(222)
 value = 1058


[State 140, アニメ変更]
type = ChangeAnim
 Trigger1 = RoundState =2

triggerall = IsHelper(222)
 triggerall = ishelper
 trigger1 = NumTarget
 trigger1 =!target,Ishelper
 triggerall = !HitPauseTime
 value = 223


[State 3600, 5]
 type = Destroyself
 triggerall = IsHelper(222)
 Trigger1=Anim=223
 Trigger1=AnimTime=0 

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

[Statedef 10001]
type = U
movetype = H
physics = U
sprpriority = -1
ctrl = 0

[State 10001]
type = ChangeAnim
triggerall = Statetype != A
trigger1 = Anim != 0
value = 0
[State 10001]
type = ChangeAnim
trigger1 = Statetype = A
value = 41
[State 10001]
type = VelSet
trigger1 = 1
x = 0
y = 0
[State 10001]
type = PosSet
trigger1 = 1
y = ifelse((Statetype = A),-20,0)
persistent = 0


[State 10001]
type = HitBy
trigger1 = 1
value = SCA,AA,AP,AT
[State 10001]
type = SelfState
trigger1 = Time >= 30
value = 5050

;=========================================
;この下、一行以上空ける事！
