[Statedef -2]
[State -2, PowerAdd]
type = PowerAdd
triggerall = palno = [1,12]
trigger1 = Time = 0 && StateNo = [150,154]
trigger2 = MoveType = H && Time = 0
value = 10 + Random%2
ignorehitpause = 1
persistent = 0

[State -2]
type = poweradd
triggerall = palno = [1,12]
triggerall = alive = 1
trigger1 = (GameTime%5) = 0
ignorehitpause = 0
value = 8

[State -2,]
type = StopSnd
trigger1 = command != "holdfwd"
trigger2 = Anim != 100
channel = 6

[State 2100, 8]
type = Stopsnd
trigger1 = Anim != 2000
channel = 30

[State 2100, 9]
type = Stopsnd
trigger1 = Anim != 2000
channel = 31

[State 2100, 8]
type = Stopsnd
trigger1 = Anim != 2100
channel = 25

[State 2100, 9]
type = Stopsnd
trigger1 = Anim != 2100
channel = 26

[State 2100, 8]
type = Stopsnd
trigger1 = Anim != 2300
channel = 21

[State 2100, 9]
type = Stopsnd
trigger1 = Anim != 2300
channel = 22

[State 2100, 8]
type = Stopsnd
trigger1 = Anim != 2400
channel = 27

[State 2100, 9]
type = Stopsnd
trigger1 = Anim != 2400
channel = 28

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1105
ID = 1100

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1105
ID = 1101

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1300
ID = 1301

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1310
ID = 1301

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1300
ID = 1303

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1310
ID = 1302

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1300
ID = 1304

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1310
ID = 1305

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1705
trigger2 = Movetype != A
ID = 1706

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1711

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1712

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1713

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1714

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1715

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1716

[State 1001,]
type = RemoveExplod
trigger1 = Anim != 1710
trigger2 = Movetype != A
ID = 1717
;----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
; コンボ補正
;-----------------------------------------------------------------------------
[State -2, リセット]
type = VarSet
trigger1 = 1
fvar(30) = 1.0
ignorehitpause = 1

[State -2, コンボ補正]
type = VarSet
triggerall = Life > 500
trigger1 = p2movetype = H
trigger1 = fvar(31) >= 2
fvar(30) = ((100.0-(25.0+(fvar(31)/2.0)*5.0))/100.0)
ignorehitpause = 1

[State -2, 補正限界値]
type = VarSet
triggerall = Life > 500
trigger1 = fvar(30) <= 0.6
fvar(30) = 0.6
ignorehitpause = 1

[State -2, 連続ヒット数記憶]
type = varadd
triggerall = Life > 500
triggerall = p2movetype = H
triggerall = (stateno != [800,899])
trigger1 = MoveHit = 1
trigger2 = ProjHit = 1
fvar(31) = 1
ignorehitpause = 1
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
;カウンターヒット判定
;-----------------------------------------------------------------------------
[State -2, Counter]
type = VarSet
trigger1 = P2MoveType = A
fvar(32) = 1

[State -2, Counter Time Add]
type = VarAdd
trigger1 = P2MoveType != A
trigger1 = fvar(32) >= 1
fvar(32) = 1

[State -2, Counter Time Reset]
type = VarSet
trigger1 = fvar(32) > 3
fvar(32) = 0
ignorehitpause = 1

[State -2, カウンターヒット呼出]
type = Helper
triggerall = Numhelper(10200) = 0
triggerall = fvar(32) >= 1
trigger1 = movehit = 1 && numtarget
name = "counter"
id = 10200
pos = 0,0
postype = left
stateno = 10200
helpertype = normal
ownpal = 1
keyctrl = 0
size.xscale = 1
size.yscale = 1
persistent = 0
ignorehitpause = 1
supermovetime = 9999
pausemovetime = 9999


[State -2,]
type = StopSnd
trigger1 = Movetype = H
channel = 10
ignorehitpause = 1

[State -2, PlaySnd]
type = PlaySnd
triggerall = alive = 1
triggerall = random <= 700
triggerall = time = 1
trigger1 = stateno = 5000
trigger1 = anim = 5000 || anim = 5001 || anim = 5010 || anim = 5011
trigger2 = stateno = 5010
trigger2 = anim = 5020 || anim = 5021
value = s5000,1

[State -2, PlaySnd]
type = PlaySnd
triggerall = alive = 1
triggerall = random <= 700
triggerall = time = 1
trigger1 = stateno = 5000
trigger1 = anim = 5002 || anim = 5003 || anim = 5012 || anim = 5013
trigger2 = stateno = 5010
trigger2 = anim = 5022 || anim = 5023
value = s5000,2

[State -2, PlaySnd]
type = PlaySnd
triggerall = alive = 1
triggerall = random <= 700
triggerall = time = 1
trigger1 = stateno = 5101
value = s5000,3

;==============================================================================
;サクラカ式爆衣KO
[State -2]
type = ChangeState
triggerall = !Alive
triggerall = PrevStateNo = [5000,5025]
triggerall = Enemy, HitDefAttr = SCA,NP,SA,SP,HA,HP
trigger1 = var(50)=1
value = 54321
ctrl = 0
persistent = 0

[State -2]
type = SelfState
triggerall = !Alive
triggerall = var(50)=1
triggerall = StateNo = 54321
trigger1 = Anim != 5500
value = 54320

;サクラカ式超级爆衣KO
[State -2]
type = ChangeState
triggerall = !Alive
triggerall = PrevStateNo = [5000,5025]
triggerall = Enemy, HitDefAttr = SCA,NP,SA,SP,HA,HP
trigger1 = var(50)=2
value = 55321
ctrl = 0
persistent = 0

[State -2]
type = SelfState
triggerall = !Alive
triggerall = var(50)=2
triggerall = StateNo = 55321
trigger1 = Anim != 5500
value = 55320

;-----------------------------------------------------------------------------
;---------------------------------------------------------------------------------
[Statedef -3];常時監視ステート(p2statenoなどで相手に行動を制御された時は実行しない)
;※※※※※※※※※※※※※※※※※※※※ハイジャンプ?東方萃夢想風味
;理論は簡単
;ハイジャンプコマンドを入れた「瞬間」、varスイッチを１にする。
;でハイジャンプのコマンドは最後がU、つまりジャンプする。
;そしてジャンプステート５０の時にvarスイッチが１以上ならveladdで加速します。
;varスイッチを０にするトリガーは「ステート５０の２フレーム目」です。

[State -3, 爆衣KO選択]
type = VarSet
trigger1 = 1
var(50) = 1 ;0 不爆衣，1 爆衣，2 超级爆衣（你们懂得）
             ;良い子のみんなは0にするんだぞ？おぢさんとの約束だ！

[State -3, コマンドを入れたらVarをON] 
type = VarSet
trigger1 = command = "jump"
trigger1 = ctrl
trigger1 = statetype = S
trigger2 = prevstateno = 100
trigger2 = command = "holdfwd"
v = 3
value = 1

[State -3, sysvarを引継ぐ]
type = VarSet
trigger1 = Var(3) = 1
trigger1 = stateno = 40 ;ジャンプする前のステート
trigger1 = AnimTime = 0 ;ジャンプ方向を決めるsysvarがリセットされる寸前
var(3) = ifelse(sysvar(1)=0, 2, ifelse(sysvar(1)=1, 3, 4))

[State -3, varをOFFにするステート]
type = VarSet
triggerall = Time = 2
trigger1 = stateno = 50
trigger2 = stateno != [40,59]
v = 3
value = 0

[State -3, 前にボタンを押してたら前にも加速]
type = VelAdd
trigger1 = var(3) = 3
trigger1 = stateno = 50
y = -0.6
x = 1.8

[State -3, 後ろなら後ろに加速]
type = VelAdd
trigger1 = var(3) = 4
trigger1 = stateno = 50
y = -0.6
x = -1.8

[State -3, 垂直ジャンプにveladdを使って上に加速]
type = VelAdd
trigger1 = var(3) = 2
trigger1 = stateno = 50
y = -1.8

[State -3, 成功したときの残像]
type = AfterImage
trigger1 = var(3) >= 1
trigger1 = stateno = 50
time = 25
trans = add1
length = 4
timeGap = 3
frameGap = 1
palBright = 0, 0, 0
palContrast = 128, 128, 128
palAdd = 0, 0, 0
palMul = 1, 1, 1

[State -3, CornerPush]
Type = Width
Trigger1 = Enemy, BackEdgeDist < 10
Trigger2 = Enemy, FrontEdgeDist < 10
Edge = 10

