;-------------------------
[Statedef -2]
;意味：
;	常時実行されるstate
;------------------------------

[state 5900,ppecial]
type = lifeadd
trigger1 = palno = 12
trigger2 = ishelper(1)
trigger2 = root,palno = 12
value = ceil(lifemax*.002)

[state 5900,ppecial]
type = varset
trigger1 = 1
var(40) = 2

[state 5900,special]
type = varset
trigger1 = 1
var(42) = 0

[state 5900,special]
type = varset
trigger1 = 1
fvar(10) = 0

[state 5900,ppecial]
type = varset
trigger1 = 1
fvar(11) = 0

[state 5900,ppecial]
type = hitoverride
trigger1 = ishelper(1)
attr = acs,aa,ap,at
stateno = 5000*(statetype = S && gethitvar(type) != 3) + 5010*(statetype = C && gethitvar(type) != 3) + 5020*(statetype = A && gethitvar(type) != 3) + 5080*(statetype = L && gethitvar(type) != 3) + 5070*(gethitvar(type) = 3)
[state 210]
type = Helper
trigger1 = !ishelper
trigger1 = numhelper(1) < 3
ID = 1
pos = floor(random%320 - screenpos x + pos x), floor(pos y * -1)
facing = 1
stateno = ifelse(RoundsExisted = 0,190,0)
Helpertype = player
keyctrl = 1
ownpal = 1
size.ground.back = 11
size.ground.front = 11
size.air.back = 10
size.air.front = 10
height = 60
head.pos = 0,-96
mid.pos = 0,-60
ignorehitpause = 1
[State -2,spell]
type = Helper
trigger1 = !ishelper
trigger1 = numhelper(10000) = 0
pos = 0,0
postype = left
ID=10000
pausemovetime = 0
name = "Engun"
sprpriority = 100
stateno = 10000
helpertype = normal
ownpal = 1
ignorehitpause = 1
[state 210]
type = Helper
trigger1 = !ishelper
trigger1 = roundstate && stateno != [3500,3501]
name = "Kasuga Fuesugi"
ID = 2000
pos = floor(random%320 - screenpos x + pos x), floor(pos y * -1)
facing = 1
stateno = ifelse(random%60 = 0,2252,ifelse(random%9 = 0,2200,ifelse(random%8 = 0,2201,ifelse(random%7 = 0,2202,ifelse(random%6 < 4,2260 + random%4,ifelse(random%2 = 0,2265,2251))))))
Helpertype = normal
ownpal = 1
size.ground.back = 15
size.ground.front = 16
size.air.back = 13
size.air.front = 13
height = 60
head.pos = 5,-80
mid.pos = 0,54
ignorehitpause = 1

;ブースト
[state a]
type = targetstate
triggerall = var(5) = 1
triggerall = movehit = 1
trigger1 = numtarget(200)
trigger2 = numtarget(199)
trigger3 = numtarget(198)
trigger4 = numtarget(197)
trigger5 = numtarget(196)
trigger6 = numtarget(195)
trigger7 = numtarget(194)
trigger8 = numtarget(193)
trigger9 = numtarget(192)
value = 550
ignorehitpause = 1

[state a]
type = targetstate
triggerall = var(5) = 2
triggerall = movehit = 1
trigger1 = numtarget(200)
trigger2 = numtarget(199)
trigger3 = numtarget(198)
trigger4 = numtarget(197)
trigger5 = numtarget(196)
trigger6 = numtarget(195)
trigger7 = numtarget(194)
trigger8 = numtarget(193)
trigger9 = numtarget(192)
value = 555
ignorehitpause = 1

[state a]
type = playsnd
trigger1 = p2movetype = H
trigger1 = numtarget
trigger1 = target,stateno = [556,557]
trigger1 = target,Time%10 = 1
value = 5100,1
ignorehitpause = 0

[State 1000 , 2];
type = explod
trigger1 = numtarget
trigger1 = p2movetype = H
trigger1 = target,stateno = [556,557]
trigger1 = target,Time%5 = 1
trigger1 = target,pos y > -10
trigger1 = target,vel x != [-2,2]
anim = 555
postype = p2
pos = 0,0
;vel = random%100*-0.01,-3.47
;accel = 0,0.4
sprpriority = -1
ownpal = 1
bindtime = 1
ignorehitpause = 0
pausemovetime = 0
supermovetime = 0
scale = 0.5,0.5

[State 1000 , 2];
type = explod
trigger1 = p2movetype = H
trigger1 = numtarget
trigger1 = target,stateno = [556,557]
trigger1 = target,vel x != [-2,2]
trigger1 = target,pos y > -10
anim = 564+random%6
postype = p2
pos = 0,0
vel = -5+(random%100*0.1),-6.47
accel = 0,0.4
sprpriority = -1
bindtime = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 0
supermovetime = 0
scale = 0.5,0.5

[State a];とまれ
type = velset
triggerall= frontEdgeBodyDist<=40
triggerall = vel x > 0
trigger1 = var(5)=1
trigger2 = stateno = 3900
x = 0

[State a];
type = palfx
triggerall = var(5) = 2
triggerall = movehit = 1
triggerall = p2stateno = 555
triggerall = numtarget(200)||numtarget(199)||numtarget(198)||numtarget(197)||numtarget(196)||numtarget(195)||numtarget(194)||numtarget(193)||numtarget(192)
triggerall = numhelper(6030)=0
;triggerall = p2stateno = [556,557]
trigger1 = enemynear,frontEdgeBodyDist>10&&enemynear,backEdgeBodyDist>10
trigger2 = backEdgeBodyDist<35
time = 8
mul = 255,255,255
sinadd = 255,255,255,20
color = 255
ignorehitpause = 1
;上手く働いてないのは気のせい

[State a];
type = velset
triggerall = var(5) = 2
triggerall = movehit = 1
triggerall = numtarget(200)||numtarget(199)||numtarget(198)||numtarget(197)||numtarget(196)||numtarget(195)||numtarget(194)||numtarget(193)||numtarget(192)
triggerall = p2stateno = 555
triggerall = numhelper(6030)=0
;triggerall = p2stateno = [556,557]
trigger1 = enemynear,frontEdgeBodyDist>10&&enemynear,backEdgeBodyDist>20
trigger2 = backEdgeBodyDist<35
x = 11.85
ignorehitpause = 1
;値の調整が大事っぽい
;この数値で･･･いいのか？

[state a];ブーストエフェクト
type = Helper
triggerall = var(5) = 2
triggerall = movehit = 1
triggerall = numtarget(200)||numtarget(199)||numtarget(198)||numtarget(197)||numtarget(196)||numtarget(195)||numtarget(194)||numtarget(193)||numtarget(192)
triggerall = p2stateno = 555
triggerall = numhelper(6030)=0
;triggerall = p2stateno = [556,557]
trigger1 = enemynear,frontEdgeBodyDist>10&&enemynear,backEdgeBodyDist>10
trigger2 = backEdgeBodyDist<35
id = 6030
name = "hit"
pos = 0 , -80
postype = p1
stateno = 6030
helpertype = normal
pausemovetime = 0
persistent = 0
ignorehitpause = 1
keyctrl = 0 
ownpal = 1


;------------------------------------------------------------------
[State -2 ,2]
type = poweradd
triggerall = alive = 1
triggerall = time = 1
trigger1 = stateno = 5000
trigger1 = anim    = 5000 || anim    = 5010 || anim    = 5020
trigger2 = stateno = 5010
trigger2 = anim    = 5000 || anim    = 5010 || anim    = 5020
value = 1

[State -2 ,2]
type = poweradd
triggerall = alive = 1
triggerall = time = 1
trigger1 = stateno = 5000
trigger1 = anim    = 5001 || anim    = 5011 || anim    = 5021
trigger2 = stateno = 5010
trigger2 = anim    = 5001 || anim    = 5011 || anim    = 5021
value = 2

[State -2 ,1]
type = poweradd
triggerall = alive = 1
triggerall = time = 1
trigger1 = stateno = 5000
trigger1 = anim   != [5000,5001] 
trigger1 = anim   != [5010,5011]
trigger1 = anim   != [5020,5021]
trigger2 = stateno = 5010
trigger2 = anim   != [5000,5001] 
trigger2 = anim   != [5010,5011]
trigger2 = anim   != [5020,5021]
value = 3

[State -2 ,1]
type = poweradd
triggerall = alive = 1
triggerall = time = 1
trigger1 = stateno = 5020
value = 2

;ダメージ声 
[State -3,damage w]
type = PlaySnd
triggerall = stateno = 5000  || stateno = 5010 || stateno = 5020 || stateno = 5070 || stateno = 5080
triggerall = gethitvar(animtype) = 0
triggerall = random%3 = 0
triggerall = alive 
trigger1 = Time = 1
value = s5000, random%3
channel = 1
parsistent = 0
ignorehitpause = 1

;ダメージ声 中
[State -3, damage m]
type = PlaySnd
triggerall = stateno = 5000  || stateno = 5010 || stateno = 5020 || stateno = 5070 || stateno = 5080
triggerall = gethitvar(animtype) = [1,2]
triggerall = random%3 = 1
triggerall = alive 
trigger1 = Time = 1
value = s5000, 1+random%3
channel = 1
parsistent = 0
ignorehitpause = 1

;ダメージ声 強
[State -3, damage s]
type = PlaySnd
triggerall = stateno = 5000  || stateno = 5010 || stateno = 5020 || stateno = 5070 || stateno = 5080
triggerall = gethitvar(animtype) >= 3 ;back3,up4,diegup5
triggerall = random%3 = 2
triggerall = alive 
trigger1 = Time = 1
value = s5000, 1+random%4
channel = 1
parsistent = 0
ignorehitpause = 1

;-----------------------------------------------------------------------------------------------
;スピードアップ関係
[State -2 ,2]
type = varset
trigger1 = enemynear,pos y >= 0
trigger1 = enemynear,life > 0
trigger2 = Var(18) = 5
v = 10
value = 0
persistent = 0
ignorehitpause = 1

[State -2 ,2]
type = varset
trigger1 = Var(10) = 0
v = 18
value = 0
persistent = 0
ignorehitpause = 1

;---------------------[演出]
[State a];
type = palfx
trigger1 = var(10) >= 1
trigger1 = gametime%40 = 0
trigger1 = var(13) = 0
trigger1 = RoundState = 2
time = 80
;add = 255,255,255
mul = 145,175,0
sinadd = 145,175,0,80
color = 255
ignorehitpause = 1

;[State a];
;type = palfx
;trigger1 = var(10) = 0
;trigger1 = gametime%40 = 0
;time = 80
;add = 255,255,255
;mul = 255,255,255
;sinadd = 0,0,0,0
;color = 255
;ignorehitpause = 1

;-----------------------------------------------------------------------------------------------
;裏モード
[State 7000]
type = varset
trigger1 = palno = 9
trigger2 = palno = 10
trigger3 = palno = 11
v = 21
value = 1
persistent = 0
ignorehitpause = 1

;-----------------------------------------------------------------------------------------------
;ガードボイス
[State -2 ,2]
type = PlaySnd
triggerall = alive = 1
triggerall = time = 1
triggerall = var(45) != 3
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
value = 151, random%8
channel = 1

;------------------------------------------------------------------------------------------
;めまいボイス
[State -2 ,2]
type = PlaySnd
triggerall = alive = 1
triggerall = time = 1
trigger1 = anim = 5300
value = 5300, random%2
channel = 1

;相手が壁にぶつかったとき
[state 3000, stand]
type = varset
triggerall = Var(16) = 0
trigger1 = (p2stateno = 552)*(p2movetype = H)
V = 16
value = 1

[State 410, 0]
type = PlaySnd
trigger1 = Var(16) = 1
trigger1 = (p2stateno = 552)*(p2movetype = H)
value = s5100,2
persistent = 0

[state 3000, stand]
type = varset
trigger1 = Var(16) = 1
V = 16
value = 2
IgnoreHitPause = 1

[state 3000, stand]
type = varset
trigger1 = var(16)
trigger1 = p2stateno != 552
V = 16
value = 0
IgnoreHitPause = 1
;------------------------------------------------------------------------------------------
[State -2, 4];２段ジャンプ制御
type = Varset
trigger1 = stateno = 0
trigger2 = stateno = 11
trigger3 = stateno = 52
trigger4 = movetype = H
v = 2
value = 0
[State -2, 4]
type = Varset
trigger1 = stateno = 0
trigger2 = stateno = 11
trigger3 = stateno = 52
trigger4 = movetype = H
v = 48
value = 0

;-----------------------------------------------------------------------------------------------
[State -2, 4];ハイジャンプ制御
type = Varset
trigger1 = stateno = 0
trigger2 = stateno = 11
trigger3 = stateno = 52
trigger4 = movetype = H
v = 3
value = 0

;------------------------------------------------------------------------------------------------
[State -2, 4];ダスト制御
type = Varset
triggerall = var(8)
trigger1 = movetype = H
trigger2 = statetype != A
trigger2 = stateno != [850,851]
trigger2 = stateno != [40,50]
trigger2 = stateno != [200,1999]
v = 8
value = 0

;-------------------------------------------------------------------------------------------------
[State -2, 4];空中ダッシュ制御
type = Varset
trigger1 = stateno = 0
trigger2 = stateno = 11
trigger3 = stateno = 52
v = 4
value = 0

[State -2, 0]
type = varset
triggerall = var(4) != 0
trigger1 = stateno = [5000, 5300]
trigger2 = Movetype = H
trigger3 = stateno != [101,102]
trigger3 = stateno != [600,650]
v = 4
value = 3

;-----------------------------------------------------------------------------------------------
[State -2, 0];残像消去
type = AfterImageTime
trigger1 = stateno = 52
trigger2 = movetype = H
trigger3 = stateno = [0,20]
trigger4 = stateno = [100,199]
trigger5 = stateno = 1210
time = 0



;------------------------------------------------------------------------------------------------
;ダッシュ中Varリセット
[State -2, 0]
type = varset
trigger1 = var(10) = 0
trigger2 = stateno = 11
trigger3 = stateno = 52
v = 9
value = 0

[State -2, 0];ダッシュストップ中
type = varset
trigger1 = stateno = 103
v = 9
value = 2

;ダッシュ中varセット
[State -2, 0]
type = varset
trigger1 = stateno = 100
v = 9
value = 1
;---------------------------------------------------------------------------------------------
;自動振り向き
[State -2, 0]
type = turn
triggerall = p2dist X < 0
triggerall = time >= 0
trigger1 = stateno = 45
trigger2 = stateno = 50
trigger2 = PrevStateno = 45
trigger3 = Stateno = 50
trigger3 = var(3) = 1
trigger4 = Stateno = 51
trigger4 = PrevStateno = 101
trigger5 = Stateno = 51
trigger5 = PrevStateno = 102
trigger6 = var(5)

;-----------------------------------------------------------------------------
;pa-fekutoga-doフォルトレスディフェンス
[State -2, 0]
type = PowerAdd
triggerall= Anim = [120,165]
trigger1 = Var(26)
trigger2 = Var(45) = 2
trigger3 = Numhelper(11040)
ignorehitpause = 0
value = -5

[State -2, 4]
type = RemoveExplod
triggerall = Var(26) = 0
trigger1 = Power < 10
trigger2 = StateNo != [120,165]
trigger3 = var(45) != 2
trigger4 = stateno >= 5000
ignorehitpause = 1
ID = 11040

[State -2, 1]
type = helper
triggerall = Var(26)
triggerall = Numhelper(11040)= 0
triggerall = Power > 10
trigger1 = StateNo = [0,20]
trigger2 = StateNo = [120,165]
trigger3 = Var(45) = 2
helpertype = normal
name = "FD helper"
ID = 11040
pos = 0,0
postype = p1
stateno = 11040
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 0

[State -2, 0]
type = PowerAdd
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
ignorehitpause = 0
value = -40

[state -2, 2];ＦＤで当たったときの
type = helper
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
helpertype = normal
ID = 11045
pos = 10,ifelse(statetype = C,-30,-65)
postype = p1
stateno = 11045
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 1
pausemovetime = 999
[state -2, 2];ＦＤで当たったときの
type = helper
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
helpertype = normal
ID = 11046
pos = 10,ifelse(statetype = C,-30,-65)
postype = p1
stateno = 11045
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 1
pausemovetime = 999
[state -2, 2];ＦＤで当たったときの
type = helper
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
helpertype = normal
ID = 11047
pos = 10,ifelse(statetype = C,-30,-65)
postype = p1
stateno = 11045
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 1
pausemovetime = 999
[state -2, 2];ＦＤで当たったときの
type = helper
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
helpertype = normal
ID = 11048
pos = 10,ifelse(statetype = C,-30,-65)
postype = p1
stateno = 11045
keyctrl = 0
ownpal = 1
ignorehitpause = 1
persistent = 1
pausemovetime = 999

[state -2, 2];ＦＤで当たったときの
type = Explod
triggerall = Numhelper(11040)
triggerall = Var(26)
triggerall = time = 0
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
anim = 9930
ID = 760
postype = p1
pos = 10,ifelse(statetype = C,-30,-65)
sprpriority = 4
bindtime = 1
removetime = -2
ownpal=1
removeongethit = 0
ignorehitpause = 1
scale = 0.2,0.2
persistent = 0
[State -2, 2];フォルトレスディフェンスやめた時Varリセット
type = Varset
triggerall= Var(26)||StateNo != [120,165]
trigger1 = Power = 0
trigger2 = Var(45) != 2
trigger3 = stateno >= 5000
ignorehitpause = 1
v = 26
value = 0

[State -2,0];体力格納決定varリセット
type = Varset
trigger1 = Var(27) != 0
v = 28
value = 0

;体力格納用varリセット
[State -2,0]
type = varset
trigger1 = var(26) = 0
v = 27
value = 0

[State -2,0];体力格納決定
type = Varset
triggerall = var(27) = 0
trigger1 = var(26)
trigger2 = var(45) = 3
v = 28
value = 1

;体力をvar(27)へ格納
[State -2,0]
type = varset
trigger1 = var(28) = 1
trigger2 = var(45) = 3
v = 27
value = Life

;体力減らない
[State -2, life]
type = Lifeset
trigger1 = Var(26)
trigger2 = var(45) = 3
value = Var(27)



[State -1, FD]
type = varset
var(26) = 0 
trigger1 = var(26) = 2 && (command != "holdP" && command != "holdS") 
trigger2 = var(26) = 1 && command != "holdC"
trigger3 = power <= 10  
trigger4 = StateNo != [120,165]
trigger5 = Anim != [120,165]
ignorehitpause = 0

[State -1, FD]
type = varset
var(45) = 0
triggerall = var(45) = 2
triggerall = stateno != 150 && stateno != 152 && stateno != 154 && stateno != 930
trigger1 = var(26) = 0 
trigger2 = power <= 10  
trigger4 = stateno != [120,169]
ignorehitpause = 0
;--------------------------------------------------------------------------------------------
;はためく
[State -2, 4]
type = PlaySnd
trigger1 = Vel y > 1
trigger1 = time%30 = 6
trigger1 = anim != 800
value = 50,0

[State -2 ,2]
type = poweradd
triggerall = alive = 1
triggerall = time = 1
trigger1 = stateno = 150
trigger2 = stateno = 152
trigger3 = stateno = 154
value = 2

;-----------------------------------------------------------------------------------------------
;落下時の音

[State -2,0]
type = varadd
trigger1 = anim = 44
trigger2 = anim = 45
trigger3 = anim = 46
trigger4 = anim = 50
trigger5 = anim = 51
trigger6 = anim = 5040
trigger7 = anim = 5200
trigger8 = anim = 5210
trigger9 = anim = 5070
trigger9 = var(13) <= 2
trigger10 = anim = 5300
trigger10 = var(13) <= 2
trigger11 = anim = 5003
trigger11 = var(13) <= 2
v = 12
value = 1
persistent = 1
ignorehitpause = 1

[State -2,0]
type = varset
trigger1 = anim != 44
trigger1 = anim != 45
trigger1 = anim != 46
trigger1 = anim != 50
trigger1 = anim != 51
trigger1 = anim != 5040
trigger1 = anim != 5200
trigger1 = anim != 5210
trigger1 = anim != 5070
trigger1 = anim != 5300
trigger1 = anim != 5003
trigger2 = anim = 5003
trigger2 = time = 0
v = 12
value = 0
persistent = 1
ignorehitpause = 1

;------------------------------------------------------------------------------------------------
;ジャンプキャンセル制御用
[State -2, 0]
type = varset
trigger1 = movecontact
v = 11
value = 1

[State -2, 0]
type = varset
trigger1 = !movecontact
v = 11
value = 0

[State -2, 0]
type = varset
triggerall = var(2) = 0
trigger1 = stateno = 610
v = 2
value = 1

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

[State 200, 2]
type = helper
triggerall = fvar(0)
triggerall = time <= 2
triggerall = numhelper(10052)=0
trigger1 = stateno = 100||101||102||105
trigger2 = stateno = [200,3599]
stateno = 10052
id = 10052
postype = p1
pos = 0,-70
facing = 1
sprpriority = 4
ownpal = 1
persistent = 0
pausemovetime = 99999
supermovetime = 99999
supermove = 1

;----0にする・・
[state -3,];
type = varset
trigger1 = time <= 2
trigger2 = movetype = H
trigger3 = ctrl
trigger4 = numhelper(10052)
trigger5 = stateno = [0,50]
fvar(0) = 0
ignorehitpause = 1

;----0にする・・
[state -3,];
type = varset
triggerall = var(5)
trigger1 = ctrl
trigger1 = statetype!=A
trigger2 = movetype = H
trigger3 = p2stateno != [550,560]
trigger3 = stateno = 40
trigger4 = var(5) = 1
trigger4 = movehit
trigger4 = stateno=291
trigger4 = (enemynear,prevstateno = [551,554])
trigger5 = enemynear,stateno = [0,22]
trigger5 = stateno != [290,291]
trigger5 = stateno != 3900
trigger6 = numtarget
trigger6 = !Target,Ishelper
trigger6 = target,prevstateno = [551,554]
var(5) = 0
ignorehitpause = 1

[state -3,];
type = varset
;triggerall = var(5)
trigger1 = stateno != [290,291]
trigger1 = p2stateno = [555,558]
var(5) = 2
ignorehitpause = 1

;リバーサルアタック
[State -2]
Type = VarSet
Trigger1 = StateNo != 5120
Trigger1 = Time = 2
V = 47
Value = 0
IgnoreHitPause = 1

[State -2]
Type = NotHitBy
TriggerAll = Var(47) >= 990
Trigger1 = StateNo = 5120
Trigger1 = AnimTime = 0
Value = SCA, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
Time = 6

[State -2];相手しゃがみ食らい判定
type = varset
trigger1 = numenemy
var(41) = ifelse(enemynear,statetype=C,1,0)
persistent = 1
ignorehitpause = 1

;---------V25　ガード状態0,1,2か食らい状態-1  st1でもやってる  超必,投げなら-3(バースト封じ)　それ以外-1
[state 120x,];通常状態
type = varset
triggerall = var(45) < 0
trigger1 = movetype != H
trigger1 = stateno != [120,155] 
var(45)  = -1
ignorehitpause = 1

[state 120x,];普通くらい
type = varset
triggerall= numenemy
triggerall = movetype = H
triggerall = gethitvar(guarded) = 0
trigger1 = 1;!HitShakeOver
trigger1 = enemynear,hitdefattr = sca,na,np,sa,sp
var(45)  = -2
ignorehitpause = 1

[state 120x,];援軍ダメくらい
type = varset
triggerall= numenemy
triggerall = movetype = H
triggerall = gethitvar(guarded) = 0
trigger1 = enemynear,hitdefattr = sca,nt,st,ha,hp,ht
var(45)  = -3
ignorehitpause = 1

;=========================================================================
;------------------------------------------------
;スタイリッシュポイント
[state 7000,]
type = varset
trigger1 = fvar(30) < 1
fvar(30) = 1
ignorehitpause = 1
supermovetime = 999


;--------------------------------------------------
;通常技全部ヒット立ち
[state 7000,]
type = varadd
triggerall = stateno=200&&movehit&&prevstateno=[0,119]
triggerall = var(51)!=1&&var(51)!=11&&var(51)!=111
Trigger1 = var(51)=0
Trigger2 = var(51)=10
Trigger3 = var(51)=100
Trigger4 = var(51)=110
var(51) = 1
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=210&&movehit&&prevstateno=[0,119]
triggerall = var(51)!=10&&var(51)!=110&&var(51)!=111
Trigger1 = var(51)=0
Trigger2 = var(51)=1
Trigger3 = var(51)=100
Trigger4 = var(51)=101
var(51) = 10
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=220&&movehit&&prevstateno=[0,119]
triggerall = var(51)!=100&&var(51)!=110&&var(51)!=111
Trigger1 = var(51)=0
Trigger2 = var(51)=1
Trigger3 = var(51)=10
Trigger4 = var(51)=11
var(51) = 100
persistent = 0

[state 7000,]
type = varadd
Trigger1 = var(51)=111
fvar(30) = 0.08
persistent = 0

[state 7000,]
type = varset
Trigger1 = var(51)=111
var(51) = 999
persistent = 0
;-----------------------------------------------------------
;通常技全部ヒットしゃがみ
[state 7000,]
type = varadd
triggerall = stateno=400&&movehit&&prevstateno=[0,119]
triggerall = var(52)!=1&&var(52)!=11&&var(52)!=111
Trigger1 = var(52)=0
Trigger2 = var(52)=10
Trigger3 = var(52)=100
Trigger4 = var(52)=110
var(52) = 1
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=410&&movehit&&prevstateno=[0,119]
triggerall = var(52)!=10&&var(52)!=110&&var(52)!=111
Trigger1 = var(52)=0
Trigger2 = var(52)=1
Trigger3 = var(52)=100
Trigger4 = var(52)=101
var(52) = 10
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=421&&movehit&&prevstateno=[0,119]
triggerall = var(52)!=100&&var(52)!=110&&var(52)!=111
Trigger1 = var(52)=0
Trigger2 = var(52)=1
Trigger3 = var(52)=10
Trigger4 = var(52)=11
var(52) = 100
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=422&&movehit&&prevstateno=[0,119]
triggerall = var(52)!=100&&var(52)!=110&&var(52)!=111
Trigger1 = var(52)=0
Trigger2 = var(52)=1
Trigger3 = var(52)=10
Trigger4 = var(52)=11
var(52) = 100
persistent = 0

[state 7000,]
type = varadd
Trigger1 = var(52)=111
fvar(30) = 0.08
persistent = 0

[state 7000,]
type = varset
Trigger1 = var(52)=111
var(52) = 999
persistent = 0
;--------------------------------------------------
;通常技全部ヒット空中
[state 7000,]
type = varadd
triggerall = stateno=600&&movehit&&prevstateno=50
triggerall = var(50)!=1&&var(50)!=11&&var(50)!=111
Trigger1 = var(50)=0
Trigger2 = var(50)=10
Trigger3 = var(50)=100
Trigger4 = var(50)=110
var(50) = 1
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=610&&movehit&&prevstateno=50
triggerall = var(50)!=10&&var(50)!=110&&var(50)!=111
Trigger1 = var(50)=0
Trigger2 = var(50)=1
Trigger3 = var(50)=100
Trigger4 = var(50)=101
var(50) = 10
persistent = 0

[state 7000,]
type = varadd
triggerall = stateno=620&&movehit&&prevstateno=50
triggerall = var(50)!=100&&var(50)!=110&&var(50)!=111
Trigger1 = var(50)=0
Trigger2 = var(50)=1
Trigger3 = var(50)=10
Trigger4 = var(50)=11
var(50) = 100
persistent = 0

[state 7000,]
type = varadd
Trigger1 = var(50)=111
fvar(30) = 0.08
persistent = 0

[state 7000,]
type = varset
Trigger1 = var(50)=111
var(50) = 999
persistent = 0
;-----------------------------------------------------------
[state 7000,]
type = varadd
Trigger1 = p2movetype=H
trigger1 = p2stateno!=[120,165]
;Trigger1 = p2statetype=L
fvar(30) = 0.00005
persistent = 0

[state 7000,]
type = varadd
Trigger1 = enemynear,movetype=H
trigger1 = enemynear,prevstateno=[120,165]
trigger1 = enemynear,stateno=[5000,5099]
Trigger1 = enemynear,statetype!=L
fvar(30) = 0.02
persistent = 0

[state 7000,]
type = varadd
Trigger1 = p2stateno=[3000,4999]
trigger1 = stateno=[120,165]
Trigger1 = gethitvar(guarded)
fvar(30) = 0.0004
persistent = 0

[state 7000,]
type = varadd
Trigger1 = movetype=H
trigger1 = stateno!=[120,165]
Trigger1 = statetype!=L
fvar(30) = 0.00015
persistent = 0

[state 7000,]
type = varadd
Trigger1 = Life = Const(data.life)
Trigger1 = enemynear,Life >= enemynear,Const(data.life)-80
trigger1 = movehit = 1
trigger1 = hitcount <= 1
fvar(30) = 0.05
persistent = 0

[state 7000,]
type = varset
triggerall= numenemy
trigger1 = fvar(30) > 2
fvar(30) = 2
ignorehitpause = 1
supermovetime = 999

;------------------------------------------------------------------------
;===========================================================================================-

;--------------------------------相手のガードバランス自然増加減少
[state 7000,]
type = varadd
triggerall= numenemy
triggerall = time % 5 = 0
triggerall = var(22) > 160
trigger1 = enemynear,movetype != H
trigger1 = p2stateno != [5000,5119]
trigger1 = p2stateno != [830,833]
trigger1 = p2stateno != [840,841]
trigger1 = p2stateno != [852,853]
trigger1 = p2stateno != [1060,1061]
trigger1 = p2stateno != [2031,2032]
trigger1 = p2stateno != [3120,3145]
trigger1 = p2stateno != [3210,3211]
trigger2 = enemynear,statetype = L
var(22) = ifelse(enemynear,stateno = 5120,-2,-1) 
ignorehitpause = 1
supermovetime = 999

[state 7000,]
type = varset
trigger1 = var(22) > 200
var(22) = 200
ignorehitpause = 1
supermovetime = 999

[state 7000,]
type = varset
triggerall= numenemy
trigger1 = var(22) <= 150
trigger1 = enemynear,movetype != H
var(22) = 150
ignorehitpause = 1
supermovetime = 999

;----------------------------------------------------------------------------------------------
;コンボ計算

[state -3,fvhj2re]
type = varset
trigger1 = var(22) >= 150
fvar(6) = 1
ignorehitpause = 1

[state -3,fv2hjre]
type = varset
trigger1 = var(22) = [140,149]
fvar(6) = 0.8
ignorehitpause = 1

[state -3,fv2hjre]
type = varset
trigger1 = var(22) = [130,139]
fvar(6) = 0.75
ignorehitpause = 1

[state -3,fv2ghre]
type = varset
trigger1 = var(22) = [120,129]
fvar(6) = 0.70
ignorehitpause = 1

[state -3,fvm2re]
type = varset
trigger1 = var(22) = [110,119]
fvar(6) = 0.63
ignorehitpause = 1

[state -3,fv2rnme]
type = varset
trigger1 = var(22) = [100,109]
fvar(6) = 0.50
ignorehitpause = 1

[state -3,fv2fcre]
type = varset
trigger1 = var(22) = [90,99]
fvar(6) = 0.43
ignorehitpause = 1

[state -3,fv2rdse];20.35%
type = varset
trigger1 = var(22) = [80,89]
fvar(6) = 0.38
ignorehitpause = 1

[state -3,fv2rgbe];17.3type = varset
type = varset
trigger1 = var(22) = [70,79]
fvar(6) = 0.43
ignorehitpause = 1

[state -3,fv2remj];20.35%
type = varset
trigger1 = var(22) = [60,69]
fvar(6) = 0.29
ignorehitpause = 1

[state -3,fv2rk,me];18.5
type = varset
trigger1 = var(22) = [50,59]
fvar(6) = 0.235
ignorehitpause = 1

[state -3,fv2mjre];13.5
type = varset
trigger1 = var(22) = [40,49]
fvar(6) = 0.185
ignorehitpause = 1

[state -3,fv2re];7%
type = varset
trigger1 = var(22) = [30,39]
fvar(6) = 0.13
ignorehitpause = 1

[state -3,mjfv2re];5%
type = varset
trigger1 = var(22) <= 30
fvar(6) = 0.09
ignorehitpause = 1

[state -3,fv2r/e];さらに補正
type = AttackMulSet
trigger1 = var(8)
value = 0.75
ignorehitpause = 1

[state -3,fv2r/e];さらに補正
type = AttackMulSet
trigger1 = p2statetype = C
value = 1.1
ignorehitpause = 1

[state 7000,]
type = varadd
trigger1 = var(22) = [10,20]
trigger1 = p2stateno != [2550,2552]
fvar(30) = 0.002
persistent = 0

[state 7000,]
type = varadd
trigger1 = var(22) <= 10
fvar(30) = 0.001
persistent = 0

;------------------------------------------
[State -2];カウンター判定初期化
type = varset
triggerall = numenemy
triggerall = var(33)
triggerall = time >= ifelse(stateno=610,20,1)
trigger1 = p2movetype != A
var(33) = 0

[State -2];カウンター判定
type = varset
trigger1 = p2movetype = A
trigger2 = p2stateno = [100,119]
;trigger3 = var(22) > 128 + 64
var(33) = 1
persistent = 1
ignorehitpause = 1

[state 7000,debu2]
type =powerset
trigger1 = 1
value = 2000
ignorehitpause = 1

;--------------------------------enemynearの状態監視主にHITDEFとよろけなどの判定に
;----------------------仕様変更にともないmovetype＝A判定ぐらいしかつかわないかも
[state 5900,v46];44  くらい状態の長さをはかる	復帰不能時間減少に使う10秒ごとに減り始める？600F　
type = varadd
triggerall= numenemy
trigger1 = enemynear,movetype = H
trigger1 = enemynear,stateno != 150
trigger1 = enemynear,stateno != 152
trigger1 = enemynear,stateno != 154
var(44) = 1
ignorehitpause = 0

[state 5900,v46];44  くらいい状態の長さリセット　
type = varset
triggerall= numenemy
trigger1 = enemynear,movetype != H
trigger2 = enemynear,stateno = 150
trigger3 = enemynear,stateno = 152
trigger4 = enemynear,stateno = 154
var(44) = 0
ignorehitpause = 1

;------------fvar(5)　ヒットバック補正
;---------------1秒以降増加開始、最大8秒
[state 5900,fv5];fv14  くらい状態の長さでX距離増加 基本乗数1
type = varset
triggerall= numenemy
trigger1 = enemynear,movetype != H
trigger2 = enemynear,stateno = [120,155]
trigger3 = var(44) < 30
fvar(14) = 1
ignorehitpause = 0

[state 5900,fv5]
type = varset
triggerall= numenemy
trigger1 = 1
fvar(14) = ((160-var(22))+115)*0.008
ignorehitpause = 0

[state 5900,fv5]
type = varset
triggerall = var(5) = 2
triggerall= numenemy
trigger1 = 1
fvar(14) = fvar(14)*2
ignorehitpause = 0

[state 5900,fv5]
type = varset
triggerall= numenemy
trigger1 = 1
fvar(15) = 1-((160-var(22))*0.002)
ignorehitpause = 0

;HIT数記憶(宇宙旅行用)
[state -2, v35-1];HIT数記憶管理上限値
type = varset
trigger1 = var(20) > 320
var(20) = 320
ignorehitpause = 1
supermovetime = 999

[state -2, v35-2];HIT数記憶管理下限値
type = varset
trigger1 = var(20) < 0
var(20) = 0
ignorehitpause = 1
supermovetime = 999

[state -2, v35-3];HIT数記憶管理初期化
type = varset
triggerall= numenemy
trigger1 = var(20) <= 320
trigger1 = enemynear,movetype != H
var(20) = 320
ignorehitpause = 1
supermovetime = 999

[state -3,];浮き補正
type = varset
trigger1 = fvar(15) <= 0.01
fvar(15) = 0.01
ignorehitpause = 1

[state -3,];エリアル
type = varadd
;trigger1 = fvar(15) >= 0.52
triggerall = var(20) > 20;31ヒット未満
trigger1 = var(8)
fvar(15) = -0.1
ignorehitpause = 1

[state -3,];オワタグレイブ
type = varset
;trigger1 = fvar(15) <= 0.52
triggerall = var(20) <= 20;31ヒット以上
trigger1 = var(8)
fvar(15) = 1.5
ignorehitpause = 1

;---------------24-30の間にガードにいければ、成功
;---------------ギルティよりちょこっとだけ短い
[state 120x,]
type = varadd
triggerall = var(35) > 0
trigger1 = stateno != 3150
trigger1 = 1
var(35)  = -1
ignorehitpause = 1

[state 120x,]
type = varset
triggerall = var(35) <= 0
trigger1 = stateno != 3150
trigger1 = 1
var(35)  = 0
ignorehitpause = 1

[state 120x,]
type = varset
triggerall = var(35) <= 24
trigger1 = stateno != 3150
trigger1 = var(36) = 1
var(35)  = 0
ignorehitpause = 1

;---------V25　ガード状態0,1,2か食らい状態-1  st1でもやってる  超必,投げなら-3(バースト封じ)　それ以外-1
[state 120x,];通常状態
type = varset
triggerall = var(45) < 0
trigger1 = movetype != H
trigger1 = stateno != [120,155] 
var(45)  = -1
ignorehitpause = 1

[state 120x,];普通くらい
type = varset
triggerall= numenemy
triggerall = movetype = H
triggerall = gethitvar(guarded) = 0
triggerall = !(var(45)=3&&time=0)
trigger1 = 1;!HitShakeOver
trigger1 = enemynear,hitdefattr = sca,na,np,sa,sp
var(45)  = -2
ignorehitpause = 1

[state -2, displayb];
type = displaytoclipboard
trigger1 = 1
text = "Stylish Point=%f,%f,Y = %f\n"
params = fvar(30),fvar(10), P2BodyDist Y
ignorehitpause = 1

;---------------------[一撃BASARA技関係]
[state a];
type = Helper
trigger1 = winko
trigger1 = numhelper(6250) = 0
trigger1 = stateno = [3000,3498]
trigger2 = winko
trigger2 = numhelper(6250) = 0
trigger2 = stateno = [3500,3699]
id = 6250
name = "FINISH"
pos = 0 , 0
postype = back
stateno = 6250
pausemovetime = 999
helpertype = normal
persistent = 0
ignorehitpause = 1
keyctrl = 0 
ownpal = 1

[state a]
type = varadd
trigger1 = roundstate = 2
trigger1 = var(24) > 1
v = 24
value = -1
ignorehitpause = 1

[state a]
type = powerset
trigger1 = var(24) = 2
value = 0
ignorehitpause = 1

;---------------------[演出]
[State a];
type = palfx
trigger1 = var(24) > 1
trigger1 = gametime%40 = 0
time = 80
;add = 255,255,255
mul = 185,185,0
sinadd = 185,185,0,80
color = 255
ignorehitpause = 1

;==========================[音楽]
[state a]
type = AssertSpecial
trigger1 = var(13)
flag = nomusic

[State 193, 5]
type = PlaySnd
triggerall = numenemy
trigger1 = var(40)=1
trigger1 = var(46)=655
value = 2011, 0
channel = 1
lowpriority = 0
persistent = 0

[State -1, ]
type = SelfState
value = ifelse(random%3 = 0,181 + random%2,3500)
trigger1 = random < 10 && stateno != 3501
