;-----------------------------------------------------------------------------
[Statedef -2]
;-----------------------------------------------------------------------------
;----------------------------------------------
;----------------------------------------------
;----------------------------------------------
;生存判定
[State -2]
type = Varset
trigger1 = alive
var(4) = 0
ignorehitpause = 1

[State -2]
type = Explod
triggerall = anim = 0
triggerall = time >= 1
trigger1 = (GameTime%9) = 1
anim = 50003
sprpriority = 0
postype = p1
velset = 0,0
pos = -12,-105
bindtime = 1
supermove = 0
ignorehitpause = 0
under = 0
ownpal = 1
Scale = 0.6,1

[State -2]
type = Explod
triggerall = anim = 0
triggerall = time >= 1
trigger1 = (GameTime%5) = 1
anim = 50003
sprpriority = 0
postype = p1
velset = 0,0
pos = -5,-3
bindtime = 1
supermove = 0
ignorehitpause = 0
under = 0
ownpal = 1
Scale = 1,0.2

[State a]
type = Afterimage
triggerall = stateno != [190,192]
trigger1 = roundstate != 0
trigger1 = TIME = 0
trans = add
PalContrast =  150, 500, 500
PalBright = 0,0,0
time    =  -1
length  = 20
TimeGap = 1
FrameGap = 1

[State a]
type = EnvColor
trigger1 = projhit1050 = 1
persistent = 0
ignorehitpause = 1
time = 1
value = 255,255,255
under = 1

[State 1000, 9]
type = Envcolor
trigger1 = projHit22079 = 1
ignorehitpause = 1
value = 255, 255, 255
time = 1
under = 5
supermove = 1

[State -2]
type = Varset
trigger1 = !alive && var(4)!= 2
var(4) = 1
ignorehitpause = 1

[State -2]
type = Varset
trigger1 = !alive && var(4)= 1 && time=2
var(4) = 2
ignorehitpause = 1

;KOダメージボイス
[State -2,PlaySnd]
type =PlaySnd
trigger1 = roundstate = 3
trigger1 = !alive && var(4) = 1 && time = 1
value = 110,0
channel = 11
volume = 255

;----------------------------------------------
[State -2]
type = Varset
trigger1 = stateno != [800,899]
var(5) = 0
ignorehitpause = 1

;----------------------------------------------
;火闌降回数判定
[State -2, Combo]
type = VarSet
trigger1 = stateno != [1500,1580]
var(11) = 0
ignorehitpause = 1

[State -2, Combo];通常技
type = Varadd
triggerall = time = 1
trigger1 = stateno = [1500,1580]
var(11) = 1
ignorehitpause = 1

;----------------------------------------------
;特定技ヒット後ジャグル増大判定
[State -2, Combo]
type = VarSet
trigger1 = !numtarget
trigger2 = p2movetype != H
var(12) = 0
ignorehitpause = 1

[State -2, Combo];通常技
type = VarSet
triggerall = p2statetype = A
triggerall = movehit
trigger1 = stateno = [200,690]
var(12) = 1
ignorehitpause = 1

[State -2, Combo];クロウバイツ
type = null;VarSet
triggerall = movehit
trigger1 = stateno = 1200
trigger2 = stateno = 1210
var(12) = 2
ignorehitpause = 1

;----------------------------------------------
;スーパーキャンセル判定
[State -2, 5]
type = VarSet
triggerall = MoveContact
trigger1 = stateno = 1100
var(14) = 1
ignorehitpause = 1

[State 1305, 1]
type = VarSet
trigger1 = stateno = 0
trigger2 = movetype = H
trigger3 = P2MoveType != H
var(14) = 0
ignorehitpause = 1

;----------------------------------------------
;ドリームキャンセル判定
[State 1020, 2]
type = null;VarSet
trigger1 = ProjHit(3050) = 1
var(15) = 1
ignorehitpause = 1

[State 1305, 1]
type = VarSet
trigger1 = stateno = 0
trigger2 = movetype = H
trigger3 = P2MoveType != H
var(15) = 0
ignorehitpause = 1

;----------------------------------------------
スーパーキャンセル,ドリームキャンセルコンボ制限解除
[State -2, Kill Juggle Checking]
type = assertspecial
trigger1 = var(14) = 1 || var(15) = 1
trigger1 = P2MoveType = H; && P2stateType = A
flag = nojugglecheck

;----------------------------------------------
;強顕斎（打撃エフェクト）ヘルパーヒット回数判定
[State 1020, 2]
type = VarSet
trigger1 = P2MoveType != H
trigger2 = P2Stateno = [120,155]
var(16) = 0
ignorehitpause = 1

;-----------------------------------------------------------------------
;ダメージ補正
[state -2]
type = varset
trigger1 = 1
Trigger2 = RoundState = 0
trigger3 = P2MoveType != H
trigger4 = P2stateno = [120,155]
;trigger2 = enemy,gethitvar(hitcount) = 0
fvar(0) = 1.0

[state -2]
type = varset
trigger1 = P2MoveType = H
trigger1 = enemy,gethitvar(hitcount) > 2
fvar(0) = abs((100.0-(25.0+(enemy,gethitvar(hitcount)/2.0)*5.0))/100.0)
IgnoreHitPause = 1

[state -2]
type = attackmulset
trigger1 = 1
value = fvar(0)

;--------------------------------------------------------
;ネバリ補正（根性値）
[State -2]
Type = DefenceMulSet
gethitvar(hitcount) > 0
;Triggerall = stateno != 3300
Trigger1 = 1
IgnoreHitPause = 1
Value = FVar(1)+(ifelse((GetHitVar(HitCount)/10 < 1.0), GetHitVar(HitCount)/10, 0))

[State -2]
Type = VarSet
Trigger1 = stateno = 3301
Trigger1 = 1
IgnoreHitPause = 1
FV = 1
Value = 0

[State -2]
Type = VarSet
Triggerall = stateno != 3301
Triggerall = (1000*life/const(data.life)) > 750
Trigger1 = 1
IgnoreHitPause = 1
FV = 1
Value = 1

[State -2]
Type = VarSet
Triggerall = stateno != 3301
Triggerall = (1000*life/const(data.life)) = [151,750]
Trigger1 = 1
IgnoreHitPause = 1
FV = 1
Value = 0.75

[State -2]
Type = VarSet
Triggerall = stateno != 3301
Triggerall = (1000*life/const(data.life)) < 151
Trigger1 = 1
IgnoreHitPause = 1
FV = 1
Value = 0.5

;-----------------------------------------------------------------------
;--------------------------------------------------------
;空中復帰誘導
[State -2, airReturn]
type = VarSet
trigger1 = !NumTarget
trigger2 = P2MoveType != H
trigger3 = movehit
trigger4 = projhit = 1
trigger5 = numtarget
trigger5 = !target,gethitvar(fall)
fvar(2) = 0
ignorehitpause = 1

[State -2, airReturn]
type = VarSet
triggerall = P2MoveType = H
triggerall = P2stateType = A
triggerall = movehit
triggerall = (stateno = [200,650])
trigger1 = stateno != 240
trigger1 = stateno != 241
trigger1 = stateno != 250
trigger1 = stateno != 255
trigger1 = stateno != 260
trigger1 = stateno != 270
trigger1 = stateno != 280
trigger1 = stateno != 450
trigger1 = stateno != 650
fvar(2) = 1
ignorehitpause = 1

[State -2, airReturn]
type = TargetState
triggerall = Numtarget
triggerall = fvar(2)
trigger1 = target,stateno = 5050
trigger1 = target,alive
value = 950
;----------------------------------------------
;afterimage除去
[State -2, RemoveAfterImage]
type = AfterImageTime
trigger1 = MoveType = H
time = 0

[State -2, RemoveAfterImage]
type = null;AfterImageTime
trigger1 = stateno != 3100
trigger1 = stateno != 3110
trigger1 = stateno != 3130
trigger1 = stateno != 3400
trigger1 = stateno != 3400
trigger1 = stateno != 3401
trigger1 = stateno != 3402
time = 0

;----------------------------------------------
;AssertSpecial除去
[State -2, AssertSpecial]
type = AssertSpecial
triggerall = time = 0
trigger1 = stateno != 3100 && Prevstateno = 3100
flag = NoFG
flag2 = NOBG
flag3 = noshadow
ignorehitpause = 1

;----------------------------------------------
;端でめくらないように
[State -2, 100]
type = Width
trigger1 = p2Dist X >= 0
edge = 3,-3

[State -2, 100]
type = Width
trigger1 = p2Dist X < 0
edge = -3,3

;----------------------------------------------
;攻撃音止め
[State -2, 3]
type = stopSnd
trigger1 = MoveType = H
channel = 0

;ダッシュの音止め
[State -2, 1]
type = stopSnd
trigger1 = stateno != 100
channel = 1

;挑発の音止め
[State -2, 1]
type = stopSnd
trigger1 = stateno != 195
channel = 2

;攻撃の振り音止め
[State -2, 3]
type = null;stopSnd
trigger1 = MoveType = H
channel = 3

;----------------------------------------------
;ダメージボイス
;地上やられ
[State -2,PlaySnd]
type = PlaySnd
triggerall = Alive && Random%2 = 0
triggerall = Time = 1
triggerall = (StateNo = 5000 || StateNo = 5010 || StateNo = 5020)
trigger1 = GethitVar(animtype)=[0,2]
value = 110,ifelse((GethitVar(animtype)=[0,1]),2,3)
channel = 10
volume = 255

;地上吹き飛びやられ
[State -2,PlaySnd]
type = PlaySnd
triggerall = Alive && Random%2 = 0
triggerall = Time = 1
triggerall = (StateNo = 5000 || StateNo = 5010 || StateNo = 5020)
trigger1 = GethitVar(animtype)=[0,2]
value = 110,ifelse((GethitVar(animtype)=[4,5]),3,3)
channel = 10
volume = 255

;空中やられ
[State -2,PlaySnd]
type = null;PlaySnd
triggerall = Alive && Random%2 = 0
triggerall = Time = 1
triggerall = (StateNo = 5000 || StateNo = 5010 || StateNo = 5020)
trigger1 = GethitVar(animtype)=[0,2]
value = 110,ifelse((GethitVar(airtype)=[0,1]),2,4)
channel = 10
volume = 255

;空中吹き飛びやられ
[State -2,PlaySnd]
type = null;PlaySnd
triggerall = Alive && Random%2 = 0
triggerall = Time = 1
triggerall = (StateNo = 5000 || StateNo = 5010 || StateNo = 5020)
trigger1 = GethitVar(animtype)=[0,2]
value = 110,ifelse((GethitVar(airtype)=[4,5]),3,3)
channel = 10
volume = 255


;--------------------------------------------------------
;デバック用
[State -2]
Type = null;DisplayToClipboard
Trigger1 = 1
Text = "hit:%d,SC:%d,DC:%d,harae:%d";AI:%d";over:%d";raijin:%d";
Params = Var(12),Var(14),Var(15),Var(25);Var(59);
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -2]
Type = DisplayToClipBoard
Trigger1 = 1
Text = "(12)=%d,(16)=%d,(59)=%d,p2Vel X: %d ,\n"
Params = var(12),var(16),var(59),ceil(enemynear,Vel X)
IgnoreHitPause = 1


[State -2,]
type = AppendToClipboard
trigger1 = 1
text = "P2BodyDist X: %d | P2BodyDist Y: %d | Pos X: %d | Pos Y: %d \n"
params	= floor(P2BodyDist X),ceil(P2BodyDist Y),ceil(Pos X),ceil(Pos Y)
ignorehitpause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999


;---------------------------------------------------------------------------------
[Statedef -3];常時監視ステート(p2statenoなどで相手に行動を制御された時は実行しない)
;---------------------------------------------------------------------------------

[State -3, ダメージボイス]
type = null;PlaySnd
triggerall = Time = 1
triggerall = Alive && GameTime % 3 = 0         ;生きている時
trigger1 = stateno=5000 || stateno=5010 || stateno=5020 ;ダメージの瞬間
trigger2 = stateno = 5070 || stateno = 5080             ;ダメージの瞬間
value = 5000,random/250                                   ;50,0〜50,3までをランダムに決定
channel = 3 ;チャンネルを決定しています。同じチャンネルの音は重なりません。
