;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[statedef -2]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;













;-------------------------------------------------------------------------------

[state ]
type = selfstate
trigger1 = ishelper
value = 999999999
persistent = 256
ignorehitpause = 1

;-------------------------------------------------------------------------------

[state ]
type = explod
triggerall = !ishelper
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10101
id = 9999
postype = p1
pos = 0,-65
bindtime = -1
random = 50,100
sprpriority = 1
scale = 0.2,0.2
ownpal = 1
trans = sub
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10110
id = 9999
postype = p1
pos = 0,-65
bindtime = -1
random = 50,100
sprpriority = 1
scale = 0.2,0.2
ownpal = 1
trans = sub
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1















;ぐるぐる回る奴
[state ]
type = explod
triggerall = !ishelper
triggerall = alive
triggerall = palno = 1
triggerall = 1
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
sprpriority = 0
postype = p1
pos = 3 * cos((gametime * 0.2) - (pi/180)) * 25,3 * sin(gametime * 0.2) * 25 - 75
ownpal = 1
scale = 0.3,0.3
trans = sub
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

[state ]
type = null;explod
triggerall = !ishelper
triggerall = alive
triggerall = palno = 1
triggerall = 1
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
sprpriority = 0
postype = p1
pos = 3 * cos((gametime * 0.2) - (pi/180)) * 23,-3 * sin(gametime * 0.2) * 23 - 75
ownpal = 1
scale = 0.3,0.3
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = alive
triggerall = palno = [2,12]
triggerall = 1
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
;sprpriority = 0 + (1 * sin(gametime * 3.5)) * (-1 * sin(gametime * 0.2))
sprpriority = sin(gametime * 1.5) * sin(gametime * 0.075)
postype = p1
pos = 1 * cos((gametime * 3) - (pi/180)) * 95,1 * sin(gametime * 0.15) * 50 - 75
ownpal = 1
scale = 0.3,0.3
trans = sub
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

[state ]
type = null;explod
triggerall = !ishelper
triggerall = alive
triggerall = palno = [2,12]
triggerall = 1
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
;sprpriority = 0 + (1 * sin(gametime * 3.5)) * (-1 * sin(gametime * 0.2))
sprpriority = sin(gametime * 1.5) * sin(gametime * 0.075)
postype = p1
pos = 1 * cos((gametime * 3) - (pi/180)) * 95,-1 * sin(gametime * 0.15) * 50 - 75
ownpal = 1
scale = 0.3,0.3
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;numhelper(10305)

[state ]
type = explod
triggerall = !ishelper
triggerall = numhelper(10305)
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
sprpriority = 0
postype = p1
pos = 0,-65
random = 20,20
vel = -1 + (random%5),-1 + (random%5)
facing = -1
ownpal = 1
scale = 0.4,0.4
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = numhelper(10305)
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10010
id = 9999
sprpriority = 0
postype = p1
pos = 0,-65
random = 10,10
vel = -1 + (random%4),-1 + (random%4)
facing = -1
ownpal = 1
scale = 0.4,0.4
trans = sub
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = numhelper(10305)
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10101
id = 9999
sprpriority = 0
postype = p1
pos = 0,-65
random = 20,20
vel = -1 + (random%5),-1 + (random%5)
facing = -1
ownpal = 1
scale = 0.35,0.35
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = numhelper(10305)
triggerall = alive
triggerall = (gametime%4) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
anim = 10110
id = 9999
sprpriority = 0
postype = p1
pos = 0,-65
random = 10,10
vel = -1 + (random%4),-1 + (random%4)
facing = -1
ownpal = 1
scale = 0.35,0.35
trans = sub
supermovetime  =  2147483648
pausemovetime  =  2147483648
ignorehitpause = 1

;-------------------------------------------------------------------------------
;ヘルパーアーマー

[state ]
type = helper
triggerall = !ishelper
triggerall = alive
trigger1 = numhelper(150) = 0
name = "helper armor"
id = 150
pos = 0,0
postype = p1
stateno = 150
helpertype = player
supermovetime = 9999999999999
pausemovetime = 9999999999999
ignorehitpause = 1

[state ]
type = nothitby
trigger1 = !ishelper
value = sca
time = -1
ignorehitpause = 1

[state ]
type = assertspecial
trigger1 = !ishelper
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard
ignorehitpause = 1

[state ]
type = lifeset
triggerall = !ishelper
trigger1 = enemy,name != "E-Fairy"
value = lifemax - (numexplod(1111) * 50)
ignorehitpause = 1

;対E-Fairy 奇数
[state ]
type = lifeset
triggerall = !ishelper
triggerall = numenemy
triggerall = enemy,name = "E-Fairy"
trigger1 = (enemy,palno = 1) || (enemy,palno = 3) || (enemy,palno = 5) || (enemy,palno = 7) || (enemy,palno = 9) || (enemy,palno = 11)
value = lifemax - 1
ignorehitpause = 1

;対E-Fairy 偶数
[state ]
type = lifeset
triggerall = !ishelper
triggerall = numenemy
triggerall = enemy,name = "E-Fairy"
trigger1 = (enemy,palno = 2) || (enemy,palno = 4) || (enemy,palno = 6) || (enemy,palno = 8) || (enemy,palno = 10) || (enemy,palno = 12)
value = lifemax
ignorehitpause = 1

[state ]
type = lifeset
triggerall = !ishelper
triggerall = enemy,alive && alive
triggerall = enemy,name != "E-Fairy"
trigger1 = roundstate > 2
value = enemy,life - 1
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
triggerall = alive
triggerall = roundstate = 2
triggerall = helper(150),gethitvar(damage)
trigger1 = palno = 1
trigger2 = palno != 1
trigger2 = life < 500
trigger2 = enemy,life < (enemy,lifemax / 2)
trigger3 = palno != 1
trigger3 = life > 500
trigger3 = enemy,life > (enemy,lifemax / 2)
anim = 1000001
id = 1111
postype = p1
pos = 0,0
bindtime = -1
ontop = 0
sprpriority = 0
scale = 1,1
removetime = -1
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

[state ]
type = removeexplod
triggerall= !ishelper
triggerall = alive
trigger1 = roundstate > 2
trigger2 = !numexplod(1111)
id = 1111
ignorehitpause = 1

;-------------------------------------------------------------------------------
;power関連

[state ]
type = powerset
trigger1 = !ishelper
value = sysvar(3)
ignorehitpause = 1

;対E-Fairy 奇数カラー
[state ]
type = varset
triggerall = !ishelper
triggerall = palno = [2,12]
triggerall = enemy,name = "E-Fairy"
trigger1 = (enemy,palno = 1) || (enemy,palno = 3) || (enemy,palno = 5) || (enemy,palno = 7) || (enemy,palno = 9) || (enemy,palno = 11)
sysvar(3) = 0
ignorehitpause = 1

;対E-Fairy 偶数カラー
[state ]
type = varset
triggerall = !ishelper
triggerall = palno = [2,12]
triggerall = enemy,name = "E-Fairy"
trigger1 = (enemy,palno = 2) || (enemy,palno = 4) || (enemy,palno = 6) || (enemy,palno = 8) || (enemy,palno = 10) || (enemy,palno = 12)
sysvar(3) = 3000
ignorehitpause = 1

[state ]
type = varset
triggerall = !ishelper
triggerall = enemy,name != "E-Fairy"
trigger1 = var(59) = 0
sysvar(3) = 3000
ignorehitpause = 1

[state ]
type = varadd
triggerall = !ishelper
triggerall = alive
triggerall = enemy,name != "E-Fairy"
triggerall = roundstate = 2
triggerall = var(59) > 0
trigger1 = sysvar(3) <= 3000
sysvar(3) = 1
ignorehitpause = 1

[state ]
type = varset
triggerall = !ishelper
triggerall = enemy,name != "E-Fairy"
triggerall = var(59) > 0
trigger1 = sysvar(3) <= 0
sysvar(3) = 0
ignorehitpause = 1

[state ]
type = varset
triggerall = !ishelper
triggerall = enemy,name != "E-Fairy"
triggerall = var(59) > 0
trigger1 = sysvar(3) >= 3000
sysvar(3) = 3000
ignorehitpause = 1

;-------------------------------------------------------------------------------
;時止め無視＆凍結解除

[state ]
type = pause
trigger1 = !ishelper
trigger1 = alive
trigger1 = roundstate != 2
time = 2147483647
movetime = 2147483647
ignorehitpause = 1

[state ]
type = superpause
trigger1 = !ishelper
trigger1 = alive
trigger1 = roundstate != 2
anim = -1
time = 2147483647
movetime = 2147483647
UnHittable = 0
darken = 0
ignorehitpause = 1

[state ]
type = helper
triggerall = !ishelper
triggerall = roundstate != 4
trigger1 = alive
trigger1 = gametime%45 = 0
trigger2 = numhelper(112233) = 0
trigger2 = roundstate <= 1
name = "tokitome kaijo"
id = 112233
pos = 0,0
postype = p1
stateno = 112233
Helpertype = player
keyctrl = 0
ownpal = 1
pausemovetime = 2147483647
supermovetime = 2147483647
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
trigger1 = hitpausetime
value = 987654321
persistent = 256
ignorehitpause = 1

;-------------------------------------------------------------------------------
;その他

[state ]
type = changeanim
triggerall = !ishelper
trigger1 = !alive
value = 1000001
ignorehitpause = 1

[state ]
type = posset
triggerall = !ishelper
trigger1 = !alive
y = 999999999
ignorehitpause = 1

[state ]
type = hitadd
trigger1 = !ishelper
value = -999
ignorehitpause = 1

[state ]
type = playerpush
triggerall = !ishelper
trigger1 = 1
value = 0
ignorehitpause = 1

[state ]
type = afterimage
triggerall = !ishelper
triggerall = alive
trigger1 = 1;(time%10) = 0
trans = add1
timegap  = 1
framegap = 10
time = 1
palbright = -250, -250, 0
palcontrast = 0, -25, -25
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
triggerall = roundstate = 4
trigger1 = lose && alive
;trigger1 = ctrl
value = 170
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
triggerall = roundstate = 4
trigger1 = !win && !lose
value = 175
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
triggerall = roundstate = 4
trigger1 = win
value = 180
ignorehitpause = 1

[state ]
type = assertspecial
triggerall = !ishelper
trigger1 = (enemy,alive) || (enemy,life != 0)
trigger1 = (!enemy,alive) || (!enemy,life != 0)
trigger2 = roundstate != 2
flag = noko
ignorehitpause = 1

[state ]
type = assertspecial
trigger1 = !ishelper
flag = noautoturn
flag2 = noshadow
ignorehitpause = 1

;振り向き
[state ]
type = turn
triggerall = !ishelper
triggerall = alive
triggerall = numenemy
triggerall = (anim = 0) && (roundstate = 2) || (anim = [170,175]) && (animelemtime(1) = 0)
trigger1 = enemynear (numenemy > 1 && enemynear,alive = 0),facing = -facing
trigger1 = frontedgedist < enemynear(numenemy > 1 && enemynear,alive = 0),backedgedist
trigger2 = enemynear(numenemy > 1 && enemynear,alive = 0),facing = facing
trigger2 = frontedgedist < enemynear(numenemy > 1 && enemynear,alive = 0),frontedgedist
ignorehitpause = 1

[state ]
type = statetypeset
triggerall = !ishelper
trigger1 = roundstate > 2
statetype = s
movetype = i
physics = s
ignorehitpause = 1

[state ]
type = ctrlset
triggerall = !ishelper
trigger1 = roundstate != 2
value = 0
ignorehitpause = 1

;12P用
[state ]
type = helper
triggerall = !ishelper
triggerall = alive
triggerall = palno = 12
triggerall = numhelper(10305) = 0
trigger1 = roundstate > 1
trigger1 = roundstate < 4
id = 10305
pos = 0,0
postype = p1
stateno = 10305
helpertype = player
supermovetime = 9999999999999
pausemovetime = 9999999999999
ignorehitpause = 1

;-------------------------------------------------------------------------------
;本体ステ抜け

;がめちめ＆オニ式
[state ]
type = selfstate
triggerall = !ishelper
triggerall = alive
trigger1 = gametime != sysvar(1)
trigger2=(stateno!=0)&&(stateno!=20)&&(stateno!=120)&&(stateno!=130)&&(stateno!=[131,132])&&(stateno!=140)&&(stateno!=[150,155])&&(stateno!=170)&&(stateno!=175)&&(stateno!=180)&&(stateno!=190)
trigger2=(stateno!=5000)&&(stateno!=5001)&&(stateno!=[5010,5011])&&(stateno!=5020)&&(stateno!=5030)&&(stateno!=5035)&&(stateno!=5040)&&(stateno!=5050)&&(stateno!=[5070,5071])&&(stateno!=[5080,5081])
trigger2=(stateno!=[5100,5101])&&(stateno!=50110)&&(stateno!=50120)&&(stateno!=5150)&&(stateno!=[5200,5201])&&(stateno!=5210)&&(stateno!=5500)&&(stateno!=5900)
trigger2=(stateno!=10000)&&(stateno!=10100)&&(stateno!=10200)&&(stateno!=10300)&&(stateno!=10400)&&(stateno!=10500)&&(stateno!=10600)&&(stateno!=10700)&&(stateno!=10800)
trigger2=(stateno!=30000)&&(stateno!=30100)&&(stateno!=30200)&&(stateno!=30300)
value = 120
persistent = 256
ignorehitpause = 1

;-----------------------------------
;アニメ監視式

[state ]
type = selfstate
triggerall = !ishelper
triggerall = alive
trigger1=(anim=190)||(anim=10000)||(anim=10100)||(anim=10200)||(anim=10300)||(anim=10400)||(anim=10500)||(anim=10600)||(anim=10700)||(anim=10800)
trigger2=(anim=30000)||(anim=30100)||(anim=30200)||(anim=30300)
value = anim
persistent = 256
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
triggerall = alive
trigger1 = roundstate > 1
trigger1 = anim = 0
value = 0
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
triggerall = alive
trigger1=(anim=20)||(anim=21)
value = 20
persistent = 256
ignorehitpause = 1

;-------------------------------------------------------------------------------

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[statedef -3]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;




;-------------------------------------------------------------------------------
;ステ抜け用がめちめ記憶

[state ]
type = varset
trigger1 = 1
sysvar(1) = gametime
ignorehitpause = 1

;-------------------------------------------------------------------------------