;==============================================================================
;---------------------------------------------------------------------------
; ここは-2のステートを書いてください、ヘルパー関係です
;---------------------------------------------------------------------------

[Statedef -2] ; States that are always executed (use statedef -2)

[State -2,AttackMulSet] 
Type = AttackMulSet 
TriggerAll = NumEnemy 
TriggerAll = Alive 
Trigger1 = Enemy,GetHitVar(HitCount) < 50 
Value = 0.50+(0.50-(Enemy,GetHitVar(HitCount)*0.01)) 

[State -2, p2認識]
type = varset
triggerall = PalNo = [7,12]
trigger1 = p2name = "Tendril" || p4name = "Tendril"
var(14) = 1

;---------------------------------------------------------------------------
[State -2,] ;tendril壁ハメ足表示
type = explod
ID = 8428
triggerall = NumExplod(8428) = 0
Trigger1 = (p2name = "tendril") || (p4name = "tendril")
trigger1       = Anim = 48428 && Animelem = 2
anim = 58428
postype = p1
pos = 0, 0
bindtime = -1
velocity = 0,0
sprpriority = 4
shadow = -1
ownpal = 0
scale = const(size.xscale),const(size.yscale)
removetime = 432

[State -2,] ;tendrilダブル足表示
type = explod
ID = 8466
triggerall = NumExplod(8466) = 0
Trigger1 = (p2name = "tendril") || (p4name = "tendril")
trigger1       = Anim = 48466
anim = 58466
postype = p1
pos = 0, 0
bindtime = -1
velocity = 0,0
sprpriority = 4
shadow = -1
ownpal = 0
scale = const(size.xscale),const(size.yscale)
removetime = 392

[State -2,] ;tendril対空レイプ足表示
type = explod
ID = 8438
triggerall = NumExplod(8466) = 0
Trigger1 = (p2name = "tendril") || (p4name = "tendril")
trigger1       = Anim = 48438
anim = 58438
postype = p1
pos = 0, 0
bindtime = -1
velocity = 0,0
sprpriority = 4
shadow = -1
ownpal = 0
scale = const(size.xscale),const(size.yscale)
removetime = 10

;-------------------------------------------------ランダムブリス関連
[State -2,VarSet(27)];フラグリセット
type = VarSet
trigger1       = Anim != 9020 
var(27) = 1
ignorehitpause = 1

[State -2,VarSet(26)]
type = VarSet
trigger1       = Anim = 9020 
;trigger1       = animelemno(1) = 1 
trigger1       = (Var(27) = 1) ;変化は１回のブリスで1回のみ
var(26) = 1+(Random % 6)
;var(26) = 2
ignorehitpause = 1

[State -2,VarSet(27)];変化は１回のブリスで1回のみ
type = VarSet
trigger1       = Anim = 9020 
trigger1       = var(27) = 1 
var(27) = 2
ignorehitpause = 1

[State -2,Varadd(26)]
type = VarAdd
trigger1       = Anim = 9020 
trigger1       = AnimElemtime(3) = 0 
trigger1       = (Var(26) != 1 )
trigger1       = var(27) = 2 
var(26) = 30
ignorehitpause = 1
;persistent=0

[State -2,VarSet(27)]
type = VarSet
trigger1       = AnimElemtime(3) = 0
trigger1       = Anim = 9020 
trigger1       = var(27) = 2 
var(27) = 3
ignorehitpause = 1

[State -2,] ;変化するときだけ本体を消す
type = AssertSpecial
trigger1       = (Var(26) !=1 )
trigger1       = Anim = 9020 
flag = invisible

[State -2,] ;喰らい
type = explod
ID = 9021
trigger1       = ((var(26) !=1)  )
trigger1       = Anim = 9020 
anim = (9021-2+var(26))
postype = p1
pos = 0, 0
velocity = 0,0
sprpriority = -1
ownpal = 0
removetime = 1
;persistent=0

;---------------------------------
;初音ミク「戦闘メッセージ」対応ステート

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,var(2) = [0,8]
triggerall = enemynear,statetime = 111
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19385
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 2
triggerall = enemynear,var(2) = [0,8]
triggerall = enemynear,statetime = 111
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19386
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 0
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [0,8]
trigger1 = enemynear,statetime = 111 || enemynear,statetime = 296
trigger2 = enemynear,var(2) = [10,18]
trigger2 = enemynear,statetime = 181
anim = 19380
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,var(2) = 9 && enemynear,statetime = 116
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19387
ID = 19380
postype = left
pos = 56,205
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 0
triggerall = enemynear,fvar(31) != [1,2]
triggerall = numexplod(19380) <=1
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = 9 && (enemynear,statetime = 116 || enemynear,statetime = 121 || enemynear,statetime = 306)
trigger2 = enemynear,var(2) = 19 && (enemynear,statetime = 186 || enemynear,statetime = 191)
anim = 19380
ID = 19380
postype = left
pos = 56,205
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,fvar(31) != [1,2]
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [0,8]
trigger1 = enemynear,statetime = 296
trigger2 = enemynear,var(2) = 9 && enemynear,statetime = 306
anim = 19388
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 2
triggerall = enemynear,fvar(31) != [1,2]
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [0,8]
trigger1 = enemynear,statetime = 296
trigger2 = enemynear,var(2) = 9 && enemynear,statetime = 306
anim = 19389
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [0,8]
trigger1 = enemynear,fvar(31) = 1
trigger1 = enemynear,statetime = 142
trigger2 = enemynear,var(2) = 9 && enemynear,fvar(31) = 1
trigger2 = enemynear,statetime = 152
trigger3 = enemynear,var(2) = [0,8]
trigger3 = enemynear,fvar(31) = 2
trigger3 = enemynear,statetime = 212
trigger4 = enemynear,var(2) = 9 && enemynear,fvar(31) = 2
trigger4 = enemynear,statetime = 222
trigger5 = enemynear,var(2) = [0,8]
trigger5 = enemynear,fvar(31) = 3
trigger5 = enemynear,statetime = 327
trigger6 = enemynear,var(2) = 9 && enemynear,fvar(31) = 3
trigger6 = enemynear,statetime = 337
trigger7 = enemynear,var(2) = [10,19]
trigger7 = enemynear,fvar(31) = 1
trigger7 = enemynear,statetime = 147
trigger8 = enemynear,var(2) = [10,18]
trigger8 = enemynear,fvar(31) = 2
trigger8 = enemynear,statetime = 212
trigger9 = enemynear,var(2) = 19 && enemynear,fvar(31) = 2
trigger9 = enemynear,statetime = 222
trigger10 = enemynear,var(2) = [10,18]
trigger10 = enemynear,fvar(31) = 3
trigger10 = enemynear,statetime = 287
trigger11 = enemynear,var(2) = 19 && enemynear,fvar(31) = 3
trigger11 = enemynear,statetime = 297
trigger12 = enemynear,var(2) = [20,29]
trigger12 = enemynear,fvar(31) = 1
trigger12 = enemynear,statetime = 122
trigger13 = enemynear,var(2) = [20,29]
trigger13 = enemynear,fvar(31) = 2
trigger13 = enemynear,statetime = 166
trigger14 = enemynear,var(2) = [20,27]
trigger14 = enemynear,fvar(31) = 3
trigger14 = enemynear,statetime = 206
trigger15 = enemynear,var(2) = 28 && enemynear,fvar(31) = 3
trigger15 = enemynear,statetime = 242
trigger16 = enemynear,var(2) = 29 && enemynear,fvar(31) = 3
trigger16 = enemynear,statetime = 277
anim = 19381
ID = 19380
postype = left
pos = 56,173
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(31) != 1
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,var(2) = [10,18]
triggerall = enemynear,statetime = 181
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19390
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(31) != 1
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 2
triggerall = enemynear,var(2) = [10,18]
triggerall = enemynear,statetime = 181
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19391
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(31) != 1
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,var(2) = 19 && enemynear,statetime = 186
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19392
ID = 19380
postype = left
pos = 56,205
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,fvar(31) != [1,2]
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [10,18]
trigger1 = enemynear,statetime = 246
trigger2 = enemynear,var(2) = 19 && enemynear,statetime = 256
anim = 19382
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) != 1
triggerall = enemynear,fvar(31) != [1,2]
triggerall = !numexplod(19380)
triggerall = TeamMode = single || TeamMode = turns
trigger1 = enemynear,var(2) = [10,18]
trigger1 = enemynear,statetime = 246
trigger2 = enemynear,var(2) = 19 && enemynear,statetime = 256
trigger3 = enemynear,var(2) = 28 && enemynear,statetime = 201
trigger4 = enemynear,var(2) = 29 && enemynear,statetime = 236
anim = 19383
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State -2]
type = Explod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno = 3204
triggerall = enemynear,fvar(31) != [1,2]
triggerall = enemynear,fvar(3) = 1 && enemynear,fvar(1) = 1
triggerall = enemynear,var(2) = 29 && enemynear,statetime = 236
triggerall = !numexplod(19380)
trigger1 = TeamMode = single || TeamMode = turns
anim = 19384
ID = 19380
postype = left
pos = 56,189
ownpal = 1
ontop = 1
bindtime = -1

[State 3100, 1]
type = RemoveExplod
triggerall = numenemy
triggerall = enemynear,name = "HATSUNE MIKU" && enemynear,Authorname = "YU-TOHARU"
triggerall = enemynear,stateno != 3204
trigger1 = TeamMode = single || TeamMode = turns
ID = 19380

;---------------------------------------------------------------------------
;ジャギ「おい、そこへ座れ」対応ステート

[State -2]
type = ChangeAnim
triggerall = movetype = H
triggerall = stateno = 805
triggerall = numenemy >= 1
trigger1 = enemynear(0), name = "JAGI"
trigger1 = enemynear(0),Authorname = "Ahuron"
trigger1 = statetime >= 10
trigger2 = enemynear(0), name = "JagiMeirin"
trigger2 = enemynear(0),Authorname = "Ts"
trigger2 = statetime = [10,141]
value = 5330

[State -2]
type = SprPriority
triggerall = movetype = H
triggerall = stateno = 805
triggerall = numenemy >= 1
trigger1 = enemynear(0), name = "JAGI"
trigger1 = enemynear(0),Authorname = "Ahuron"
trigger1 = statetime >= 10
trigger2 = enemynear(0), name = "JagiMeirin"
trigger2 = enemynear(0),Authorname = "Ts"
trigger2 = statetime = [10,141]
value = 4

;---------------------------------------------------------------------------
[State -2]
type = AssertSpecial
triggerall = movetype = H
triggerall = stateno = 901
triggerall = numenemy >= 1
triggerall = enemynear(0), name = "JAGI"
trigger1 = enemynear(0),Authorname = "Drowin hokuto"
flag = invisible

[State -2, ドロウィンさん作ジャギ投げ専用ヘルパー呼び出し]
type = Helper
triggerall = numhelper(3218) = 0
triggerall = movetype = H
triggerall = stateno = 901
triggerall = numenemy >= 1
triggerall = enemynear(0), name = "JAGI"
trigger1 = enemynear(0),Authorname = "Drowin hokuto"
helpertype = normal
name = "isu"
ID = 3218
pos = 0,0
postype = p1
facing = 1
stateno = 3218
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State -2, ドロウィンさん作ジャギ投げ専用イスヘルパー呼び出し]
type = Helper
triggerall = numhelper(2991) = 0
triggerall = movetype = H
triggerall = stateno = 901
triggerall = numenemy >= 1
triggerall = enemynear(0), name = "JAGI"
trigger1 = enemynear(0),Authorname = "Drowin hokuto"
helpertype = normal
name = "isu"
ID = 2991
pos = 0,0
postype = p1
facing = 1
stateno = 2991
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

;---------------------------------------------------------------------------
;バレッタ「アップルフォーユー」対応ステート

[State -2, マークヘルパー呼び出し]
type = Helper
triggerall = numhelper(3247) = 0
trigger1 = stateno = 860
trigger1 = anim = 850
helpertype = normal
name = "EFE"
ID = 3247
pos = 0,0
postype = p1
facing = 1
stateno = 3247
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State -2]
type = ChangeAnim
trigger1 = stateno = 860
trigger1 = anim = 850
value = 858
ignorehitpause = 1
persistent=0

[State -2, マークヘルパー呼び出し]
type = Helper
triggerall = numhelper(3248) = 0
trigger1 = stateno = 2003
trigger1 = anim = 2003
helpertype = normal
name = "EFE"
ID = 3248
pos = 0,0
postype = p1
facing = 1
stateno = 3248
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State -2]
type = ChangeAnim
trigger1 = stateno = 2003
trigger1 = anim = 2003
value = 3944
ignorehitpause = 1
persistent=0

[State -2]
type = ChangeAnim
trigger1 = stateno = 2004
trigger1 = anim = 3944
value = 3945
ignorehitpause = 1
persistent=0

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

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

[Statedef -3]

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

[State -3, ダメージボイス]
type = PlaySnd
triggerall = Time = 1
triggerall = Alive
trigger1 = stateno=5000 || stateno=5010 || stateno=5020
trigger2 = stateno = 5070 || stateno = 5080
value = 5000,(Random % 5)
channel = 8


[State -3, 叩きつけられボイス]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 5100
value = 5100,0
channel = 8

[State -3, 起き上がりボイス]
type = PlaySnd
triggerall = Time = 1
triggerall = Alive
trigger1 = stateno = 5120
value = 5120,(Random % 4)
channel = 9

[State -3, ガードボイス]
type = PlaySnd
triggerall = Time = 1
triggerall = Alive
trigger1 = stateno = 150 || stateno = 152 || stateno = 154
trigger2 = stateno = 151 || stateno = 153 || stateno = 155
value = 5200,(Random % 8)
channel = 8

[State 821, 1] ;←コマンドを入れたらVarをON
type = varset
trigger1 = command = "jump"
trigger1 = ctrl = 1
trigger1 = statetype = s
v = 1
value = 1

[State 821, 1] ;←varをOFFにするステート
type = varset
trigger1 = stateno = 50
trigger1 = time = 2
v = 1
value = 0

[State 821, 1] ;←ジャンプ力にveladdを使って加速
type = veladd
trigger1 = var(1) = 1
trigger1 = stateno = 50
y = -3.5

[State 821, 1] ;←前にボタンを押してたら前にも加速
type = veladd
trigger1 = var(1) = 1
trigger1 = stateno = 50
trigger1 = command = "holdfwd"
x = 2.3

[State 821, 1] ;←後ろなら後ろに加速
type = veladd
trigger1 = var(1) = 1
trigger1 = stateno = 50
trigger1 = command = "holdback"
x = -2.5

[State 50, 4];←成功したときの残像
type = AfterImage
trigger1 = var(1) = 1
trigger1 = stateno = 50
time = 20
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 12,12,12
palcontrast = 225,225,225
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1
