;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]
;---------------------------------------------------------------------------
; １ヒットごとのダメージ量（変更可）

[State -2]
type = VarSet
trigger1 = SysFVar(0) = 0
sysfvar(0) = 100		;←ここの数値分、ダメージを受けます。
ignorehitpause = 1

;---------------------------------------------------------------------------
; オートターン＆ガード不可

[State -2]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State -2]
type = AssertSpecial
trigger1 = 1
flag  = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoAirGuard

;---------------------------------------------------------------------------
; 特殊振り向き

[State -2]
type = VarSet
triggerall = RoundState = [2,3]
triggerall = StateType != A
trigger1 = Ctrl
trigger1 = Command = "holdfwd"
trigger2 = Command = "FF"
var(0) = 0

[State -2]
type = VarSet
triggerall = RoundState = [2,3]
triggerall = MoveType != A
triggerall = StateType != A
triggerall = !(Command = "holdfwd" && Command = "holdback")
trigger1 = Ctrl
trigger1 = Command = "holdback"
trigger2 = Command = "BB"
var(0) = 1

[State -2]
type = Turn
triggerall = Var(0) = 1
triggerall = StateType != A
trigger1 = Ctrl
trigger1 = Command = "holdback"
trigger2 = Command = "BB"

;---------------------------------------------------------------------------
; ジャンプ回数リセット

[State -2]
type = VarSet
trigger1 = StateType != A || StateNo = 5210
var(1) = 0

;---------------------------------------------------------------------------
; ラウンド開始フラグ

[State -2]
type = VarSet
trigger1 = Var(2) = 0
trigger1 = RoundState = 2 && Ctrl
var(2) = 1

;---------------------------------------------------------------------------
; 永続ターゲット

[State -2, Target]
type = Helper
triggerall = !NumHelper(11111)
triggerall = P2MoveType != H
trigger1 = !EnemyNear,Ctrl
trigger1 = RoundState = 2 && P2StateNo = 190
trigger2 = !EnemyNear,Ctrl
;trigger2 = IfElse(RoundsExisted, RoundState <= 2, RoundState < 2)
trigger2 = P2StateNo = 0 || P2StateNo = 5900
trigger2 = EnemyNear,Anim = 0 && EnemyNear,AnimTime = -1
trigger3 = RoundState = 2
trigger3 = P2StateNo = 0 || P2StateNo = 5900
trigger3 = EnemyNear,Time = 1 || EnemyNear,AnimTime = 0
stateno = 11111
id = 11111
name = "E-Target_11111"
helpertype = normal
postype = P2
pos = 0,-30
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999999
pausemovetime = 9999999999

[State -2, Target]
type = null;Helper
triggerall = !NumHelper(11112)
triggerall = !EnemyNear,Ctrl
triggerall = P2MoveType != H
trigger1 = RoundState = 2 && P2StateNo = 190
;trigger2 = IfElse(RoundsExisted, RoundState <= 2, RoundState < 2)
trigger2 = P2StateNo = 0 || P2StateNo = 5900
trigger2 = EnemyNear,Anim = 0 && EnemyNear,AnimTime = -1
stateno = 11111
id = 11112
name = "E-Target_11112"
helpertype = normal
postype = P2
pos = 0,-50
keyctrl = 0
ownpal = 1
ignorehitpause = 1
supermovetime = 9999999999
pausemovetime = 9999999999

;---------------------------------------------------------------------------
; ライフ監視

[State -2]
type = VarSet
trigger1 = PalNo >= 12
trigger1 = SysFVar(0) != 0
sysfvar(0) = Floor(SysFVar(0)*0.1)
ignorehitpause = 1

[State -2]
type = VarSet
trigger1 = 1
var(4) = Floor(LifeMax / SysFVar(0))
ignorehitpause = 1

[State -2]
type = NotHitBy
trigger1 = RoundState != 2
trigger2 = Var(2) = 0
value = SCA
time = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; ステ抜け

[State -2]
type = SelfState
triggerall = StateNo != 4444
triggerall = StateNo != 5150
triggerall = StateNo != 5900
trigger1 = MoveType = H
trigger2 = SysVar(4) != GameTime
trigger3 = StateNo > 4500
trigger4 = StateNo = [200,1000]
trigger5 = HitPauseTime
value = 4444
ignorehitpause = 1

;---------------------------------------------------------------------------
; 復帰無敵時間

[State -2]
type = NotHitBy
trigger1 = Var(5) > 0
value = SCA
time = 1
ignorehitpause = 1

[State -2]
type = VarAdd
trigger1 = Var(5) > 0
trigger1 = StateNo != [4444,4450]
v = 5
value = -1

[State -2]
type = AssertSpecial
trigger1 = Var(5) > 0
trigger1 = StateNo != [4444,4450]
trigger1 = Time%3 = 0
flag = Invisible
ignorehitpause = 1

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
[Statedef -3]

[State -3, DisplayToClipBoard]
type = DisplayToClipBoard
trigger1 = 1
text = "P2-X=%f P2-Y=%f PosY=%f VelY=%f V2=%d \n"
params = P2BodyDist X, P2BodyDist Y, Enemy,Pos Y, Enemy,Vel Y, Var(2)
ignorehitpause = 1

[State -3, DisplayToClipBoard]
type = AppendToClipBoard
trigger1 = 1
text = "V3=%d V4=%d SV4=%d SFV0=%d"
params = Var(3), Var(4), SysVar(4), Floor(SysFVar(0))
ignorehitpause = 1

[State -3, GameTime]
type = VarSet
trigger1 = 1
sysvar(4) = GameTime
ignorehitpause = 1
