[Statedef -2]

[state stats]
type=null
trigger1=roundstate>2
trigger1=!numexplod(4321)
trigger1=0&&var(32):=var(32)+floor(life*100./lifemax)*1000+floor((1-enemy,life*1./enemy,lifemax)*100.)
trigger2=enemy,gethitvar(hitcount)>var(32)/1000000
trigger2=var(32):=var(32)%1000000+enemy,gethitvar(hitcount)*1000000
ignorehitpause=1

[state stats]
type=explod
id=4321
anim=99999
trigger1=roundstate>2
trigger1=!numexplod(4321)
ignorehitpause=1

[State -2, VarSet]
type = VarSet
trigger1 = roundstate < 2
var(7) = 0

[State -2, lifeadd]
type = lifeadd
trigger1 = power >= 3000
trigger1 = var(7) != 2
trigger1 = alive
trigger1 = gethitvar(fall.kill) = 1
trigger1 = life <= 0 || GetHitVar(damage) >= life
trigger1 = var(7):= 1
value = 1
ignorehitpause = 1

[State -2, pause]
type = pause
trigger1 = var(7) = 1
trigger1 = alive
trigger1 = movetype = H
trigger1 = time%2 = 0
trigger1 = gethitvar(hitshaketime) = 0
time = 1

[State -2]
Type = VarSet
Trigger1 = Var(8) = 0
Trigger1 = Life > 0
V = 8
Value = Ceil(Life)
IgnoreHitPause = 1
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -2, Striker Bars]
type = Helper
trigger1 = roundstate=2
trigger1 = numhelper(10900)=0
trigger1 = var(33)!=4444
id = 10900
name = "strikerbars"
stateno = 10900
ownpal = 1
postype = left
pos = 160
ignorehitpause = 1

[state @_@]
type=helper
id=17000
stateno=17000
name="defense select"
ownpal=1
pausemovetime=99999999
supermovetime=99999999
trigger1=!numhelper(17000)
trigger1=!roundsexisted
trigger1=roundstate<1

[state shield remove]
type=removeexplod
id=855
triggerall=numexplod(855)
trigger1=stateno!=850

[state shield remove]
type=removeexplod
id=850
triggerall=numexplod(850)
trigger1=stateno!=850

[state shield remove]
type=removeexplod
id=858
triggerall=numexplod(858)
trigger1=stateno!=[851,852]

[state parry]
type=helper
name="parry1"
id=855
stateno=855
ownpal=1
triggerall=roundstate=[2,3]
triggerall=var(30)%10=1
triggerall=statetype!=l
triggerall=!numhelper(855)
trigger1=ifelse(statetype=a,command="fwd",command="fwd"^^command="down")
trigger1=command!="rls_dir"
ignorehitpause=1

[state parry]
type=helper
name="parry2"
id=856
stateno=856
ownpal=1
triggerall=roundstate=[2,3]
triggerall=var(30)%10=1
triggerall=statetype!=l
triggerall=!numhelper(856)
trigger1=ifelse(statetype=a,command="fwd",command="fwd"^^command="down")
trigger1=command!="rls_dir"
ignorehitpause=1

[State striker var]
type=null
triggerall=var(33)!=4444
trigger1=var(33)>=1
trigger1=0&&var(33):=var(33)-1
trigger2=var(33)<-1
trigger2=0&&var(33):=-1

[state jd]
type=null
triggerall=var(30)%10=2
triggerall=roundstate=[2,3]
trigger1=stateno=[150,154]
trigger1=stateno%2=0
trigger1=!time
trigger1=(var(31)/10)%10=0
trigger1=var(31)%10>1
trigger1=0&&var(31):=10
trigger2=var(31)%10>0
trigger2=0&&var(31):=var(31)-1
trigger3=var(31)%10=[0,1]
trigger3=ctrl||stateno=[150,155]
trigger3=ifelse(statetype=a,command="back",command="downback"||command="back")
trigger3=0&&var(31):=(var(31)/10)*10+4
trigger4=var(31)%10<0
trigger4=0&&var(31):=var(31)+1
trigger5=var(31)%10>1
trigger5=command!="holdback"
trigger5=0&&var(31):=1-var(31)%10
trigger6=(var(31)/10)%10
trigger6=!(stateno=150||stateno=152||stateno=154)
trigger6=0&&var(31):=var(31)-((var(31)/10)%10)*10
ignorehitpause=1

[state jd reset]
type=defencemulset
value=1
triggerall=var(30)%10=2
triggerall=var(31)%10<=1
trigger1=!(stateno=120||stateno=[150,155])
trigger1=(var(31)/10)%10!=1
trigger2=stateno=150||stateno=152||stateno=154
trigger2=(var(31)/10)%10=2
trigger3=var(31)<0

[state message var]
type=null
trigger1=0&&var(34):=var(34)-(var(34)/10-var(34)%10)*10
trigger2=0&&var(34):=(var(34)/10)*10+ifelse(p2movetype=a,1,ifelse(p2movetype=h,2,3))
ignorehitpause=1

[state messages]
type=helper
postype=left
name="messages"
stateno=16000
id=16000
ownpal=1
supermovetime=99999999
pausemovetime=99999999
triggerall=roundstate>=2
trigger1=!(var(33)||numhelper(3501)||numhelper(3601))
trigger1=0&&var(33):=-2
trigger2=(var(34)%100)/10=1
trigger2=var(34)%10=2
trigger2=0&&var(34):=var(34)-((var(34)/10)%10-4)*10
trigger3=(stateno=5201||stateno=5210)
trigger3=time=1
trigger3=0&&var(34):=var(34)-((var(34)/100)%10-1)*100
trigger4=stateno=851
trigger4=time=1
trigger4=0&&var(34):=var(34)-((var(34)/1000)%10-(1+numexplod(858)))*1000
trigger5=stateno=852
trigger5=time=1
trigger5=0&&var(34):=var(34)-((var(34)/10000)%10-1)*10000
trigger6=prevstateno=[150,154]
trigger6=prevstateno%2=0
trigger6=movetype=a
trigger6=time=1
trigger6=0&&var(34):=var(34)-((var(34)/100000)%10-1)*100000
trigger7=var(31)=10
trigger7=0&&var(34):=var(34)-((var(34)/1000000)%10-1)*1000000
trigger8=!numhelper(16000)
trigger8=var(33)=-2||(var(34)/10)%10=4||(var(34)/100)%10=1||(var(34)/1000)%10||(var(34)/10000)%10||(var(34)/100000)%10||(var(34)/1000000)%10
ignorehitpause=1

[state dtc]
type=displaytoclipboard
text="%d %d"
params=var(31),life
trigger1=1
ignorehitpause=1

[State -2,汎用変数初期化]
type = VarRangeSet
triggerall = movetype != A
trigger1 = stateno != [190,195]
value = 0
first = 0
last = 4

[State -2,汎用変数初期化]
type = VarRangeSet
triggerall = movetype != A
trigger1 = stateno != [190,195]
fvalue = 0
first = 0
last = 4

[state airjump]
type=null
trigger1=statetype=a
trigger1=var(18)>=0
trigger1=command!="holdup"
trigger1=var(18):=-var(18)-1

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

;オプション

[State -2, クリップボード]
type = null;DisplayToClipboard
trigger1 = 1
text = "var(11)=%d, var(15)=%d, var(10)=%d, var(40)=%d,var(20)=%d \n"
params = var(11),var(15),var(10),var(40),var(20)

[State -2, クリップボード（追加専用）]
type = AppendToClipboard
trigger1 = 1
text = "fvar(11)=%f,fVar(10)=%f, fvar(11)=%f,fvar(10)=%f,fVar(13)=%f \n"
params = fvar(11),fVar(10),fvar(11),fvar(10),fVar(13)

[State -2, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(7) = %d"
params = var(7)

;月ゲージ関連

[State -2, 常駐処理ヘルパー]
Type = Helper
trigger1 = numhelper(20000) = 0
name = "MAIN"
postype = left
pos = 0, 240
id = 20000
stateno = 20000
ownpal = 1
pausemovetime = 99999999
supermovetime = 99999999
ignorehitpause = 1

[State -2, ステートを戻す]
Type = selfstate
trigger1 = ishelper(20000)
trigger1 = stateno != 20000
value = 20000
ignorehitpause = 1



;いろいろ(変数)

[State -2,ドライブ強化時間減少]
type = VarAdd
trigger1 = var(36) > 0
var(36) = -1
IgnoreHitPause = 1

[State -2, ドライブ強化点滅]
type = PalFX
triggerall = Var(36) > 0
trigger1 = gametime%10 = 0
time = 5
add = 180,25,25
ignorehitpause = 1

[State -2,キャンセルフラグ初期化]
type = VarSet
trigger1 = var(15) != 0
trigger1 = Movetype != A
var(15) = 0

[State -2,空中突進クリティカルフラグ初期化]
type = VarSet
triggerall = var(20) != 0
trigger1 = P2movetype != H
var(20) = 0

;ヒット数カウント
[State -2,ヒット数]
type = VarAdd
trigger1 = MoveHit = 1
trigger2 = ProjHit = 1
var(10) = 1

[State -2,ヒット数初期化]
type = VarSet
triggerall = var(10) != 0
trigger1 = P2movetype != H
var(10) = 0

;補正色々
;攻撃関係
[State -2,コンボ補正1]
type = VarSet
trigger1 = var(10) = 1
fVar(13) = 0.9

[State -2,コンボ補正2]
type = VarSet
trigger1 = var(10) = 2
fVar(13) = 0.85

[State -2,コンボ補正3]
type = VarSet
trigger1 = var(10) = 3
fVar(13) = 0.7

[State -2,コンボ補正4]
type = VarSet
trigger1 = var(10) = 4
fVar(13) = 0.5

[State -2,コンボ補正5]
type = VarSet
trigger1 = var(10) >= 5
fVar(13) = 0.3

[State -2,必殺技用コンボ補正1]
type = VarSet
trigger1 = var(10) = 1
fVar(14) = 0.9

[State -2,必殺技用コンボ補正2]
type = VarSet
trigger1 = var(10) = 2
fVar(14) = 0.85

[State -2,必殺技用コンボ補正3]
type = VarSet
trigger1 = var(10) = 3
fVar(14) = 0.8

[State -2,必殺技用コンボ補正4]
type = VarSet
trigger1 = var(10) = 4
fVar(14) = 0.7

[State -2,必殺技用コンボ補正5]
type = VarSet
trigger1 = var(10) >= 5
fVar(14) = 0.6

[State -2,コンボ補正リセット]
type = varset
triggerall = fVar(13) != 1
trigger1 = p2movetype != H
fVar(13) = 1

[State -2,コンボ補正リセット]
type = varset
triggerall = fVar(14) != 1
trigger1 = p2movetype != H
fVar(14) = 1

[State -2,燃焼補正リセット]
type = varset
triggerall = fVar(15) != 1
trigger1 = p2movetype != H
fVar(15) = 1



;根性値
;体力		ダメージ倍率
;920〜401		100%
;400〜281		75%
;280〜101		65%
;100〜000		50%

[State -2, 根性値その1]
type = DefenceMulSet
triggerall = var(12) = 0
triggerall = var(40) >= 0
triggerall = palno != 10
triggerall = palno != 12
trigger1 = Life <= 400
Trigger1 = Life > 321
value = 0.75
IgnoreHitPause = 1

[State -2, 根性値その2]
type = DefenceMulSet
triggerall = var(12) = 0
triggerall = var(40) >= 0
triggerall = palno != 10
triggerall = palno != 12
trigger1 = Life <= 320
Trigger1 = Life > 121
value = 0.65
IgnoreHitPause = 1

[State -2, 根性値その3]
type = DefenceMulSet
triggerall = var(12) = 0
triggerall = var(40) >= 0
triggerall = palno != 10
triggerall = palno != 12
trigger1 = Life <= 120
value = 0.50
IgnoreHitPause = 1

;浮き関連
[State -2,重力補正ヒット数]
type = VarAdd
triggerall = enemynear,StateType = A
trigger1 = MoveHit = 1
trigger2 = ProjHit = 1
var(11) = 1

[State -2,重力補正ヒット数初期化]
type = VarSet
triggerall = var(11) != 0
trigger1 = enemynear,movetype != H
var(11) = 0

[State -2,重力補正]
type = varset
trigger1 = var(11) >= 4
fvar(11) = 0.025*(var(11))

[State -2,重力補正リセット]
type = varset
triggerall = enemynear,movetype != H
trigger1 = var(11) = 0
fvar(11) = 0

[State -2, VarSet]
Type     = VarSet
Trigger1 = Var(12) > 0
Trigger1 = StateType != A
V        = 12
Value    = 0
IgnoreHitPause = 1

[state -2]
type = afterimagetime
trigger1 = stateno != [2000,2999]
time = 0
