;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
[Statedef 100000]

[State -2]
type = NotHitBy
trigger1 = 1
value2 = SCA
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AssertSpecial
trigger1 = 1
flag = invisible
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = BindToRoot
trigger1 = var(1) = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = BindToRoot
trigger1 = var(1) > 0
trigger2 = root,stateno = 1070
trigger3 = root,stateno = 1071
trigger4 = root,stateno = 1072
trigger5 = root,stateno = 1080
trigger6 = root,stateno = 1082
trigger7 = root,stateno = 1084
trigger8 = root,stateno = 2000
trigger9 = root,stateno = 2100
trigger10 = root,stateno = 2300
trigger11 = root,stateno = 2400
trigger12 = root,stateno = 10000
trigger13 = root,stateno = 10100
trigger14 = root,stateno = 10200
trigger15 = root,stateno = 10300
trigger16 = root,stateno = 10400
trigger17 = root,stateno = 10500
trigger18 = root,stateno = 10600
trigger19 = root,stateno = 1040
pos = 0,99999
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ChangeAnim
trigger1 = root,animelemtime(1) = 0
trigger1 = AnimExist(root,anim+70000)
value = 70000+(root,anim)
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ChangeAnim
trigger1 = root,animelemtime(1) = 0
trigger1 = !AnimExist(root,anim+70000)
value = 2035
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Turn
trigger1 = Facing != root,Facing
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA,AA,AT,AP
sparkno = -1
hitsound = s0,19
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
triggerall = root,palno = [7,11]
trigger1 = NumTarget > 0
v = 0
value = 50
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
triggerall = root,palno = 12
trigger1 = NumTarget > 0
trigger1 = root,life > 100
v = 0
value = 45
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
triggerall = root,palno = 12
trigger1 = NumTarget > 0
trigger1 = root,life <= 100
v = 0
value = 5
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = loseko
v = 0
value = root,lifemax
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = NumTarget > 0
v = 1
value = 60
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
trigger1 = var(1) > 0
v = 1
value = -1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = TargetDrop
trigger1 = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[Statedef 100001]

[State -2]
type = NotHitBy
trigger1 = 1
value2 = SCA
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AssertSpecial
trigger1 = 1
flag = invisible
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = BindToRoot
trigger1 = var(1) = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = BindToRoot
trigger1 = var(1) > 0
trigger2 = root,stateno = 1070
trigger3 = root,stateno = 1071
trigger4 = root,stateno = 1072
trigger5 = root,stateno = 1080
trigger6 = root,stateno = 1082
trigger7 = root,stateno = 1084
trigger8 = root,stateno = 2000
trigger9 = root,stateno = 2100
trigger10 = root,stateno = 2300
trigger11 = root,stateno = 2400
trigger12 = root,stateno = 10000
trigger13 = root,stateno = 10100
trigger14 = root,stateno = 10200
trigger15 = root,stateno = 10300
trigger16 = root,stateno = 10400
trigger17 = root,stateno = 10500
trigger18 = root,stateno = 10600
trigger19 = root,stateno = 1040
trigger20 = var(2) = 1
pos = 0,99999
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ChangeAnim
trigger1 = root,animelemtime(1) = 0
trigger1 = AnimExist(root,anim+70000)
value = 70000+(root,anim)
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ChangeAnim
trigger1 = root,animelemtime(1) = 0
trigger1 = !AnimExist(root,anim+70000)
value = 2035
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Turn
trigger1 = Facing != root,Facing
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA,AA,AT,AP
sparkno = -1
hitsound = s0,86
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = NumTarget > 0
v = 1
value = 60
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
trigger1 = var(1) > 0
v = 1
value = -1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = NumTarget > 0
trigger1 = Target,Ishelper = 0
v = 2
value = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = TargetDrop
trigger1 = Target,Ishelper
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

;死の宣告

[State 1701]
type = targetlifeadd
trigger1 = var(2) = 1
trigger1 = roundstate > 2
trigger1 = !winko
trigger1 = !loseko
value = -9999999999
absolute = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = targetstate
trigger1 = var(2) = 1
trigger1 = roundstate > 2
trigger1 = !winko
trigger1 = !loseko
value = 5150
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[Statedef 200000]
anim = 40000

[State -2]
type = BindToRoot
trigger1 = ishelper
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = palno = [7,12]
trigger1 = !ishelper
value = 50
ctrl = 1
ignorehitpause = 1

[State -2]
type = Helper
trigger1 = ishelper
trigger1 = numhelper(200001) <= 0
trigger1 = enemy,numprojid(29557855184810662727) > 0
stateno = 200001
id = 200001
ignorehitpause = 1

[Statedef 200001]
anim = 40060

[State -2]
type = BindToRoot
trigger1 = ishelper
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = palno = [7,12]
trigger1 = !ishelper
value = 50
ctrl = 1
ignorehitpause = 1

[State -2]
type = HitBy
trigger1 = ishelper
value = C,SP
ignorehitpause = 1

[State -2]
type = HitBy
trigger1 = ishelper
value2 = C,SP
ignorehitpause = 1

[State -2]
type = DestroySelf
trigger1 = enemy,numprojid(29557855184810662727) <= 0
ignorehitpause = 1

[Statedef 300000]
statetype = A
movetype = I
ctrl = 0

[State -2]
type = SelfState
trigger1 = time = 0
value = 50
ctrl = 1
ignorehitpause = 1

[Statedef 400000]
anim = 10210
sprpriority = 6

[State -2]
type = BindToRoot
trigger1 = 1
pos = 4,-70
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleSet
trigger1 = 1
value = -1*(GameTime%360)
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Trans
trigger1 = 1
trans = add
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = DestroySelf
trigger1 = time > 6
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[Statedef 400001]
anim = 10210
sprpriority = 4

[State -2]
type = BindToRoot
trigger1 = 1
pos = 4,-70
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleSet
trigger1 = 1
value = -1*(GameTime%360)
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Trans
trigger1 = 1
trans = add
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = DestroySelf
trigger1 = time > 6
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[Statedef 400002]
anim = 10030
sprpriority = -99999

[State -2]
type = BindToRoot
trigger1 = 1
pos = 4,-70
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = AngleAdd
trigger1 = 1
value = -2
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Trans
trigger1 = 1
trans = add
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = DestroySelf
trigger1 = root,movetype = H
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[Statedef 500000]
anim = 40000

[State -2]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1

[state -1]
type = varset
trigger1 = enemy,hitdefattr = SCA,NA,NT,NP
trigger2 = enemy,hitdefattr = SCA,SA,ST,SP
trigger3 = enemy,hitdefattr = SCA,HA,HT,HP
var(0) = 1
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10000
v = 10
value = 0
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 1070
trigger2 = root,stateno = 1071
trigger3 = root,stateno = 1072
v = 10
value = 1
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10100
v = 10
value = 2
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10200
v = 10
value = 3
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10000
v = 11
value = 0
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 1080
trigger2 = root,stateno = 1082
trigger3 = root,stateno = 1084
v = 11
value = 1
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10100
v = 11
value = 2
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10200
v = 11
value = 3
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10000
v = 12
value = 0
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 2100
v = 12
value = 1
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10500
trigger2 = root,stateno = 10600
v = 12
value = 2
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 10300
v = 12
value = 3
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 2000
v = 13
value = 1
ignorehitpause = 1

[state -1]
type = VarSet
trigger1 = root,stateno = 2400
v = 13
value = 0
ignorehitpause = 1

[state -1]
type = varset
triggerall = P2MoveType != H
trigger1 = root,movecontact = 1
trigger2 = root,projcontacttime(0) = 1
var(20) = 1
ignorehitpause = 1

[State -2]
type = null;Pause
trigger1 = 1
movetime = 2
time = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = null;SuperPause
trigger1 = 1
movetime = 2
time = 0
darken = 0
anim = -1
p2defmul = 1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = BGPalFx
trigger1 = winko
invertall = 1
time = 10
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = PlaySnd
trigger1 = winko
value = s0,79
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = PlaySnd
trigger1 = winko
value = s0,83
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = PlaySnd
trigger1 = winko
value = s0,84
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = PlaySnd
trigger1 = winko
value = s0,85
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = PlaySnd
trigger1 = winko
value = s0,86
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 1701]
type = Explod
trigger1 = winko
anim = 10220
postype = back
bindtime = -1
removetime = -1
ontop = 1
persistent = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

;-----------------------------------------------------------------------------
[Statedef -2];常時監視ステート(相手に行動を制御されても関係無く常に実行される)
;-----------------------------------------------------------------------------
;基本性能

[State 10000]
type = Pause
triggerall = GameTime%3 <= 2
trigger1 = var(30) > 48
time = 1

[State -2]
type = AllPalFx
trigger1 = var(30) > 0
Color = 256-(4*var(30))
time = 2
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarAdd
trigger1 = var(30) > 0
var(30) = -1
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = PowerAdd
trigger1 = helper(100000),NumTarget > 0
value = 100
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = null;PowerAdd
trigger1 = MoveReversed = 1
value = 1000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = PowerAdd
triggerall = MoveReversed = 0
trigger1 = roundstate = 2
trigger1 = MoveType != A
value = 8
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = 1
var(51) = GameTime

[State -2]
type = VarSet
trigger1 = var(51) != var(52)
var(53) = Stateno
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = enemy,stateno = var(53)
var(53) = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = MoveReversed
var(54) = enemy,anim
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = var(51) != var(52)
trigger1 = life <= 0
var(55) = Stateno
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = enemy,stateno = var(55)
var(55) = 0
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = MoveReversed
trigger1 = life <= 0
var(56) = enemy,anim
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
trigger1 = var(51) != var(52)
var(40) = enemy,Stateno

[State -2]
type = VarSet
trigger1 = var(51) != var(52)
trigger1 = life <= 0
var(41) = enemy,Stateno

[State -2]
type = Helper
trigger1 = numhelper(200000) <= 0
trigger1 = enemy,numprojid(29557855184810662727) > 0
stateno = 200000
id = 200000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
trigger1 = numhelper(500000) <= 0
stateno = 500000
id = 500000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

;強化モードの特典

[State -2]
type = NotHitBy
triggerall = palno = [7,12]
trigger1 = 1
value2 = SCA
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = PalFx
triggerall = palno = [7,12]
trigger1 = helper(100000),NumTarget > 0
add = 255,0,0
time = 5
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Sprpriority
triggerall = palno = [7,12]
trigger1 = helper(100000),NumTarget <= 0
value = 5
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Sprpriority
triggerall = palno = [7,12]
trigger1 = helper(100000),NumTarget > 0
value = -999
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
trigger1 = palno = [7,11]
trigger1 = numhelper(100000) <= 0
stateno = 100000
id = 100000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = LifeSet
triggerall = palno = [7,12]
trigger1 = 1
value = LifeMax-(helper(100000),var(0))
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = SelfState
triggerall = palno = [7,12]
trigger1 = var(51) != var(52)
value = 300000
ctrl = 1
;ignorehitpause = 1
;supermovetime = 3600
;pausemovetime = 3600
;バグ防止

;12Pカラーの特典

[State -2]
type = HitOverride
trigger1 = palno = 12
time = 1
attr = SCA, AA, AT, AP
slot = 0
stateno = 300000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
triggerall = Palno = 12
trigger1 = 1
v = 48
value = enemy,power
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type =  PowerAdd
triggerall = Palno = 12
trigger1 = var(48) > var(49)
value = var(48)-var(49)
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type =  PowerSet
triggerall = Palno = 12
trigger1 = power <= enemy,power
value = enemy,power
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = VarSet
triggerall = Palno = 12
trigger1 = 1
v = 49
value = enemy,power
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
trigger1 = palno = 12
trigger1 = numhelper(100000) <= 0
trigger1 = helper(100001),var(2) = 1
stateno = 100000
id = 100000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
trigger1 = palno = 12
trigger1 = numhelper(100001) <= 0
stateno = 100001
id = 100001
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

;演出

[State -2]
type = Helper
triggerall = palno = 12
trigger1 = GameTime%2 = 1
trigger1 = MoveType != H
stateno = 400000
pos = 4,-70
size.xscale = 0.4*sin(6*pi*(GameTime%60)/180)
size.yscale = 0.4
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
triggerall = palno = 12
trigger1 = GameTime%2 = 1
trigger1 = MoveType != H
stateno = 400001
pos = 4,-70
size.xscale = 0.4*sin(-6*pi*(GameTime%60)/180)
size.yscale = 0.4
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Explod
trigger1 = movetype != H
trigger1 = numexplod(10000) <= 0
anim = 10001
id = 10000
pos = 4,-70
bindtime = -1
ownpal = 1
sprpriority = 999
scale = 0.4,0.4
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Explod
triggerall = palno = [7,12]
trigger1 = movetype != H
trigger1 = numexplod(10001) <= 0
anim = 10010
id = 10001
pos = 4,-70
bindtime = -1
ownpal = 1
sprpriority = -999
scale = 0.89,0.89
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = Helper
triggerall = palno = 12
trigger1 = movetype != H
trigger1 = numhelper(400002) <= 0
stateno = 400002
id = 400002
size.xscale = 0.52
size.yscale = 0.52
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = RemoveExplod
trigger1 = movetype = H
id = 10000
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = RemoveExplod
trigger1 = movetype = H
id = 10001
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = RemoveExplod
trigger1 = movetype = H
id = 10002
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = RemoveExplod
trigger1 = movetype = H
id = 10003
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State -2]
type = RemoveExplod
trigger1 = stateno != 10400
id = 10007
ignorehitpause = 1
supermovetime = 3600
pausemovetime = 3600

[State 191, 1]
type = stopsnd
trigger1 = stateno != [191,192]
channel = 2

[State -3, 3];
type = null;PlaySnd
trigger1 = stateno = 150
trigger2 = stateno = 152
;trigger2 = anim = 150
;trigger3 = anim = 152
;trigger4 = anim = 154
triggerall = time = 0
value = S0,19
persistent = 0
ignorehitpause = 1

[State -3, 3];
type = PlaySnd
trigger1 = stateno = 150
trigger2 = stateno = 152
;trigger2 = anim = 150
;trigger3 = anim = 152
;trigger4 = anim = 154
triggerall = time = 0
value = S0,19
persistent = 0
ignorehitpause = 1

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

[Statedef -3]

[State -2]
type = VarSet
triggerall = palno = [7,12]
trigger1 = 1
var(52) = GameTime

[State 191, 3]
type = stopsnd
trigger1 = movetype = H
channel = 0

[State -3]
type = varset
trigger1 = 1
trigger1 = P2statetype != C
var(11) = -150 - (-150 - floor(p2bodydist y))

[State -3]
type = varset
trigger1 = 1
trigger1 = P2statetype = S
var(11) = 0

[State -3, 3];着地
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 || stateno = 1011 || stateno = 1016
value = S0,16

[State -3, 5];ジャンプ
type = PlaySnd
trigger1 = stateno = 50
trigger1 = Time = 2
value = S0,15

[State -2]
type = AssertSpecial
trigger1 = 1
flag = NoAirGuard
ignorehitpause = 1

[State -3, 5]
type = varrandom
trigger1 = 1
v = 3
range = 1,4

[State -3, 5]
type = PlaySnd
triggerall = alive = 1
trigger1 = Time = 1 && stateno = 5000 && (anim = 5000 || anim = 5010)
triggerall = var(3) = 1
value = S0,33

[State -3, 5]
type = PlaySnd
triggerall = alive = 1
trigger1 = Time = 1 && stateno = 5000 && (anim = 5001 || anim = 5011)
triggerall = var(3) = 1
value = S0,34

[State -3]
type = varset
trigger1 = command = "CPU 01"
trigger2 = command = "CPU 02"
trigger3 = command = "CPU 03"
trigger4 = command = "CPU 04"
trigger5 = command = "CPU 05"
trigger6 = command = "CPU 06"
trigger7 = command = "CPU 07"
trigger8 = command = "CPU 08"
trigger9 = command = "CPU 09"
trigger10 = command = "CPU 10"
trigger11 = command = "CPU 11"
trigger12 = command = "CPU 12"
trigger13 = command = "CPU 13"
trigger14 = command = "CPU 14"
trigger15 = command = "CPU 15"
trigger16 = command = "CPU 16"
trigger17 = command = "CPU 17"
trigger18 = command = "CPU 18"
trigger19 = command = "CPU 19"
trigger20 = command = "CPU 20"
trigger21 = command = "CPU 21"
trigger22 = command = "CPU 22"
trigger23 = command = "CPU 23"
trigger24 = command = "CPU 24"
trigger25 = command = "CPU 25"
trigger26 = command = "CPU 26"
trigger27 = command = "CPU 27"
trigger28 = command = "CPU 28"
trigger29 = command = "CPU 29"
trigger30 = command = "CPU 30"
trigger31 = command = "CPU 31"
trigger32 = command = "CPU 32"
trigger33 = command = "CPU 33"
trigger34 = command = "CPU 34"
trigger35 = command = "CPU 35"
trigger36 = command = "CPU 36"
trigger37 = command = "CPU 37"
trigger38 = command = "CPU 38"
trigger39 = command = "CPU 39"
trigger40 = command = "CPU 40"
trigger41 = command = "CPU 41"
trigger42 = command = "CPU 42"
trigger43 = command = "CPU 43"
trigger44 = command = "CPU 44"
trigger45 = command = "CPU 45"
trigger46 = command = "CPU 46"
trigger47 = command = "CPU 47"
trigger48 = command = "CPU 48"
trigger49 = command = "CPU 49"
trigger50 = command = "CPU 50"
var(59) = 1

[State -3, BOSS]
type = varset
trigger1 = palno = [7,12]
var(58) = 1

[State -2]
type = AssertSpecial
trigger1 = 1
trigger1 = var(58) = 1
flag = Nojugglecheck
ignorehitpause = 1

[State -1]
type = ChangeState
value = 10000
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = statetype != A
triggerall = power >= 4000
triggerall = var(58) = 1
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 10500
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 1000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(12) = 1
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 150
triggerall = P2BodyDist Y > -50
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 10600
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 1000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(12) = 1
triggerall = P2BodyDist X > 150
triggerall = P2BodyDist Y > -50
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 10300
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 3000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(12) = 2
triggerall = P2BodyDist X > 75
triggerall = P2BodyDist X <= 150
triggerall = P2BodyDist Y < 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 10200
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = statetype != A
triggerall = power >= 3000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(10) = 2
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist Y > -50
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 10100
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 2000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(10) = 1
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist Y > -50
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 2400
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200||enemynear,ctrl = 0
triggerall = statetype != A
triggerall = power >= 3000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(13) = 1
triggerall = helper(500000),var(20) = 0
triggerall = P2StateType = S
triggerall = P2MoveType != H
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 2300
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 100+(200*(enemynear,ctrl = 0))
triggerall = statetype != A
triggerall = power >= 2000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(20) = 0
triggerall = P2StateType = S
triggerall = P2MoveType != H
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 2000
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200||enemynear,ctrl = 0
triggerall = statetype != A
triggerall = power >= 2000
triggerall = var(55) = 0
triggerall = helper(500000),var(13) = 0
triggerall = helper(500000),var(20) = 0
triggerall = P2StateType = S
triggerall = P2MoveType != H
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1070+(palno = [7,12])+(palno = 12)
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 1000
triggerall = var(55) = 0
triggerall = helper(500000),var(10) = 0
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist Y > -50
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1080+(2*(palno = [7,12]))+(2*(palno = 12))
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 1000
triggerall = var(55) = 0
triggerall = helper(500000),var(11) = 0
triggerall = P2BodyDist X <= 50
triggerall = P2BodyDist Y = 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 2100
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = power >= 1000
triggerall = var(58) = 1
triggerall = var(55) = 0
triggerall = helper(500000),var(12) = 0
triggerall = P2BodyDist X > 75
triggerall = P2BodyDist X <= 150
triggerall = P2BodyDist Y < 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1700
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 40
triggerall = statetype != A
triggerall = P2BodyDist X > 100
triggerall = P2BodyDist Y > -150
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1, Taunt]
type = ChangeState
value = 195
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X > 100
triggerall = P2BodyDist Y > -150
trigger1 = ctrl

[State -1]
type = ChangeState
value = 900
triggerall = !winko
triggerall = var(59) = 1
triggerall = P2BodyDist X > 100
triggerall = P2BodyDist Y > -150
trigger1 = statetype != A && (ctrl || stateno = 100)

[State -1]
type = ChangeState
value = 1600
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = numhelper(1601) <= 0
triggerall = numhelper(1602) <= 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 900
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 150
triggerall = P2BodyDist X <= 40
trigger1 = statetype != A && (ctrl || stateno = 100)

[State -1]
type = ChangeState
value = 1500
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 350
triggerall = statetype != A
triggerall = P2BodyDist X <= 40
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1400
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 350
triggerall = statetype != A
triggerall = P2BodyDist Y > -30
triggerall = P2BodyDist X > 40
triggerall = P2BodyDist X <= 120
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1300
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 250
triggerall = statetype != A
triggerall = P2BodyDist Y <= -30
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1200
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X <= 50
triggerall = enemynear,vel X > 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1210
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X <= 50
triggerall = enemynear,vel X > 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1210
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = statetype != A
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 130
triggerall = enemynear,vel X > 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1100
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = statetype != A
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 150
triggerall = P2BodyDist Y > -100
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1101
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 300
triggerall = statetype != A
triggerall = P2BodyDist X > 150
triggerall = P2BodyDist Y > -100
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1102
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2StateType = A
triggerall = P2MoveType = H
triggerall = P2BodyDist Y <= -80
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070

[State -1]
type = ChangeState
value = 1050
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2StateType = A
triggerall = P2MoveType != H
triggerall = P2BodyDist X <= 100
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070
trigger2 = stateno != 1050

[State -1]
type = ChangeState
value = 1060
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2StateType = A
triggerall = P2MoveType = H
triggerall = P2BodyDist X <= 100
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070
trigger2 = stateno != 1060

[State -1]
type = ChangeState
value = 1030
triggerall = !winko
triggerall = var(59) = 1
triggerall = statetype != A
triggerall = P2BodyDist X < 100
triggerall = enemy,vel X <= 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070
trigger2 = stateno != 1030

[State -1]
type = ChangeState
value = 1031
triggerall = !winko
triggerall = var(59) = 1
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X < 100
triggerall = enemy,vel X > 0
trigger1 = ctrl
trigger2 = movecontact
trigger2 = stateno < 1070
trigger2 = stateno != 1031

[State -1, Standing Strong Kick]
type = ChangeState
value = 240
triggerall = !winko
triggerall = var(59) = 1
triggerall = P2StateType != A
triggerall = P2BodyDist X <= 120
triggerall = enemy,vel X > 0
trigger1 = statetype != A
trigger1 = ctrl