;***************************************************************************
;===========================================================================
;---------------------------------------------------------------------------
[Statedef -2]

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

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20243)=0
ID = 20243
anim = 20243
removetime = -1
sprpriority = -2
postype = p1
pos = -4,0
scale = 1.1,0.1
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20243
ID = 20243

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20248)=0
ID = 20248
anim = 20248
removetime = -1
sprpriority = -2
postype = p1
pos = -4,0
scale = 0.85,0.1
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20248
ID = 20248

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20254)=0
ID = 20254
anim = 20254
removetime = -1
sprpriority = -2
postype = p1
pos = -4,0
scale = 0.36,0.1
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20254
ID = 20254


[state ]
type = explod
triggerall = !ishelper
trigger1 = anim = 0 && roundstate > 0
trigger1 = numexplod(202551) = 0
anim = 20255
id = 202551
sprpriority = 10
postype = p1
pos = -4,-27
scale = 0.88,0.88
bindtime = 1
removetime = -1
ownpal = 1
under = 0
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = explod
triggerall = !ishelper
trigger1 = anim = 0 && roundstate > 0
trigger1 = numexplod(202562) = 0
anim = 20256
id = 202562
sprpriority = -11
postype = p1
pos = -4,-40
scale = 0.88,0.88
bindtime = 1
removetime = -1
ownpal = 1
under = 0
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = modifyexplod
trigger1 = !ishelper
trigger1 = anim != 0
id = 202551
removetime = 1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = modifyexplod
trigger1 = !ishelper
trigger1 = anim != 0
id = 202562
removetime = 1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999




;===========================================================================

[state ]
type = explod
triggerall = !ishelper
trigger1 = anim = 0 && roundstate > 0
trigger1 = numexplod(202511) = 0
anim = 20251
id = 202511
sprpriority = 10
postype = p1
pos = -4,-27
scale = 0.94,0.94
bindtime = 1
removetime = -1
ownpal = 1
under = 0
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = explod
triggerall = !ishelper
trigger1 = anim = 0 && roundstate > 0
trigger1 = numexplod(202522) = 0
anim = 20252
id = 202522
sprpriority = -10
postype = p1
pos = -4,-40
scale = 0.94,0.94
bindtime = 1
removetime = -1
ownpal = 1
under = 0
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = modifyexplod
trigger1 = !ishelper
trigger1 = anim != 0
id = 202511
removetime = 1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[state ]
type = modifyexplod
trigger1 = !ishelper
trigger1 = anim != 0
id = 202522
removetime = 1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999


[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20250)=0
ID = 20250
anim = 20250
removetime = -1
sprpriority = -2
postype = p1
pos = -4,-23
scale = 0.8,0.8
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20250
ID = 20250

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20244)=0
ID = 20244
anim = 20244
removetime = -1
sprpriority = -3
postype = p1
pos = -4,-105
scale = 0.36,0.36
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20244
ID = 20244


[State 4]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(20247) = 0
anim = 20247
id = 20247
sprpriority = -9
postype = p1
pos = -4,-105
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
trans = add
scale = 0.7,0.7
SuperMoveTime = 9999
PauseMoveTime = 9999
[State a]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20247
ID = 20247

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20245)=0
ID = 20245
anim = 20245
removetime = -1
sprpriority = -5
postype = p1
pos = -4,-105
scale = 0.36,0.36
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20245
ID = 20245

[State explod]
type = Explod
trigger1 = !ishelper
trigger1 = anim = 0
trigger1 = numexplod(20246)=0
ID = 20246
anim = 20246
removetime = -1
sprpriority = -8
postype = p1
pos = -4,-105
scale = 0.36,0.36
ownpal = 1
bindtime = -1
under = 0
trans = add

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20246
ID = 20246


;=========================================================================
[state -2]
type=projectile
triggerall=!ishelper
triggerall=roundstate=2
triggerall=(palno=[7,10])||palno=12
trigger1=var(17)&4
trigger2=var(3)=4||var(3)=6&&enemy,stateno=[200,600]
projid=10200
projanim=40000+(var(3)=6)*2000
projremove=0
projremovetime=1
projpriority=9999999999999999999999
attr=sca,aa,ap,at
priority=7,hit
projedgebound=200
projstagebound=200
pausetime=0,0
postype=p1
offset=fvar(4),fvar(5)
numhits=0
fall.damage=2147483648
pausemovetime=2147483647
supermovetime=2147483647

[state -2]
type=projectile
triggerall=!ishelper
triggerall=roundstate=2
triggerall=palno=[7,12]
trigger1=var(3)=1||var(3)=8||var(3)=12
trigger2=numenemy>1
trigger2=!enemy(0),alive||!enemy(1),alive
projid=10200
projanim=40000
projremove=0
projremovetime=1
projpriority=9999999999999999999999
attr=sca,at
priority=7,hit
projedgebound=200
projstagebound=200
pausetime=0,0
postype=p1
offset=0,0
numhits=0
p2stateno=5150
fall.damage=2147483648
pausemovetime=2147483647
supermovetime=2147483647

;---------------------------------------------------------------------------
[state -2]
type=lifeset
trigger1=1
value=lifemax
ignorehitpause= 1
;==============================================================================


[State -2]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
;triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(20240) = 0
anim = 20240
id = 20240
sprpriority = 99999
postype = p1
pos = 2,-56
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
trans = add
scale = 0.5,0.5
SuperMoveTime = 9999
PauseMoveTime = 9999
[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20240
ID = 20240


[State -2]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
;triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(20239) = 0
anim = 20239
id = 20239
sprpriority = -1
postype = p1
pos = -5,-11
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
scale = 0.55,0.55
SuperMoveTime = 9999
PauseMoveTime = 9999
[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20239
ID = 20239


[State 4]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(12355) = 0
anim = 12355
id = 12355
sprpriority = -2
postype = p1
pos = -0,-105
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
trans = add
scale = 0.7,0.7
SuperMoveTime = 9999
PauseMoveTime = 9999
[State a]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 12355
ID = 12355

[State -2]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
;triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(20225) = 0
anim = 20225
id = 20225
sprpriority = 7
postype = p1
pos = 0,-80
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
trans = add
scale = 0.5,0.5
SuperMoveTime = 9999
PauseMoveTime = 9999

[State -2]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 20225
ID = 20225


------------------

;===========================================================================


[State 4]
type = Explod
triggerall = !ishelper
triggerall = anim = 0
triggerall = time >= 15
trigger1 = palno = 12
trigger1 = NumExplod(12354) = 0
anim = 12354
id = 12354
sprpriority = -1
postype = p1
pos = -0,-105
bindtime = -1
under = 0
ownpal = 1
persistent = 0
removetime = -1
ignorehitpause = 99999999
scale = 0.8,0.8
SuperMoveTime = 9999
PauseMoveTime = 9999
[State a]
type = RemoveExplod
trigger1 = anim != 0 || stateno = 12354
ID = 12354

;***************************************************************************

[state -2]
type = Explod
triggerall = anim = [10,12]
triggerall = time >= 0 && !ishelper
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-4
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 20 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -4,-0.5 + (random%2)
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 20 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -4,1.5 + (random%2)
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 21 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,-0.5 + (random%2)
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 21 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,1.5 + (random%2)
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 40 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-4
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 40 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%2),-4
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 41 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-3
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 41 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%2),-3
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [42,43]
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%3),-4
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [42,43]
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%3),-4
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 47 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-5
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 47 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-5
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [105,107]
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,-0.5 + (random%2)
scale = 0.15,0.15
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [105,107]
trigger1 = (GameTime%2) = 1
anim = 22130
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,1.5 + (random%2)
scale = 0.1,0.1
supermovetime = 2147483647
pausemovetime = 2147483647



;==========================================================================
[state -2]
type = Explod
triggerall = anim = [10,12]
triggerall = time >= 0 && !ishelper
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-4
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 20 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -4,-0.5 + (random%2)
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 20 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -4,1.5 + (random%2)
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 21 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,-0.5 + (random%2)
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 21 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,1.5 + (random%2)
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 40 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-4
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 40 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%2),-4
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 41 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-3
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 41 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%2),-3
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [42,43]
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%3),-4
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [42,43]
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 1.5+ (random%3),-4
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 47 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = anim = 47 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = var(50),var(51)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-5
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [105,107]
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,-0.5 + (random%2)
supermovetime = 2147483647
pausemovetime = 2147483647
[state -2]
type = Explod
triggerall = time >= 0
triggerall = !ishelper
triggerall = anim = [105,107]
trigger1 = (GameTime%2) = 1
anim = 22131
sprpriority = 10
postype = p1
pos = 0,var(52)
bindtime = 1
ontop = 1
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = 4,1.5 + (random%2)
scale = .5,.5
supermovetime = 2147483647
pausemovetime = 2147483647

;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
[State -2]
type = SelfState
value = 0
triggerall = name ="EXERION"
triggerall = roundstate = 2
triggerall = movetype = H || stateno =[5000,5999]
trigger1 = !time
trigger2 = MoveReversed
trigger3 = GetHitVar(damage) > 0 || GetHitVar(damage) <= 0
trigger4 = GetHitVar(hitcount) > 0 || GetHitVar(hitcount) <= 0
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

;=================================================================================
;=================================================================================
[State -2]
type = Pause
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = SuperPause
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
darken = 0
anim = -2
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = Pause
triggerall = palno = [1,7]
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = SuperPause
triggerall = palno = [1,7]
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
darken = 0
anim = -1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = Pause
triggerall = palno = [8,11]
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = SuperPause
triggerall = palno = [8,11]
triggerall = p2name != "New_Shiki_Nanaya"
triggerall = p2name != "genjitsu"
trigger1 = 1
;trigger2 = roundstate <= 1
;trigger3 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
darken = 0
anim = -1
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999

[State -2]
type = SuperPause
triggerall = p2name = "New_Shiki_Nanaya"
trigger1 = enemy,alive = 0
trigger2 = roundstate >= 3
time = 0+9999999999*(!ishelper)
movetime = 9999999999
darken = 0
anim = -2
ignorehitpause = 1
supermovetime = 99999999999999999999
pausemovetime = 99999999999999999999


;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================

[State -2]
type = helper
triggerall = !Ishelper
;triggerall = p2name != "New_Shiki_Nanaya"
triggerall = enemynear,name != "D.O.G."
trigger1 = numhelper(1112)=0
id = 1112
name = "OTHK1"
pos = 0,0
postype = P1
stateno = 1112
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
SuperMoveTime = 99999999999
PauseMoveTime = 99999999999

[State -2]
type = helper
triggerall = !Ishelper
;triggerall = p2name != "New_Shiki_Nanaya"
triggerall = enemynear,name != "D.O.G."
triggerall = numhelper(1111)=0
trigger1 = enemy(0),numprojid(1007)>0||enemy(0),stateno=5152
trigger2 = enemy(1),numprojid(1007)>0||enemy(1),stateno=5152
id = 1111
name = "OTHK2"
pos = 0,0
postype = P1
stateno = 1111
helpertype = player
keyctrl = 0
ownpal = 1
ignorehitpause = 1
SuperMoveTime = 99999999999
PauseMoveTime = 99999999999

[State 1]
type = AssertSpecial
trigger1 = Ishelper(1111)
flag = Invisible
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(1111)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=1111
value = 1111
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(1112)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=1112
value = 1112
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999


[State -2]
type = helper
trigger1 = !numhelper(7700000)
helpertype = normal
stateno = 7700000
ID = 7700000
name = "Garasu"
postype = p1
pausemovetime = 65535
supermovetime = 65535
[State -2]
type = helper
trigger1 = !numhelper(7800000)
helpertype = normal
stateno = 7800000
ID = 7800000
name = "Garasu"
postype = p1
pausemovetime = 65535
supermovetime = 65535
[State -2]
type = null;helper
trigger1 = alive
trigger1 = var(29) >= 1
trigger1 = numhelper(77) = 0
id = 77
stateno = 77
pos = 0,0
pausemovetime = 999999
supermovetime = 999999

;=================================================================================
;=================================================================================
[state -2]
type = DisplayToClipboard
trigger1 = 1
text = "AIlevel = %d,hitorproj = %d,armor = %d"
params = var(40),var(41),fvar(30)
ignorehitpause = 1

[state -2]
type=AppendToClipboard
trigger1 = palno = [1,6]
text="p2dist x = %f, p2dist y = %f"
params= (p2dist x),(p2dist y)
ignorehitpause=1

;=================================================================================
;=================================================================================
[State -2]
type = lifeset
triggerall = fvar(30) = 2
triggerall = palno = 12
triggerall = alive
trigger1 = roundstate >= 3
;trigger1 = enemy,alive = 1
value = lifemax
ignorehitpause = 1

;=================================================================================
;=================================================================================
;アーマー強さレベル7pから12pまで
;弱　0 1 2 強
;試合開始時にランダム決めることにもできるですが適当に選んで・・・・
;・Lv0 ごりごり削れていく
;・Lv1 まあまあの硬さ
;・Lv2 自重しない上に硬くて論外timeを止めれば倒せるが馬鹿みたいに時間がかかる。
;どちらにしろtimeup回復も試合中の回復もないんで余裕で勝てます。
[state -2]
type = varset
triggerall = palno= [7,12]
trigger1 = !ishelper&&roundstate<2
fv = 30
value = 2 ;random%3
ignorehitpause = 1

;=================================================================================
;=================================================================================
;変数リセットスイッチ
;0 なし
;1 あり
;一部相手に不具合を起こす可能性があります。
:例　倒しても2回目にストーリーが始まらないなど
[State 1]
type = varset
trigger1 = 1
fv = 3
value = 1
ignorehitpause = 1

;=================================================================================
;=================================================================================
;Hitdef掻き消しヘルパーありかなしか
;0 なし
;1 あり
;すべてのカラーにつきます。
;7pから12pに死の宣告の当身つき

[State 1]
type = varset
trigger1 = palno != 12
v = 36
value = 0
ignorehitpause = 1

[State 1]
type = varset
trigger1 = palno = 12
v = 36
value = 0
ignorehitpause = 1

;=================================================================================
;=================================================================================
;ガードバリアありかなしか
;0 無敵なし
;1 無敵あり
[State 1]
type = varset
trigger1 = 1
v = 39
value = 1
ignorehitpause = 1

;=================================================================================
;=================================================================================
;AI on/off on;5 off;0
;初心者？　0
;強　1
;凶　2
;狂　3
;糞弾幕モード　4
;神EXモード　5
;4,5は常時AIが入ります
[state -2]
type = varset
triggerall = enemynear,name != "genjitsu"
trigger1 = !ishelper&&roundstate<2
v = 40
value = 0
ignorehitpause = 1

[state -2]
type = varset
triggerall = palno = 12
triggerall = enemynear,name != "genjitsu"
trigger1 = !ishelper&&roundstate<2
v = 40
value = 0
ignorehitpause = 1

[state -2]
type = varset
triggerall = palno != 12
trigger1 = !ishelper&&roundstate<2
trigger1 = p2name="genjitsu"|| p2name="genjitsu"
v = 40
value = 0
ignorehitpause = 0

[state -2]
type = varset
triggerall = palno = 12
trigger1 = !ishelper&&roundstate<2
trigger1 = p2name="genjitsu"|| p2name="genjitsu"
v = 40
value = 0
ignorehitpause = 1



;=================================================================================
;=================================================================================
;Hitdefかproj
;Hitdef　0
;すぐに当身とられます・・・格闘する技のみHitdef
;proj　1
;当身をとられずになりますがコンボなどができません
;当身をとられますが少し強くなります。
;AIにも影響します1pから6pのみ各レベルが若干強くなります.
;1pから6p
[state -2]
type = varset
triggerall = palno != [7,12]
trigger1 = !ishelper&&roundstate<2
v = 41
value = 1
ignorehitpause = 1
;7pから12p
;即死させたいならこれを0に
[state -2]
type = varset
triggerall = palno= [7,12]
trigger1 = !ishelper&&roundstate<2
v = 41
value = 1
ignorehitpause = 1

;=================================================================================
;=================================================================================



[State -2]
type = varset
triggerall = var(30)
triggerall = palno = [7,12]
trigger1 = numhelper(6400000)
v = 30
value = 1
ignorehitpause = 1

[State -2]
type = varset
triggerall = palno = [7,12]
triggerall = numhelper(6400000)
trigger1 = helper(6400000),var(0) = 1
v = 30
value = 1
ignorehitpause = 1

[state -1]
type = varset
trigger1 = fvar(30)!=[0,2] 
fv = 30
value = 0
ignorehitpause = 1

[State -2]
type = RemoveExplod
triggerall = !ishelper
trigger1 = anim != 0
id = 32400
ignorehitpause = 1

[State -2, Y座標自己修復]
type = PosSet
triggerall = RoundState = 2
trigger1 = stateno = [0,12]      
trigger1 = floor(Pos Y) = [-2,3] 
y = 0

[State -2, Y座標自動修正]
type = PosAdd
triggerall = RoundState = 2
triggerall = Life < 1200     
trigger1 = stateno = [0,30] 
trigger1 = floor(Pos Y) < -2
y = 2

[State -2, Y座標自動修正]
type = PosAdd
triggerall = RoundState = 2
triggerall = Life < 1200
trigger1 = stateno = [0,30]
trigger1 = floor(Pos Y) > 2
y = -2

[State -2, Y座標強制修復]
type = ChangeState
triggerall = RoundState = 2
triggerall = ctrl = 0
triggerall = alive = 1
triggerall = !Lose
trigger1 = Pos Y < -1280
trigger1 = GameTime % 10 = 0
trigger2 = Pos Y > 480
trigger2 = GameTime % 10 = 0
value = 40

[State -2]
type = posset
triggerall = !ishelper
trigger1 = roundstate = 4
y = 0
ignorehitpause = 1

[State -2]
type = playsnd
triggerall = Time = 1
trigger1 = stateno = 52 
trigger2 = stateno = 103 
value = 40,0

[State -3]
type = PlaySnd
triggerall = time = 1
trigger1 = stateno = 40 
value = 40,1

[State -2]
type = playsnd
triggerall = Time = 1
trigger1 = stateno = 107 
value = 40,2

[State -2]
type = playsnd
triggerall = Time = 1
trigger1 = stateno = 105 
value = 105,0

[State -2]
type = stopsnd
trigger1 = stateno != 40
channel = 1

[State -2]
type = width
trigger1 = 1
edge = 5,0

[state -2]
type = varset
trigger1 = var(10) = 0
trigger1 = facing = 1
v = 10
value = 1

[state -2]
type = varset
trigger1 = var(10) = 0
trigger1 = facing = -1
v = 10
value = 2

[state a]
type = stopsnd
trigger1 = movetype = H
channel = 1

[state a]
type = afterimagetime
trigger1 = movetype = H
time = 0

[State a] 
type = afterimage
triggerall = palno = 12
trigger1 = roundstate != 0 && !ishelper
trigger1 = time = 0
trans = add
palcontrast = 240,60,240
palbright = 0,0,0
time = -1
length = 13
timegap = 1
framegap = 1

[State 0]
type = Trans
triggerall = palno != 12
trigger1 = stateno!=3000
trigger1 = stateno!=10155
trigger1 =  !ishelper
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[State -2]
type = assertspecial
triggerall = roundno = 1
trigger1 = roundstate < 2
flag = nomusic

[State -2]
type = assertspecial
triggerall = !ishelper&&!loseko&&!lose&&!drawgame
trigger1 = roundstate = 4
trigger1 = stateno!=181
trigger1 = stateno!=184
trigger1 = stateno!=1840
trigger1 = stateno!=185
trigger1 = stateno!=186
trigger1 = stateno!=187
trigger1 = stateno!=189
trigger1 = stateno!=[150,155]
flag = roundnotover
ignorehitpause = 1

[state -2]
type = destroyself
triggerall = palno = [10,12]
trigger1 = var(55)!=gametime+123456789
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;ライフ管理ステート抜けnoko
;------------------------------------------------------------------------------------------------------
[State -2];ダブルKO阻止
type = assertspecial
triggerall = !ishelper && !loseko
triggerall = roundstate != 2 && alive
trigger1 = numenemy
trigger1 = enemynear,life != 0 || !enemynear,alive
flag = noko
ignorehitpause = 1

[State -2]
type = varset
trigger1 = !ishelper
v = 38
value = 0
ignorehitpause = 1

[State -2]
type=varset
trigger1=stateno=0||(stateno=[10,12])||stateno=20||stateno=21||stateno=40
trigger2=(stateno=[50,52])||(stateno=[100,102])||(stateno=[105,107])||stateno=120
trigger3=(stateno=[130,132])||stateno=140||(stateno=[150,155])||stateno=170
trigger4=(stateno=[180,181])||(stateno=[180,184])||(stateno=[180,185])||(stateno=[180,186])
trigger5=(stateno=[180,187])||(stateno=[180,189])||(stateno=[180,1840])||(stateno=[190,191])
trigger6=(stateno=[190,1910])||(stateno=[190,18400])||(stateno=[190,193])||(stateno=[190,194])
trigger7=(stateno=[190,192])||(stateno=[190,1900])||(stateno=[190,1920])||(stateno=[190,19000])
trigger8=stateno=195||stateno=200||stateno=205||stateno=210||stateno=215
trigger9=stateno=230||stateno=235||stateno=240||stateno=290||stateno=400
trigger10=stateno=410||stateno=430||stateno=440||stateno=600||stateno=610
trigger11=stateno=630||stateno=640||stateno=690||stateno=700||stateno=701
trigger12=stateno=702||stateno=800||stateno=801||stateno=1050||stateno=1100
trigger13=stateno=1200||stateno=1201||stateno=1250||stateno=1260||stateno=1450
trigger14=stateno=1700||stateno=1800||stateno=1810||(stateno=[1950,1955])||stateno=11610
trigger15=stateno=11650||stateno=11670||stateno=11700||stateno=12300||stateno=3001
trigger16=stateno=11500||stateno=11101||stateno=25555||(stateno=[22115,22117])||(stateno=[24000,24050])
trigger17=stateno=18100||(stateno=[25000,25100])||stateno=3000||stateno=1030||(stateno=[1040,1045])
trigger18=(stateno=[10000,10005])||(stateno=[11220,11230])||(stateno=[10150,10160])||(stateno=[11000,11002])
trigger19=stateno=1007000||(stateno=[30080,30081])||(stateno=[19600,300810])||stateno=19500
trigger20=(stateno=[33500,33600])||(stateno=[23100,23200])||(stateno=[2300,23001])||(stateno=[19200,19201])
trigger21=(stateno=[2200,2210])||stateno=100500||(stateno=[1045,1063])||(stateno=[1049,1063])
trigger22=stateno=5000||stateno=5001||stateno=5010
trigger23=stateno=5011||stateno=5020||stateno=5030
trigger24=stateno=5035||stateno=5040||stateno=5050
trigger25=stateno=5070||stateno=5071||stateno=5080
trigger26=stateno=5081||stateno=5100||stateno=5101
trigger27=stateno=5110||stateno=5120||stateno=5150
trigger28=stateno=5210||stateno=5500||stateno=5900
v=38
value=1
ignorehitpause=1

[State -2]
type = SelfState
triggerall = var(40)=5 && !ishelper
trigger1 = gethitvar(damage) >= 100||var(38)!=1||var(55) !=gametime+123456789
value = (statetype=S)*151+(statetype=C)*153+(statetype=A)*155+(statetype=L)*151
ignorehitpause = 1




;=================================================================================
;ステ抜け1
;=================================================================================
;ヘルパーID
;==========
;3002
;11100
;11502
;22222222
;11710
;11720
;11730
;1168000
;11680
;==========
;ステ抜け先
;==========
;value = 0
;==========
;
[State -2]
type = Selfstate
triggerall = Ishelper(3002)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=3002
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11100)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11100
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11502)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11502
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(22222222)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=22222222
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11710)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11710
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11720)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11720
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11730)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11730
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(1168000)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=1168000
value = 0;24640
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

[State -2]
type = Selfstate
triggerall = Ishelper(11680)
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno!=11680
value = 0;11690
ctrl = 0
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999

;=================================================================================
;=================================================================================



[State -2]
type = null;SelfState
triggerall = ishelper
trigger1 = ishelper(3002) 
trigger1 = stateno != (3002)
trigger2 = ishelper(11100) 
trigger2 = stateno != (11100)
trigger3 = ishelper(11502) 
trigger3 = stateno != (11502)
trigger4 = ishelper(22222222)
trigger4 = stateno !=(22222222)
trigger5 = ishelper(11710)
trigger5 = stateno !=(11710)
trigger6 = ishelper(11720)
trigger6 = stateno !=(11720)
trigger7 = ishelper(11730)
trigger7 = stateno !=(11730)
trigger8 = ishelper(1168000)
trigger8 = stateno !=(1168000)
value= 24640
ignorehitpause = 1

[State -2]
type = null;SelfState
triggerall = ishelper
triggerall = var(55) != gametime+123456789
trigger1 = ishelper(11680)
trigger1 = stateno !=(11680)
value= 11690
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,9]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=0
trigger1 =  (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -10
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,9]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=1
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -10
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,9]
triggerall = !ishelper && alive && roundstate=2 && fvar(30)=2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life >= 201
value = -10
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = [7,9]
triggerall = !ishelper && alive && roundstate=2 && fvar(30) = [0,2]
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
trigger1 = life = [0,200]
value = -10
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = numhelper(41000) = 0
triggerall = palno = 10
triggerall = !ishelper && alive && roundstate=2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
value = -1
ignorehitpause = 1

[State -2]
type = lifeadd
triggerall = numhelper(6400000)
triggerall = palno = 11
triggerall = !ishelper && alive && roundstate=2
trigger1 = (helper(6400000),GetHitVar(Damage)=[1,(lifemax*0.3)])
trigger1 = stateno != [120,155]
value = -1
ignorehitpause = 1


[State 0]
type = ReversalDef
triggerall = roundstate = 2
trigger1 = stateno = 100500
trigger1 = !ishelper
reversal.attr = SCA,AA,AT,AP
hitflag = M-
priority = 2147483647
pausetime = 0,0
numhits = 0
ignorehitpause = 1

[State -2]
type = helper
trigger1 = numhelper(22222222) <= 5
trigger1 = roundstate = 2
trigger1 = stateno = 100500
trigger1 = enemynear,alive = 1
name = "22222222"
helpertype = player
id = 22222222
stateno = 22222222
persistent = 30
posType = p1
pos = 0,2147483647
facing = 1
ownpal= 1
ignorehitpause=1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = ReversalDef
triggerall = !ishelper
trigger1 = stateno = 2205
trigger2 = p2name="Kyuketsuki"&&enemy,palno=11 || p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="genjitsu" || p2name="Shutdown"
trigger3 = stateno = 19201
reversal.attr = SCA,AA,AT,AP
priority = 7, Hit
pausetime = 0,0
hitsound = -1
p2stateno = 5150
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper && numtarget
trigger1 = target,ishelper
trigger1 = roundstate = 2 && stateno = 19201
value = 30100+(gametime%60<20)+(gametime%60<40)+(gametime%60<60)+(gametime%60<80)+(gametime%60<100)
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper && numtarget
trigger1 = target,ishelper
trigger1 = roundstate = 2 && stateno = 2205
trigger2 = p2name="Kyuketsuki"&&enemy,palno=11 || p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="genjitsu" || p2name="Shutdown"
trigger2 = enemy,alive
value = 50340
ignorehitpause = 1

[State -2];アーマー
type = helper
triggerall = !ishelper
triggerall = palno = [7,12]
trigger1 = numhelper(6400000) = 0
stateno = 150
name = "Helper"
id = 6400000
persistent = 1
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = enemynear,name != "D-Athena";フライング反応し過ぎw
triggerall = enemynear,name != "G Mizuchi";バック
triggerall = var(54) >= 50
triggerall = !ishelper
triggerall = palno = 12
trigger1 = numhelper(66666) = 0
trigger1 = roundstate = 2
stateno = 150
name = "hitdefhelper"
id = 66666
persistent = 1
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = helper
triggerall = var(36) = 1
triggerall = numhelper(166666) = 0
trigger1 = !ishelper
stateno = 150
name = "Helper"
id = 166666
persistent = 1
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647
;-------------------------------------------------------------------------------------------------------
;　power,time and powerup管理
;-------------------------------------------------------------------------------------------------------
[state -2]
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 2
v = 54
value = 1
IgnoreHitPause = 1
[state -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate = 2
trigger1 = var(54) > 6500
v = 54
value = 0
IgnoreHitPause = 1
[State -2]
type = VarSet
trigger1 = roundstate = 0
var(54) = 0
[state -2]
type = varadd
triggerall = !ishelper
triggerall = palno!= 12
trigger1 = (GameTime%2) = 1
v = 35
value=((var(40)=[1,5])*2)+3+((var(40)=[2,5])*2)+((var(40)=[3,5])*2)+((var(40)=[4,5])*2)+((var(40)=5)*2)
ignorehitpause = 1
[state -2]
type = varadd
triggerall = !ishelper
triggerall = palno = 12
trigger1 = (GameTime%2) = 1
v = 35
value = 15
ignorehitpause = 1
[state -2]
type = varset
triggerall = !ishelper
trigger1 = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
v = 35
value = 7000
ignorehitpause = 1
[state -2]
type = varadd
triggerall = !ishelper
trigger1 = roundstate = 2 &&  var(54) < 5700
fv = 24
value = 1+((enemy,life>=enemy,lifemax&&enemy,power>=enemy,powermax)*80)
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate != 2 || numtarget || var(54) >= 5700
fv = 24
value = 0
ignorehitpause = 1
[state -2]
type = powerset
trigger1 = !ishelper
value = var(35) 
ignorehitpause = 1

[State -2]
type = pause
triggerall = palno= 12
triggerall = p2name != "New_Shiki_Nanaya"
trigger1 = roundstate != 2 
time = 2147483647
movetime = 2147483647
ignorehitpause = 1

[State -2]
type = superpause
triggerall = palno=12
triggerall = p2name != "New_Shiki_Nanaya"
trigger1 = roundstate != 2 
anim = -1
time = 2147483647
movetime = 2147483647
darken = 0
ignorehitpause = 1

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

[state a]
type = playsnd
triggerall = palno !=12
triggerall = !ishelper
triggerall = var(12) = 0
trigger1 = losekO
trigger1 = numpartner = 0
trigger2 = numpartner
trigger2 = !alive
trigger2 = stateno != 5150 || stateno = 5150 && time = 1
ignorehitpause = 1
persistent = 0
value = 12,0
freqmul = 0.9
channel = 4

[state a]
type = playsnd
triggerall = palno =12
triggerall = !ishelper
triggerall = var(12) = 0
trigger1 = loseko
trigger1 = numpartner = 0
trigger2 = numpartner
trigger2 = !alive
trigger2 = stateno != 5150 || stateno = 5150 && time = 1
ignorehitpause = 1
persistent = 0
value = 10000,5
freqmul = 0.9
channel = 4

[state a]
type =  varset
triggerall = !ishelper
trigger1 = roundstate = 3
trigger1 = numpartner = 0
trigger2 = numpartner
trigger2 = !alive
trigger2 = stateno != 5150 || stateno = 5150 && time = 1
ignorehitpause = 1
v = 12
value = 1

[state a]
type = varset
triggerall = !ishelper
trigger1 = roundstate = 2
trigger1 = alive || numpartner = 0
ignorehitpause = 1
v = 12
value = 0

[State 0]
type = Trans
triggerall = stateno != 1007000
triggerall = numhelper(10070000)
trigger1 = !ishelper
trans = addalpha
alpha = 20,256
ignorehitpause = 1

[State -2]
type = assertspecial
triggerall = palno = [7,12]
trigger1 = !ishelper
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard
ignorehitpause = 1

[state -2]
type = playerpush
trigger1 = 1
value = 0
ignorehitpause = 1

[State -2]
type = statetypeset
triggerall = numhelper(6400000)
triggerall = palno = 12
triggerall = !ishelper
trigger1 = var(55)!=gametime+123456789
trigger2 = stateno = [5000,5150]
trigger3 = roundstate >= 3
movetype = I
ignorehitpause = 1

[State -2]
type = AttackDist
triggerall = palno != 12
trigger1 = movetype != A
value = 360
ignorehitpause = 1

[State -2]
type = NotHitBy
triggerall = palno = [7,12]
trigger1 = 1
value = SCA,AA,AT,AP
time = 2147483647
ignorehitpause = 1

[State -2]
type = NotHitBy
triggerall = palno = [7,12]
trigger1 = RoundState != 2
value = SCA,AA,AT,AP
ignorehitpause = 1

[State -2,]
type = ctrlset
trigger1 = roundstate = 4
trigger1 = win && ctrl = 1
value = 0

[State -2]
type = screenbound
trigger1 = ishelper
value = 0
movecamera = 0
ignorehitpause = 1

[State -2]
type = targetLifeAdd
triggerall = !ishelper && palno = 12
trigger1 = 1
value = -(Ceil(0.001 * Const(data.life)))
absolute = 1
ignorehitpause = 1

[State -2]
type = AssertSpecial
triggerall = !ishelper
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state -2]
type = sprpriority
trigger1 = !ishelper
trigger1 = 1
value = 2
ignorehitpause = 1

;-------------------------------------------------------------------------------------------------------
;　1pから6pまでの特典
;-------------------------------------------------------------------------------------------------------

[State -2]
type = attackMulSet
trigger1 = 1
value = 0.5+((var(40)=[2,5])*0.3)+((var(40)=[3,5])*0.4)-((var(40)=[4,5])*0.7)+((var(40)=5)*0.9)
ignorehitpause = 1

[State -2]
type = defenceMulSet
trigger1 = 1
value = 1.1-((var(40)=[2,5])*0.15)-((var(40)=[3,5])*0.1)-((var(40)=[4,5])*0.15)-((var(40)=5)*0.15)
ignorehitpause = 1

[State -2]
type = hitoverride
triggerall = var(40)=5
triggerall = palno = [1,3]
trigger1 = statetype = S
attr = SCA,AA,AT,AP
slot = 1
stateno = 5000
time = -1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = S
attr = SCA,AA,AT,AP
slot = 1
stateno = 5000
time = -1

[State -2]
type = hitoverride
triggerall = var(40)=5
triggerall = palno = [1,3]
trigger1 = statetype = C
attr = SCA,AA,AT,AP
slot = 1
stateno = 5010
time = -1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = C
attr = SCA,AA,AT,AP
slot = 1
stateno = 5010
time = -1

[State -2]
type = hitoverride
triggerall = var(40)=5
triggerall = palno = [1,3]
trigger1 = statetype = A
attr = SCA,AA,AT,AP
slot = 1
stateno = 5020
time = -1

[State -2]
type = hitoverride
triggerall = palno = [4,6]
trigger1 = statetype = A
attr = SCA,AA,AT,AP
slot = 1
stateno = 5020
time = -1

;-------------------------------------------------------------------------------------------------------
;　演出面
;-------------------------------------------------------------------------------------------------------

[State 1]
type = varrandom
trigger1 = 1
range = -40,30
v = 50

[State 1]
type = varrandom
trigger1 = 1
range = 0,-60
v = 51

[State 1]
type = varrandom
trigger1 = 1
range = -40,-130
v = 52

[State -1]
type = varset
trigger1 = roundstate = 0
var(58) = 1

[State -1]
type = varset
trigger1 = roundstate = 0
var(59) = 1

[State -1]
type = varset
trigger1 = var(58) > -10
var(59) = 3

[State -1]
type = varset
trigger1 = var(58) < -110
var(59) = 2

[State -1]
type = varadd
trigger1 = 1
trigger1 = var(59) = 3
var(58) = -4

[State -1]
type = varadd
trigger1 = 1
trigger1 = var(59) = 2
var(58) = 4

[State a]
type = PalFX
trigger1 = !ishelper
trigger1 = stateno != [190,192]
time = 2
add = var(58),var(58),var(58)
ignorehitpause = 1

[State a]
type = PalFX
trigger1 = !ishelper
trigger1 = stateno != [190,192]
trigger1 = var(58) < -110
time = 2
add = var(58),var(58),var(58)
ignorehitpause = 1
color = 0





[State -2]
type = Explod
triggerall = anim = 0 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%7) = 1
anim = 22131
id = 22131
sprpriority = 10
pos = var(50),var(51)
bindtime = 1
under = 0
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-3
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2]
type = Explod
triggerall = anim = 1 && !ishelper
triggerall = time >= 0
trigger1 = (GameTime%7) = 1
anim = 22131
id = 22131
sprpriority = 10
pos = var(50),var(51)
bindtime = 1
under = 0
ownpal = 1
persistent = 1
ignorehitpause = 1
vel = -0.5+ (random%2),-3
supermovetime = 2147483647
pausemovetime = 2147483647
;-------------------------------------------------------------------------------------------------------
;　負け演出
;-------------------------------------------------------------------------------------------------------

[State -2]
type = PlaySnd
triggerall = roundstate = 2
trigger1 = (GameTime%60) = 0
value = 10000,26
volume = -255

[State -2]
type = PlaySnd
triggerall = !ishelper
triggerall = loseko
triggerall = palno != 12
trigger1 = stateno = 5150
trigger1 = Time = 0||Time = 60||Time = 120||Time = 180||Time = 240||Time = 300
value = 10000,26
volume = 255
freqmul = 0.9
IgnoreHitPause = 1
persistent = 0

[State -2]
type = PlaySnd
triggerall = !ishelper
triggerall = loseko
triggerall = palno != 12
trigger1 = stateno = 5150
trigger1 = Time = 80
value = 12,1
volume = 255
freqmul = 0.5
IgnoreHitPause = 1
persistent = 0

[State -2]
type = Trans
triggerall = !ishelper
triggerall = loseko
triggerall = palno != 12
trigger1 = stateno = 5150
trans = AddAlpha
alpha = 256-ifelse(time<257,time,256),ifelse(time<257,time,256)

[State -2]
type = AssertSpecial
triggerall = !ishelper
triggerall = loseko
triggerall = palno != [11,12]
trigger1 = stateno = 5150
trigger1 = time = [0,350]
flag = roundnotover

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

[State -2];アニメ1
type = parentvarset
triggerall = ishelper(66666)
triggerall = var(21) != enemynear,anim
triggerall = (enemy,stateno != 0)&&(enemy,stateno != [10,12])&&(enemy,stateno != [50,52])
triggerall = enemy,stateno != 20
triggerall = enemy,stateno != 40
triggerall = enemy,stateno != 45
triggerall = enemy,stateno != 100&&(enemy,stateno != [105,106])
triggerall = enemy,stateno != 110
triggerall = enemy,stateno != 115
triggerall = enemy,stateno != 120
triggerall = enemy,stateno != [130,132]
triggerall = enemy,stateno != 140
triggerall = enemy,stateno != [150,155]
trigger1 = var(55)!=gametime+123456789
v = 20
value = enemy,anim
ignorehitpause = 1
[State -2];アニメ2
type = parentvarset
triggerall = ishelper(66666)
triggerall = var(21) <= 0
triggerall = (enemy,stateno != 0)&&(enemy,stateno != [10,12])&&(enemy,stateno != [50,52])
triggerall = enemy,stateno != 20
triggerall = enemy,stateno != 40
triggerall = enemy,stateno != 45
triggerall = enemy,stateno != 100&&(enemy,stateno != [105,106])
triggerall = enemy,stateno != 110
triggerall = enemy,stateno != 115
triggerall = enemy,stateno != 120
triggerall = enemy,stateno != [130,132]
triggerall = enemy,stateno != 140
triggerall = enemy,stateno != [150,155]
trigger1 = var(55)!=gametime+123456789
v = 21
value = enemy,anim
ignorehitpause = 1
[State 0];アニメ3
type = varset
triggerall = !ishelper
triggerall = var(25) = 0
trigger1 = enemynear,movecontact
trigger2 = enemynear,movereversed
trigger3 = enemynear,hitdefattr = SCA,AA,AT,AP
var(25) = enemynear,anim
ignorehitpause = 1
[State 0]
type = varset
triggerall = !ishelper
trigger1 = var(25) = 200
var(25) = 0
ignorehitpause = 1
[State 0];アニメ4
type = varset
triggerall = !ishelper
triggerall = var(26) = 0
triggerall = var(25) != 0
trigger1 = enemynear,movecontact
trigger2 = enemynear,movereversed
trigger3 = enemynear,hitdefattr = SCA,AA,AT,AP
var(26) = enemynear,anim
ignorehitpause = 1

[State -2];ステート1
type = parentvarset
triggerall = ishelper(66666)
triggerall = root,var(19) = 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 19
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 19
value = 0
ignorehitpause = 1
[State -2];ステート2
type = parentvarset
triggerall = ishelper(66666)
triggerall = root,var(22) = 0
triggerall = root,var(19) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 22
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(22)
v = 22
value = 0
ignorehitpause = 1
[State -2];ステート3
type = parentvarset
triggerall = ishelper(66666)
triggerall = root,var(23) = 0
triggerall = root,var(19) != 0
triggerall = root,var(22) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 23
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 23
value = 0
ignorehitpause = 1
[State -2];ステート4
type = parentvarset
triggerall = ishelper(66666)
triggerall = root,var(24) = 0
triggerall = root,var(19) != 0
triggerall = root,var(22) != 0
triggerall = root,var(23) != 0
triggerall = stateno != root,var(19)
triggerall = stateno != root,var(22)
triggerall = stateno != root,var(23)
triggerall = stateno != root,var(24)
triggerall = stateno != root,var(26)
trigger1 = var(55)!=gametime+123456789
v = 24
value = stateno
ignorehitpause = (movereversed = 0)
[State -2]
type = varset
triggerall = !ishelper
triggerall = enemynear,alive
trigger1 = enemynear,stateno = var(19)
v = 24
value = 0
ignorehitpause = 1
[State -2]
type = SelfState
triggerall = ishelper(66666)
triggerall = ishelper(64000)
triggerall = ishelper(6400000)
triggerall = ishelper(10070000)
triggerall = ishelper(1065)
triggerall = ishelper(313900)
triggerall = ishelper(16500)
triggerall = ishelper(1412)
triggerall = ishelper(22122)
triggerall = ishelper(169990)
triggerall = ishelper(24610)
triggerall = ishelper(10015)
triggerall = ishelper(18510)
triggerall = ishelper(649999)
triggerall = ishelper(301050)
trigger1 = var(55)!=gametime+123456789
value = 150
ignorehitpause = 1
[State -2]
type = SelfState
triggerall = ishelper(1720)
triggerall = ishelper(1890)
triggerall = ishelper(12310)
triggerall = ishelper(18102)
triggerall = ishelper(22101)
trigger1 = var(55)!=gametime+123456789
value = 130
ignorehitpause = 1



[State -2]
type = SelfState
triggerall = ishelper
trigger1 = ishelper(99919)
trigger1 = stateno !=(99919)
trigger2 = var(55)!=gametime+123456789
value= 99919
ignorehitpause = 1

[State -2]
type = SelfState
triggerall = ishelper
trigger1 = ishelper(99920)
trigger1 = stateno !=(99920)
trigger2 = var(55)!=gametime+123456789
value= 99920
ignorehitpause = 1



[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Kyuketsuki" && enemy,palno = 11
v = 19
value = 200
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "Kyuketsuki" && enemy,palno = 11
v = 20
value = 912
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "syugosya_emiya"
v = 19
value = 3994
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "syugosya_emiya"
v = 20
value = 39001
ignorehitpause = 
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name="" || p2name="MUAHAHAHAHAHAHAHAHA" || p2name="Shutdown"
v = 19
value = 944
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "UNKNOWN"
v = 19
value = 882
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = p2name = "UNKNOWN"
v = 20
value = 8001
ignorehitpause = 1

[State -2]
type = varset
triggerall = !ishelper
trigger1 = roundstate != 2
trigger2 = projcontact = 1
trigger2 = numtarget
trigger2 = target,ishelper = 0
trigger2 = enemy,stateno = [5000,5110]
v = 37
value = 0
ignorehitpause = 1
[State -2]
type = varset
triggerall = !ishelper
trigger1 = projcontact = 1
trigger1 = !numtarget || (enemy,stateno!=[5000,5110])
v = 37
value = 1
ignorehitpause = 1

[state -2]
type = targetstate
triggerall = !ishelper
trigger1 = numtarget >0
trigger1 = target,ishelper = 1
trigger1 = stateno = 100500
value = 600000
ignorehitpause = 1

[State 1]
type = varset
triggerall = !ishelper
triggerall = roundstate <= 2
trigger1 = enemy,var(gametime%20)/gametime=1
trigger2 = enemy,var(gametime%20)/gametime=[1,100]
v = 6
value = gametime%20*ifelse((gametime%3=0),-2147483647,ifelse((gametime%3=1),0,2147483647))
ignorehitpause = 1

[State 1]
type = varset
triggerall = !ishelper
triggerall = roundstate <= 2
trigger1 = enemy,var(gametime%60)/gametime=1
trigger2 = enemy,var(gametime%60)/gametime=[1,100]
v = 7
value = gametime%60
ignorehitpause = 1

[State 1]
type = varset
triggerall = !ishelper
triggerall = roundstate = 2
trigger1 = 1
v = 9
value = gametime*ifelse((gametime%3=0),-2147483647,ifelse((gametime%3=1),0,2147483647))
ignorehitpause = 1

;***************************************************************************
;===========================================================================
;---------------------------------------------------------------------------
[Statedef -3]; 常時監視ステート
;---------------------------------------------------------------------------
;===========================================================================

;***************************************************************************

[State -3];gametime
type = null;varset
;triggerall = p2name != "New_Shiki_Nanaya"
;triggerall = enemynear,name != "D.O.G."
trigger1 = 1
v = 51
value = gametime
ignorehitpause = 1
supermovetime = 9999999999999
pausemovetime = 9999999999999

;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================

[State -3]
type = varset
trigger1 = 1
var(55) = gametime+123456789
ignorehitpause = 1
supermovetime = 9999999999999
pausemovetime = 9999999999999

[State -3]
type = helper
triggerall = enemynear,name != "D-Athena"
triggerall = enemynear,name != "G OROCHI"
triggerall = enemynear,name != "OrorinrinLand"
triggerall = enemynear,name != "Mephistopheles"
triggerall = enemynear,name != "SAMSARA018"
triggerall = enemy,alive
triggerall = roundstate = 0 || var(4)=1
triggerall = palno = 12
trigger1 = !Ishelper
trigger1 = !numhelper(99919)
trigger1 = roundstate <=1
stateno = 99919
name = "Helper"
id = 99919
persistent = 1
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -3]
type = helper
triggerall = enemynear,name != "D-Athena"
triggerall = enemynear,name != "G OROCHI"
triggerall = enemynear,name != "OrorinrinLand"
triggerall = enemynear,name != "Mephistopheles"
triggerall = enemynear,name != "SAMSARA018"
triggerall = enemy,alive
triggerall = roundstate = 0 || var(4)=1
triggerall = palno = 12
trigger1 = !Ishelper
trigger1 = !numhelper(99920)
stateno = 99920
name = "Helper"
id = 99920
persistent = 1
pos = 0,0
helpertype = player
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State -3]
type = varset
triggerall = !ishelper
trigger1 = numenemy
fv = 5
value = abs(pos x-enemynear,pos x)*ifelse(frontedgedist<ifelse((facing=enemynear,facing),(enemynear,frontedgedist),(enemynear,backedgedist)),-1,1)
ignorehitpause = 1

[State -3]
type = assertspecial
triggerall = !ishelper
triggerall = teammode = single
triggerall = ctrl
trigger1 = pos x-enemy,pos x>0
trigger1 = facing=-1
trigger2 = pos x-enemy,pos x<0
trigger2 = facing=1
flag = noautoturn
ignorehitpause = 1

[State -3]
type = turn
triggerall = !ishelper
triggerall = teammode = single
triggerall = ctrl
triggerall = stateno != 20
trigger1 = pos x-enemy,pos x>0
trigger1 = facing=1
trigger2 = pos x-enemy,pos x<0
trigger2 = facing=-1
ignorehitpause = 1

[State -3]
type = varset
triggerall = !var(30)
triggerall = roundstate = 2
trigger1 = command = "AI0"
trigger2 = command = "AI1"
trigger3 = command = "AI2"
trigger4 = command = "AI3"
trigger5 = command = "AI4"
trigger6 = command = "AI5"
trigger7 = command = "AI6"
trigger8 = command = "AI7"
trigger9 = command = "AI8"
trigger10 = command = "AI9"
trigger11 = command = "AI10"
trigger12 = command = "AI11"
trigger13 = command = "AI12"
trigger14 = command = "AI13"
trigger15 = command = "AI14"
trigger16 = command = "AI15"
trigger17 = command = "AI16"
trigger18 = command = "AI17"
trigger19 = command = "AI18"
trigger20 = command = "AI19"
trigger21 = command = "AI20"
trigger22 = command = "AI21"
trigger23 = command = "AI22"
trigger24 = command = "AI23"
trigger25 = command = "AI24"
trigger26 = command = "AI25"
trigger27 = command = "AI26"
trigger28 = command = "AI27"
trigger29 = command = "AI28"
trigger30 = command = "AI29"
trigger31 = command = "AI30"
trigger32 = command = "AI31"
trigger33 = command = "AI32"
trigger34 = command = "AI33"
trigger35 = command = "AI34"
trigger36 = command = "AI35"
trigger37 = command = "AI36"
trigger38 = command = "AI37"
trigger39 = command = "AI38"
trigger40 = command = "AI39"
trigger41 = command = "AI40"
trigger42 = command = "AI41"
trigger43 = command = "AI42"
trigger44 = command = "AI43"
trigger45 = command = "AI44"
trigger46 = command = "AI45"
trigger47 = command = "AI46"
trigger48 = command = "AI47"
trigger49 = command = "AI48"
trigger50 = command = "AI49"
trigger51 = command = "AI50"
var(30) = 1

[state -3]
type = varset
trigger1 = roundstate >= 3
var(30) = 0
ignorehitpause = 1

[State -3]
type = VarRandom
triggerall = !ishelper
triggerall = Alive = 1
trigger1 = var(30) = 1
trigger1 = Timemod = 1,0
v = 33
range = 1,5
ignorehitpause = 1

[State -3]
type = varset
trigger1 = !ishelper && roundstate = 0
var(30) = 0
IgnoreHitPause = 1

[State -3]
type = varset
triggerall = var(40) = [4,5]
trigger1 = !ishelper && roundstate <= 2
var(30) = 1
IgnoreHitPause = 1


;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;-------------------------------------------------------------------------------------------------------
;AI動作
;-------------------------------------------------------------------------------------------------------
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;---------------------------------------------------------------------------------
;12pのみ
;---------------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 2200
triggerall = var(30)
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = enemynear,name != "R-kunagi"
triggerall = enemynear,name != "G OROCHI"
triggerall = p2name != "New_Shiki_Nanaya"
trigger1 = Ctrl = 1
trigger1 = random <= 10
trigger1 = power >= 9000

;カオティック・フレア
[State -1]
type = ChangeState
value = 2200
triggerall = var(30)
;triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl = 1
triggerall = numhelper(6400000)
triggerall = enemynear,name != "rise7"
triggerall = enemynear,name != "R-kunagi"
triggerall = enemynear,name != "Phantom Mizuchi JP"
triggerall = enemynear,name != "G Igniz"
trigger1 = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
trigger1 = Ctrl = 1
trigger1 = Var(33) = 3
trigger2 = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
trigger2 = Ctrl = 1
trigger2 = Var(33) = 4
trigger3 = var(54) >= 5700 || fvar(24)>=2150 && var(54)>=2150
trigger3 = Ctrl = 1
trigger3 = Var(33) = 5
trigger4 = random <= 60
trigger4= ctrl
trigger4= p2name = "UNKNOWN" || p4name = "UNKNOWN"
trigger5 = ctrl
trigger5 = p2name = "Matsugami"
trigger5 = random < 999
trigger6 = power >= 7000
trigger6= ctrl
trigger6= p2name = "syugosya_emiya" || p4name = "syugosya_emiya"
trigger7 = random <= 200
trigger7 = enemy,life <= lifemax/4
trigger7 = ctrl
trigger7 = p2name = "G OROCHI" || p4name = "G OROCHI"

;カオティック・レイ
[State -1];trigger3以降の指定に特に意味はない
type = ChangeState
value = 19200
triggerall = var(30)
;triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger1 = p2name="tenrou"&&enemy,palno=12 || p2name="tenrou"&&enemy,palno=12
trigger2 = ctrl
trigger2 = p2name="Poltergeist"&&enemy,palno=12 || p2name="Poltergeist"&&enemy,palno=12
trigger3 = ctrl
trigger3 = p2name="efreet"|| p2name="efreet"
trigger4 = random <= 20
trigger4 = ctrl
trigger4 = p2name="EXERION"|| p2name="EXERION"
trigger5 = power >= 9000
trigger5 = random <= 20
trigger5 = ctrl
trigger5 = p2name="Mephistopheles"|| p2name="Mephistopheles"
trigger6 = power >= 9000
trigger6 = random <= 20
trigger6 = ctrl
trigger6 = p2name="ALSIEL"|| p2name="ALSIEL"
trigger7 = power >= 9000
trigger7 = random <= 20
trigger7 = ctrl
trigger7 = p2name="ONI-MIKO-REIMU"|| p2name="ONI-MIKO-REIMU"
trigger8 = power >= 9000
trigger8 = random <= 20
trigger8 = ctrl
trigger8 = p2name="Iofiel"|| p2name="Iofiel"
trigger9 = random <= 20
trigger9 = power >= 9000
trigger9 = ctrl
trigger9 = p2name="Agares"|| p2name="Agares"
trigger10 = random <= 20
trigger10 = power >= 9000
trigger10 = ctrl
trigger10 = p2name="Apollo Mizuchi"|| p2name="Apollo Mizuchi"
trigger11 = random <= 20
trigger11 = power >= 9000
trigger11 = ctrl
trigger11 = p2name="Fake"|| p2name="Fake"
trigger12 = random <= 20
trigger12 = power >= 9000
trigger12 = ctrl
trigger12 = p2name="GGGGG"|| p2name="GGGGG"
trigger13 = random <= 20
trigger13 = power >= 9000
trigger13 = ctrl
trigger13 = p2name="G Mizuka"|| p2name="G Mizuka"
trigger14 = random <= 20
trigger14 = power >= 9000
trigger14 = ctrl
trigger14 = p2name="Kanna Binomikoto"|| p2name="Kanna Binomikoto"
trigger15 = random <= 20
trigger15 = power >= 9000
trigger15 = ctrl
trigger15 = p2name="G-Sakuya"|| p2name="G-Sakuya"
trigger16 = random <= 20
trigger16 = power >= 9000
trigger16 = ctrl
trigger16 = p2name="7L|]{(L2!"|| p2name="7L|]{(L2!"
trigger17 = random <= 20
trigger17 = power >= 9000
trigger17 = ctrl
trigger17 = p2name="ss-iku"|| p2name="ss-iku"
trigger18 = random <= 20
trigger18 = power >= 9000
trigger18 = ctrl
trigger18 = p2name="G Mizuchi"|| p2name="G Mizuchi"
trigger19 = random <= 20
trigger19 = power >= 9000
trigger19 = ctrl
trigger19 = p2name="S-Tomy"|| p2name="S-Tomy"
trigger20 = random <= 20
trigger20 = power >= 9000
trigger20 = ctrl
trigger20 = p2name="S-Kishima"|| p2name="S-Kishima"
trigger21 = random <= 20
trigger21 = power >= 9000
trigger21 = ctrl
trigger21 = p2name="RSP"|| p2name="RSP"
trigger22 = random <= 20
trigger22 = power >= 9000
trigger22 = ctrl
trigger22 = p2name="Kouryou"|| p2name="Kouryou"
trigger23 = random <= 20
trigger23 = power >= 9000
trigger23 = ctrl
trigger23 = p2name="Hades"|| p2name="Hades"
trigger24 = random <= 20
trigger24 = power >= 9000
trigger24 = ctrl
trigger24 = p2name="OrorinrinLand"|| p2name="OrorinrinLand"
trigger25 = random <= 20
trigger25 = power >= 9000
trigger25 = ctrl
trigger25 = p2name="MUKAI"|| p2name="MUKAI"
trigger26 = random <= 20
trigger26 = power >= 9000
trigger26 = ctrl
trigger26 = p2name="Devils eye"|| p2name="Devils eye"
trigger27 = random <= 20
trigger27 = power >= 9000
trigger27 = ctrl
trigger27 = p2name="AxAyAzSSX"|| p2name="AxAyAzSSX"
trigger28 = random <= 20
trigger28 = power >= 9000
trigger28 = ctrl
trigger28 = p2name="AlmaOrochi"|| p2name="AlmaOrochi"
trigger29 = random <= 20
trigger29 = power >= 9000
trigger29 = ctrl
trigger29 = p2name="G-REMILIA"|| p2name="G-REMILIA"
trigger30 = random <= 20
trigger30 = power >= 9000
trigger30 = ctrl
trigger30 = p2name="Amabomb"|| p2name="Amabomb"
trigger31 = random <= 20
trigger31 = power >= 9000
trigger31 = ctrl
trigger31 = p2name="D-Athena"|| p2name="D-Athena"
trigger32 = random <= 20
trigger32 = power >= 9000
trigger32 = ctrl
trigger32 = p2name="G-Mizuchi-v2"|| p2name="G-Mizuchi-v2"

;神に挑むとは無謀
[State -1]
type = ChangeState
value = 19500
triggerall = var(30)
triggerall = palno = 12
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = var(54) > 2500
triggerall = var(54) < 3500
triggerall = numhelper(6400000)
triggerall = EnemyNear,HitDefAttr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP
trigger1 = helper(6400000),var(3) > 0
trigger1 = p2name != "New_Shiki_Nanaya" || p4name != "New_Shiki_Nanaya"
trigger1 = ctrl
trigger1 = p2bodydist X = [-120,120]
trigger1 = random <= 999

;ソウル・デストラクション
[State -1]
type = ChangeState
value = 30080
triggerall = palno = 12
triggerall = var(30)
triggerall = roundstate = 2
triggerall = var(54) > 3500
triggerall = var(54) < 5000
triggerall = numhelper(6400000)
triggerall = helper(6400000),var(1) < 3
triggerall = EnemyNear,HitDefAttr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP
triggerall = random <= 300
trigger1 = statetype != A
trigger1 = ctrl
trigger1 = random <= 999
trigger1 = p2movetype != H

;ブラック・アビス
[State -1]
type = ChangeState
value = 2300
;triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = var(54) < 3000
triggerall = numhelper(6400000)
triggerall = random <= 300
triggerall = enemynear,name != "rise7"
triggerall = enemynear,name != "R-kunagi"
trigger1 = ctrl
trigger1 = enemy,life = enemy,lifemax
trigger1 = p2name = "New_Shiki_Nanaya" || p4name = "New_Shiki_Nanaya"
trigger1 = random <= 200
trigger1 = helper(6400000),var(1) < 4
trigger2 = ctrl
trigger2 = p2name = ""|| p2name = "MUAHAHAHAHAHAHAHAHA"|| p2name = "Shutdown"|| p4name = ""|| p4name  = "MUAHAHAHAHAHAHAHAHA"|| p4name = "Shutdown" 
trigger2 = enemy,stateno = 944
trigger2 = random <= 999
trigger3 = ctrl
trigger3 = p2name = "Gogeta" || p4name = "Gogeta"
trigger3 = random <= 500
trigger3 = helper(6400000),var(1) < 4
trigger4 = ctrl
trigger4 = life <= lifemax/2
trigger4 = life >= 100
trigger4 = enemy,life >=lifemax*0.8
trigger4 = var(54) > 4500
trigger4 = random <= 350
trigger5 = ctrl
trigger5 = var(54) = [650,2600]
trigger5 = enemy,life >= enemy,lifemax
trigger5 = random <= 400
trigger6 = ctrl
trigger6 = enemy,life>=enemy,lifemax*0.8
trigger6 = random = [501,800]
trigger7 = random <=600
trigger7 = ctrl
trigger7 = p2name="Keias"|| p2name="Keias"

;パニッシュ・レイ
[State -3]
type = ChangeState
value = 33500
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = Random <= 250
triggerall = Ctrl = 1
triggerall = RoundState = 2
triggerall = numhelper(6400000)
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
trigger1 = Var(33) = 3
trigger2 = Var(33) = 4
trigger3 = Var(33) = 5

;バニッシュ
[State -3]
type = null;ChangeState
value = 1007000
triggerall = palno = 12
triggerall = alive = 1
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl = 1
triggerall = numhelper(6400000)
triggerall = numhelper(10070000) = 0
trigger1 = fvar(30) = 0
trigger1 = life < lifemax*0.3
trigger2 = fvar(30) = 1
trigger2 = life < lifemax*0.25
trigger2 = random <= 250
trigger3 = fvar(30) = 2
trigger3 = life < lifemax*0.1
trigger3 = random <= 400
trigger4 = life <= lifemax/12
trigger4 = ctrl
trigger4 = var(54) <= 3500 
trigger4 = random <= 420
trigger5 = life <= lifemax/12
trigger5 = var(54) >=3501 
trigger5 = ctrl
trigger5 = random <= 700

;死刑宣告
[State -3]
type = ChangeState
value = 24000
triggerall = var(30)
triggerall = palno = 12
triggerall = var(37) != 1
triggerall = numhelper(6400000)
triggerall = statetype != A
trigger1 = ctrl
trigger1 = helper(6400000),var(4) < 100

;骸骨柱
[State -1]
type = ChangeState
value = 1450
triggerall = var(30)
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
trigger1 = ctrl
trigger1 = p2bodydist X > 100-40
trigger1 = random <= 180
trigger1 = Time = 60 || Time = 120 || Time = 180 || Time = 240 || Time = 300 || Time = 360 || Time = 400 || Time = 440 || Time = 460 || Time = 500
trigger2 = ctrl
trigger2 = p2movetype = A
trigger2 = p2bodydist X = [-30,30]
trigger2 = random <= 140
trigger3 = ctrl
trigger3 = p2movetype = A
trigger3 = p2bodydist X = [0,30]
trigger3 = random <= 140

[State -1]
type = ChangeState
value = 195
triggerall = var(30) = 1
triggerall = palno = 12
triggerall = var(37) = 1
triggerall = numhelper(16500) = 0
triggerall = Alive   = 1
triggerall = statetype != A
triggerall = Power >= 0
triggerall = numhelper(6400000)
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = roundstate = 2

;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 23100
triggerall = palno = 12
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = numhelper(6400000)
triggerall = ctrl = 1
triggerall = enemy,life !=enemy,lifemax
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = life >= 101
trigger1 = Var(33) = 3
trigger2 = ctrl
trigger2 = random <= 200
trigger2 = life >= 101
trigger2 = Var(33) = 4
trigger3 = ctrl
trigger3 = Var(33) = 5

[State -1];血の贖罪
type = ChangeState
value = 11220
triggerall = var(30)
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
triggerall = numhelper(6400000)
trigger1 = life >= lifemax/4
trigger1 = ctrl
trigger1 = power >= 2000
trigger1 = power <= 3999
trigger1 = enemy,life >= lifemax/2
trigger1 = P2bodydist Y >= -50
trigger1 = random <= 70
trigger2 = ctrl
trigger2 = enemy,life >= lifemax/2
trigger2 = random <= 120
trigger3 = ctrl
trigger3 = power >= 2000
trigger3 = power <= 6000
trigger3 = var(54) <= 1200
trigger3 = random <= 150

[State -1];ニュークリアー・レイジエーション
type = ChangeState
value = 10150
triggerall = var(30) = 1
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemy,life != lifemax
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 200
trigger2 = life >= lifemax/2
trigger2 = P2bodydist X = [60,200]
trigger2 = p2movetype != A
trigger2 = p2movetype != H
trigger2 = ctrl
trigger2 = random <= 200
trigger3 = life >= lifemax/2
trigger3 = P2bodydist X = [-200,-60]
trigger3 = p2movetype != A
trigger3 = p2movetype != H
trigger3 = ctrl
trigger3 = random <= 200

[State -1];オロチ飛び道具2
type = ChangeState
value = 11610
triggerall = palno = 12
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 50
trigger1 = random <= 200

[State -1];オロチ飛び道具4
type = ChangeState
value = 11650
triggerall = palno = 12
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 50
trigger1 = random <= 200

[State -1];オロチ飛び道具5
type = ChangeState
value = 11700
triggerall = palno = 12
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 50
trigger1 = random <= 150

[State -1];フォール
type = ChangeState
value = 11670
triggerall = var(30) = 1
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(37) = 1
triggerall = numhelper(11680) = 0
triggerall = numhelper(116800) = 0
triggerall = statetype != A
trigger1 = ctrl
trigger1 = life > lifemax/4
trigger1 = random <= 150
trigger2 = ctrl
trigger2 = var(37) = 1
trigger2 = random <= 100

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = H
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 840

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = P2stateno = [150,153]
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 860

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2movetype = A
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = Random <= 240

;ディメンション・ホール
[State -3]
type = ChangeState
value = 1950
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = backEdgeDist <= 90
trigger1 = Ctrl = 1
trigger1 = Random <= 290

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-90,0]
trigger1 = Ctrl        = 1
trigger1 = Random <= 100

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=20
triggerall = Ctrl = 1
trigger1 = Random <= (50+(p2bodydist X >= 180)*120)
trigger2 = Random <= 50

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A && EnemyNear,time >= 12
trigger1 = Ctrl        = 1
trigger1 = Random <= 50

[State -1];オロチ飛び道具
type = ChangeState
value = 1050
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = numhelper(1050) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = Random <= 150

[State -1];オロチ飛び道具3
type = ChangeState
value = 3001
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = Random <= 50

[State -1];オロチ飛び道具3
type = ChangeState
value = 3001
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = P2StateType != C
trigger1 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
trigger1 = EnemyNear,MoveType = A
trigger1 = InGuardDist
trigger1 = EnemyNear,HitDefAttr = SCA,NP,SP,HP,NA,SA,HA
trigger1 = P2MoveType = A
trigger1 = Random <= 640

[State -1];エクスプロージョンスフィアΩ
type = ChangeState
value = 1700
triggerall = palno = 12
triggerall = numHelper(1720) <= 0
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X >= 50
trigger1 = ctrl
trigger1 = random <= 150

[State -1];ヘル・パニシュ
type = ChangeState
value = 1100
triggerall = palno = 12
triggerall = var(30)
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 120
trigger1 = ctrl

[State -1];フォトンスフィア
type = ChangeState
value = 11101
triggerall = palno = 12
triggerall = var(30)
triggerall = numhelper(11100) = 0
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X >= 50
trigger1 = random <= 200

[State -1];フォトンスフィア2
type = ChangeState
value = 11500
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = numhelper(11500) = 0
triggerall = enemy,alive
trigger1 = ctrl  = 1
trigger1 = random <= 90

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno = 12
triggerall = numhelper(12310) = 0
triggerall = Alive   = 1
triggerall = roundstate = 2
triggerall = var(30) = 1
triggerall = p2bodydist X >= 50
triggerall = statetype != A
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = Random <= 250

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno = 12
triggerall = numhelper(12310) = 0
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2bodydist X >= 50
triggerall = statetype != A
triggerall = enemy,alive
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1 = Random<= 100

;紋章
[State -1]
type = ChangeState
value = 18100
triggerall = palno = 12
triggerall = numhelper(18102) = 0
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power >= 0
trigger1 = statetype  = S
trigger1   = Ctrl = 1
trigger1 = Random <= 200
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1250
triggerall = palno = 12
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,240]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = Random <= 400

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno = 12
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*850)
trigger1 = Random <= 105

[State -3]
type = ChangeState
value = 25555
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,60]
trigger1 = Ctrl        = 1
trigger1 = Random <= 100

[State -3]
type = ChangeState
value = 25555
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-130,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = Random <= 800

[State -3]
type = ChangeState
value = 25555
triggerall = palno = 12
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = Random <= 990

;---------------------------------------------------------------------------------
;12pここまで
;---------------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;11p
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;10p
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[State -1];ジェノサイドカッター
type = ChangeState
value = 1030
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = p2movetype != H && p2movetype != I
triggerall = p2statetype != L
triggerall = p2stateno != [150,155]
triggerall = P2BodyDist X = [0,100]
triggerall = Power    >= 3000 
trigger1 = ctrl
trigger1 = random <= 100
trigger1 = enemy,alive

;ジェノサイドカッター
[State -1]
type = ChangeState
value = 1042
triggerall = var(30)
triggerall = palno = 10
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = p2movetype != H && p2movetype != I
triggerall = p2stateno != [150,155]
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = P2bodydist X = [0,90]
trigger2 = ctrl
trigger2 = random <= 200
trigger2 = P2bodydist X = [-20,50]
trigger3 = ctrl
trigger3 = p2statetype != A
trigger3 = p2movetype = A
trigger3 = random <= 200
trigger3 = P2bodydist X = [-30,60]

;ソウルデストラクション
[State -1]
type = ChangeState
value = 30080
triggerall = var(30)
triggerall = palno = 10
triggerall = roundstate = 2
triggerall = power >= 4000
triggerall = numhelper(6400000)
triggerall = helper(6400000),var(1) < 3
triggerall = enemynear,hitdefattr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT,AA,AT,AP
trigger1 = statetype != A
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = p2bodydist X = [-50,50]
trigger1 = p2movetype != H
trigger1 = enemy,alive

[State -1];瞬獄殺
type = ChangeState
value = 10000
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = p2movetype != H && p2movetype != I
triggerall = p2statetype != L
triggerall = p2stateno != [150,155]
triggerall = Power >= 5000
trigger1 = ctrl
trigger1 = life <= lifemax/2
trigger1 = random <= 300
trigger1 = enemy,alive
trigger1 = p2bodydist X = [-50,100]
trigger2 = ctrl
trigger2 = life <= lifemax/2
trigger2 = life >= 100
trigger2 = enemy,life >=lifemax*0.8
trigger2 = var(54) > 4500
trigger2 = random <= 350
trigger3 = ctrl
trigger3 = var(54) = [650,2600]
trigger3 = enemy,life >= enemy,lifemax
trigger3 = random <= 400
trigger4 = ctrl
trigger4 = enemy,life>=enemy,lifemax*0.8
trigger4 = random = [501,800]

[State -3]
type = ChangeState
value = 200
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = P2BodyDist X = [0,50]
trigger1 = Ctrl        = 1
trigger1 = Random <= 120

[State -3]
type = ChangeState
value = 205
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2statetype != L
triggerall = p2BodyDist X = [0,50]
trigger1 = ctrl
trigger1 = P2bodydist Y > -80
trigger1 = P2bodydist Y != 0
trigger1 = p2stateno != [150,153]

[State -3]
type = ChangeState
value = 210
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = P2BodyDist X = [0,50]
trigger1 = Ctrl        = 1
trigger1 = Random <= 140

[State -3]
type = ChangeState
value = 215
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2bodydist X = [-5,55]
trigger1 = p2movetype != A
trigger1 = random < 150

[State -3]
type = ChangeState
value = 230
triggerall = palno = 10
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2life > 0
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-140,-40]
triggerall = statetype != A
trigger1 = ctrl = 1
trigger1 = Random <= 290

[State -3]
type = ChangeState
value = 240
triggerall = var(30)
triggerall = palno = 10
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2bodydist X = [-5,55]
trigger1 = p2movetype != A
trigger1 = random <= 90
trigger2 = P2bodydist X = [40,80]
trigger2 = p2movetype = H
trigger2 = random < 999
trigger2 = stateno = 430

[State -3]
type = ChangeState
value = 400
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = stateno != 101
trigger1 = statetype = C
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = p2bodydist X < 20
trigger2 = stateno = 200
trigger2 = p2bodydist X = [-5,25]
trigger2 = Random = [480,630]
trigger3 = stateno = 400
trigger3 = p2bodydist X = [-5,25]
trigger3 = Random = [150,350]
trigger4 = stateno = 52

[State -3]
type = ChangeState
value = 410
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-5,50]
trigger1 = p2stateno != [150,153]
trigger1 = Random < 230

[State -3]
type = ChangeState
value = 430
triggerall = palno = 10
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-40,40]
trigger1 = P2bodydist Y = 0
trigger1 = p2stateno != [152,153]
trigger1 = Random < 800
trigger2 = P2statetype != A && p2statetype != L
trigger2 = P2bodydist X = [-40,40]
trigger2 = stateno = 430&&movecontact >= 1
trigger2 = p2movetype = H
trigger2 = P2bodydist Y = 0
trigger2 = p2stateno != [152,153]
trigger2 = Random < 800

[State -3]
type = ChangeState
value = 440
triggerall = palno = 10
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-5,70]
trigger1 = p2stateno != [150,153]
trigger1 = Random < 240

[State -1,]
type = ChangeState
value = 610
triggerall = palno = 10
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X = [-5,70]
trigger1 = P2bodydist Y = [-80,0]

[State -1,]
type = ChangeState
value = 640
triggerall = palno = 10
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]

[State -1]
type = ChangeState
value = 690
triggerall = palno = 10
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]
trigger1 = p2statetype = A
trigger1 = p2movetype = H
trigger1 = random < 150

;地上リフレクト
[State -3]
type = ChangeState
value = 1200
triggerall = roundstate = 2
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype != A
triggerall = p2bodydist x = [0,50]
trigger1 = p2movetype = A
trigger1 = ctrl
trigger1 = random <= 400

;対空リフレクト
[State -3]
type = ChangeState
value = 1201
triggerall = roundstate = 2
triggerall = palno = 10
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype != A
triggerall = p2bodydist x = [0,50]
triggerall = p2bodydist y = [-140,-40]
trigger1 = p2movetype = A
trigger1 = ctrl
trigger1 = random <= 450

;立ちガード
[State -3]
type = ChangeState
value = 130
triggerall = palno = 10
triggerall = var(30)
triggerall = Alive = 1
triggerall = roundstate = 2
triggerall = p2statetype != C
triggerall = enemynear,hitdefattr = C, NA, SA, HA, NP, SP, HP
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = inguarddist
trigger1 = p2movetype = A
trigger2 = enemynear,movetype = A
trigger3 = stateno = [100,101]
trigger4 = enemy,numproj >= 1
trigger5 = enemynear,numproj >= 1

;ジャンプ
[State -3]
type = ChangeState
value = 40
triggerall = palno = 10
triggerall = roundstate = 2
triggerall = var(30)
triggerall = StateType != A
triggerall = Ctrl
trigger1 = random < 300
trigger1 = p2bodydist X = [-40,40]
trigger1 = p2bodydist Y < -80
trigger1 = movetype = I
trigger2 = stateno = [100,101]
trigger2 = random < 300
trigger2 = p2bodydist X = [80,120]
trigger2 = p2bodydist Y = 0
trigger2 = movetype = I

;ダッシュ
[State -3]
type = ChangeState
value = 100
triggerall = var(30)
triggerall = palno = 10
triggerall = EnemyNear,StateType != L
triggerall = EnemyNear,MoveType = I
triggerall = StateType != A
triggerall = roundstate = 2
triggerall = ctrl
trigger1 = p2bodydist X < 200
trigger1 = random < 80

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;7pから9pまで
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[State -1];ニュークリアー・レイジエーション
type = ChangeState
value = 10150
triggerall = var(30) = 1
triggerall = palno = [7,9]
triggerall = power >= 2000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = numhelper(6400000)
triggerall = enemy,life != lifemax
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 150
trigger2 = life >= lifemax/2
trigger2 = p2bodydist X = [60,200]
trigger2 = p2movetype != A
trigger2 = p2movetype != H
trigger2 = ctrl
trigger2 = random <= 200
trigger3 = life >= lifemax/2
trigger3 = P2bodydist X = [-200,-60]
trigger3 = p2movetype != A
trigger3 = p2movetype != H
trigger3 = ctrl
trigger3 = random <= 200

;カオティック・フレア
[State -1]
type = ChangeState
value = 2300
triggerall = palno = [7,9]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = power >= 6000
triggerall = enemy,alive
triggerall = statetype != A
triggerall = random <= 300
triggerall = roundstate = 2
triggerall = numhelper(6400000)
triggerall = ctrl = 1
trigger1 = Var(33) = 3
trigger2 = Var(33) = 4
trigger3 = Var(33) = 5

[State -1];瞬獄殺
type = ChangeState
value = IfElse((Random < 500),10000,23100)
triggerall = palno = [7,9]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = power >= 3000
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = p2movetype != H && p2movetype != I
triggerall = p2stateno != [150,155]
triggerall = random <= 200
trigger1 = ctrl
trigger1 = P2bodydist X = [0,90]
trigger2 = ctrl
trigger2 = P2bodydist X = [-20,50]
trigger3 = ctrl
trigger3 = p2statetype != A
trigger3 = p2movetype = A
trigger3 = p2bodydist X = [-30,60]

[State -1];髑髏柱
type = ChangeState
value = 1450
triggerall = var(30) = 1
triggerall = palno = [7,9]
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = p2bodydist X > 100-40
trigger1 = random <= 220
trigger2 = ctrl
trigger2 = p2movetype = A
trigger2 = p2bodydist X = [-30,30]
trigger2 = random <= 220
trigger3 = ctrl
trigger3 = p2movetype = A
trigger3 = p2bodydist X = [0,30]
trigger3 = random <= 220
trigger4 = ctrl
trigger4 = p2bodydist X > 100-40
trigger4 = random <= 250
trigger4 = Time = 60 || Time = 120 || Time = 180 || Time = 240 || Time = 300 || Time = 360 || Time = 400 || Time = 440

[State -1];血の贖罪
type = ChangeState
value = IfElse((Random < 600),11000,11220)
triggerall = var(30)
triggerall = roundstate = 2
triggerall = palno = [7,9]
triggerall = power >= 2000
triggerall = statetype != A
triggerall = enemy,life !=enemy,lifemax
triggerall = enemy,life != 0
triggerall = numhelper(6400000)
trigger1 = life >= lifemax/4
trigger1 = ctrl
trigger1 = power >= 2000
trigger1 = power <= 4999
trigger1 = enemy,life >= lifemax/2
trigger1 = P2bodydist Y >= -50
trigger1 = random <= 70
trigger2 = ctrl
trigger2 = enemy,life >= lifemax/2
trigger2 = random <= 120
trigger3 = ctrl
trigger3 = power >= 2000
trigger3 = power <= 5000
trigger3 = var(54) <= 1200
trigger3 = random <= 200

[State -1];グラビティースフィア
type = ChangeState
value = IfElse((Random < 600),1800,1810)
triggerall = palno = [7,9]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X   >= 80
trigger1 = ctrl
trigger1 = random <= 150

[State -1];オロチ飛び道具2
type = ChangeState
value = 11610
triggerall = palno = [7,9]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 50
trigger1 = random <= 200

[State -1];フォール
type = ChangeState
value = 11670
triggerall = var(30) = 1
triggerall = palno = [7,9]
triggerall = roundstate = 2
triggerall = alive = 1
triggerall = numhelper(11680) = 0
triggerall = numhelper(116800) = 0
triggerall = statetype != A
trigger1 = ctrl
trigger1 = life > lifemax/4
trigger1 = random <= 200
trigger2 = ctrl
trigger2 = random <= 200

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = [7,10]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = H
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = random <= 360

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = [7,10]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = P2stateno = [150,153]
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = random <= 460

;ディメンション・ホール
[State -3]
Type = ChangeState
Value = 1950
triggerall = palno = [7,10]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2movetype = A
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = random <= 140

;ディメンション・ホール
[State -3]
type = ChangeState
value = 1950
triggerall = palno = [7,10]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = backEdgeDist <= 90
trigger1 = Ctrl = 1
trigger1 = random <= 190

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,10]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-90,0]
trigger1 = Ctrl        = 1
trigger1 = random <= 120

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,10]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=20
triggerall = Ctrl = 1
trigger1 = random <= (50+(p2bodydist X >= 180)*120)
trigger2 = random <= 100

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno = [7,10]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A && EnemyNear,time >= 12
trigger1 = Ctrl        = 1
trigger1 = random <= 100

[State -1];オロチ飛び道具
type = ChangeState
value = 1050
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = numhelper(1050) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = random <= 150

[State -1];オロチ飛び道具3
type = ChangeState
value = 3001
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = StateType != A
triggerall = ctrl = 1
trigger1 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
trigger1 = EnemyNear,MoveType = A
trigger1 = InGuardDist
trigger1 = EnemyNear,HitDefAttr = SCA,NP,SP,HP,NA,SA,HA
trigger1 = P2MoveType = A
trigger1 = random <= 640
trigger2 = p2bodydist x  >= 30
trigger2 = random <= 150

[State -1];エクスプロージョンスフィアΩ
type = ChangeState
value = 1700
triggerall = palno = [7,9]
triggerall = numHelper(1720) <= 0
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X >= 50
trigger1 = ctrl
trigger1 = random <= 150

[State -1];ヘル・パニシュ
type = ChangeState
value = 1100
triggerall = palno = [7,9]
triggerall = var(30)
triggerall = random <= 200
triggerall = statetype != A
triggerall = P2BodyDist X > 50
triggerall = P2BodyDist X <= 120
trigger1 = ctrl

[State -1];フォトンスフィア
type = ChangeState
value = 11101
triggerall = palno = [7,9]
triggerall = var(30)
triggerall = numhelper(11100) = 0
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X >= 50
trigger1 = random <= 300
trigger2 = stateno = 220 && animelemtime(4) > 0
trigger3 = stateno = 240 && animelemtime(10) > 0
trigger4 = stateno = 410 && animelemtime(7) > 0

[State -1];フォトンスフィア2
type = ChangeState
value = 11500
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = numhelper(11500) = 0
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = random <= 60

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno = [7,9]
triggerall = numhelper(12310) = 0
triggerall = Alive   = 1
triggerall = roundstate = 2
triggerall = var(30) = 1
triggerall = p2bodydist X >= 50
triggerall = statetype != A
triggerall = random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = random <= 250

;紋章
[State -1]
type = ChangeState
value = 18100
triggerall = palno = [7,9]
triggerall = numhelper(18102) = 0
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power >= 0
triggerall = numhelper(6400000)
trigger1 = statetype  = S
trigger1   = Ctrl = 1
trigger1 = random <= 150
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1250
triggerall = palno = [7,9]
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,240]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = random <= 350

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = random <= 200
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno = [7,9]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Ctrl = 1
triggerall = random<=990-((enemynear,statetype=C)*850)
trigger1 = random <= 105

[State -3]
type = ChangeState
value = 25555
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,60]
trigger1 = Ctrl        = 1
trigger1 = random <= 100

[State -3]
type = ChangeState
value = 25555
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-130,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = random <= 800

[State -3]
type = ChangeState
value = 25555
triggerall = palno = [7,9]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = random <= 990

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;1pから6pまで
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------

;カオティック・フレア
[State -1]
type = ChangeState
value = 2300
triggerall = palno != [7,12]
triggerall = random <= 100
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = power >=5000+((var(40)=[1,2])*1000)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl = 1
triggerall = enemy,alive
trigger1 = var(40)=1&&random<=50||var(40)=2&&random<=100
trigger2 = var(40)=3&&Random<=20+((enemy,numhelper>=3&&enemy,movetype=A&&enemy,life<enemy,lifemax)*300)
trigger3 = var(40)=3&&(enemy,life<enemy,lifemax||enemy,life>=enemy,lifemax&&((var(54)=[0,500])||(var(54)=[1800,2000])||(var(54)=[4000,4200])||(var(54)= [5000,5200])))
trigger4 = var(40)=3&&life<=lifemax/4&&enemynear,movetype=A&&enemynear,HitDefAttr=SCA,NA,SA,HA,NT,ST,HT,NP,SP,HP&&Random<=500

;デッドリーレイブ
[State -1]
type = ChangeState
value = 10000
triggerall = var(40)=[1,5]
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = power >= 5000
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = p2movetype != H && p2movetype != I
triggerall = p2stateno != [150,155]
triggerall = random <= 100
trigger1 = ctrl
trigger1 = random <= 200
trigger1 = P2bodydist X = [0,90]
trigger2 = ctrl
trigger2 = random <= 400
trigger2 = P2bodydist X = [-20,50]
trigger3 = ctrl
trigger3 = p2statetype != A
trigger3 = p2movetype = A
trigger3 = random <= 400
trigger3 = P2bodydist X = [-30,60]

;ソウルデストラクション
[State -3]
type = ChangeState
value = 19600
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = power >= 3000-((var(40)=3)*1000)
triggerall = var(40)= [0,4]
triggerall = p2bodydist Y >= 0 
triggerall = p2bodydist X = [-5,70]
triggerall = p2statetype != A
triggerall = p2statetype != L
trigger1 = ctrl
trigger1 = var(40)=1&&random<=250||var(40)=2&&random<=375||var(40)=3&&random<=500
trigger1 = enemy,alive

[State -3]
type =  null;ChangeState
value =1007000
triggerall = var(40)=[3,5]
triggerall = palno != [7,12]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = power >= 3000
triggerall = statetype != A
triggerall = ctrl = 1
triggerall = roundstate = 2
trigger1 = life < lifemax*0.2
trigger2 = life < lifemax*0.1
trigger2 = random < 200
trigger3 = life < lifemax*0.02
trigger3 = random < 150

;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 3000
triggerall = palno != [7,12]
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2bodydist X >= 150
triggerall = p2movetype = A
triggerall = Power >= 2000-((var(40)=3)*1000)
triggerall = p2life > 0
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=150||var(40)=2&&random<=260||var(40)=3&&random<=450

;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 3000
triggerall = var(30)
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = power >= 2000-((var(40)=3)*1000)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = enemy,life != lifemax
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = var(40)=1&&random<=50||var(40)=2&&random<=130||var(40)=3&&random<=200

[State -1];ニュークリアー・レイジエーション
type = ChangeState
value = 10150
triggerall = var(30)
triggerall = var(40)=[1,4]
triggerall = palno != [7,12]
triggerall = power >= 2000-((var(40)=3)*1000)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = life >= lifemax/2
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = random <= 200

[State -3]
type = ChangeState
value = 1450
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = p2bodydist X >= 150-((var(40)=2)*50)-((var(40)=3)*50)
trigger1 = ctrl = 1
trigger1 = var(40)=1&&random<=10||var(40)=2&&random<=50||var(40)=3&&random<=150

[State -3]
type = ChangeState
value = 1050
triggerall = var(40)=[1,3]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = p2bodydist X   >= 80-((var(40)=3)*50)
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = numhelper(1050) = 0||var(40)=3
trigger1 = Ctrl        = 1
trigger1 = Random <= ((var(40)=[2,3])*10)+5+((var(40)=3)*30)

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = var(40)=[1,3]
triggerall = palno!= [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-80,0]
trigger1 = Ctrl        = 1
trigger1 = var(40)=1&&random<=10||var(40)=2&&random<=50||var(40)=3&&random<=130

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=50
triggerall = Ctrl = 1
trigger1 = ((var(40)=[2,3])*(20+((var(40)=3)*10)))+20+((p2bodydist X >= 180)*120)
trigger1 = var(40)=1&&random<=10||var(40)=2&&random<=55||var(40)=3&&random<=130

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=10||var(40)=2&&random<=40||var(40)=3&&random<=120

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1250
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,150]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = var(40)=1&&random<=150||var(40)=2&&random<=350||var(40)=3&&random<=500

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,100]
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = var(40)=1&&random<=50||var(40)=2&&random<=150||var(40)=3&&random<=300
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,100]
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*850)
trigger1 = var(40)=1&&random<=20||var(40)=2&&random<=70||var(40)=3&&random<=105

[State -1]
type = ChangeState
value = ifelse((var(40)=3),1040,1200)
triggerall = var(40)=[1,3]
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = p2statetype != L
triggerall = p2movetype != H && p2movetype != I
triggerall = p2stateno != [150,155]
trigger1 = ctrl
trigger1 = var(40)=1&&random<=70||var(40)=2&&random<=130||var(40)=3&&random<=180
trigger1 = P2bodydist X = [0,70]
trigger2 = ctrl
trigger2 = var(40)=1&&random<=80||var(40)=2&&random<=210||var(40)=3&&random<=290
trigger2 = P2bodydist X = [-20,50]
trigger3 = ctrl
trigger3 = p2statetype != A
trigger3 = p2movetype = A
trigger3 = var(40)=1&&random<=90||var(40)=2&&random<=210||var(40)=3&&random<=300
trigger3 = P2bodydist X = [-20,60]

[State -3]
type = ChangeState
value = 25555
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,30]
trigger1 = Ctrl        = 1
trigger1 = Random <= 100

[State -3]
type = ChangeState
value = 25555
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,30]
triggerall = P2BodyDist Y = [-110,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = var(40)=1&&random<=200||var(40)=2&&random<=400||var(40)=3&&random<=600

[State -3]
type = ChangeState
value = 25555
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = var(40)=1&&random<=250||var(40)=2&&random<=395||var(40)=3&&random<=695

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = var(40)=[0,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = H
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=45||var(40)=2&&random<=95||var(40)=3&&random<=120

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = P2stateno = [150,153]
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=45||var(40)=2&&random<=95||var(40)=3&&random<=145

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = P2BodyDist X >= 55
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=60||var(40)=2&&random<=230||var(40)=3&&random<=250

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2movetype = A
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=60||var(40)=2&&random<=135||var(40)=3&&random<=215

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = backedgedist <= 90
trigger1 = Ctrl = 1
trigger1 = var(40)=1&&random<=60||var(40)=2&&random<=235||var(40)=3&&random<=295

;投げ
[State -3]
type = ChangeState
value = 800
triggerall = var(40)=[1,3]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2life > 0
triggerall = P2stateno != [150,153]
triggerall = P2BodyDist X = [0,25]
triggerall = p2statetype != A && p2statetype != L
triggerall = p2movetype != H || EnemyNear,Ctrl = 0
triggerall = Ctrl = 1
triggerall = var(40)=3&&Random<=990-((enemynear,statetype=C)*900)
trigger1 = Random <= (IfElse((EnemyNear,Ctrl = 0),200+((var(40)=[2,3])*500),30)) + ((var(40)=3)*10)

[State -3]
type = ChangeState
value = 200
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = P2BodyDist X = [0,50]
trigger1 = Ctrl        = 1
trigger1 = Random <= 250

[State -3]
type = ChangeState
value = 205
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = statetype != A
trigger1 = p2dist X <= 50
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = p2bodydist Y > -80
trigger1 = p2bodydist Y != 0
trigger1 = p2stateno != [150,153]

[State -3]
type = ChangeState
value = 210
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = Alive = 1
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = enemy,alive
trigger1 = ctrl
trigger1 = p2bodydist X = [0,50]
trigger1 = p2movetype != A
trigger1 = p2movetype != H
trigger1 = var(40)=1&&random<=50||var(40)=2&&random<=150||var(40)=3&&random<=250

[State -3]
type = ChangeState
value = 230
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2life > 0
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-140,-40]
triggerall = statetype != A
trigger1 = ctrl = 1
trigger1 = Random <= 290

[State -3]
type = ChangeState
value = 240
triggerall = var(40)=[1,3]
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2bodydist X = [-5,45]
trigger1 = p2movetype != A
trigger1 = random <= 250
trigger2 = P2bodydist X = [40,80]
trigger2 = p2movetype = H
trigger2 = random < 999
trigger2 = stateno = 430

;しゃがみ弱攻撃
[State -3]
type = ChangeState
value = 400
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = stateno != 101
trigger1 = statetype = C
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = p2bodydist X < 20
trigger2 = stateno = 200
trigger2 = p2bodydist X = [-5,21]
trigger2 = Random = [480,630]
trigger3 = stateno = 400
trigger3 = p2bodydist X = [-5,21]
trigger3 = Random = [150,350]
trigger4 = stateno = 52

;しゃがみ弱キック
[State -3]
type = ChangeState
value = 430
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-40,40]
trigger1 = P2bodydist Y = 0
trigger1 = p2stateno != [152,153]
trigger1 = Random < 999
trigger2 = P2statetype != A && p2statetype != L
trigger2 = P2bodydist X = [-40,40]
trigger2 = stateno = 430 && movecontact >= 1
trigger2 = p2movetype = H
trigger2 = P2bodydist Y = 0
trigger2 = p2stateno != [152,153]
trigger2 = Random < 999

;しゃがみ強キック
[State -3]
type = ChangeState
value = 440
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = ctrl
trigger1 = P2statetype != A && p2statetype != L
trigger1 = P2bodydist X = [-5,70]
trigger1 = p2stateno != [150,153]
trigger1 = Random < 120

;空中強パンチ
[State -1,]
type = ChangeState
value = 610
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X = [-5,70]
trigger1 = P2bodydist Y = [-80,0]

;空中強キック
[State -1,]
type = ChangeState
value = 640
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = p2statetype != L
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]

;空中ふっ飛ばし攻撃
[State -1]
type = ChangeState
value = 690
triggerall = var(40)=[1,3]
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]
trigger1 = p2statetype = A
trigger1 = p2movetype = H
trigger1 = random < 50

[State -3]
type = ChangeState
value = 702
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = random <= 200
triggerall = life > 0
triggerall = roundstate = 2
triggerall = Alive
trigger1 = stateno = 5050
trigger1 = pos y >=-40

[State -3]
type = ChangeState
value = 5210
triggerall = roundstate = 2
triggerall = var(30) > 0
triggerall = alive
triggerall = canrecover
triggerall = vel Y > -1
triggerall = stateno = 5050
trigger1 = random <= 200

[State -3]
type = changestate
value = 120
triggerall = var(40)=[0,3]
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = var(30) > 0
triggerall = statetype  != A
triggerall = ctrl
triggerall = IfElse(facing*(enemynear(floor(fvar(0))),facing)*p2dist x >0,(Abs(p2dist x) <= 60),1)
triggerall = random<=var(30)*100
trigger1 = inguarddist|| (facing*(enemynear(floor(fvar(0))),facing)*p2dist x >0 && p2movetype = A)
trigger1 = enemynear(floor(fvar(0))),hitdefattr = sc,na,sa,ha,np,sp,hp || enemynear(floor(fvar(0))),hitdefattr = a,na,sa,ha,np,sp,hp
trigger2 = inguarddist|| facing*(enemynear(floor(fvar(0))),facing)*p2dist x >0 
trigger2 = enemy,numproj > 0
trigger3 = enemynear(floor(fvar(0))),hitdefattr = sc,na,sa,ha,np,sp,hp || enemynear(floor(fvar(0))),hitdefattr = a,na,sa,ha,np,sp,hp
trigger3 = p2bodydist x < 0
trigger4 = enemynear(floor(fvar(0))),Vel x > 0
trigger4 = enemynear(floor(fvar(0))),hitdefattr = sc,na,sa,ha,np,sp,hp || enemynear(floor(fvar(0))),hitdefattr = a,na,sa,ha,np,sp,hp
trigger5 = enemy,numhelper
trigger5 = inguarddist

;---------------------------------------------------------------------------------
;格闘モード
;---------------------------------------------------------------------------------
[State -3]
type = ChangeState
value = 1045
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = p2statetype  != L
triggerall = P2BodyDist X = [0,50]
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 250

[State -3]
type = ChangeState
value = 205
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype  != L
trigger1 = p2dist X <= 50
trigger1 = ctrl
trigger1 = p2bodydist Y > -80
trigger1 = p2bodydist Y != 0
trigger1 = p2stateno != [150,153]

[State -3]
type = ChangeState
value = 230
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = P2statetype = A
triggerall = p2statetype  != L
triggerall = P2BodyDist X = [0,60]
triggerall = p2BodyDist Y = [0,-75]
triggerall = statetype != A
trigger1 = ctrl = 1
trigger1 = random <= 290

[State -3]
type = ChangeState
value = 240
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype  != L
triggerall = p2BodyDist Y = [0,-60]
trigger1 = ctrl
trigger1 = P2bodydist X = [-5,45]
trigger1 = p2movetype != A
trigger1 = random <= 250
trigger2 = P2bodydist X = [40,80]
trigger2 = p2movetype = H
trigger2 = random < 999
trigger2 = stateno = 430

;しゃがみ弱攻撃
[State -3]
type = ChangeState
value = 400
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = stateno != 101
triggerall = p2statetype  != L
trigger1 = statetype = C
trigger1   = Ctrl = 1
trigger1 = Random <= 300
trigger1 = p2bodydist X < 20
trigger2 = stateno = 200
trigger2 = p2bodydist X = [-5,21]
trigger2 = Random = [480,630]
trigger3 = stateno = 400
trigger3 = p2bodydist X = [-5,21]
trigger3 = Random = [150,350]
trigger4 = stateno = 52

;しゃがみ強キック
[State -3]
type = ChangeState
value = 440
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = var(54) > 0
triggerall = var(54) < 100
triggerall = p2statetype != A && p2statetype != L
trigger1 = statetype = C
trigger1 = ctrl
trigger1 = p2bodydist X = [0,100]
trigger1 = p2stateno != [150,153]
trigger1 = random < 999

;空中強パンチ
[State -1,]
type = ChangeState
value = 610
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2statetype  != L
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X = [-5,70]
trigger1 = P2bodydist Y = [-80,0]

;空中強キック
[State -1,]
type = ChangeState
value = 640
triggerall = var(40) = 0
triggerall = palno != [7,12]
triggerall = var(30) = 1
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = p2statetype  != L
trigger1 = statetype = A
trigger1 = stateno != 106
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]

;空中ふっ飛ばし攻撃
[State -1]
type = ChangeState
value = 690
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2statetype  != L
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = vel Y > 0
trigger1 = P2bodydist X < 70
trigger1 = P2bodydist Y = [0,70]
trigger1 = p2statetype = A
trigger1 = p2movetype = H
trigger1 = var(40)=0&&random < 50

;リフレクト
[State -3]
type = ChangeState
value = 1200
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype  = A
triggerall = p2movetype = H
triggerall = p2statetype  != L
triggerall = P2BodyDist X = [0,60]
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 200

;対空リフレクト
[State -3]
type = ChangeState
value = 1201
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype  = A
triggerall = p2movetype = H
triggerall = p2statetype  != L
triggerall = p2BodyDist X = [0,65]
triggerall = p2BodyDist Y = [-101,-120]
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 160

[State -3]
type = ChangeState
value = 1030
triggerall = var(30) = 1
triggerall = power >= 1000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype != A
triggerall = p2statetype != L
triggerall = movehit
triggerall = p2bodydist Y >= 0 
triggerall = p2bodyDist X = [0,40]
trigger1 = var(40)=0&&random <= 200

[State -3]
type = ChangeState
value = 1049
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype != L
triggerall = p2movetype != H
triggerall = p2stateno != [150,155]
trigger1 = ctrl
trigger1 = var(40)=0&&random<=120
trigger1 = p2bodydist X = [0,100]

[State -3]
type = ChangeState
value = 12300
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2bodydist X >= 30
triggerall = enemy,alive
triggerall = numhelper(12310) = 0
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 5

[State -3]
type = ChangeState
value = 1050
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype = L
triggerall = p2bodydist X >= 60
triggerall = p2StateNo = 5110
triggerall = enemy,alive
triggerall = numhelper(1065) = 0
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 60

[State -3]
type = ChangeState
value = 1050
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2bodydist X >= 60
triggerall = enemy,alive
triggerall = numhelper(1065) = 0
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random <= 10

;投げ
[State -3]
type = ChangeState
value = 800
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype != A && p2statetype != L
triggerall = p2movetype != H || enemynear,ctrl = 0
triggerall = Ctrl = 1
trigger1 = p2bodydist X < 15
trigger1 = var(40)=0&&random<=350

;ソウルデストラクション起き攻め
[State -3]
type = ChangeState
value = 19600
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = power >= 2000
triggerall = p2bodydist Y >= 0 
triggerall = p2bodydist X = [0,150]
triggerall = p2StateNo = 5110
triggerall = p2statetype  != A
triggerall = p2statetype = L
triggerall = p2movetype = A
triggerall = enemy,alive
trigger1 = var(40)=0&&random<=999

;ソウルデストラクション
[State -3]
type = ChangeState
value = 19600
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = power >= 2000
triggerall = p2bodydist Y >= 0 
triggerall = p2bodydist X = [0,150]
triggerall = p2statetype  != A && p2statetype  != L
triggerall = p2movetype = A
triggerall = enemy,alive
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random<=300
trigger2 = ctrl && prevstateno = 5120 && time <= 1

;バックステップ
[State -3]
type = ChangeState
value = 105
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = ctrl || stateno = 20 || stateno = 21 || (stateno = 52 && time >= 3)
triggerall = p2statetype = L
triggerall = p2BodyDist X <= 30
trigger1 = ctrl = 1
trigger1 = var(40)=0&&random<=100
;---------------------------------------------------------------------------------
;弾幕モード
;---------------------------------------------------------------------------------
;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 3000
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2bodydist X >= 150
triggerall = p2movetype = A
triggerall = Power >= 1000
triggerall = p2life > 0
trigger1 = Ctrl = 1
trigger1 = var(40)=4&&random<=450

;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 3000
triggerall = var(30)
triggerall = palno != [7,12]
triggerall = power >= 1000
triggerall = roundstate = 2
triggerall = statetype != A
trigger1 = enemy,life != lifemax
trigger1 = P2bodydist X = [60,150]
trigger1 = p2movetype != A
trigger1 = ctrl
trigger1 = var(40)=4&&random<=200

[State -1];オロチ飛び道具2
type = ChangeState
value = 11610
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 100
trigger1 = var(40)=4&&random<=150

[State -1];オロチ飛び道具4
type = ChangeState
value = 11650
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 100
trigger1 = var(40)=4&&random<=150

[State -1];オロチ飛び道具5
type = ChangeState
value = 11700
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 100
trigger1 = var(40)=4&&random<=150

[State -1];フォール
type = ChangeState
value = 11670
triggerall = var(30) = 1
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(37) = 1
triggerall = numhelper(11680) = 0
triggerall = numhelper(116800) = 0
triggerall = statetype != A
trigger1 = ctrl
trigger1 = life > lifemax/4
trigger1 = var(40)=4&&random<=150
trigger2 = ctrl
trigger2 = var(37) = 1
trigger2 = var(40)=4&&random<=150

[State -1];オロチ飛び道具
type = ChangeState
value = 1050
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = numhelper(1050) = 0
triggerall = p2bodydist X   >= 100
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = var(40)=4&&random<=120

[State -1];オロチ飛び道具3
type = ChangeState
value = 3001
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = p2bodydist X   >= 100
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = var(40)=4&&random<=100

[State -1];オロチ飛び道具3
type = ChangeState
value = 3001
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30)
triggerall = numhelper(3002) = 0
triggerall = StateType != A
triggerall = Ctrl = 1
triggerall = P2StateType != C
trigger1 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
trigger1 = EnemyNear,MoveType = A
trigger1 = InGuardDist
trigger1 = EnemyNear,HitDefAttr = SCA,NP,SP,HP,NA,SA,HA
trigger1 = P2MoveType = A
trigger1 = var(40)=4&&random<=650

[State -1];エクスプロージョンスフィアΩ
type = ChangeState
value = 1700
triggerall = palno != [7,12]
triggerall = numHelper(1720) <= 0
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X >= 100
trigger1 = ctrl
trigger1 = var(40)=4&&random<=120

[State -1];フォトンスフィア
type = ChangeState
value = 11101
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = numhelper(11100) = 0
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X >= 100
trigger1 = var(40)=4&&random<=120

[State -1];フォトンスフィア2
type = ChangeState
value = 11500
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = numhelper(11500) = 0
triggerall = enemy,alive
trigger1 = ctrl  = 1
trigger1 = var(40)=4&&random<=100

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno != [7,12]
triggerall = numhelper(12310) = 0
triggerall = Alive   = 1
triggerall = roundstate = 2
triggerall = var(30) = 1
triggerall = p2bodydist X >= 100
triggerall = statetype != A
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = var(40)=4&&random<=250

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno != [7,12]
triggerall = numhelper(12310) = 0
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2bodydist X >= 100
triggerall = statetype != A
triggerall = enemy,alive
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1 = var(40)=4&&random<=250

;紋章
[State -1]
type = ChangeState
value = 18100
triggerall = palno != [7,12]
triggerall = numhelper(18102) = 0
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power >= 0
trigger1 = statetype  = S
trigger1   = Ctrl = 1
trigger1 = var(40)=4&&random<=200
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1250
triggerall = palno != [7,12]
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,240]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = var(40)=4&&random<=400

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = var(40)=4&&random<=300
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*850)
trigger1 = var(40)=4&&random<=105

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,60]
trigger1 = Ctrl        = 1
trigger1 = var(40)=4&&random<=100

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-130,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = var(40)=4&&random<=800

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = var(40)=4&&random<=990

[State -3]
type = ChangeState
value = 1450
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = p2bodydist X >= 100
trigger1 = ctrl = 1
trigger1 = var(40)=4&&random<=150

[State -1];グラビティースフィア
type = ChangeState
value = IfElse((Random < 600),1800,1810)
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X   >= 100
trigger1 = ctrl
trigger1 = var(40)=4&&random<=150

;投げ
[State -3]
type = ChangeState
value = 800
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype != A && p2statetype != L
triggerall = p2movetype != H || enemynear,ctrl = 0
triggerall = Ctrl = 1
trigger1 = p2bodydist X < 15
trigger1 = var(40)=4&&random<=999

[State -3]
type = ChangeState
value = 701
triggerall = var(40)=4
triggerall = ctrl
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = var(30)
triggerall = backedgebodydist > 40
triggerall = stateno != [150,153]
trigger1 = p2bodydist X = [60,120]
trigger2 = enemynear,movetype = H
trigger2 = p2bodydist X = [60,180]

;---------------------------------------------------------------------------------
;神モード
;---------------------------------------------------------------------------------

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = H
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=120

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = P2stateno = [150,153]
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=145

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = P2BodyDist X >= 55
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=250

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2movetype = A
triggerall = P2BodyDist X >= 80
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=215

;ディメンション・ホール
[State -3]
type = ChangeState
value = 25000
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = backedgedist <= 90
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=295

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno!= [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = H
triggerall = P2BodyDist Y = [-80,0]
trigger1 = Ctrl        = 1
trigger1 = var(40)=5&&random<=130

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X >=50
triggerall = Ctrl = 1
trigger1 = 50+((p2bodydist X >= 180)*120)
trigger1 = var(40)=5&&random<=130

;バニシング・ラッシュ
[State -3]
type = ChangeState
value = 22115
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2bodydist X = [0,120]
triggerall = p2statetype = C && p2movetype = A
trigger1 = Ctrl = 1
trigger1 = var(40)=5&&random<=120

[State -1];オロチ飛び道具2
type = ChangeState
value = 11610
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 100
trigger1 = var(40)=5&&random<=150

[State -1];オロチ飛び道具4
type = ChangeState
value = 11650
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X  >= 100
trigger1 = var(40)=5&&random<=150

[State -1];オロチ飛び道具
type = ChangeState
value = 1050
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = numhelper(1050) = 0
triggerall = p2bodydist X   >= 30
triggerall = statetype  != A
triggerall = enemy,alive
trigger1 = Ctrl        = 1
trigger1 = var(40)=5&&random<=120

[State -1];エクスプロージョンスフィアΩ
type = ChangeState
value = 1700
triggerall = palno != [7,12]
triggerall = numHelper(1720) <= 0
triggerall = var(30)
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = p2bodydist X >= 70
trigger1 = ctrl
trigger1 = var(40)=5&&random<=120

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno != [7,12]
triggerall = numhelper(12310) = 0
triggerall = Alive   = 1
triggerall = roundstate = 2
triggerall = var(30) = 1
triggerall = p2bodydist X >= 100
triggerall = statetype != A
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = var(40)=5&&random<=250

;マグネティックスフィア
[State -3]
type = ChangeState
value = 12300
triggerall = palno != [7,12]
triggerall = numhelper(12310) = 0
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = p2bodydist X   >= 30
triggerall = statetype != A
triggerall = enemy,alive
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1 = var(40)=5&&random<=250

;紋章
[State -1]
type = ChangeState
value = 18100
triggerall = palno != [7,12]
triggerall = numhelper(18102) = 0
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = Power >= 0
trigger1 = statetype  = S
trigger1 = ctrl
triggerall = p2bodydist X   >= 70
trigger1 = var(40)=5&&random<=200
trigger1 = p2movetype = I

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1250
triggerall = palno != [7,12]
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = enemy,alive
triggerall = P2BodyDist X = [0,240]
triggerall = p2movetype = H
trigger1 = Ctrl = 0
trigger1 = stateno = 1260 && animelem = 4,>=0
trigger1 = var(40)=5&&random<=400

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Random<=990-((enemynear,statetype=C)*950)
trigger1   = Ctrl = 1
trigger1 = var(40)=5&&random<=300
trigger1 = RoundState = 2

;エクスプローディングスフィア
[State -3]
type = ChangeState
value = 1260
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = enemy,alive
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,190]
triggerall = Ctrl = 1
triggerall = Random<=990-((enemynear,statetype=C)*850)
trigger1 = var(40)=5&&random<=105

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = statetype  != A
triggerall = enemy,alive
triggerall = p2movetype = A
triggerall = P2BodyDist X = [0,60]
trigger1 = Ctrl        = 1
trigger1 = var(40)=5&&random<=100

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = P2statetype = A
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-130,0]
triggerall = statetype != A
trigger1 = ctrl
trigger1 = var(40)=5&&random<=800

[State -3]
type = ChangeState
value = 25555
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = StateType != A
trigger1 = Ctrl = 1
trigger1 = EnemyNear,MoveType = A
trigger1 = EnemyNear,HitDefAttr = SCA,NT,ST,HT
trigger1 = P2BodyDist X = [0,40]
trigger1 = P2BodyDist Y = [-40,0]
trigger1 = var(40)=5&&random<=990

[State -3]
type = ChangeState
value = 1450
triggerall = palno != [7,12]
triggerall = Alive   = 1
triggerall = var(30) = 1
triggerall = enemy,alive
triggerall = statetype  != A
triggerall = p2bodydist X   >= 50
trigger1 = ctrl = 1
trigger1 = var(40)=5&&random<=250

[State -1];フォトンスフィア
type = ChangeState
value = 11101
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = numhelper(11100) = 0
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl
triggerall = p2bodydist X   >= 30
trigger1 = var(40)=5&&random<=150

;投げ
[State -3]
type = ChangeState
value = 800
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = p2statetype != A && p2statetype != L
triggerall = p2movetype != H || enemynear,ctrl = 0
triggerall = Ctrl = 1
trigger1 = p2bodydist X < 15
trigger1 = var(40)=5&&random<=150

;地上リフレクト
[State -3]
type = ChangeState
value = 1200
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype != A
triggerall = p2movetype = A
triggerall = p2bodydist X = [0,50]
trigger1 = ctrl = 1
trigger1 = random <= 190

;地上リフレクト
[State -3]
type = ChangeState
value = 1200
triggerall = roundstate = 2 && var(40)=5
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = StateType != A
triggerall = p2statetype = C
triggerall = p2movetype = A && EnemyNear,HitDefAttr=C,NA
triggerall = P2BodyDist X = [0,120]
trigger1 = ctrl = 1
trigger1 = random <= 850

;神に挑むとは無謀
[State -1]
type = ChangeState
value = 11000
triggerall = palno != [7,12]
triggerall = var(30)
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = var(54) > 3500
triggerall = var(54) < 5000
trigger1 = p2name != "New_Shiki_Nanaya" || p4name != "New_Shiki_Nanaya"
trigger1 = power >= 4000
trigger1 = ctrl
trigger1 = p2bodydist X = [-120,120]
trigger1 = var(40)=5&&random <= 999

;ユニバース・ディストーションΩ
[State -1]
type = ChangeState
value = 23100
triggerall = palno != [7,12]
triggerall = alive   = 1
triggerall = var(30) = 1
triggerall = power >= 3000
triggerall = statetype != A
triggerall = roundstate = 2
triggerall = ctrl = 1
triggerall = enemy,life !=enemy,lifemax
trigger1 = ctrl
trigger1 = var(40)=5&&random <= 200
trigger1 = life >= 101
trigger1 = Var(33) = 3
trigger2 = ctrl
trigger2 = var(40)=5&&random <= 200
trigger2 = life >= 101
trigger2 = Var(33) = 4
trigger3 = ctrl
trigger3 = Var(33) = 5
trigger3 = var(40)=5&&random <= 200

;カオティック・フレア
[State -1]
type = ChangeState
value = 2300
triggerall = palno != [7,12]
triggerall = roundstate = 2
triggerall = Alive = 1
triggerall = var(30) = 1
triggerall = statetype != A
triggerall = power >=6000
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = ctrl = 1
triggerall = enemy,alive
trigger1 = var(40)=5&&Random<=20+((enemy,numhelper>=3&&enemy,movetype=A&&enemy,life<enemy,lifemax)*300)
trigger2 = var(40)=5&&(enemy,life<enemy,lifemax||enemy,life>=enemy,lifemax&&((var(54)=[0,500])||(var(54)=[1800,2000])||(var(54)=[4000,4200])||(var(54)= [5000,5200])))
trigger3 = var(40)=5&&life<=lifemax/4&&enemynear,movetype=A&&enemynear,HitDefAttr=SCA,NA,SA,HA,NT,ST,HT,NP,SP,HP&&Random<=500


;===============================================================================


;=================================================================================
;=================================================================================
;=================================================================================
;=================================================================================
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 45, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

[State 45, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State 105, 2]
type = CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 47

[State 106, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_UP
[Statedef 110]
type    = S
physics = N

[State 110, 0]
type = CtrlSet
trigger1 = Time = 0
value = 0

[State 110, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 110

[State 110, 3]
type = VelSet
trigger1 = Time = 0
x = 0
z = -7

[State 110, 4]
type = VelMul
trigger1 = 1
z = 0.8

[State 110, 5]
type = VelSet
trigger1 = AnimTime = -8
z = 0

[State 110, 7]
type = CtrlSet
trigger1 = AnimTime = 0
value = 1

[State 110, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; RUN_DOWN
[Statedef 115]
type    = S
physics = N

[State 115, 0]
type = CtrlSet
trigger1 = Time = 0
value = 0

[State 115, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 110

[State 115, 3]
type = VelSet
trigger1 = Time = 0
x = 0
z = 7

[State 115, 4]
type = VelMul
trigger1 = 1
z = 0.8

[State 115, 5]
type = VelSet
trigger1 = AnimTime = -8
z = 0

[State 115, 7]
type = CtrlSet
trigger1 = AnimTime = 0
value = 1

[State 115, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 120 + (statetype = C) + (statetype = A)*2

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131
value = 131

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132
value = 132

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 151, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 151, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 152, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 152, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 153, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 153, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = -1

;---------------------------------------------------------------------------
; DRAWGAME (Time over)
[Statedef 175]
type = S
ctrl = 0
velset = 0,0

[State 175, 1] ; If no anim, use go to lose state.
type = ChangeState
trigger1 = Time = 0
trigger1 = !SelfAnimExist(175)
value = 170

[State 175, 2]
type = ChangeAnim
trigger1 = Time = 0
value = 175

[State 175, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 190, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(190)
value = 190

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191

;---------------------------------------------------------------------------
; INTRO (override this state to give character an intro)
[Statedef 191]
type = S
ctrl = 0

[State 191, 1]
type = ChangeState
trigger1 = Time = 0
value = 0

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type    = S
movetype= H
physics = S

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5011 ;HITC_SLIDE

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type    = C
movetype= H
physics = C

[State 5011, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5011, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5025 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5011, 6]
type = ChangeState
trigger1 = HitOver
value = 11
ctrl = 1


;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type    = A
movetype= H
physics = N

[State 5040, 1]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5070, 1]
type = ChangeAnim 
trigger1 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 5071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5081 ;HITL_SLIDE

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type    = L
movetype= H
physics = C

[State 5081, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5081, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5081, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5081, 4]
type = ChangeState
trigger1 = HitOver
value = 5110 ;HIT_LIEDOWN

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type    = A
movetype= H
physics = N

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = A
movetype= H
physics = A
anim = 5200

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
x = -.15
y = -3.5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 4]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5210, 1]
type = PosFreeze
trigger1 = Time = 0
value = 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
x = .8
y = .8

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
y = -4.5

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
trigger1 = Vel Y > 0
y = .5

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -3
y = -2

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = -2

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = 1.5

[State 5210, 2] ;Go fwd
type = VelMul
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = 1

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = -1

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
y = .35

[State 5210, 5] ;Land on ground
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMP_LAND
ctrl = 1

;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
type = S
ctrl = 0
anim = 5300
velset = 0,0

[State 5500, 1] ;Use continue animation if available
type = ChangeAnim
trigger1 = time = 0
trigger1 = SelfAnimExist(5500)
value = 5500

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900, 3] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190
;-----------------------------------------------------------------------------

[Statedef 1301]
movetype = A
anim  = 1200
ctrl = 0
velset = 0
[State 1301]
type = VelSet
trigger1 = 1
x = 0
y = 0
ignorehitpause = 1

[State 1301]
type = PlaySnd
trigger1 = animelem = 5
value = s1300,0
channel = 6
Persistent = 2

[State 1301]
type = PlaySnd
trigger1 = animelem = 5
value = s2000,5
channel = 7
Persistent = 1

[state 1301]
type = changestate
trigger1 = animtime = 0
trigger1 = pos Y >= 0
value = 0
ctrl = 1
[state 1301]
type = changestate
trigger1 = animtime = 0
trigger1 = pos Y < 0
trigger1 = var(11) = 0
value = 650
ctrl = 1
[State 1301]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = pos Y < 0
trigger1 = var(11) > 0
value = 71
ctrl = 1

[State 1301]
type = helper
trigger1 = !numhelper(1506)
trigger1 = time > 23
trigger1 = time <= 34
id = 1506
name = "Hitdef"
pos = 55,-80
postype = p1
stateno = 1506
helpertype = player
keyctrl = 0
ownpal = 0
ignorehitpause = 1

[State 1301];55,-95
type = Projectile
trigger1 = time > 23
trigger1 = time <= 34
Projanim = 22216
Velocity = 0,0
Projremove = 0
Projremovetime = 1
Projepriority = 99999999
Projespriority = 99999999
postype = p1
offset = 55,-95
attr = S, SA
animtype = light
damage = Ceil(0.005 * enemy,Const(data.life)),Ceil(0.001 * enemy,Const(data.life)) * var(39)
priority  = 7
guardflag = M
pausetime = 1,10
priority = 7
hitflag = MAFDP
guard.pausetime = 1,4
guard.velocity = 0
sparkxy = ceil((p2dist X)-50), ceil((p2dist Y)-1)
sparkno = s22215
guard.sparkno = s22113
hitsound = S220,1
guardsound = S120, 0
sprpriority = 2
ground.slidetime = 18
ground.hittime = 1
ground.velocity = -1,-10
air.velocity = -1,-10
guard.velocity = -3
fall = 1
fall.recover = 0
sprpriority = 3
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22214
ID = 10000
scale = 1,1
postype = p1
pos = 55,-95
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10001
scale = 0.2,0.7
postype = p1
pos = 45,-95
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10002
scale = 0.15,0.5
postype = p1
pos = 65,-95
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1

[State 1301];30,-125
type = Projectile
trigger1 = time > 23
trigger1 = time <= 34
Projanim = 22216
Velocity = 0,0
Projremove = 0
Projremovetime = 1
Projepriority = 99999999
Projespriority = 99999999
postype = p1
offset = 30,-125
attr = S, SA
animtype = light
damage = Ceil(0.005 * enemy,Const(data.life)),Ceil(0.001 * enemy,Const(data.life)) * var(39)
priority  = 7
guardflag = M
pausetime = 1,10
priority = 7
hitflag = MAFDP
guard.pausetime = 1,4
guard.velocity = 0
sparkxy = ceil((p2dist X)-50), ceil((p2dist Y)-1)
sparkno = s22215
guard.sparkno = s22113
hitsound = S220,1
guardsound = S120, 0
sprpriority = 2
ground.slidetime = 18
ground.hittime = 1
ground.velocity = -1,-10
air.velocity = -1,-10
guard.velocity = -3
fall = 1
fall.recover = 0
sprpriority = 3

[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22214
ID = 10003
scale = 1,1
postype = p1
pos = 30,-125
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10004
scale = 0.2,0.7
postype = p1
pos = 20,-125
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10005
scale = 0.15,0.5
postype = p1
pos = 40,-125
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10006
scale = 0.15,0.5
postype = p1
pos = 60,-125
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1

[State 1301];30,-55
type = Projectile
trigger1 = time > 23
trigger1 = time <= 34
Projanim = 22216
Velocity = 0,0
Projremove = 0
Projremovetime = 1
Projepriority = 99999999
Projespriority = 99999999
postype = p1
offset = 30,-55
attr = S, SA
animtype = light
damage = Ceil(0.005 * enemy,Const(data.life)),Ceil(0.001 * enemy,Const(data.life)) * var(39)
priority  = 7
guardflag = M
pausetime = 1,10
priority = 7
hitflag = MAFDP
guard.pausetime = 1,4
guard.velocity = 0
sparkxy = ceil((p2dist X)-50), ceil((p2dist Y)-1)
sparkno = s22215
guard.sparkno = s22113
hitsound = S220,1
guardsound = S120, 0
sprpriority = 2
ground.slidetime = 18
ground.hittime = 1
ground.velocity = -1,-10
air.velocity = -1,-10
guard.velocity = -3
fall = 1
fall.recover = 0
sprpriority = 3
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22214
ID = 10007
scale = 1,1
postype = p1
pos = 30,-55
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10008
scale = 0.2,0.7
postype = p1
pos = 20,-55
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10009
scale = 0.15,0.5
postype = p1
pos = 40,-55
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10010
scale = 0.15,0.5
postype = p1
pos = 60,-55
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1

[State 1301];90,-160
type = Projectile
trigger1 = time > 23
trigger1 = time <= 34
Projanim = 22216
Velocity = 0,0
Projremove = 0
Projremovetime = 1
Projepriority = 99999999
Projespriority = 99999999
postype = p1
offset = 90,-160
attr = S, SA
animtype = light
damage = Ceil(0.005 * enemy,Const(data.life)),Ceil(0.001 * enemy,Const(data.life)) * var(39)
priority  = 7
guardflag = M
pausetime = 1,10
priority = 7
hitflag = MAFDP
guard.pausetime = 1,4
guard.velocity = 0
sparkxy = ceil((p2dist X)-50), ceil((p2dist Y)-1)
sparkno = s22215
guard.sparkno = s22113
hitsound = S220,1
guardsound = S120, 0
sprpriority = 2
ground.slidetime = 18
ground.hittime = 1
ground.velocity = -1,-10
air.velocity = -1,-10
guard.velocity = -3
fall = 1
fall.recover = 0
sprpriority = 3
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22214
ID = 10011
scale = 1,1
postype = p1
pos = 90,-160
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10012
scale = 0.2,0.7
postype = p1
pos = 80,-160
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10013
scale = 0.15,0.5
postype = p1
pos = 100,-160
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10014
scale = 0.15,0.5
postype = p1
pos = 120,-160
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1

[State 1301];90,-10
type = Projectile
trigger1 = time > 23
trigger1 = time <= 34
Projanim = 22216
Velocity = 0,0
Projremove = 0
Projremovetime = 1
Projepriority = 99999999
Projespriority = 99999999
postype = p1
offset = 90,-10
attr = S, SA
animtype = light
damage = Ceil(0.005 * enemy,Const(data.life)),Ceil(0.001 * enemy,Const(data.life)) * var(39)
priority  = 7
guardflag = M
pausetime = 1,10
priority = 7
hitflag = MAFDP
guard.pausetime = 1,4
guard.velocity = 0
sparkxy = ceil((p2dist X)-50), ceil((p2dist Y)-1)
sparkno = s22215
guard.sparkno = s22113
hitsound = S220,1
guardsound = S120, 0
sprpriority = 2
ground.slidetime = 18
ground.hittime = 1
ground.velocity = -1,-10
air.velocity = -1,-10
guard.velocity = -3
fall = 1
fall.recover = 0
sprpriority = 3
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22214
ID = 10015
scale = 1,1
postype = p1
pos = 90,-10
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10016
scale = 0.2,0.7
postype = p1
pos = 80,-10
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10017
scale = 0.15,0.5
postype = p1
pos = 100,-10
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1
[State 1100, wind]
type = Explod
trigger1 = animelem = 5
anim = 22213
ID = 10018
scale = 0.15,0.5
postype = p1
pos = 120,-10
bindtime = 1
sprpriority = 3
supermove = 0
ownpal = 1
removeongethit = 1

[State 1301]
type = PlaySnd
trigger1 = projcontact(22214) = 1
value = 220,1
channel = 5
Persistent = 1


[Statedef 1506]
type = A
movetype = A
physics = N
anim = 22217
velset = 0
sprpriority = 3

[State 1]
type = AttackDist
trigger1 = 1
value = 0
ignorehitpause = 1

[state 1]
type = hitdef
triggerall = ishelper
trigger1 = 1
damage = 1
attr = A,AA
hitflag = MAFPD
sparkno = -1
hitsound = -1
ground.type = none
air.type = none
getpower = 0,0
givepower = 0,0
ignorehitpause = 1

[state 1]
type = destroyself
trigger1 = root,stateno = 1301 && root,time > 34
trigger2 = root,stateno != 1301
ignorehitpause = 1

;===============================================================================


[Statedef 7700000]
type=A
physics=N
ctrl=0

[State 77, nhb]
type=nothitby
trigger1= 1
value=SCA
time=-1
ignorehitpause=1

[State 77, noshadow]
type=assertspecial
trigger1=1
flag=noshadow

[State 77, bind]
type=bindtoroot
trigger1=1
pos = (5.5*sin(gametime*0.09))*ifelse(ishelper(2011),1,1),(5.5*cos(gametime*0.09))*ifelse(ishelper(2011),1,1)
facing=1

[State 77, trans]
type=angledraw
trigger1= 1
scale= 1

[State 77, trans]
type=angledraw
trigger1= root,stateno=4010
scale= 1

[State 77, trans]
type=trans
trigger1= 1
trans=addalpha
alpha= 185,250
ignorehitpause=1

[State 77, anim]
type=changeanim
trigger1=selfanimexist(root,anim)
value=(root,anim)
elem=(root,animelemno(0))

[State 77, spr]
type=sprpriority
trigger1= 0
value=20

[State 77, end]
type=destroyself
trigger1= root,stateno=194 && root,animelemtime(2)<0

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

[Statedef 7800000]
type=A
physics=N
ctrl=0

[State 77, nhb]
type=nothitby
trigger1= 1
value=SCA
time=-1
ignorehitpause=1

[State 77, noshadow]
type=assertspecial
trigger1=1
flag=noshadow

[State 77, bind]
type=bindtoroot
trigger1=1
pos = (5.5*sin(gametime*0.09))*ifelse(ishelper(2011),1,-1),(5.5*cos(gametime*0.09))*ifelse(ishelper(2011),1,-1)
facing=1

[State 77, trans]
type=angledraw
trigger1= 1
scale= 1

[State 77, trans]
type=angledraw
trigger1= root,stateno=4010
scale= 1

[State 77, trans]
type=trans
trigger1= 1
trans=addalpha
alpha= 185,250
ignorehitpause=1

[State 77, anim]
type=changeanim
trigger1=selfanimexist(root,anim)
value=(root,anim)
elem=(root,animelemno(0))

[State 77, spr]
type=sprpriority
trigger1= 0
value=20

[State 77, end]
type=destroyself
trigger1= root,stateno=194 && root,animelemtime(2)<0

;========================================================================
;========================================================================
