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

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

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

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; 開始前の動作
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 1] 
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

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

[State 191, 3]
type = PlaySnd
trigger1 = Time = 50
value = 9,0

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

; この下のステートがKFMが蹴る木の板です。KFMのCNSを貴方のキャラに利用しているなら、
; 下にあるステート（191）を消したらいいです。
[State 191, Wood 1]
type = Explod
trigger1 = RoundState != 0
persistent = 0
anim = 191
postype = p1
pos = 260, -90
velocity = -4.2, -7
accel = 0, .32
removetime = 48

[State 191, Wood 2]
type = Explod
trigger1 = AnimElemTime(7) = 1
anim = 192
postype = p1
pos = 60, -70
velocity = 2, -4
accel = 0, .32
removetime = 35

[State 191, 5]
type = PlaySnd
trigger1 = AnimElem = 7
value = F5,2
volume = -40

[State 191, 6]
type = PlaySnd
trigger1 = AnimElemTime(7) = 3
value = F5,3
volume = -80

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

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

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


;---------------------------------------------------------------------------
; 立ち・弱・パンチ・の動作
[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 20000                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -8000                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 4101]
type = Explod
trigger1 = AnimElem = 2
removetime = 60
bindtime = -1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 20,0
scale = 2,2
anim = 200001
sprpriority = 9999999999999999999999999
ontop = 1
ignorehitpause = 1

[State 2000, 6]
type = Projectile
trigger1 = AnimElem = 2
projanim = 200002
projremove = 0
projremovetime = 57
projpriority = 1
projsprpriority = 5
projshadow = 0,0,0
getpower = 100
offset = 0,0
attr = S,NA
animtype = Hard
damage = ceil(((enemy,const(data.defence)*0.01)*enemy,lifemax*0.500))                  ;ダメージ量（左が当たった時、右はガードした時）
hitflag = MAFPDLH
guardflag = 
hitsound = s0,42
guardsound = -1
pausetime = 0,4
ground.type = High
ground.hittime = 21
ground.slidetime = 21
ground.velocity = -2,-10
air.juggle = 8
air.velocity = -2,-10
fall = 1
air.fall = 1
envshake.time = 4
envshake.freq = 180
envshake.ampl = 22
palfx.time = 15
palfx.add = 32,0,0
palfx.mul = 300,192,192

[State 4212, shockwave1]
type=helper
trigger1= AnimElem = 1
helpertype=player
stateno=800000
ID=800000
name="thyou"
postype=p1
facing=1
pos=2,-16
ownpal=1
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State 4206,EnvShake]
type = EnvShake
trigger1 =AnimElem = 2
time = 53
ampl = 21

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 0, 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10020, 1

[State 861, 時間停止]
type = Pause
trigger1 = AnimElem = 1
time = 31
movetime = 31
ignorehitpause = 1

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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


;---------------------------------------------------------------------------
; 立ち・弱・パンチ・の動作
[Statedef 210]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 21000                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -4000                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 4101]
type = Explod
trigger1 = AnimElem = 1
removetime = 24
bindtime = -1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 1,-18
anim = 210001
scale = 0.5,0.5
sprpriority = 9999999999999999999999999
ontop = 1
ignorehitpause = 1

[State 4101]
type = Explod
trigger1 = AnimElem = 1
removetime = 24
bindtime = -1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 15,-18
anim = 210000
sprpriority = 9999999999999999999999999
ontop = 1
ignorehitpause = 1

[State 2000, 6]
type = Projectile
trigger1 = gametime%6 = 1
projanim = 210002
projremove = 0
projremovetime = 3
projpriority = 1
projsprpriority = 5
projshadow = 0,0,0
getpower = 100
offset = 0,0
attr = S,NA
animtype = Hard
damage = ceil(((enemy,const(data.defence)*0.01)*enemy,lifemax*0.120))                  ;ダメージ量（左が当たった時、右はガードした時）
hitflag = MAFPDLH
guardflag = 
hitsound = -1
guardsound = -1
pausetime = 0,4
ground.type = High
ground.hittime = 21
ground.slidetime = 21
ground.velocity = -1,0
air.juggle = 8
air.velocity = -1,0
fall = 1
air.fall = 1
envshake.time = 4
envshake.freq = 180
envshake.ampl = 22
palfx.time = 15
palfx.add = 0,0,255
palfx.mul = 0,0,255

[State 4206,EnvShake]
type = EnvShake
trigger1 = gametime%6 = 1
time = 4
ampl = 14

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 0,1

[State 200, 1]
type = PlaySnd
trigger1 = gametime%6 = 1
value = 7,1

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

;---------------------------------------------------------------------------
; はねる
[Statedef 230]
type    = A                     
movetype= A                      
physics = N                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,-23                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 20000                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -6500                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 85,2

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 85,1

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0,2

[State 3210, 速度加算]
type = VelAdd
trigger1 = 1
y = .56

[State 1101, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y > 0
value = 231
ctrl = 0

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

;---------------------------------------------------------------------------
; 立ち・弱・パンチ・の動作
[Statedef 231]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 23001                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -2000                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 200, 1]
type = Posset
trigger1 = Time = 0
y = 0

[State 4101]
type = Explod
trigger1 = AnimElem = 1
removetime = 36
bindtime = -1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 0,0
anim = 230000
scale = 2,2
sprpriority = 9999999999999999999999999
ontop = 1
ignorehitpause = 1

[State 2000, 6]
type = Projectile
trigger1 = Animelem = 1
projanim = 230001
projremove = 0
projremovetime = 36
projpriority = 1
projsprpriority = 5
projshadow = 0,0,0
getpower = 100
offset = 0,0
attr = S,NA
animtype = Back
damage = ceil(((enemy,const(data.defence)*0.01)*enemy,lifemax*0.222))                  ;ダメージ量（左が当たった時、右はガードした時）
hitflag = MAFPDLH
guardflag = 
hitsound = -1
guardsound = -1
pausetime = 0,4
ground.type = High
ground.hittime = 21
ground.slidetime = 21
ground.velocity = -1,12
air.juggle = 8
air.velocity = -1,12
air.fall = 1
fall=1
fall.recover=1
fall.xvelocity =-1
fall.yvelocity =-8

[State 4206,EnvShake]
type = EnvShake
trigger1 = Animelem= 1
time = 34
ampl = 16

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 85,3

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 85,4

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

;---------------------------------------------------------------------------
; 立ち・弱・パンチ・の動作
[Statedef 240]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 24000                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -2900                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 200, 1]
type = Veladd
trigger1 = 1
x = 2

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 700,3

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0,3

[State 200, 7]
type = ChangeState
trigger1 = Time >= 33
value = 0
ctrl = 1

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

;---------------------------------------------------------------------------
; ハイドロポンプ
[Statedef 260]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 26000                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = -9000                    ;このステートを使った時のパワー増加量(0で変化無し)
sprpriority = 2                  ;表示した絵の重なり具合(2一番前　0通常　-1奥)

[State 4101]
type = Explod
trigger1 = AnimElem = 1
removetime = 163
bindtime = -1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 15,-8
anim = 260000
sprpriority = 9999999999999999999999999
ontop = 1
ignorehitpause = 1

[State 2000, 6]
type = Projectile
trigger1 = AnimElem = 1
projanim = 260001
Projhits = 11111
projremove = 0
projremovetime = 163
projpriority = 1
projsprpriority = 5
projshadow = 0,0,0
getpower = 100
offset = 15,-8
attr = S,NA
animtype = Hard
sparkno = -1
damage = ceil(((enemy,const(data.defence)*0.01)*enemy,lifemax*0.003))                  ;ダメージ量（左が当たった時、右はガードした時）
hitflag = MAFPDLH
guardflag = 
hitsound = s0,42
guardsound = -1
pausetime = 0,4
ground.type = High
ground.hittime = 21
ground.slidetime = 21
ground.velocity = -2,-10
air.juggle = 8
air.velocity = -2,-10
fall = 1
air.fall = 1

[State 4206,EnvShake]
type = EnvShake
trigger1 =AnimElem = 1
time = 163
ampl = 21

[State 200, 1]
type = PlaySnd
trigger1 = Time = 0
value = 0,4

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8,3

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

;---------------------------------------------------------------------------
; ここから下に新しいステートを書くと分かりやすくていいと思います
;---------------------------------------------------------------------------

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

;---Finish---
[Statedef 800000]
type = S
movetype = A
physics = S
juggle = 1
velset= 0,0
ctrl= 0
sprpriority= 999999999999999999999999999999999999999999999999999999999999999999999

[State 7500, Lv1]
type=bgpalfx
trigger1= sysvar(1)<=31
time=1
add=0,0,0

[State 77, trans]
type=angledraw
trigger1= 1
scale=1.5-(.0333*sysvar(1)),1.5-(.0333*sysvar(1))

[State 240, 4]
type = ChangeAnim
trigger1 = Anim != 200000
value = 200000

[State 240, 4]
type = Trans
trigger1 = 1
trans = add

[State 4206,Playsnd]
type= Varadd
trigger1= 1
sysvar(1) = 1

[State 4206,Playsnd]
type= playsnd
trigger1= AnimElem = 1
value= 10020,2

[State 4206,assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
ignorehitpause = 1

[State 4206,destroyself]
type = Destroyself
trigger1 = sysvar(1) >= 31

;====================<HOLINESS>====================
[Statedef 77]
type=A
physics=N
anim=9741
ctrl=0
[state 150]
type = statetypeset
trigger1 = ishelper(2010) || ishelper(2011)
statetype = s
movetype = i
physics = n
ignorehitpause = 1
[state 150]
type = velset
trigger1 = ishelper(2010) || ishelper(2011)
x = 0
y = 0
persistent = 0
ignorehitpause = 1
[State 77, anim]
type=changeanim
trigger1 = ishelper(2010) || ishelper(2011)
trigger1= selfanimexist(root,anim)
value=(root,anim)
elem=(root,animelemno(0))
[state 150]
type = ctrlset
trigger1 = ishelper(2010) || ishelper(2011)
value = 0
persistent = 0
ignorehitpause = 1
[state 150]
type = hitoverride
trigger1 = ishelper(2010) || ishelper(2011)
time = -1
attr = SCA,AA,AT,AP
slot = 1
stateno = 150
ignorehitpause = 1
[state 150]
type = assertspecial
triggerall = ishelper(2010) || ishelper(2011)
trigger1 = root,movetype = h || root,alive != 1
flag = invisible
[state 150]
type = assertspecial
trigger1 = ishelper(2010) || ishelper(2011)
flag = noshadow
[state 150]
type = bindtoroot
trigger1 = ishelper(2010) || ishelper(2011)
pos = (5.5*sin(gametime*0.09))*ifelse(ishelper(2011),1,-1),(5.5*cos(gametime*0.09))*ifelse(ishelper(2011),1,-1)

[state 150]
type = nothitby
trigger1 = ishelper(2010) || ishelper(2011)
value = sca
time = -1
[state 150]
type = turn
triggerall = ishelper(2010) || ishelper(2011)
trigger1 = facing != root,facing
[state 150]
type = trans
trigger1 = ishelper(2010) || ishelper(2011)
trans = add1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; ここは-2のステートを書いてください、ヘルパー関係です
;---------------------------------------------------------------------------

[Statedef -2]

[State ]
type=RemoveExplod
trigger1=!ishelper
trigger1=roundstate=2&&ctrl
id=5900
ignorehitpause=1

[State ]
type=AssertSpecial
triggerall=!ishelper
trigger1=!alive&&sysvar(4)!=lifemax
trigger2=lifemax<1||gethitvar(damage)
trigger3=roundstate!=2&&life=0
flag=noko
flag2=timerfreeze
ignorehitpause=1

[State ]
type=AssertSpecial
triggerall=ishelper
trigger1=!root,alive&&root,sysvar(4)!=root,lifemax
trigger2=root,lifemax<1||root,gethitvar(damage)
flag=noko
flag2=timerfreeze
ignorehitpause=1

[State ]
type=VarSet
trigger1=!ishelper
sysfvar(0)=ifelse(palno<enemynear(!enemynear,alive&&numenemy>1),palno,enemynear(!enemynear,alive&&numenemy>1),palno,palno)
ignorehitpause=1

[State ]
type=VarAdd
triggerall=!ishelper
triggerall=numhelper(254)
trigger1=sysvar(3)=0&&sysvar(4)<lifemax
trigger1=enemynear(!enemynear,alive&&numenemy>1),alive
trigger1=enemynear(!enemynear,alive&&numenemy>1),movehit||enemynear(!enemynear,alive&&numenemy>1),hitdefattr=SCA,AA,AP
trigger1=helper(254),movetype=H&&helper(254),time=0&&helper(254),sysfvar(1)=0
trigger1=helper(254),gethitvar(damage)=[1,199]
sysvar(4)=1
ignorehitpause=1
[State ]
type=VarAdd
triggerall=!ishelper
triggerall=numhelper(254)
trigger1=sysvar(4)<lifemax
trigger1=enemynear(!enemynear,alive&&numenemy>1),alive
trigger1=enemynear(!enemynear,alive&&numenemy>1),movehit||enemynear(!enemynear,alive&&numenemy>1),hitdefattr=SCA,AA,AP
trigger1=helper(254),movetype=H&&helper(254),time=0&&helper(254),sysfvar(1)=0
trigger1=helper(254),gethitvar(damage)=[1,199]
sysvar(3)=-1
ignorehitpause=1

[State ]
type=VarAdd
triggerall=!ishelper
trigger1=sysvar(4)!=[0,lifemax]
sysvar(4)=ifelse(sysvar(4)<0,0,lifemax)
ignorehitpause=1

[State ]
type=VarSet
triggerall=!ishelper
trigger1=!numhelper(254)||roundstate!=2||numexplod(5900)
trigger2=alive&&life=0&&sysvar(4)!=lifemax
trigger3=lifemax<1||gethitvar(damage)
trigger4=palno!=[1,12]
sysvar(4)=0
ignorehitpause=1

[State ]
type=VarSet
trigger1=!ishelper
sysfvar(1)=ifelse(sysvar(3)=0,sysfvar(1)+1,0)
ignorehitpause=1

[State ]
type=VarSet
triggerall=!ishelper
trigger1=!numhelper(254)||numexplod(5900)
trigger2=sysfvar(1)>254
sysvar(3)=-1
ignorehitpause=1
[State ]
type=VarSet
triggerall=!ishelper
trigger1=alive&&life=0&&sysvar(4)!=lifemax
trigger2=lifemax<1||gethitvar(damage)
trigger3=palno!=[1,12]
sysvar(3)=9999
ignorehitpause=1

[State ]
type=VarSet
triggerall=!ishelper
trigger1=sysvar(3)<0&&sysfvar(0)=[1,4]
sysvar(3)=3
ignorehitpause=1
[State ]
type=VarSet
triggerall=!ishelper
trigger1=sysvar(3)<0&&sysfvar(0)=[5,6]
sysvar(3)=11
ignorehitpause=1
[State ]
type=VarSet
triggerall=!ishelper
trigger1=sysvar(3)<0&&sysfvar(0)=[7,8]
sysvar(3)=25
ignorehitpause=1
[State ]
type=VarSet
triggerall=!ishelper
trigger1=sysvar(3)<0&&sysfvar(0)=[9,10]
sysvar(3)=54
ignorehitpause=1
[State ]
type=VarSet
triggerall=!ishelper
trigger1=sysvar(3)<0&&sysfvar(0)!=[1,10]
sysvar(3)=254
ignorehitpause=1

[State ]
type=HitFallDamage
trigger1=!ishelper
ignorehitpause=1
[State ]
type=LifeSet
trigger1=!ishelper
value=lifemax-sysvar(4)
ignorehitpause=1

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 11111
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State -2, AfterImage]
type = afterimage
trigger1 = !time
trans = add
PalContrast =  250,250,250
PalBright = 250,250,250
time    =  -1
length  = 10
TimeGap = 1
FrameGap = 1
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

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

[State a];音楽
type = PlaySnd
trigger1 = !IsHelper
value = 9999, 9999
channel = 9
lowpriority = 1
loop = 1
abspan=0
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State 4200]
Type = trans
Trigger1 = !IsHelper
trans = add1

[State 191, 2] 
type = AssertSpecial
trigger1 = 1
flag = nomusic
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State 200, 7]
type = Poweradd
trigger1 = 1
value = 1000
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State 200, 7]
type = SelfState
trigger1 = IsHelper(800000)
value = 800000
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State -2, gametime式ステ抜け]
type = SelfState
trigger1 = IsHelper(77)
value=77
ignorehitpause = 1
supermovetime = 9999999999
pausemovetime = 9999999999

[State 200, 7]
type = SelfState
trigger1 = IsHelper(2010)
value =77
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State 200, 7]
type = SelfState
trigger1 = IsHelper(2011)
value =77
ignorehitpause=1
SuperMoveTime = 999999999999999999999999999
PauseMoveTime = 999999999999999999999999999

[State ]
type=Helper
triggerall=!ishelper
trigger1=!numhelper(2541)
helpertype=player
name="magi"
id=2541
supermovetime=2147483647
pausemovetime=2147483647
ignorehitpause=1
[State ]
type=Helper
triggerall=!ishelper
trigger1=!numhelper(2542)
helpertype=player
name="karp"
id=2542
supermovetime=2147483647
pausemovetime=2147483647
ignorehitpause=1

[state -2]
type = helper
triggerall = !ishelper
trigger1 = numhelper(2010) = 0
helpertype = player
name = "kage"
id = 2010
keyctrl = 0
stateno = 77
ownpal = 1
ignorehitpause=1
supermovetime = 2147483647
pausemovetime = 2147483647

[state -2]
type = helper
triggerall = !ishelper
trigger1 = numhelper(2011) = 0
helpertype = player
name = "kage2"
id = 2011
keyctrl = 0
stateno = 77
ownpal = 1
ignorehitpause=1
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type=Helper
triggerall=!ishelper&&roundstate=2&&alive
trigger1=!numhelper(254)
trigger1=palno!=11
helpertype=player
name="fish"
id=254
supermovetime=2147483647
pausemovetime=2147483647
ignorehitpause=1

[State ]
type=VarSet
trigger1=ishelper(254)
sysvar(4)=0
ignorehitpause=1
[State ]
type=VarSet
trigger1=ishelper(254)
trigger1=movetype=H&&time=0
sysfvar(0)=50
ignorehitpause=1

[State ]
type=SelfState
trigger1=ishelper(254)
value=254
ignorehitpause=1
[State ]
type=SelfState
trigger1=ishelper(2541)||ishelper(2542)
value=2541
ignorehitpause=1

;---------------------------------------------------------------------------
; ここから下は-3のステートを書いてください、ここに書いたものはゲーム中
; に条件が成立すればいつでも開始するステートです。
;---------------------------------------------------------------------------

[Statedef -3]

;ゲーム中に常にいつでも開始したいステート、ここでは「着地音」に使用しています
;下の条件は「52か106のステートに移動して１フレーム目に」と言う事です。
;52と106はバックステップとジャンプの着地のステートです。
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
triggerall = !IsHelper
trigger1 = stateno = 52 
trigger2 = stateno = 106 
value = 40,1

[State 4101]
type = Explod
triggerall = Time = 0
triggerall = !IsHelper
trigger1 = stateno = 52 
trigger2 = stateno = 106 
removetime = 14
bindtime = 1
pausemovetime = - 1
postype = p1
ownpal = 1
pos = 0,0
anim = 40000
sprpriority = -3
ignorehitpause = 1

[State 5900]
type=Explod
id=5900
removetime=-1
triggerall=!ishelper
triggerall=!numexplod(5900)&&!numexplod(5901)
triggerall=movetype!=H&&time=0
trigger1=roundstate=0&&stateno=5900
trigger2=roundstate=2&&stateno=0
supermovetime=-1
pausemovetime=-1
anim=9741
[State 5901]
type=Explod
id=5901
removetime=-1
triggerall=!ishelper
trigger1=!numexplod(5901)
supermovetime=-1
pausemovetime=-1
anim=9741

[Statedef 254]
type=U

[State ]
type=SelfState
trigger1=!ishelper(254)
value=52
ignorehitpause=1
persistent=256

[State ]
type=Explod
trigger1=sysvar(4)=[0,1]
removetime=1
supermovetime=-1
pausemovetime=-1
postype=left
id=254+sysvar(4)
anim=97000+sysvar(4)
ownpal=1
bindtime=-1

[State ]
type=ModifyExplod
trigger1=sysvar(4)=[0,1]
trigger1=(teamside&1)=1
id=254+sysvar(4)
pos=60,50
sprpriority=2100000001-sysvar(4)
postype=left
[State ]
type=ModifyExplod
trigger1=sysvar(4)=[0,1]
trigger1=(teamside&1)=0
id=254+sysvar(4)
pos=-59.5,50
sprpriority=2100000001-sysvar(4)
postype=right
[State ]
type=ModifyExplod
trigger1=1
id=255
trans=addalpha
alpha=256,120

[State ]
type=VarSet
trigger1=sysvar(4)=0&&root,sysvar(3)>=0
sysvar(3)=(root,sysvar(3)/1)%10
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=sysvar(4)=1
sysvar(3)=(root,sysvar(3)/10)%10
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=sysvar(4)=2
sysvar(3)=(root,sysvar(3)/100)%10
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=sysvar(4)=3
sysvar(3)=(root,sysvar(3)/1000)%10
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=root,sysvar(3)>9999
sysvar(3)=9
ignorehitpause=1
persistent=256

[State ]
type=Explod
triggerall=sysvar(3)=[0,9]
trigger1=sysvar(4)=0&&root,sysvar(3)>=0
trigger2=sysvar(4)=1&&root,sysvar(3)>=10
trigger3=sysvar(4)=2&&root,sysvar(3)>=100
trigger4=sysvar(4)=3&&root,sysvar(3)>=1000
removetime=1
supermovetime=-1
pausemovetime=-1
postype=left
id=2540+sysvar(4)
anim=97100+sysvar(3)
ownpal=1
bindtime=-1

[State ]
type=ModifyExplod
trigger1=(teamside&1)=1
id=2540+sysvar(4)
pos=108-12*sysvar(4),72
sprpriority=2100000010
postype=left
[State ]
type=ModifyExplod
trigger1=(teamside&1)=0
id=2540+sysvar(4)
pos=-11.5-12*sysvar(4),72
sprpriority=2100000010
postype=right

[State ]
type=VarAdd
trigger1=1
sysvar(4)=1
ignorehitpause=1
persistent=256
[State ]
type=ChangeState
trigger1=sysvar(4)<4
value=stateno
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=1
sysvar(4)=0
ignorehitpause=1
persistent=256

[State ]
type=ChangeAnim
trigger1=1
value=0
[State ]
type=ChangeAnim
trigger1=selfanimexist(root,anim)
value=root,anim
elem=root,animelemno(0)
[State ]
type=AssertSpecial
trigger1=1
flag=invisible
flag2=noshadow
ignorehitpause=1
persistent=256
[State ]
type=BindToRoot
trigger1=1
facing=1
ignorehitpause=1
persistent=256
[State ]
type=LifeSet
trigger1=1
value=lifemax
ignorehitpause=1
persistent=256

[State ]
type=HitOverride
trigger1=1
attr=SCA,AA,AP,AT
slot=0
stateno=stateno
ignorehitpause=1
persistent=256

[State ]
type=NotHitBy
trigger1=1
value=SCA
ignorehitpause=1
persistent=256
[State ]
type=HitBy
trigger1=1
value=SCA,AA,AP
[State ]
type=HitBy
trigger1=sysfvar(0)>0
trigger2=roundstate!=2||root,numexplod(5900)
value=

[State ]
type=VarSet
trigger1=1
sysfvar(0)=ifelse(sysfvar(0)>0,sysfvar(0)-1,0)
ignorehitpause=1
persistent=256

[State ]
type=DestroySelf
trigger1=!root,alive
ignorehitpause=1
persistent=256

[Statedef 2541]
type=U

[State ]
type=SelfState
trigger1=!ishelper(2541)&&!ishelper(2542)
value=52
ignorehitpause=1
persistent=256

[State ]
type=ChangeAnim
trigger1=anim!=9741
value=9741
[State ]
type=BindToRoot
trigger1=1
ignorehitpause=1
persistent=256
[State ]
type=LifeSet
trigger1=1
value=lifemax
ignorehitpause=1
persistent=256

[State ]
type=VarSet
trigger1=ishelper(2542)
sysfvar(0)=ifelse((root,animtime=sysvar(2)||sysfvar(0)<0),sysfvar(0)+1,0)
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=ishelper(2542)
trigger1=sysfvar(0)>300
sysfvar(0)=-300
ignorehitpause=1
persistent=256
[State ]
type=VarSet
trigger1=ishelper(2542)
sysvar(2)=root,animtime
ignorehitpause=1
persistent=256

[State ]
type=Helper
trigger1=ishelper(2542)
trigger1=!numhelper(2541)
helpertype=player
name="magi"
id=2541
supermovetime=2147483647
pausemovetime=2147483647
ignorehitpause=1

[State ]
type=Pause
triggerall=ishelper(2541)
trigger1=helper(2542),sysfvar(0)<0
trigger2=roundstate!=2
time=0
movetime=0
ignorehitpause=1
persistent=256
[State ]
type=SuperPause
triggerall=ishelper(2541)
trigger1=helper(2542),sysfvar(0)<0
trigger2=roundstate!=2
time=0
movetime=0
anim=-1
sound=-1
darken=0
p2defmul=1
ignorehitpause=1
persistent=256

[State ]
type=DisplayToClipboard
trigger1=1
text="%d"
params=gametime
ignorehitpause=1
persistent=256

[State ]
type=ChangeAnim
triggerall=ishelper(2541)
trigger1=helper(2542),sysfvar(0)>=0
trigger1=roundstate=2
value=anim
[State ]
type=DestroySelf
triggerall=ishelper(2541)
trigger1=animelemtime(1)||parent,id=root,id
ignorehitpause=1
persistent=256
