;===========================================================================
; 準常時監視ステート（−３）
;===========================================================================
;---------------------------------------------------------------------------
; こちらは通常の食らい状態以外の「P2StateNo」や「TargetState」等で制御された、
; 作成者が任意に指定した相手側の食らいステートに限り、
; 登録したステートコントローラが有効にはなりません。
; −１や−２と上手く使い分けて行きましょう。
;---------------------------------------------------------------------------

[Statedef -3]

;=============================================================================

[State 0, VarSet];デバッグスイッチ。０で何もなし。1でXボタンを押すたびに満開ゲージが10溜まる。Yで-10。
type = VarSet
trigger1 = 1
v = 4
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];強制満開スイッチ。0でなし。1で強制的に満開を発動させられることがある。2で自分が負けているときのみ強制満開発動
type = VarSet
trigger1 = 1
v = 6
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];バーストステ抜けスイッチ。0でステ抜けはしない。1でステ抜けする。
type = VarSet
trigger1 = 1
v = 5
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];火車スイッチ  1で常に火車が使えるように。通常は満開経験後に使用可能。勇者キック（２ゲージ技）が最初から使えるようになります。
type = VarSet
trigger1 = 1
v = 7
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];目の散華のオンオフ。0でなし。1で完全に散華。2で控えめな散華。3で微妙な散華。4で何とも言えない散華。
type = VarSet
trigger1 = 1
v = 8
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];散華があるかどうか。1であり。2でなし。
type = VarSet
trigger1 = 1
v = 9
value = 1			;左の数値を変更（デフォルト：1）

;=============================================================================

[State 0, VarSet];くらい抜けの上限回数　デフォルトでは1
type = VarSet
trigger1 = 1
v = 24
value = 1			;左の数値を変更（デフォルト：1）

;=============================================================================

[State 0, VarSet];満開時一撃の演出設定。0で通常演出。1で短縮。
type = VarSet
trigger1 = 1
v = 18
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

[State 0, VarSet];満開時一撃(勇者部五か条ひとーつの方)が使用可能になる満開回数です。デフォルトでは2回満開することで使えるようになります。(2回目の満開から使用可能)
type = VarSet
trigger1 = 1
Fv = 8
value = 2			;左の数値を変更（デフォルト：2）

;=============================================================================

[State 0, VarSet];一撃当身(うおおおおおおおの方)が使用可能になる満開回数です。デフォルトでは2回満開することで使えるようになります。(2回目の満開から使用可能)
type = VarSet
trigger1 = 1
Fv = 10
value = 2			;左の数値を変更（デフォルト：2）

;=============================================================================

[State 0, VarSet];勇者パンチのカットインをオフにする。0でカットインあり、1でカットインなし。
type = VarSet
trigger1 = 1
Fv = 14
value = 0			;左の数値を変更（デフォルト：0）

;=============================================================================

;=============================================================================
;AI用設定　※AI_Config.txtに移動しました。
;=============================================================================






;-----------------------------------
;ここは「ジャンプ」か「バックステップ」をした後に
;着地する音を鳴らす設定をしています。


[State 0, VarAdd]
type = VarAdd
triggerall = Var(4) = 1
trigger1 = var(59) <= 0
trigger1 = command ="x"
trigger2 = var(47) = 1
trigger2 = var(57) != 1 && (stateno != [4000,4999]) && roundstate = 2 && Gametime%4 = 0
trigger3 = var(47) = 2
trigger3 = roundstate = 2 && Gametime%4 = 0
v = 58    ;fv =
value = 10

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(4) = 1
trigger1 = var(59) <= 0
trigger1 = command ="y"
v = 58    ;fv =
value = -10

[State 0, VarSet]
type = VarSet
trigger1 = NumPartner
trigger1 = partner,name = "Miyoshi_Karin" && partner,Authorname = "Arumikan"
Fv = 6    ;fv = 10
value = 5

[State 0, VarSet]
type = VarSet
trigger1 = NumPartner
trigger1 = partner,name = "Yuna" && partner,Authorname = "Arumikan"
trigger1 = partner,Palno < Palno
Fv = 6    ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = NumPartner
trigger1 = Enemy,name = "Yuna" && Enemy,Authorname = "Arumikan"
trigger2 = Enemy,name = "Miyoshi_Karin" && Enemy,Authorname = "Arumikan"
Fv = 7    ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 33    ;fv = 10
value = Ceil(Gametime)


[State 0, LifeAdd]
type = LifeAdd
trigger1 = Var(57) = 1
trigger1 = Life <=0
value = 1
kill = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Var(52)
flag = nokosnd


[State 0, NotHitBy]
type = NotHitBy
trigger1 = Var(57)=1
value = ,NT,ST,HT
time = 1


[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 100  ;着地ステート
trigger2 = stateno = 110  ;着地ステート
value = s40, 1

[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステート
trigger2 = stateno = 45  ;着地ステート
value = s40, 1

[State 0, Explod]
type = Explod
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステート
trigger2 = stateno = 45  ;着地ステート
trigger3 = stateno = 252  ;着地ステート
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,0.6
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = Time = 1
trigger1 = stateno = 40  ;着地ステート
trigger2 = stateno = 45  ;着地ステート
trigger3 = stateno = 252  ;着地ステート
anim = 8001
ID = 40
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,0.6
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, VarSet]
type = VarSet
trigger1 = RoundState = 1
v = 13    ;fv = 10
value = Ceil(P2Life)


[State 0, VarSet]
type = VarSet
trigger1 = Var(13) != 0
fvar(36)  = P2Life*100.0/Var(13)*1.0 

[State 0, VarAdd]
type = VarAdd
trigger1 = (stateno != [1200,1230]) &&(stateno != 1700)
trigger1 = movecontact = 1
trigger1 = (stateno != [4000,4999])
v = 58    ;fv =
value = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = (stateno != [1200,1230]) &&(stateno != 1700)
trigger1 = movehit = 1
trigger1 = (stateno != [4000,4999])
v = 58    ;fv =
value = 1

[State -3, 音を鳴らす]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52  ;着地ステート
trigger2 = stateno = 106 ;バックステップ後の着地ステート
value = 40, 0

[State 0, Helper]
type = Helper
trigger1 = Numhelper(11000) = 0
trigger1 = teamside = 1
helpertype = normal ;player
name = "gage"
ID = 11000
stateno = 11000
pos = 0,-0
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.2
size.yscale = 0.2



[State 0, Helper]
type = Helper
trigger1 = Numhelper(11000) = 0
trigger1 = teamside = 2
helpertype = normal ;player
name = "gage"
ID = 11000
stateno = 11000
pos = 0,-0
postype = right    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.2
size.yscale = 0.2

[State 0, Helper]
type = Helper
trigger1 = Numhelper(21100) = 0
trigger1 = teamside = 1
helpertype = normal ;player
name = "silhouette"
ID = 21100
stateno = 21100
pos = 0,0
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.4
size.yscale = 0.4

[State 0, Helper]
type = Helper
trigger1 = Numhelper(21100) = 0
trigger1 = teamside = 2
helpertype = normal ;player
name = "silhouette"
ID = 21100
stateno = 21100
pos = 0,0
postype = right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = 0.4
size.yscale = 0.4

[State 0, VarSet]
type = VarSet
trigger1 = Var(59) <= 0
trigger1 = command ="z"
trigger1 = movehit = 1

trigger2 = Var(59) > 0
trigger2 = random < Var(59)*100 || Var(59) > 3
trigger2 = movehit = 1
v = 21    ;fv = 10
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 47 || Anim = 48
trigger1 = Animtime = 0
value = 0
ctrl = 1
anim = 0


[State -2, SelfState バースト記述]
type = SelfState
triggerall = Var(5) = 0     ; ステ抜けスイッチ
triggerall = !ctrl && Var(57) = 0
triggerall = Var(59) <= 0
triggerall = roundstate = 2
triggerall = !canrecover
triggerall = command !="a" ||command !="a+b"
triggerall = command !="b" ;||command !="hold_b"
triggerall = command ="z" || (command = "recovery" && !Canrecover )
triggerall = Var(23) < Var(24)
triggerall = Var(25) = 0
triggerall = Stateno != [5110,5120]
triggerall = Stateno != [120,139]
triggerall = Stateno != [4000,4510]
triggerall = Alive
trigger1 = power>= 500
trigger1 = movetype = H
;trigger2 = Var(30)!= Var(33)
;trigger2 =movetype = H
value = 1700
ctrl = 0

[State -2, SelfState AIバースト記述]
type = SelfState
triggerall = var(59)>2 && RoundState=2 && Alive && !Ishelper && PlayerIDExist(var(49))
triggerall = Var(5) = 0     ; ステ抜けスイッチ
triggerall = !ctrl && Var(57) = 0; && !canrecover
triggerall = power>= 500 && Var(25)=0 && Var(23) < Var(24)
triggerall = movetype=H && (Stateno != [5110,5120]) && (Stateno != [120,159]) && (Stateno != [4000,4510])
triggerall = PlayerID(var(49)),movetype = A
Triggerall = PlayerID(var(49)),Time<=6 || GetHitVar(damage)
Triggerall = ((P2bodydist X=[-60,60]) && (P2bodydist Y=[-50,50])) || Life<=100
Triggerall = fvar(39)=0 || (fvar(39)>0 && Var(19)<100) || PlayerID(var(49)),statetype = A || Floor(Var(48))/1000=0

trigger1 = random%600 < 10-(var(59)*2)
trigger1 = Life>lifemax/2
trigger2 = Life<=lifemax/2
trigger2 = random%180<=Var(59)*5
trigger3 = Life<=lifemax/4
trigger3 = (Random<=Var(59)*100 || var(59)<=4)
trigger4 = Life<=100 && var(59)>3

trigger5 = Life<=lifemax/2 || (Var(24)-Var(23)>1)
trigger5 = GetHitVar(hitcount)>10-ifelse(Palno>=10,5,0)
trigger5 = Random<=Var(59)*20
trigger6 = Life<=lifemax/4 || (Var(24)-Var(23)>1)
trigger6 = GetHitVar(hitcount)>5-ifelse(Palno>=10,2,0)
trigger6 = Random<=Var(59)*150

value = 1700
ctrl = 0


;---------------------------------------------------------------------
;アシスト Assist

[State 0, VarAdd]
type = VarAdd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = var(59) <= 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = (Palno = [7,9]) || palno = 11
trigger1 = command = "F"
fv = 39    ;fv =
value = 1

[State 0, VarAdd]
type = VarAdd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = var(59) <= 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = (Palno = [7,9]) || palno = 11
trigger1 = command = "B"
fv = 39    ;fv =
value = -1



[State 0, VarAdd]
type = VarAdd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
fv = 30    ;fv =
value = 1

[State 0, VarSet]
type = VarSet
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 =(command = "F") || (command = "B")
fv = 30    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
triggerall = Var(59) <= 0
trigger1 = Fvar(6) = 0
trigger1 = FVar(39) >= 5

trigger2 = Fvar(6) = 4
trigger2 = Fvar(39) >= 4
fv = 39    ;fv = 10
value = 0

[State 0, VarSet]
type = VarSet
triggerall = Fvar(30) > 300
trigger1 = FVar(39) = 5
fv = 39    ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = Fvar(6) = 0
trigger1 = FVar(39) <= -1
Fv = 39    ;fv = 10
value = 4

[State 0, VarSet]
type = VarSet
trigger1 = Fvar(6) = 4
trigger1 = FVar(39) <= -1
Fv = 39    ;fv = 10
value = 3

[State 0, PlaySnd]
type = PlaySnd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = var(59) <= 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 =  (Palno = [7,9]) || palno = 11
trigger1 = (command = "F") || (command = "B")
value = S19000,0
volume = 250
channel = -1


[State 0, PlaySnd]
type = PlaySnd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = var(59) <= 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = (Palno = [7,9]) || palno = 11
trigger1 = (command = "a") || (command = "b")|| (command = "c") ||(command = "start")
value = S19000,1
volume = 250
channel = -1


[State 0, PlaySnd]
type = PlaySnd
triggerall = roundstate = 1
triggerall = Roundno = 1
trigger1 = var(59) <= 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = (Palno = [7,9]) || palno = 11
trigger1 = (command = "a") || (command = "b")|| (command = "c") ||(command = "start")
value = S19000+ceil(fvar(39)),0
volume = 250
channel = Ceil(fvar(39))


;=====================================================================================
;---------------------------------------------------------------------
;アシスト Assist
[State 0, VarSet]
type = Varadd
triggerall = var(59) > 0
triggerall = GameTime%5 = 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = var(34) = [1,4]
trigger1 = fvar(39) != var(34)
trigger1 = (var(34)+1) != fvar(6)
fv = 39    ;fv = 10
value = 1

[State 0, VarSet]
type = Varset
triggerall = var(59) > 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = var(34) = [1,4]
trigger1 = (var(34)+1) = fvar(6)
fv = 39    ;fv = 10
value = 0

[State 0, VarSet]
type = Varadd
triggerall = var(59) > 0
triggerall = GameTime%5 = 0
trigger1 = NumHelper(19000)
trigger1 = Helper(19000),Stateno = 19000
trigger1 = var(34) = 0
trigger1 = Helper(111111),var(12) != fvar(39)
fv = 39    ;fv = 10
value = 1

[State 0, VarSet]
type = VarSet
triggerall = var(59) > 0
trigger1 = Fvar(6) = 0
trigger1 = FVar(39) >= 5
trigger2 = Fvar(6) = 4
trigger2 = Fvar(39) >= 4
fv = 39    ;fv = 10
value = 0


;------------------------------------------------------------------------------
[State 0, VarSet]
type = VarSet
triggerall = var(59) > 0
triggerall = var(7) = 0
trigger1 = Var(56) >= 1
trigger2 = Var(51)+Var(52)+Var(53)+Var(54)+Var(55)>=1
v = 7    ;fv = 10
value = 1

;==============================================================================
;　AIデバッグ用
;==============================================================================
[State -2, デバッグ1]
type = DisplayToClipboard
trigger1 = 1
text = " V48=%d b=%f \n"
params = (Floor(Var(48))/10)%10, P2bodyDist Y
ignorehitpause = 1

;[State -2, デバッグ2]
;type = AppendToClipboard
;trigger1 = 1
;text = " fv25=%d, 111=%d, 222=%d"
;params = (Floor(Var(48))/100), ((Floor(Var(48))/10)%10), (Var(48)%10)
;ignorehitpause = 1

;[State -2, デバッグ3]
;type = varset
;trigger1 = 1
;v = 51
;v = 54
;v = 55
;value = 1
;ignorehitpause = 1

;==============================================================================
;　AIレベル変更用
;==============================================================================
[State -3, Not超反応]
type = VarSet
TriggerAll = var(59)=4 && Alive
Trigger1 = Var(53)=1
v = 59
value = 3

;==============================================================================
;　トレーニングキャラ判定
;==============================================================================
[State -3, Training];相手がトレーニング専用キャラの場合、アピールでアシストゲージを満タン。
Type = varset
TriggerAll = var(59) = 0
TriggerAll = Roundstate = 2
TriggerAll = fvar(39) != 0 && ((Palno = [7,9]) || palno = 11)
TriggerAll = command = "start" && var(19) < 99
Trigger1 = enemy,Name = "Training" && enemy,Authorname = "stupa"
Trigger2 = enemy,Name = "TRM Man" && enemy,Authorname = "M3"
v = 19
value = 99
ignorehitpause = 1

;==============================================================================
;　AI用Var管理
;==============================================================================
;------------------------------------------------------------------------------
[State -3, プレイヤーID取得]
type = VarSet
;TriggerAll = var(59)>0 && Alive
TriggerAll = !IsHelper
Trigger1 = NumEnemy = 1
v = 49
value = EnemyNear(0),ID

[State -3, プレイヤーID取得（タッグ戦）]
type = VarSet
;TriggerAll = var(59)>0 && Alive
TriggerAll = !IsHelper
Trigger1 = NumEnemy >= 2
v = 49
value = IfElse(EnemyNear(0),Alive,EnemyNear(0),ID,EnemyNear(1),ID)

;==============================================================================
;学習・計測関連
;==============================================================================
[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(54) != 0
Trigger1 = Var(44)%100000 = 0
V = 44
value = Helper(111112),var(54)

[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(55) != 0
Trigger1 = Floor(Var(44))/100000 = 0
V = 44
value = Helper(111112),var(55)*100000

[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(56) != 0
Trigger1 = Var(45)%100000 = 0
V = 45
value = Helper(111112),var(56)

[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(57) != 0
Trigger1 = Floor(Var(45))/100000 = 0
V = 45
value = Helper(111112),var(57)*100000

[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(58) != 0
Trigger1 = Var(46)%100000 = 0
V = 46
value = Helper(111112),var(58)

[State -3,vs]
Type = varadd
TriggerAll = RoundState=2
Trigger1 = Helper(111112),var(54) != 0
Trigger1 = Floor(Var(46))/100000 = 0
V = 46
value = Helper(111112),var(59)*100000

;------------------------------------------------------------------------------
[State -3, ステートタイプ変更]
type = StateTypeSet
TriggerAll = var(59)>0 && RoundState=2 && Alive && !Ishelper && PlayerIDExist(var(49))
TriggerAll = StateNo = 120
TriggerAll = StateType = C
Trigger1 = PlayerID(var(49)),StateType = A
Trigger1 = Helper(111112),var(54)=0 || Helper(111112),Var(54) != PlayerID(var(49)),StateNo
Trigger1 = Helper(111112),var(55)=0 || Helper(111112),Var(55) != PlayerID(var(49)),StateNo
Trigger1 = Helper(111112),var(56)=0 || Helper(111112),Var(56) != PlayerID(var(49)),StateNo
statetype = S
physics = S
;------------------------------------------------------------------------------
[State -3, ステートタイプ変更]
type = StateTypeSet
TriggerAll = var(59)>0 && RoundState=2 && Alive && !Ishelper && PlayerIDExist(var(49))
TriggerAll = StateNo = 120
TriggerAll = StateType = S
Trigger1 = PlayerID(var(49)),StateType != A
Trigger1 = Helper(111112),var(57)=0 || Helper(111112),Var(57) != PlayerID(var(49)),StateNo
Trigger1 = Helper(111112),var(58)=0 || Helper(111112),Var(58) != PlayerID(var(49)),StateNo
Trigger1 = Helper(111112),var(59)=0 || Helper(111112),Var(59) != PlayerID(var(49)),StateNo
statetype = C
physics = C

;===========================================================================
[state -3, AI用重力加速度計測]
type = varset
triggerall = !ishelper
trigger1 = fvar(24) != PlayerID(var(49)),const(movement.yaccel)
trigger1 = PlayerID(var(49)),stateno != [5000,5210]
trigger1 = PlayerID(var(49)),Vel Y != 0
FV = 24
value = PlayerID(var(49)),const(movement.yaccel)
ignorehitpause = 1
;---------------------------------------------------------------------------
[state -3, AI用重力加速度計測]
type = varset
triggerall = !ishelper
trigger1 = fvar(24) != PlayerID(var(49)),GetHitVar(yaccel)
trigger1 = PlayerID(var(49)),stateno = [5000,5210]
trigger1 = PlayerID(var(49)),Vel Y != 0
FV = 24
value = PlayerID(var(49)),GetHitVar(yaccel);(打撃当てた時のyaccel値)
ignorehitpause = 1
;---------------------------------------------------------------------------
[state -3, AI用重力加速度計測]
type = varset
triggerall = !ishelper
trigger1 = fvar(24) != 0
trigger1 = PlayerID(var(49)),Vel Y = 0
FV = 24
value = 0;(打撃当てた時のyaccel値)
ignorehitpause = 1

;===========================================================================
[state -3, AI用摩擦係数]
type = varset
trigger1 = PlayerID(var(49)),movetype=H
trigger1 = PlayerID(var(49)),statetype=S
FV = 25
value = PlayerID(var(49)),const(movement.stand.friction)
ignorehitpause = 1
;---------------------------------------------------------------------------
[state -3, AI用摩擦係数]
type = varset
trigger1 = PlayerID(var(49)),movetype=H
trigger1 = PlayerID(var(49)),statetype=C
FV = 25
value = PlayerID(var(49)),const(movement.crouch.friction)
ignorehitpause = 1
;---------------------------------------------------------------------------
[state -3, AI用摩擦係数リセット]
type = varset
trigger1 = PlayerID(var(49)),movetype!=H
trigger2 = PlayerID(var(49)),statetype=A
FV = 25
value = 1
ignorehitpause = 1

;===========================================================================
[State -3, 距離計算用相手速度計測]
type = varset
;TriggerAll = var(59)>0 && RoundState=2 && Alive && PlayerIDExist(var(49))
Trigger1 = PlayerID(var(49)),Alive
FV = 26
value = PlayerID(var(49)),Vel X
ignorehitpause = 1

;===========================================================================
[State -3, 追い打ち可能時間記憶]
type = varset
;TriggerAll = var(59)>0 && RoundState=2 && Alive && PlayerIDExist(var(49))
TriggerAll = PlayerID(var(49)),stateno=5120
TriggerAll = var(43)=0
TriggerAll = Helper(111111),var(10)>9
Trigger1 = var(43)=0 && Helper(111111),var(10)>0
;Trigger2 = var(43)>0 && Helper(111111),var(10)<var(43)
V = 43
value = Helper(111111),var(10)

;===========================================================================
[State -1, Walking Checker]
type = varadd
TriggerAll = var(59)>0 && RoundState=2 && Alive && PlayerIDExist(var(49))
Trigger1 = fvar(28)>=1
FV = 28
value = -1
ignorehitpause=1

;==============================================================================
[State -2, Lose flag]
Type = VarSet
Trigger1 = RoundState = 4
v = 42
value = (var(42)%1000000) + Ifelse(!Win,Ifelse(!Lose,3,2),1)*1000000

[State -2, Lose]; FDDFLLWW
Type = VarSet
Trigger1 = RoundState = 0
Trigger1 = Var(42) >= 1000000
v = 42
value = (Var(42)%1000000) + Ifelse(Var(42)>=2000000,Ifelse(Var(42)>=3000000,10000,100),1)

;==============================================================================
;　AI用ヘルパー
;==============================================================================
[State -3, AI_Activate]
Type = Helper
TriggerAll = IsHelper = 0
TriggerAll = NumHelper(98765 + ID) = 0
TriggerAll = RoundState <= 2
TriggerAll = Alive
Trigger1 = Var(59) <= 0
HelperType = Normal
Name = "AI"
StateNo = 99999
ID = 98765 + ID
Pos = 9999,9999
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, Safety]
Type = ChangeState
TriggerAll = IsHelper
TriggerAll = IsHelper(98765 + Root,ID)
Trigger1 = StateNo != 99999
Value = 99999
Ctrl = 0

[State -3, Option_Helper]
Type = Helper
TriggerAll = IsHelper = 0
TriggerAll = NumHelper(99999 + ID) = 0
Trigger1 = StateNo = 5900
Name = "config"
ID = 99999 + ID
Pos = 9999, 9999
StateNo = 99999
OwnPal = 1
SuperMoveTime = 2147483647
PauseMoveTime = 2147483647

;===========================================================================
[State -3, AI用飛び道具探知ヘルパー]
Type = Helper
TriggerAll = IsHelper = 0
TriggerAll = NumHelper(300020) = 0
Trigger1 = Alive
Name = "Proj_Search"
StateNo = 300020
ID = 300020
Pos = 9999,9999
SuperMoveTime = 2147483647
PauseMoveTime = 2147483647

[State -3, 飛び道具探知変数代入]
Type = VarSet
;TriggerAll = Var(59) >= 0
Trigger1 = NumHelper(300020)
V = 41
Value = Helper(300020),Var(58)
IgNoreHitPause = 1

;===========================================================================
[State -3, めくり監視用]
Type = Helper
;triggerall = var(59) >=0
Trigger1 = !NumHelper(2666660)
Trigger1 = !IsHelper
Trigger1 = RoundState<=2&&alive
HelperType = Normal
Name = "Chain Guard"
ID = 2666660
StateNo = 2666660
pos=0,524288
KeyCtrl = 0
Ownpal = 0
pausemovetime=0
supermovetime=0
persistent = 0
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State -3, 念のため]
type=changestate
triggerAll= Ishelper
trigger1= ishelper(2666660+Root,id)
trigger1= stateno!=2666660
value=2666660

;===========================================================================
[State -3, ステージ端感知（右）]
type=Helper
;triggerall = var(59) >=0
triggerall=!ishelper
triggerall=!numhelper(111111)
trigger1=Alive
helpertype=normal
name="right_edge"
ID=111111
pos=0, 0
postype=right
facing=1
stateno=111111
ownpal=1
supermovetime=99999
pausemovetime=99999
ignorehitpause=1
;---------------------------------------------------------------------------
[State -3, 念のため]
type=changestate
triggerAll= Ishelper
trigger1= ishelper(111111+Root,id)
trigger1= stateno!=111111
value=111111

;---------------------------------------------------------------------------
[State -3, ステージ端感知（左）]
type=Helper
;triggerall = var(59) >=0
triggerall=!ishelper
triggerall=!numhelper(111112)
trigger1=Alive
helpertype=normal
name="left_edge"
ID=111112
pos=0, 0
postype=left
facing=-1
stateno=111112
ownpal=1
supermovetime=99999
pausemovetime=99999
ignorehitpause=1
;---------------------------------------------------------------------------
[State -3, 念のため]
type=changestate
triggerAll= Ishelper
trigger1= ishelper(111112+Root,id)
trigger1= stateno!=111112
value=111112

;===========================================================================
[State -3, AIフラグ]
type = VarSet
TriggerAll =!ishelper
triggerall = Var(59) <= 0
triggerall = RoundState = [1,2]
trigger1 = Command = "AI0"||Command = "AI1"||Command = "AI2"||Command = "AI3"
trigger2 = Command = "AI4"||Command = "AI5"||Command = "AI6"||Command = "AI7"
trigger3 = Command = "AI8"||Command = "AI9"||Command = "AI10"||Command = "AI11"
trigger4 = Command ="AI12"||Command ="AI13"||Command = "AI14"||Command = "AI15"
trigger5 = Command ="AI16"||Command ="AI17"||Command = "AI18"||Command = "AI19"
trigger6 = Command ="AI20"||Command ="AI21"||Command = "AI22"||Command = "AI23"
trigger7 = Command ="AI24"||Command ="AI25"||Command = "AI26"||Command = "AI27"
trigger8 = Command ="AI28"||Command ="AI29"||Command = "AI30"||Command = "AI31"
trigger9 = Command ="AI32"||Command ="AI33"||Command = "AI34"||Command = "AI35"
trigger10= Command ="AI36"||Command ="AI37"||Command = "AI38"||Command = "AI39"
trigger11= Command ="AI40"||Command ="AI41"||Command = "AI42"||Command = "AI43"
trigger12= Command ="AI44"||Command ="AI45"||Command = "AI46"||Command = "AI47"
trigger13= Command ="AI48"||Command ="AI49"||Command = "AI50"
trigger14= Numhelper(99999)
trigger14= Helper(99999),var(59)>0
;trigger15= !Ishelper && RoundState=2 && Ctrl
var(59) = 1
Ignorehitpause = 1

[State -3, AI起動用ヘルパー]
type=helper
trigger1 = !NumHelper(99999)
trigger1 = roundstate=2
trigger1 = alive
trigger1 = Var(59) <= 0
Trigger1 = (PrevStateNo=[190,194])||PrevStateNo=5900
Trigger1 = ctrl&&stateno=0
helpertype=normal
name="AI"
stateno=99999
ID=99999
pos=9999,9999
keyctrl=1
pausemovetime=2147483647
supermovetime=2147483647
persistent = 0
;---------------------------------------------------------------------------
[State -3, 関係無いステートに行かないように]
type=changestate
trigger1= ishelper(99999)
trigger1= stateno!=99999
value=99999
;---------------------------------------------------------------------------


;=====================================================================================

