;------------------------------------------------------------------
;Shiki 311: Saku Tsumagushi
[Statedef 3000]
type=S
movetype=A
physics=N
anim=3000
poweradd=-1000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3000, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=50
[State 3000, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3000, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3000, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3000, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3000, SuperPause FX]
type=Helper
trigger1=!time
helperType=Normal
stateNo=8500
ID=8500
name="Superpause FX"
posType=P1
pos=37,-52
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3000, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=50
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,0
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(2)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Animelem = 2
value = S0,7
volume = 255
channel = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem =3||animelem=4||animelem=5||animelem=6
x = 12

[State 3000, End]
type=ChangeState
trigger1=!AnimTime
value=3001
ctrl=1
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3001]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 1410

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo=3000&&!Time
x = 5
y = -5.4

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1000, End]
type=changestate
trigger1= !animtime
value=3002
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3002]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 1420

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1000, End]
type=changestate
trigger1= !animtime
value=3003
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3003]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 3001

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1500, VarSet]
type = VarSet
trigger1 =1 
var(33)=0
ignorehitpause =1

[State 210, Hit]
type=HitDef
trigger1 = !Time
attr=A, HA              
priority=4 ,Hit   
damage = 30, 10
ID = 1300*!var(20)
getpower=20 * !var(20), 0
givepower=30, 30
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = HA
hitflag = MAF
priority= 4,Hit
pausetime =1,14
sparkno=-1
guard.pausetime = Ifelse(var(20), 5, 10), Ifelse(var(20), 5, 10)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-78
hitsound=s800, 0
guardsound=s130,1
ground.type = Low
ground.slidetime = 17
ground.hittime = 17
guard.hittime = 17
guard.slidetime = 17
guard.ctrltime = 28
ground.velocity = 0
guard.velocity=0
air.type = High
air.velocity = -4.6,-6.5
air.hittime = 13
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
fall=0
air.fall=1
air.fall.recover=0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.cornerpush.veloff = 0
kill=0
p1stateno=3005

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 3004
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3004]
type=S
physics=S
movetype=I
ctrl=0
sprpriority=1
anim = 3002
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8106
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Flames"
ID = 1405
stateno = 1405
pos = 45,-20
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 1000, End]
type=changestate
trigger1= !animtime
value=0
ctrl = 1
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3005]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 3001

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.8

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3007
ignorehitpause = 1

[State 0, TargetBind]
type = TargetBind
trigger1 = 1
time = 1
pos = 60,-97
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 3006
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3006]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=1
anim = 3003

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3008

[State 3120, EnvShake]
type = EnvShake
trigger1 = AnimElem=2
time = 15
freq = 60
ampl = -6
phase = 90

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8106
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Flames"
ID = 1405
stateno = 1405
pos = 45,-20
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 0, Width]
type = Width
trigger1 = statetype=S
edge = 0,30

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 7
value = S0,56
volume = 255
channel = 0

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(2)<0
pos = 76,-62
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(2)>=0 &&animelemtime(3)<0
pos = 26,-5
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(3)>=0 &&animelemtime(4)<0
pos = 34,-4
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(4)>=0 &&animelemtime(6)<0
pos = 32,-8
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(6)>=0 &&animelemtime(7)<0
pos = 26,-24
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(7)>=0 &&animelemtime(8)<0
pos = 31,-89
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(8)>=0 &&animelemtime(9)<0
trigger2 = AnimElemTime(14)>=0 &&animelemtime(15)<0
trigger3 = AnimElemTime(20)>=0 &&animelemtime(21)<0
pos = 41,-141
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(9)>=0 &&animelemtime(10)<0
trigger2 = AnimElemTime(15)>=0 &&animelemtime(16)<0
pos = 18,-149
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(10)>=0 &&animelemtime(11)<0
trigger2 = AnimElemTime(16)>=0 &&animelemtime(17)<0
pos = -28,-135
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(11)>=0 &&animelemtime(12)<0
trigger2 = AnimElemTime(17)>=0 &&animelemtime(18)<0
pos = -30,-124
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(12)>=0 &&animelemtime(13)<0
trigger2 = AnimElemTime(18)>=0 &&animelemtime(19)<0
pos = -10,-107
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(13)>=0 &&animelemtime(14)<0
trigger2 = AnimElemTime(19)>=0 &&animelemtime(20)<0
pos = 13,-107
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(21)=1
pos = 69,-24
time = 1

[State 1100, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(8) = 1
StateType = A
physics = N

[State 1100, VelSet]
type = VelSet
trigger1 = AnimElemTime(8) = 1
y = -5.5

[State 1100, VelAdd]
type = Veladd
trigger1 =  AnimElemTime(20) >= 0
y = .45

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .6

[State 1100, flames]
type = helper
trigger1= animelemtime(20)>0 &&!numhelper(7180)
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 21
value = floor(-60*fvar(10)); like this fvar(10) is the damage dampener var 
absolute = 1
kill = 0

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 22
trigger2 = AnimElem = 23
value = -60
absolute = 1
kill = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(20)> 0 && animelemtime(21)<4
anim = 6130
ID = 6130
pos = 30+random%120,-120+random%60
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7
ontop = 1

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElemTime (20) = 1
trigger2 = AnimElemTime (21) = 1
trigger3 = AnimElemTime (22) = 1
value = S0,42
volume = 255

[State 3120, HitAdd]
type = HitAdd
trigger1 = AnimElemTime (20) = 1
trigger2 = AnimElemTime (21) = 1
trigger3 = AnimElemTime (22) = 1
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 52
;------------------------------------------------------------------
;Saku Tsumagushi-P2
[Statedef 3007]
type = A
movetype = H
physics = N
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 3330, Turn]
type = Turn
trigger1 = enemynear,facing!=facing&&!Time
ignorehitpause = 1

[State 3130, SprPriority]
type = SprPriority
trigger1 = !Time
value = 2
ignorehitpause = 1

[State 3130, ChangeAnim2]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim != 3004
value = 3004
ignorehitpause = 1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
ignorehitpause = 1
;------------------------------------------------------------------
;Saku Tsumagushi-P2
[Statedef 3008]
type = A
movetype = H
physics = N
velset = 0,0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Animelem=2
statetype = L

[State 3330, Turn]
type = Turn
trigger1 = animelem = 6

[State 3130, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3130, ChangeAnim2]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim != 3005
value = 3005

[State 3130, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 6
statetype = A

[State 3130, SprPriority]
type = SprPriority
trigger1 = Time = 42
trigger2 = Time = 54
value = -1

[State 3130, SprPriority]
type = SprPriority
trigger1 = !Time
trigger2 = Time = 48
trigger3 = Time = 60
value = 2

[State 3130, VelSet]
type = VelSet
trigger1 = AnimElemTime(11)=2 
x = -8
y = -3



[State 3130, VelAdd]
type = VelAdd
trigger1 = AnimElemTime (11) > 0 
y = .5

[State 3130, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 3020, PalFX]
type = PalFX
trigger1 = AnimElem=11
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -4

[State 1380, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;MAX Shiki 311: Saku Tsumagushi
[Statedef 3050]
type=S
movetype=A
physics=N
anim=3000
poweradd=-2000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3050, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3050, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3050, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3050, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3050, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3050, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3050, Enemy Pos Y Reset]
type=VarSet
trigger1=!time
fvar(6)=0

[State 3050, SuperPause FX]
type=Helper
trigger1=animelem=1
helperType=Normal
stateNo=8510
ID=8510
name="Superpause FX"
posType=P1
pos=37,-52
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3050, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,1
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(2)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Animelem = 2
value = S0,7
volume = 255
channel = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem =3||animelem=4||animelem=5||animelem=6
x = 12

[State 3000, End]
type=ChangeState
trigger1=!AnimTime
value=3051
ctrl=1
;------------------------------------------------------------------
;MAX Saku Tsumagushi
[Statedef 3051]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 1410

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo=3050&&!Time
x = 10
y = -5.4

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1000, End]
type=changestate
trigger1= !animtime
value=3052
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3052]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 1420

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1000, End]
type=changestate
trigger1= !animtime
value=3053
;------------------------------------------------------------------
;Max Saku Tsumagushi
[Statedef 3053]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 3001

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.5

[State 1500, VarSet]
type = VarSet
trigger1 =1 
var(33)=0
ignorehitpause =1

[State 210, Hit]
type=HitDef
trigger1 = !Time
attr=A, HA              
priority=4 ,Hit   
damage = 30, 10
ID = 1300*!var(20)
getpower=0
givepower=30, 30
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = HA
hitflag = MAF
priority= 4,Hit
pausetime =1,14
sparkno=-1
guard.pausetime = Ifelse(var(20), 5, 10), Ifelse(var(20), 5, 10)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-78
hitsound=s800, 0
guardsound=s130,1
ground.type = Low
ground.slidetime = 17
ground.hittime = 17
guard.hittime = 17
guard.slidetime = 17
guard.ctrltime = 28
ground.velocity = 0
guard.velocity=0
air.type = High
air.velocity = -4.6,-6.5
air.hittime = 13
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
fall=0
air.fall=1
air.fall.recover=0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.cornerpush.veloff = 0
kill=0
p1stateno=3055

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 3054
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3054]
type=S
physics=S
movetype=I
ctrl=0
sprpriority=1
anim = 3002
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8106
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Flames"
ID = 1405
stateno = 1405
pos = 45,-20
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 1000, End]
type=changestate
trigger1= !animtime
value=0
ctrl = 1
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3055]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=1
anim = 3001

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y =.8

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3007
ignorehitpause = 1

[State 0, TargetBind]
type = TargetBind
trigger1 = 1
time = 1
pos = 60,-97
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 3056
;------------------------------------------------------------------
;Saku Tsumagushi
[Statedef 3056]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=1
anim = 3006

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3008

[State 3120, EnvShake]
type = EnvShake
trigger1 = AnimElem=2
time = 15
freq = 60
ampl = -6
phase = 90

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8106
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Flames"
ID = 1405
stateno = 1405
pos = 45,-20
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 0, Width]
type = Width
trigger1 = statetype=S
edge = 0,30

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(2)<0
pos = 76,-62
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(2)>=0 &&animelemtime(3)<0
pos = 26,-5
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(3)>=0 &&animelemtime(4)<0
pos = 34,-4
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(4)>=0 &&animelemtime(6)<0
pos = 32,-8
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(6)>=0 &&animelemtime(7)<0
pos = 26,-24
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(7)>=0 &&animelemtime(8)<0
pos = 31,-89
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(8)>=0 &&animelemtime(9)<0
trigger2 = AnimElemTime(14)>=0 &&animelemtime(15)<0
trigger3 = AnimElemTime(20)>=0 &&animelemtime(21)<0
pos = 41,-141
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(9)>=0 &&animelemtime(10)<0
trigger2 = AnimElemTime(15)>=0 &&animelemtime(16)<0
pos = 18,-149
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(10)>=0 &&animelemtime(11)<0
trigger2 = AnimElemTime(16)>=0 &&animelemtime(17)<0
pos = -28,-135
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(11)>=0 &&animelemtime(12)<0
trigger2 = AnimElemTime(17)>=0 &&animelemtime(18)<0
pos = -30,-124
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(12)>=0 &&animelemtime(13)<0
trigger2 = AnimElemTime(18)>=0 &&animelemtime(19)<0
pos = -10,-107
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(13)>=0 &&animelemtime(14)<0
trigger2 = AnimElemTime(19)>=0 &&animelemtime(20)<0
pos = 13,-107
time = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(21)>=0 &&animelemtime(29)<0
pos = 60,0
time = 1

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 7
value = S0,56
volume = 255
channel = 0

[State 1100, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(8) = 1
StateType = A
physics = N

[State 1100, VelSet]
type = VelSet
trigger1 = AnimElemTime(8) = 1
y = -5.5

[State 1100, VelSet]
type = VelSet
trigger1 = AnimElemTime(21) = 1
y = -1.5

[State 1100, VelAdd]
type = Veladd
trigger1 =  AnimElemTime(28) >= 0
y = .45

[State 1100, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .6

[State 1100, flames]
type = helper
trigger1= animelemtime(20)>0 &&!numhelper(7180)
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 21
value = -90
absolute = 1
kill = 0

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 22
trigger2 = AnimElem = 23
value = -90
absolute = 1
kill = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(20)> 0 && animelemtime(21)<4
anim = 6130
ID = 6130
pos = 30+random%120,-120+random%60
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7
ontop = 1

[State 650, Hit]
type=HitDef
triggerall = p2statetype = A
trigger1=Animelem = 30
attr=A, NA
damage = 20, 4
animtype=Hard
guardflag=HA
hitflag=MAF
getpower=30 * !var(20), 0
givepower=30, 30
priority=4, Hit
pausetime = 4,8
sparkNo=-1 + 0 * (var(33) := 8013)
guard.sparkNo=-1 + 0 * (var(34) := 8000)
sparkXY=-10 + 0 * (var(35) := 80), var(36) := -54
hitsound=S2+10*var(44),5
guardsound=s130, 0
ground.type=High
ground.slidetime=12 + 4*var(9)
ground.hittime =12 + 4*var(9)
guard.hittime=18
ground.velocity=Ifelse(var(20),-2.5,-5)
guard.velocity=Ifelse(var(20),-2.5,-5)
air.type=High
airguard.ctrlTime=16
air.velocity =-10,10
airguard.velocity = -5.5, -1
ground.cornerPush.velOff = 0
guard.cornerPush.velOff = 0
air.cornerPush.velOff = 0
air.hittime = 120
airguard.ctrlTime = 16
yaccel = .58
fall = 1
air.fall=var(55)=2
fall.recover = 0
fall.recovertime = 120
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4
envshake.time = 12
envshake.ampl = Ifelse(random<=500,-4,4)
fall.envshake.time = 12
fall.envshake.ampl = Ifelse(random<=500,-5,5)

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElemTime (20) = 1
trigger2 = AnimElemTime (21) = 1
trigger3 = AnimElemTime (22) = 1
value = S0,42
volume = 255

[State 3120, HitAdd]
type = HitAdd
trigger1 = AnimElemTime (20) = 1
trigger2 = AnimElemTime (21) = 1
trigger3 = AnimElemTime (22) = 1
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 52
;------------------------------------------------------------------
;Shiki 1201: Ya Otome
[Statedef 3100]
type=S
movetype=A
physics=N
anim=Ifelse(Var(11),13100,3100)
poweradd=-1000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3000, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=50
[State 3000, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3000, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3000, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3000, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3000, SuperPause FX]
type=Helper
trigger1=!time
helperType=Normal
stateNo=8500
ID=8500
name="Superpause FX"
posType=P1
pos=Ifelse(Var(11),-12,0),Ifelse(Var(11),-63,-114)
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1

[State 3000, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=50
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,0
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(5)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, VelAdd]
type = VelSet
trigger1 = animelemtime(5)>=0 && animelemtime(8)<0 && !Var(11)
x = 8.5

[State 0, VelAdd]
type = VelSet
trigger1 = animelemtime(10)>=0 && animelemtime(13)<0 && Var(11)
x = 8.5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,28
volume = 255
channel = 0

[State 210, Hit]
type=hitdef
trigger1 = !Time
attr=A, HA
damage = 0,0
ID = 1300*!var(20)
getpower=20 * !var(20), 0
givepower=30, 30
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = 1,1
sparkno = -1
guard.pausetime = Ifelse(var(20), 5, 10), Ifelse(var(20), 5, 10)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-78
hitsound = -1
guardsound = s2,0
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = 0
guard.pausetime  = 2,2
guard.slidetime = 17
guard.hittime = 17
guard.ctrltime = 19
air.type = High
air.velocity = 0,0
air.hittime = 13
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
fall=0
air.fall=1
air.fall.recover=0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.cornerpush.veloff = 0
kill=0
p1stateno=3110

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8 && !Var(11)
movetype = I

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=13 && Var(11)
movetype = I

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(8)=0 && !Var(11)
x = 16.46875

[State -2, Vel]
type = VelSet
trigger1 = animelemtime(8) > 0  && !Var(11)
x = (7.470703125*exp((-0.0645)*(animelemtime(8)-1)))

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(13)=0 && Var(11)
x = 16.46875

[State -2, Vel]
type = VelSet
trigger1 = animelemtime(13) > 0  && Var(11)
x = (7.470703125*exp((-0.0645)*(animelemtime(13)-1)))

[State 1000, End]
type=changestate
trigger1= time = 70
value=0
ctrl=1
;------------------------------------------------------------------
;Ya Otome
[Statedef 3110]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=2
anim = Ifelse(Var(11),13101,3101)

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, TargetState]
type = TargetState
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
value = 3140

[State 1100, Helper]
type = Helper
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
helpertype = normal
name = "Slash Spark"
ID = 8015
stateno = 8015
pos = 1,-65
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .8
size.yscale = .8

[State 220, Blood]
type = helper
triggerall = Var(11) 
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
helpertype = normal
stateno = 8050
ID = 8050
name = "Blood"
postype = p2
pos = 0,-52
facing = -1
ownpal = 1
pausemovetime = 65535
supermovetime = 65535
ignorehitpause = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 15
trigger4 = animelem = 25
trigger5 = animelem = 32
trigger6 = animelem = 36
trigger7 = animelem = 46
value = -21
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
triggerall = !Var(11) 
trigger1 = animelem = 58
value = -63
kill = 1

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
triggerall = Var(11) 
trigger1 = animelem = 55
trigger2 = animelem = 57
trigger3 = animelem = 59
value = -8
kill = 0

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
triggerall = Var(11) 
trigger1 = AnimElem = 62
value = -63
kill = 1

[State 3120, HitAdd]
type = HitAdd
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 15
trigger4 = animelem = 25
trigger5 = animelem = 32
trigger6 = animelem = 36
trigger7 = animelem = 46
value = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
value = S2,12
volume = 255

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 10
value = S0,26
volume = 255
channel = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = !Var(11)
trigger1 = animelem = 56
value = S0,27
volume = 255

[State 0, PlaySnd]
type = PlaySnd
triggerall = !Var(11)
trigger1 = animelem = 52
value = S800,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
triggerall = !Var(11)
trigger1 = animelem = 58
value = S0,44
volume = 255

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(50)<0
pos = 55,0
time = 1

[State 0, TargetState]
type = TargetState
triggerall = !Var(11)
trigger1 = AnimElem = 50
value = 3145

[State 3120, TargetBind]
type = TargetBind
triggerall = !Var(11)
trigger1 = AnimElemTime(50)>=0 &&animelemtime(58)<0
pos = 36,0
time = 1

[State 0, TargetState]
type = TargetState
triggerall = Var(11)
trigger1 = AnimElem = 54
value = 3148

[State 1205, TargetBind]
type = TargetBind
triggerall = Var(11)
trigger1 = AnimElemTime(54)>=0 &&animelemtime(55)<0
pos = 77,-56
time = 1

[State 1205, TargetBind]
type = TargetBind
triggerall = Var(11)
trigger1 = AnimElemTime(55)>=0 &&animelemtime(56)<0
pos = 71,-9
time = 1

[State 1205, TargetBind]
type = TargetBind
triggerall = Var(11)
trigger1 = AnimElemTime(56)>=0 &&animelemtime(62)<0
pos = 70,-6
time = 1

[State 0, PosAdd]
type = PosAdd
triggerall = Var(11)
trigger1 = animelem = 51 || animelem = 52
x = 15

[State 1100, flames]
type = helper
triggerall = !Var(11)
trigger1= animelemtime(58)>0 &&!numhelper(7180)
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 1100, flames]
type = helper
triggerall = Var(11)
trigger1= animelemtime(62)>0 &&!numhelper(7180)
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 0, Explod]
type = Explod
triggerall = !Var(11)
trigger1 = AnimElemTime(58)=0
trigger2 = AnimElemTime(58)=2
anim = 6130
ID = 6130
pos = 30+random%50,-57-random%50
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(62)=0
anim = 6130
ID = 6130
pos = 71,-46
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(62)=2
anim = 6130
ID = 6131
pos = 99,-88
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(62)=4
anim = 6130
ID = 6132
pos = 97,-61
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7

[State 0, EnvShake]
type = EnvShake
triggerall = Var(11)
trigger1 = animelem = 55
trigger2 = animelem = 57
trigger3 = animelem = 59
time = 12
freq = 60
ampl = -3

[State 1120, Helper]
type = Helper
triggerall = Var(11)
trigger1 = animelem = 55
trigger2 = animelem = 57
trigger3 = animelem = 59
trigger4 = animelem = 62
helpertype=normal
stateno=8110
ID=8110
name="Impact Dust"
postype=p1
pos= 60,5
ownpal=1

[State 0, Explod]
type = Explod
trigger1 = animelemtime(55) >= 0 && animelemtime(59) <= 0 && timemod = 8,0 && Var(11)
anim = 8150
ID = 8150
pos = 0+random%-40,-10+(random%-20)
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
ownpal = 1
scale = .6,.6
sprpriority = 7
ontop = 1

[State 0, EnvShake]
type = EnvShake
triggerall = !Var(11)
trigger1 = animelem = 58
time = 15
freq = 75
ampl = -8

[State 0, TargetState]
type = TargetState
triggerall = !Var(11)
trigger1 = AnimElem = 58
value = 3146

[State 0, TargetState]
type = TargetState
triggerall = Var(11)
trigger1 = AnimElem = 62
value = 3149

[State 0, ChangeState]
type = ChangeState
triggerall = !Var(11)
trigger1= AnimElemTime(58)>4&&animelemtime(59)<6 && !winko&&power>=1000 && random<=500
triggerall = AILevel
value = 3200

[State 0, ChangeState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl = 1
;------------------------------------------------------------------
;Shiki 306: Saika
[Statedef 3200]
type=S
movetype=A
physics=N
anim=3102
poweradd=-1000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3000, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=50
[State 3000, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3000, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3000, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3000, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3000, SuperPause FX]
type=Helper
trigger1=!time
helperType=Normal
stateNo=8500
ID=8500
name="Superpause FX"
posType=P1
pos=-14,-96
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3000, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=50
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,0
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(5)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,35
volume = 255
channel = 0

[State 3100, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nojugglecheck

[State 210, 1]
type = HitDef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = !time
attr = S, HA
damage = 0
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAFD
priority = 4, Hit
pausetime = 0,26
sparkno = -1 + 0 * (var(33) := 8020)
sparkxy = -10 + 0 * (var(35) := 80), var(36) := -52
hitsound = s2,12
guard.sparkno = -1 + 0 * (var(34):=8061)
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = 0
air.type = High
air.velocity = -4,-7.77564102564102564102564102563869
air.hittime = 13
air.juggle = 8
getpower = 0,0
givepower = 16,16
kill = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
p1stateno=3210

[State 0, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;------------------------------------------------------------------
;Saika
[Statedef 3210]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=2
anim = 3103

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3270

[State 1100, Helper]
type = Helper
trigger1 = time = 36
trigger2 = time = 40
trigger3 = time = 46
trigger4 = time = 52
trigger5 = time = 62
helpertype = normal
name = "Slash Spark"
ID = 8020
stateno = 8020
pos = 1,-65
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 36
trigger2 = time = 40
trigger3 = time = 46
trigger4 = time = 52
trigger5 = time = 62
value = S2,12
channel = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 12
value = S0,5
volume = 255
channel = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = time = 36
trigger2 = time = 40
trigger3 = time = 46
trigger4 = time = 52
trigger5 = time = 62
value = -4
kill = 0

[State 3120, HitAdd]
type = HitAdd
trigger1 = time = 36
trigger2 = time = 40
trigger3 = time = 46
trigger4 = time = 52
trigger5 = time = 62
value = 1

[State 3000, EnvShake]
type = EnvShake
trigger1 = !time
trigger2 = time = 65
time = 20
freq = 180
ampl = -6

[State 1000, Yami Barai]
type=helper
trigger1= animelem=18
helpertype=normal
stateno=3105
ID=3105
name="Saika Pillar"
postype=p1
pos=50,10
ownpal=1
size.xscale=.5*const(size.xscale)
size.yscale=.5*const(size.yscale)

[State 0, PalFX]
type = PalFX
trigger1 = animelemtime(14)>0&&animelemtime(14)<=26
time = 2
mul = 256-((time-90)*9),256-((time-90)*9),256-((time-90)*9)

[State 0, PalFX]
type = PalFX
trigger1 = animelemtime(14)>26&&animelemTime(15)<0
time = 2
mul = 0,0,0

[State 0, ChangeState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl = 1
;------------------------------------------------------------------
;Ya Otome-P2
[Statedef 3140]
type = S
movetype = H
physics = N

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = IfElse(random>500,3230,3231)

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
;------------------------------------------------------------------
;Ya Otome-P2
[Statedef 3145]
type = S
movetype = H
physics = N

[State 0, Turn]
type = Turn
trigger1 = !Time && enemynear, facing = facing
ignorehitpause = 1

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3235

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
;------------------------------------------------------------------
;Ya Otome-P2
[Statedef 3146]
type = A
movetype = H
physics = N

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3236

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, VelSet]
type = VelSet
trigger1 = !Time && StateNo != 3160
x = -2.6
y = -7.6

[State 0, VelSet]
type = VelSet
trigger1 = !Time && StateNo = 3160
x = -7.6
y = -2.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -4

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
[Statedef 3148]
type = S
movetype = H
physics = N

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3320

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
;===========================.------------------------------------------.=============================
[Statedef 3149]
type = A
movetype = H
physics = N

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3330

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -3.6
y = -6.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -4

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;Max Ya Otome-P2
[Statedef 3147]
type = A
movetype = H
physics = N

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3236

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, VelSet]
type = VelSet
trigger1 = !Time 
x = -7.6
y = -4.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -4

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;MAX Shiki 1201: Ya Otome
[Statedef 3150]
type=S
movetype=A
physics=N
anim=3100
poweradd=-2000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3050, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3050, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3050, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3050, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3050, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3050, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3050, Enemy Pos Y Reset]
type=VarSet
trigger1=!time
fvar(6)=0

[State 3050, SuperPause FX]
type=Helper
trigger1=animelem=1
helperType=Normal
stateNo=8510
ID=8510
name="Superpause FX"
posType=P1
pos=0,-114
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3050, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,1
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(5)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, VelAdd]
type = VelSet
trigger1 = animelemtime(5)>=0 && animelemtime(8)<0
x = 8.5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,28
volume = 255
channel = 0

[State 210, Hit]
type=hitdef
trigger1 = !Time
attr=A, HA
damage = 0,0
ID = 1300*!var(20)
getpower=20 * !var(20), 0
givepower=30, 30
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = 1,1
sparkno = -1
guard.pausetime = Ifelse(var(20), 5, 10), Ifelse(var(20), 5, 10)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-78
hitsound = -1
guardsound = s2,0
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = 0
guard.pausetime  = 2,2
guard.slidetime = 17
guard.hittime = 17
guard.ctrltime = 19
air.type = High
air.velocity = 0,0
air.hittime = 13
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
fall=0
air.fall=1
air.fall.recover=0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.cornerpush.veloff = 0
kill=0
p1stateno=3160

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem=8
movetype = I

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(8)=0
x = 16.46875

[State -2, Vel]
type = VelSet
trigger1 = animelemtime(8) > 0
x = (7.470703125*exp((-0.0645)*(animelemtime(8)-1)))

[State 1000, End]
type=changestate
trigger1= time = 90
value=0
ctrl=1
;------------------------------------------------------------------
;Max Ya Otome
[Statedef 3160]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=2
anim = 3150

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 0, TargetState]
type = TargetState
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
value = 3140

[State 1100, Helper]
type = Helper
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
helpertype = normal
name = "Slash Spark"
ID = 8015
stateno = 8015
pos = 1,-65
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .8
size.yscale = .8

[State 220, Blood]
type = helper
triggerall = Var(11) 
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
helpertype = normal
stateno = 8050
ID = 8050
name = "Blood"
postype = p2
pos = 0,-52
facing = -1
ownpal = 1
pausemovetime = 65535
supermovetime = 65535
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 15
trigger2 = animelem = 17
trigger3 = animelem = 25
trigger4 = animelem = 27
trigger5 = animelem = 32
trigger6 = animelem = 34
trigger7 = animelem = 46
trigger8 = animelem = 48
anim = 8150
ID = 81510
pos = 1+random%10,-50-random%50
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = 7
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 15
trigger2 = animelem = 17
trigger3 = animelem = 25
trigger4 = animelem = 27
trigger5 = animelem = 32
trigger6 = animelem = 34
trigger7 = animelem = 46
trigger8 = animelem = 48
anim = 6130
ID = 6130
pos = 1+random%10,-50-random%50
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = 7
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 12,0
anim = 8150
ID = 81510
pos = 1+random%10,-100+(random%42)
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = 7
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 12,0
anim = 6130
ID = 6130
pos = 1+random%10,-100+(random%42)
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .4,.4
sprpriority = 7
ontop = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 15
trigger4 = animelem = 25
trigger5 = animelem = 32
trigger6 = animelem = 36
trigger7 = animelem = 46
value = -21
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 8,0
value = -10
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 58
value = -110
kill = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 8,0
time = 8
freq = 65
ampl = -6

[State 3120, HitAdd]
type = HitAdd
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 15
trigger4 = animelem = 25
trigger5 = animelem = 32
trigger6 = animelem = 36
trigger7 = animelem = 46
trigger8 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 8,0
value = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 15
trigger5 = animelem = 25
trigger6 = animelem = 32
trigger7 = animelem = 36
trigger8 = animelem = 46
value = S2,12
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelemtime(54) >= 0 && animelemtime(55) <= 0 && timemod = 12,0
value = S0,42
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
trigger2 = animelem = 4
trigger3 = animelem = 8
trigger4 = animelem = 36
value = S2,6
volume = 255

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 10
value = S0,26
volume = 255
channel = 1

[State 3120, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 56
value = S0,27
volume = 255
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 52
value = S800,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 58
value = S0,44
volume = 255

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(50)<0
pos = 55,0
time = 1

[State 0, TargetState]
type = TargetState
trigger1 = AnimElem = 50
value = 3145

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(50)>=0 &&animelemtime(58)<0
pos = 36,0
time = 1

[State 1100, flames]
type = helper
trigger1= animelemtime(58)>0 &&!numhelper(7180)
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(58)=0
trigger2 = AnimElemTime(58)=2
anim = 6130
ID = 6130
pos = 30+random%50,-57-random%50
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7
ontop = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 58
time = 15
freq = 75
ampl = -8

[State 0, TargetState]
type = TargetState
trigger1 = AnimElem = 58
value = 3147

[State 0, ChangeState]
type = Null;ChangeState
trigger1= AnimElemTime(58)>4&&animelemtime(59)<6 && command = "Saika"&&!winko&&power>=1000
value = 3120

[State 0, ChangeState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl = 1
;------------------------------------------------------------------
;Saika-P2
[Statedef 3270]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 3340, Anim 5050]
type = ChangeAnim
triggerall = anim = 5030
trigger1 = animtime = 0
value = 5050

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 3340, Anim 5050]
type = ChangeState
trigger1 = HitShakeOver
value = 3271
;------------------------------------------------------------------
;Saika-P2
[Statedef 3271]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 3340, Anim 5050]
type = ChangeAnim2
trigger1 = !time
value = 3270

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 13
y = -21

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 19
x = -13
y = -7

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 25
y = -21

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 31
x = -13
y = -7

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 33
x = -11
y = -7

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 35
x = -8
y = -6

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 66
y = -18

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 68
y = -17

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 70
y = -15

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 72
y = -14

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 74
y = -11

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 76
y = -9

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 78
y = -7

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 80
y = -7

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 82
y = -5

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 84
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 86
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 88
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 90
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 91
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 92
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 93
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 94
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 95
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 96
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 97
y = -1

[State 3151, PosAdd]
type = PosAdd
trigger1 = time = 99
y = -1

[State 3151, VelSet]
type = VelSet
trigger1 = time = 101
y = 0.1

[State 3151, VelAdd]
type = VelAdd
trigger1 = time > 100
y = 0.625

[State 1207, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5051)
trigger1 = time = 76
value = 5051

[State 1207, ChangeAnim]
type = ChangeAnim
trigger1 = !SelfAnimExist(5051)
trigger1 = time = 76
value = 5050

[State 1207, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5061)
trigger1 = time = 89
value = 5061

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 1000, 6]
type = SelfState
trigger1 = time > 90
trigger1 = Pos Y >= 0 && Vel Y >= 0
value = 5100
;------------------------------------------------------------------
;Saika-P2
[Statedef 3280]
type = A
movetype = H
physics = N

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 1207, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5050)
trigger1 = !time
value = 5050

[State 1207, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5052)
trigger1 = !time
value = 5052

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -2.6
y = -11.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 18
freq = 120
ampl = -5

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;Shiki 108: Ya Sakazuki
[Statedef 3300]
type=S
movetype=A
physics=N
anim=Ifelse(Var(11),13300,3300)
poweradd=-1000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3000, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=50
[State 3000, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3000, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3000, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3000, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3000, SuperPause FX]
type=Helper
trigger1=!time
helperType=Normal
stateNo=8500
ID=8500
name="Superpause FX"
posType=P1
pos=-21,-81
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3000, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=50
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,0
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= anim=3300 && time<51
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 1000, width]
type=width
trigger1= 1
value=10,0

[State 1000, Snd]
type=playsnd
trigger1= !time
value=0,54
channel=0

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 735
ID = 735
pos = -26,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pauseMoveTime = -1
superMoveTime = -1
scale = 0.6,0.5
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time >= 50 && command!="hold_x"&&command!="hold_y"&&command!="hold_z"
trigger2 = Time >= 120
id = 735

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Enemy,statetype != A && Time >= 50
triggerall = AILevel
id = 735

[State 1000, ChangeState]
type = ChangeState
trigger1 = Enemy,statetype != A && Time >= 50
triggerall = AILevel
value = 3301

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 50 && command!="hold_x"&&command!="hold_y"&&command!="hold_z"
trigger2 = Time >= 120
value = 3301
;------------------------------------------------------------------
;Ya Sakazuki Release
[StateDef 3301]
type=S
physics=S
movetype=A
ctrl=0
anim=Ifelse(Var(11),13301,3301)
velset=0,0
sprpriority=1

[State 1000, width]
type=width
trigger1= animelemtime(10)<0
value=30,0

[State 1000, Ya Sakazauki]
type=helper
trigger1= animelem=4
helpertype=normal
stateno=3305
ID=3305
name="Ya Sakazauki"
postype=p1
pos=44,0
ownpal=1
size.xscale=.5*const(size.xscale)
size.yscale=.5*const(size.yscale)

[State 1000, Move Snd]
type=PlaySnd
trigger1=Animelem=4
value=0,43
channel = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 1008
ID = 1008
pos = -20,-5
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 5
ontop = 1
ownpal = 1

[State 1000, Snd]
type=playsnd
trigger1= animelem=4
value=6,4

[State 1000, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1
;------------------------------------------------------------------
;Ya Sakazuki P2
[Statedef 3310]
movetype = H
physics = N
type = U

[State 3020, VelSet]
type = VelSet
trigger1 = 1
x = 0
y = 0

[State 3020, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3020, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim !=3306
value = 3306

[State 3020, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 1105, Fire (Back)]
type = Explod
trigger1 = !Time 
anim =3305
ID = 3305
sprPriority = 1
posType = P1
pos = 0,0
bindtime = -1
scale = 0.5, 0.5
ownPal = 1

[State 0, PalFX]
type = PalFX
trigger1 = AnimElemTime (1) > 0
time = 1
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 3020, LifeAdd]
type = LifeAdd
trigger1 = time%5 = 0
value = -4
kill = 1
absolute = 1

[State 3020, SelfState]
type = ChangeState
trigger1 = !AnimTime
trigger2 = !Alive
trigger3 = enemynear,var(39)<0
value = 3311
;------------------------------------------------------------------
;Ya Sakazuki P2
[Statedef 3311]
movetype = H
physics = N
type = A

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3020, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3020, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim !=3307
value = 3307

[State 3020, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 3020, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;MAX Shiki 108: Ya Sakazuki
[Statedef 3350]
type=S
movetype=A
physics=N
anim=Ifelse(Var(11),13300,3300)
poweradd=-2000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3050, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3050, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3050, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3050, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3050, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3050, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3050, Enemy Pos Y Reset]
type=VarSet
trigger1=!time
fvar(6)=0

[State 3050, SuperPause FX]
type=Helper
trigger1=animelem=1
helperType=Normal
stateNo=8510
ID=8510
name="Superpause FX"
posType=P1
pos=-21,-81
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3050, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,1
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= anim=3300 && time<51
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 1000, width]
type=width
trigger1= 1
value=10,0

[State 1000, Snd]
type=playsnd
trigger1= !time
value=0,54
channel=0

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 735
ID = 735
pos = -26,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pauseMoveTime = -1
superMoveTime = -1
scale = 0.6,0.5
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time >= 50 && command!="hold_x"&&command!="hold_y"&&command!="hold_z"
trigger2 = Time >= 120
id = 735

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Enemy,statetype != A && Time >= 50
triggerall = AILevel
id = 735

[State 1000, ChangeState]
type = ChangeState
trigger1 = Enemy,statetype != A && Time >= 50
triggerall = AILevel
value = 3351

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 50 && command!="hold_x"&&command!="hold_y"&&command!="hold_z"
trigger2 = Time >= 120
value = 3351
;------------------------------------------------------------------
;Ya Sakazuki Release
[StateDef 3351]
type=S
physics=S
movetype=A
ctrl=0
anim=Ifelse(Var(11),13301,3301)
velset=0,0
sprpriority=1

[State 1000, width]
type=width
trigger1= animelemtime(10)<0
value=30,0

[State 1000, Ya Sakazauki]
type=helper
trigger1= animelem=4
helpertype=normal
stateno=3355
ID=3355
name="Ya Sakazauki"
postype=p1
pos=44,0
ownpal=1
size.xscale=.5*const(size.xscale)
size.yscale=.5*const(size.yscale)

[State 1000, Move Snd]
type=PlaySnd
trigger1=Animelem=4
value=0,43
channel = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 1008
ID = 1008
pos = -20,-5
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 5
ontop = 1
ownpal = 1

[State 1000, Snd]
type=playsnd
trigger1= animelem=4
value=6,4

[State 1000, End]
type=changestate
trigger1= !animtime
value=0
ctrl=1
;------------------------------------------------------------------
;Max Ya Sakazuki P2
[Statedef 3360]
movetype = H
physics = N
type = U

[State 3020, VelSet]
type = VelSet
trigger1 = 1
x = 0
y = 0

[State 3020, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3020, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim !=3306
value = 3306

[State 3020, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 1105, Fire (Back)]
type = Explod
trigger1 = !Time 
anim =3305
ID = 3305
sprPriority = 1
posType = P1
pos = 0,0
bindtime = -1
scale = 0.5, 0.5
ownPal = 1

[State 0, PalFX]
type = PalFX
trigger1 = AnimElemTime (1) > 0
time = 1
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 3020, LifeAdd]
type = LifeAdd
trigger1 = time%5 = 0
value = -5
kill = 1
absolute = 1

[State 3020, SelfState]
type = ChangeState
trigger1 = !AnimTime
trigger2 = !Alive
trigger3 = enemynear,var(39)<0
value = 3361
;------------------------------------------------------------------
;Max Ya Sakazuki P2
[Statedef 3361]
movetype = H
physics = N
type = A

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3020, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3020, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
triggerall = anim !=3307
value = 3307

[State 3020, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 3020, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;------------------------------------------------------------------
;Shiki 100: Oni Homura
[Statedef 3700]
type=S
movetype=A
physics=N
anim=3700
poweradd=-1000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3000, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=50
[State 3000, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3000, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3000, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3000, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3000, SuperPause FX]
type=Helper
trigger1=!time
helperType=Normal
stateNo=8500
ID=8500
name="Superpause FX"
posType=P1
pos=-6,-56
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3000, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=50
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,0
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= anim=3700 && time<51
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(9)<0
time=1
value=SCA
ignorehitpause=1

[State 3100, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 123, Dust Helper]
type = Helper
trigger1 = AnimElem=23
helperType = Normal
stateNo = 8100
ID = 8100
name = "Jump Dust"
posType = P1
ownPal = 1

[State 3100, VelSet]
type = velset
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 8

[State 3100, VelMul]
type = VelMul
trigger1 = AnimElemTime(26)<=0
x = .94

[State 3100, velset ]
type = velset
trigger1 = AnimElemTime(9)=1
trigger2 = AnimElemTime(19)=1
trigger3 = AnimElemTime(30)=1
x = 0

[State 3100,VelAdd]
type = PosAdd
trigger1 = AnimElemTime(25)=1
x = 20

[State 3100,StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 26
statetype = A

[State 3100,VelSet]
type = velset
trigger1 = AnimElem = 26
x = 7
y = -12

[State 3100, VelMul]
type = VelMul
trigger1 = AnimElemTime(26)>0
x = .92

[State 3100,VelAdd]
type = VelAdd
trigger1 = AnimElemTime(26)>0
y = .61

[State 1100, Helper]
type = Helper
trigger1 = animelem = 4
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .4

[State 1100, Helper]
type = Helper
trigger1 = animelem = 12
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .4

[State 1100, Helper]
type = Helper
trigger1 = animelem = 24
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .6

[State 1005, High]
type=hitdef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = animelem = 3
trigger2 = animelem = 4
trigger3 = animelem = 5
trigger4 = animelem = 13
trigger5 = animelem = 14
trigger6 = animelem = 15
trigger7 = animelem = 23
trigger8 = animelem = 24
trigger9 = animelem = 25
priority=4, Hit
attr = S,SA
damage = 21,6
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = ifElse(var(20), 1, 4), ifElse(var(20), 1, 4)
sparkNo=-1 + 0 * (var(33) :=8013)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-84
hitsound=S2+10*var(44),2
guardsound=s130,1
ground.type = Low
ground.slidetime = 9
ground.hittime = 25
ground.velocity = 0,0
guard.velocity = -8
ground.cornerPush.velOff = 0
guard.cornerPush.velOff = 0
air.cornerPush.velOff = 0
air.type = Low
air.hittime = 18
air.velocity = -2,-4
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
airguard.velocity = -8, -1.5
fall=0
fall.recover = 0
air.fall=1
air.fall.recover=0
envshake.time=12
envshake.ampl=5
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4

[State 1005, High]
type=hitdef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = animelem = 26
priority=4, Hit
attr = S,SA
damage = 21,6
animtype = DiagUp
air.animtype = DiagUp
fall.animtype = DiagUp
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = ifElse(var(20), 2, 6), ifElse(var(20), 2, 6)
sparkNo=-1 + 0 * (var(33) :=8013)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-84
hitsound=S2+10*var(44),2
guardsound=s130,1
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -5,-13
ground.cornerPush.velOff = 0
guard.cornerPush.velOff = 0
air.cornerPush.velOff = 0
air.type = Low
air.hittime = 18
air.velocity = -5,-13
getpower= 0,0
givepower = 36,36
yaccel = .5
fall=1
fall.recover = 0
air.fall=1
air.fall.recover=0
airguard.ctrltime = 16
airguard.velocity = -8, -1.5
fall.recover = 0
envshake.time=12
envshake.ampl=5
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4

[State 1005, flames]
type = helper
trigger1 = movehit && numtarget && !numhelper(7180)
trigger1 = !(target, time) && (target, movetype = H)&&(enemynear,stateno=[5000,5050])
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 1005, Counter FX]
type=Helper
trigger1=MoveContact=1 && NumTarget && var(9)
trigger1=!(Target, HitShakeOver)
helperType=Normal
stateNo=8290
ID=8290
name="Counter FX"
posType=P1
pos=ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal=1
pauseMoveTime=65535
superMoveTime=65535
ignoreHitPause=1

[State 1100, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemtime(27)>= 0
movetype = I

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 52
;------------------------------------------------------------------
;MAX Shiki 100: Oni Homura
[Statedef 3750]
type=S
movetype=A
physics=N
anim=3750
poweradd=-2000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3050, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3050, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3050, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3050, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3050, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3050, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3050, Enemy Pos Y Reset]
type=VarSet
trigger1=!time
fvar(6)=0

[State 3050, SuperPause FX]
type=Helper
trigger1=animelem=1
helperType=Normal
stateNo=8510
ID=8510
name="Superpause FX"
posType=P1
pos=-6,-56
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3050, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,1
darken=0
poweradd=0

[State 3100, nhb]
type=nothitby
trigger1= anim=3700 && time<51
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(9)<0
time=1
value=SCA
ignorehitpause=1

[State 3100, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 123, Dust Helper]
type = Helper
trigger1 = AnimElem=23
helperType = Normal
stateNo = 8100
ID = 8100
name = "Jump Dust"
posType = P1
ownPal = 1

[State 3100, VelSet]
type = velset
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 8

[State 3100, VelMul]
type = VelMul
trigger1 = AnimElemTime(32)<=0
x = .94

[State 3100, velset ]
type = velset
trigger1 = AnimElemTime(9)=1
trigger2 = AnimElemTime(19)=1
trigger3 = AnimElemTime(30)=1
x = 0

[State 3100,VelAdd]
type = PosAdd
trigger1 = AnimElemTime(25)=1
x = 20

[State 3100,StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 26
statetype = A

[State 3100,VelSet]
type = velset
trigger1 = AnimElem = 26
x = 7
y = -12

[State 3100, VelMul]
type = VelMul
trigger1 = AnimElemTime(26)>0
x = .92

[State 3100,VelAdd]
type = VelAdd
trigger1 = AnimElemTime(27)>0
y = .61

[State 1100, Helper]
type = Helper
trigger1 = animelem = 4
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .4

[State 1100, Helper]
type = Helper
trigger1 = animelem = 12
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .4

[State 1100, Helper]
type = Helper
trigger1 = animelem = 25
helpertype = normal
name = "Oni Yaki Front Flames"
ID = 1105
stateno = 1105
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = .5
size.yscale = .6

[State 1005, High]
type=hitdef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = animelem = 3
trigger2 = animelem = 4
trigger3 = animelem = 5
trigger4 = animelem = 13
trigger5 = animelem = 14
trigger6 = animelem = 15
trigger7 = animelem = 23
trigger8 = animelem = 24
priority=4, Hit
attr = S,SA
damage = 21,6
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = ifElse(var(20), 1, 4), ifElse(var(20), 1, 4)
sparkNo=-1 + 0 * (var(33) :=8013)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-84
hitsound=S2+10*var(44),2
guardsound=s130,1
ground.type = Low
ground.slidetime = 9
ground.hittime = 25
ground.velocity = 0,0
guard.velocity = -8
ground.cornerPush.velOff = 0
guard.cornerPush.velOff = 0
air.cornerPush.velOff = 0
air.type = Low
air.hittime = 18
air.velocity = -2,-10.8
getpower= 0,0
givepower = 36,36
yaccel = .5
airguard.ctrltime = 16
airguard.velocity = -8, -1.5
fall=0
fall.recover = 0
air.fall=1
air.fall.recover=0
envshake.time=12
envshake.ampl=5
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4

[State 1005, High]
type=hitdef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = animelem = 25
trigger2 = animelem = 27
trigger3 = animelem = 29
trigger4 = animelem = 31
priority=4, Hit
attr = S,SA
damage = 21,6
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = ifElse(var(20), 1, 4), ifElse(var(20), 1, 4)
sparkNo=-1 + 0 * (var(33) :=8013)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-84
hitsound=S2+10*var(44),2
guardsound=s130,1
air.animtype=up
fall.animtype=Back
ground.type=high
air.type=Low
ground.slidetime=12
ground.hittime =12
guard.hittime=12
ground.velocity=-3,-10
air.velocity=-3,-10
guard.velocity=Ifelse(var(20),-4,-8)
airguard.velocity =Ifelse(var(20),-3,-6), -3
airguard.ctrlTime=12
ground.cornerPush.velOff=0
guard.cornerPush.velOff=0
air.cornerPush.velOff=0
yaccel=.4
fall=1
fall.recover=0
forcestand=1
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4
envshake.time=12
envshake.ampl=4
envShake.freq=120

[State 1005, High]
type=hitdef
trigger1 = !var(16) && (var(15)<1 || var(20))
trigger1 = animelem = 32
priority=4, Hit
attr = S,SA
damage = 21,6
animtype = DiagUp
air.animtype = DiagUp
fall.animtype = DiagUp
guardflag = MA
hitflag = MAF
priority= 4,Hit
pausetime = ifElse(var(20), 2, 6), ifElse(var(20), 2, 6)
sparkNo=-1 + 0 * (var(33) :=8013)
guard.sparkNo=-1 + 0 * (var(34) :=8001)
sparkXY=-10 + 0 * (var(35) :=100), var(36) :=-84
hitsound=S2+10*var(44),2
guardsound=s130,1
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6,-13
ground.cornerPush.velOff = 0
guard.cornerPush.velOff = 0
air.cornerPush.velOff = 0
air.type = Low
air.hittime = 18
air.velocity = -6,-4
getpower= 0,0
givepower = 36,36
yaccel = .5
fall=1
fall.recover = 0
air.fall=1
air.fall.recover=0
airguard.ctrltime = 16
airguard.velocity = -8, -1.5
fall.recover = 0
envshake.time=12
envshake.ampl=5
palFX.time = 30
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4

[State 1005, flames]
type = helper
trigger1 = movehit && numtarget && !numhelper(7180)
trigger1 = !(target, time) && (target, movetype = H)&&(enemynear,stateno=[5000,5050])
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 1005, Counter FX]
type=Helper
trigger1=MoveContact=1 && NumTarget && var(9)
trigger1=!(Target, HitShakeOver)
helperType=Normal
stateNo=8290
ID=8290
name="Counter FX"
posType=P1
pos=ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal=1
pauseMoveTime=65535
superMoveTime=65535
ignoreHitPause=1

[State 1100, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemtime(33)>= 0
movetype = I

[State 0, ChangeState]
type = ChangeState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 52
;-------------------------------------------------------------
;Ura 1029 Shiki: Homurabotogi
[StateDef 3400]
type = S
physics = S
moveType = A
anim = 3400
velSet = 0,0
ctrl = 0
sprPriority = 1
powerAdd = -3000
facep2=1

[State 3400, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3400, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3400, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3400, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3400, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3400, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1
[State 3400, Reset]
type=VarSet
trigger1=!time
var(11)=0
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(1)= Ifelse(Facing = 1, Pi/4, (5*Pi)/3) 
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(2)= Ifelse(Facing = 1, (7*Pi)/6, ((7*Pi)/6) - (Pi/2))
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(3)= Ifelse(Facing = 1, Pi/4, (5*Pi)/3) 
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(4)= Ifelse(Facing = 1, (7*Pi)/6, ((7*Pi)/6) - (Pi/2))
[State 3400, Reset]
type=VarSet
trigger1=!time
var(40)=0
[State 3400, SuperPause FX]
type=Helper
trigger1=animelem=4
helperType=Normal
stateNo=8520
ID=8520
name="Superpause FX"
posType=P1
pos=13,-62
superMoveTime=255
pauseMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3400, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,2
darken=0
poweradd=0

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 735
ID = 735
pos = -27,-38
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pauseMoveTime = -1
superMoveTime = -1
scale = 0.8,0.8
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 735
ID = 735
pos = 36,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pauseMoveTime = -1
superMoveTime = -1
scale = 0.7,0.7
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !AnimTime  
id = 735

[State 4001, ??(??)]
type = ChangeState
trigger1 = !AnimTime
value = 3401
;---------------------------------------------------------------------------
; Homurabotogi
[Statedef 3401]
type    = A
movetype = A
physics = N
velset = 0,0
anim = 3401
ctrl = 0

[State 123, Dust Helper]
type = Helper
trigger1 = AnimElem=1
helperType = Normal
stateNo = 8100
ID = 8100
name = "Jump Dust"
posType = P1
ownPal = 1

[State 1200, Vel]
type = velset
trigger1 = anim = 3401
x = p2dist x / ((14 + ((14 ** 2) -(4 * 0.375 * (enemynear(0), const(size.height)))) ** 0.5) / 0.75)
y = -8
persistent = 0
[State 1200, Vel]
type = turn
trigger1 = anim = 3401 && vel x < 0
persistent = 0
[State 1200, Vel]
type = velset
trigger1 = anim = 3401 && vel x > 10
x = 10
[State 1200, Vel]
type = velset
trigger1 = anim = 3401 && vel x < 0
x = 0
[State 1200, Accel]
type = veladd
trigger1 = anim = 3401
y = 0.75
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,49
channel = 1

[State 4001, ??(??)]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 3402
;---------------------------------------------------------------------------
; Homurabotogi
[Statedef 3402]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3402
ctrl = 0

[State 3402]
type = PosSet
trigger1 = time = 0
y = 0

[State 4004, ???]
type = Explod
trigger1 = Animelem = 2
anim = 735
id = 735
pos = 66,0
postype = p1
bindtime = 999
ownpal = 1
scale = 0.9,0.7
removeongethit = 1
sprpriority = 2

[State 3402]
type = HitDef
triggerall = p2stateno != [150,159]
triggerall = animelem = 1
trigger1 = p2movetype = H && p2statetype = A
trigger2 = p2statetype != A
attr = A, HT
hitflag = MAF
hitsound=s800, 0
numhits = 0
priority = 2, miss
sparkno = -1
p2stateno = 3403
p2facing = 1

[State 3402]
type = ChangeState
trigger1 = movehit
value = 3404

[State 3402]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Homurabotogi-P2
[Statedef 3403]
type = S
movetype = H
physics = N

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = 3

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3404

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

;---------------------------------------------------------------------------
; Homurabotogi
[Statedef 3404]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3403
ctrl = 0

[State 3404,BlackBG]
type=helper
trigger1 =!time
helpertype=normal
stateno=3450
ID=3450
name="BlackBG"
postype=Back
supermovetime=99999
pausemovetime=99999
ownpal=1
ignorehitpause=1

[State 52, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0

[State 52, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8106
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = time>= 0 && time<= 60 && timemod = 2,0
value = 1

[State 3404]
type = TargetBind
trigger1 = AnimElem=1
pos = 71,-2
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,55
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,52
channel = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 58
value = S0,52
channel = 3

[State 3404]
type = EnvShake
trigger1 = animelem = 1
time = 23
ampl = 4
freq = 40
persistent = 0
ignorehitpause = 1

[State 3404]
type = HitAdd
trigger1 = time = 60
value = 1
persistent = 0
ignorehitpause = 1

[State 3404]
type = TargetLifeAdd
trigger1 = time = 60
value = -410
absolute = 1
persistent = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 1
anim = 3406
ID = 3406
pos = 20,0
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 0.6,0.6
sprpriority = 7
ontop = 1

[State 0, Explod]
type = Explod
trigger1 = animelem = 1
anim = 3305
ID = 3305
pos = -30,0
postype = p2
facing = 1
vfacing = 1
bindtime = 1
removetime = -1
scale = 1.5,1.5
sprpriority = 7
ontop = 1

[State 1340, Explod]
type = Explod
trigger1 = Time = 55
anim = 6130
ID = 6130
pos = 40,-10
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = .6,.6
sprpriority = 8

[State 1340, Explod]
type = Explod
trigger1 = Time = 60
anim = 6130
ID = 6131
pos = 70,-20
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = .6,.6
sprpriority = 8

[State 1100, flames]
type = helper
trigger1 = Time = 60
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 3404]
type = EnvShake
trigger1 = animelem = 1
time = 23
ampl = 4
freq = 40
persistent = 0
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1= time = 60
time = 14
freq = 120
ampl = -3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S0,5
channel = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID = 3406
scale = 0.7+0.010*time, 0.7+0.010*time

[State 0, TargetState]
type = TargetState
trigger1 = animelemtime(1)=60
value = 3405

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 40
id = 3305

[State 4004, ??]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
;------------------------------------------------------------------
;Kototsuki In-P2 State
[Statedef 3405]
type = A
movetype = H
physics = N

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3405

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -7.6
y = -7.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -3

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100
;-------------------------------------------------------------
;Chi No Bosou
[StateDef 3500]
type = S
physics = S
moveType = A
anim = 3500
velSet = 0,0
ctrl = 0
sprPriority = 1
powerAdd = -3000
facep2=1

[State 3100, nhb]
type=nothitby
trigger1= animelemtime(3)<0
time=1
value=SCA
ignorehitpause=1

[State 220, Position]
type = PosSet
trigger1 = !Time
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,47
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,57
channel = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 =  animelemtime(3)>=0
value = SCA,AP
time = 1
ignorehitpause = 1

[State 0, HitBy]
type = HitBy
trigger1 = animelemtime(3)>=0
value = SCA,AA,AT
time = 1
ignorehitpause = 1

[State 3500, Reversal]
type = reversaldef
trigger1 = !movehit && animelemtime(3) >= 0 && animelemtime(32) < 0
attr = S, HT
reversal.attr = SA, NA, SA, HA
getpower=0,0
pausetime = 0, 0
sparkno = -1
sparkxy = 0, 0
hitsound = s130, 0
p1stateno = 3501
p2stateno = 3520
fall = 1
fall.recover = 0
numhits = 0

[State 0, StopSnd]
type = StopSnd
trigger1 = !AnimTime
channel = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = !AnimTime
channel = 2

[State 0, SelfState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl=1
;------------------------------------------------------------------
;Chi No Bosou
[StateDef 3501]
type=S
physics=S
movetype=A
ctrl=0
anim=3501
velset=0,0
sprpriority=1

[State 3400, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3400, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3400, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3400, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3400, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3400, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1

[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(1)= Ifelse(Facing = 1, Pi/4, (5*Pi)/3) 
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(2)= Ifelse(Facing = 1, (7*Pi)/6, ((7*Pi)/6) - (Pi/2))
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(3)= Ifelse(Facing = 1, Pi/4, (5*Pi)/3) 
[State 3400, By Splode]
type = VarSet
trigger1=!time
fvar(4)= Ifelse(Facing = 1, (7*Pi)/6, ((7*Pi)/6) - (Pi/2))

[State 3400, Reset]
type=VarSet
trigger1=!time
var(40)=1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S0,49
channel = 2

[State 3400, SuperPause FX]
type=Helper
trigger1=animelem=1
helperType=Normal
stateNo=8520
ID=8520
name="Superpause FX"
posType=P1
pos=-4,-62
superMoveTime=255
pauseMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3400, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,2
darken=0
poweradd=0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
ignorehitpause = 1



[State 210, Hit]
type=hitdef
trigger1 = animelem=1
attr = S,HT
damage = 0,0
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag =
hitflag = MAF
priority= 4,Hit
pausetime = 1,2
sparkno = -1
guard.sparkno = -1
guard.sparkxy = -1
sparkxy = -1
persistent=0
p2stateno=3503
p1stateno=3502
numhits=0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(32)>=0
movetype = I

[State 1000, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 3502
ctrl = 1
;------------------------------------------------------------------
;Chi No Bosou
[Statedef 3502]
type=S
physics=S
movetype=A
ctrl=0
velset=0,0
sprpriority=2
anim = 3502
facep2=1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = AnimElemTime(1)>=0 &&animelemtime(23)<0
flag = nobardisplay
flag1 = timerfreeze

[State 0, TargetState]
type = TargetState
trigger1 = !Time
value = 3503

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
trigger2 = animelem = 9
trigger3 = animelem = 16
value = S2,11
volume = 255

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 4
trigger2 = animelem = 9
value = -136
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 16
value = -136
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 23
value = -1
kill = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
trigger2 = animelem = 8
trigger3 = animelem = 15
value = S0,48
channel = 2

[State 1100, Helper]
type = Helper
trigger1 = animelem = 4
trigger2 = animelem = 9
trigger3 = animelem = 16
helpertype = normal
name = "Slash Spark"
ID = 8020
stateno = 8020
pos = 1,-65
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

[State 3120, HitAdd]
type = HitAdd
trigger1 = animelem = 4
trigger2 = animelem = 9
trigger3 = animelem = 16
value = 1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = !Time
time = 10
mul = 0,0,0
ignorehitpause=1

[State 0, AllPalFX]
type = AllPalfx
trigger1 = animelemtime(2)<0
trigger2 = animelemtime(7)>=5 && animelemtime(8)<0
trigger3 = animelemtime(12)>=5 && animelemtime(13)<0
trigger4 = animelemtime(22)>=3 && animelemtime(23)<0
time = 1
mul = 0,0,0
ignorehitpause=1
[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(2)>=0&&animelemtime(5)<0
time = 1
mul = (time-24)*42,0,0;(time-24)*42,(time-24)*42
ignorehitpause=1
[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(6)>=0&&animelemtime(7)<5
time = 1
mul = 256-(time-33)*42,0,0;256-(time-33)*42,256-(time-33)*42
ignorehitpause=1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(8)>=0&&animelemtime(10)<0
time = 1
mul = (time-60)*42,0,0;(time-60)*42,(time-60)*42
ignorehitpause=1
[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(11)>=0&&animelemtime(12)<5
time = 1
mul = 256-(time-70)*42,0,0;,256-(time-70)*42,256-(time-70)*42
ignorehitpause=1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(13)>=0&&animelemtime(16)<0
time = 1
mul = (time-93)*42,0,0;(time-95)*42,(time-95)*42
ignorehitpause=1
[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(20)>=0&&animelemtime(22)<3
time = 1
mul = 256-(time-107)*42,0,0;256-(time-109)*42,256-(time-109)*42
ignorehitpause=1

[State 0, AllPalFX]
type = AllPalFX
trigger1 = animelemtime(5)>=0&&animelemtime(6)<0
trigger2 = animelemtime(10)>=0&&animelemtime(11)<0
trigger3 = animelemtime(16)>=0&&animelemtime(20)<0
time = 1
mul = 256,0,0

[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(2)>=0&&animelemtime(5)<0
time = 1
mul = (time-24)*42,0,0;(time-24)*42,(time-24)*42
ignorehitpause=1
invertall = 1
[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(6)>=0&&animelemtime(7)<5
time = 1
mul = 256-(time-33)*42,0,0;256-(time-33)*42,256-(time-33)*42
ignorehitpause=1
invertall = 1

[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(8)>=0&&animelemtime(10)<0
time = 1
mul = (time-60)*42,0,0;(time-60)*42,(time-60)*42
ignorehitpause=1
invertall = 1
[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(11)>=0&&animelemtime(12)<5
time = 1
mul = 256-(time-70)*42,0,0;,256-(time-70)*42,256-(time-70)*42
ignorehitpause=1
invertall = 1

[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(13)>=0&&animelemtime(16)<0
time = 1
mul = (time-93)*42,0,0;(time-95)*42,(time-95)*42
ignorehitpause=1
invertall = 1
[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(20)>=0&&animelemtime(22)<3
time = 1
mul = 256-(time-107)*42,0,0;256-(time-109)*42,256-(time-109)*42
ignorehitpause=1
invertall = 1

[State 0, AllPalFX]
type = BGPalFX
trigger1 = animelemtime(5)>=0&&animelemtime(6)<0
trigger2 = animelemtime(10)>=0&&animelemtime(11)<0
trigger3 = animelemtime(16)>=0&&animelemtime(20)<0
time = 1
mul = 256,0,0
invertall = 1

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(23)<0
pos = 75,0
time = 1
ignorehitpause=1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 23
value = S0,49
volume = 255
channel = 0

[State 0, TargetState]
type = TargetState
trigger1 = AnimElem = 23
value = 3504

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 23
value = -1
kill = 1

[State 0, ChangeState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl = 1
;===========================.------------------------------------------.=============================
[Statedef 3503]
type = S
movetype = H
physics = S

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = !Time
time = 0
ignorehitpause =1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = Time =1
value = 3503

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
;===========================.------------------------------------------.=============================
[Statedef 3504]
type = S
movetype = H
physics = S

[State 3230, SprPriority]
type = SprPriority
trigger1 = !Time
value = -1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3504

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, SelfState]
type = SelfState
trigger1 = !Alive
value = 5150

[State 0, SelfState]
type = SelfState
trigger1 = !AnimTime
value = 5120
;------------------------------------------------------------------
;San Shingi no Ni
[Statedef 3600]
type=S
movetype=A
physics=N
anim=3600
poweradd=-3000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3300, SparkReset]
type = VarSet
trigger1 =!time
var(33)=0
ignorehitpause =1
[State 3300, No Corner Push]
type=VarSet
trigger1=!time
fvar(5)=0
[State 3300, Unguardable]
type=VarSet
trigger1=!time && NumEnemy
trigger1=(EnemyNear, StateNo !=[120,155])
var(17)=49
[State 3300, Super Cancel Flag]
type=VarSet
trigger1=!Time
var(21)=(PrevStateNo=[1000,2999]) && var(6)
[State 3300, Hyper Cancel Flag]
type=VarSet
trigger1=!Time
var(22)=(PrevStateNo=[3000,4999]) && var(7)
[State 3300, Super Cancel Flash]
type=PalFX
trigger1=var(21) || var(22)
trigger1=!(Time % 2) && Time <=12
time=1
add=255,255,255
ignoreHitPause=1
[State 3300, Super Cancel Juggle Reset]
type=VarSet
trigger1=!Time
trigger1=var(21) || var(22)
var(15)=0
ignoreHitPause=1
[State 3400, Reset]
type=VarSet
trigger1=!time
var(40)=2
[State 3300, SuperPause FX]
type=Helper
trigger1=AnimElem=2
helperType=Normal
stateNo=8520
ID=8520
name="Superpause FX"
posType=P1
pos=-9,-66
superMoveTime=255
size.xScale=1
size.yScale=1
ownPal=1
[State 3300, SuperPause]
type=SuperPause
trigger1=!time
time=50
moveTime=49
p2DefMul=1
unHittable=1
anim=-1
sound=s8500,2
darken=0
poweradd=0

[State 210, Hit]
type=hitdef
trigger1= !((EnemyNear, StateNo = 5040) && !(EnemyNear, Ctrl))
trigger1 = !Time
attr = S,HT
damage = 0,0
animtype = Hard
air.animtype = Back
fall.animtype = Back
guardflag =
hitflag = M-
priority = 3, Miss
pausetime = 1,1
sparkno = -1
hitsound = -1
ground.type = Low
ground.hittime  = 1
air.hittime = 13
getpower= 0,0
hitsound=s800, 0
fall=0
air.fall=1
kill=0
p1stateno=3601

[State 3300, StateTypeSet: Idle]
type=StateTypeSet
trigger1=AnimElemTime(7)=0
movetype=I

[State 3300, End]
type=ChangeState
trigger1 = !animtime
value=0
ctrl=1
;---------------------------------------------------------------------------
;San Shingi no Ni (Success)
[Statedef 3601]
type = S
movetype = A
physics = S
anim = 3610
velset = 0, 0
poweradd = 0
sprpriority = 2

[State 3301, More Safety]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3301, TargetState]
type = TargetState
trigger1 = !Time 
value = 3620

[State 0, Width]
type = Width
trigger1 = 1
edge = 63,0

[State 3404,BlackBG]
type=helper
trigger1 =AnimElem=6
helpertype=normal
stateno=3452
ID=3452
name="BlackBG"
postype=Back
supermovetime=99999
pausemovetime=99999
ownpal=1
ignorehitpause=1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelemtime(8)>=0 && animelemtime(44)<0
value = -4
kill = 0

[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0 &&animelemtime(2)<0
pos = 75,-57
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(2)>=0 &&animelemtime(3)<0
pos = 66,-8
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(3)>=0 &&animelemtime(4)<0
pos = 63,-9
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(4)>=0 &&animelemtime(5)<0
pos = 64,-6
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(5)>=0 &&animelemtime(6)<0
pos = 42,-33
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(6)>=0 &&animelemtime(7)<0
pos = 65,-67
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(7)>=0 &&animelemtime(8)<0
pos = 61,-104
time = 1
[State 3120, TargetBind]
type = TargetBind
trigger1 = AnimElemTime(8)>=0 &&animelemtime(44)<0
pos = 76,-127
time = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(44)=0
trigger2 = AnimElemTime(44)=4
trigger3 = AnimElemTime(44)=8
trigger4 = AnimElemTime(44)=12
anim = 6130
ID = 6130
pos = 76+random%50,-100-random%50
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 7
ontop = 1

[State 1005, HitSpark]
type=Helper
trigger1 = animelem = 2
helperType=Normal
stateNo=3309
ID=3309
name="Ya Sakazuki Ground FX"
pos = 0, 0
facing=-1
ownPal=0
size.xScale=0.7
size.yScale=0.6
pauseMoveTime=65535
superMoveTime=65535
ignoreHitPause=1
persistent=0

[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElem = 2
time = 10
freq = 60
ampl = -6

[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElemTime(8)>=0 &&animelemtime(44)<0
trigger1 = Time%4 = 0
time = 4
freq = 240
ampl = -5

[State 1120, Helper]
type = Helper
trigger1 = animelem = 8
helpertype = normal
name = "FlamePillar"
ID = 3605
stateno = 3605
pos = 55,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1
size.xscale=.55*const(size.xscale)
size.yscale=.55*const(size.yscale)

[State 1100, flames]
type = helper
trigger1 = AnimElem = 44
helpertype = normal
stateno = 7180
ID = 7180
name = "flames"
postype = p2
ownpal = 1
facing = -1
ignorehitpause = 1
pauseMoveTime=255

[State 3120, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = AnimElem = 44
value = -10
kill = 1

[State 0, TargetState]
type = TargetState
trigger1 = AnimElem = 44
value = 3621

[State 0, ChangeState]
type = ChangeState
trigger1= !AnimTime
value = 0
ctrl = 1
;------------------------------------------------------------------
;San Shingi no Ni-P2
[Statedef 3620]
type = A
movetype = H
physics = N

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3620

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0
;------------------------------------------------------------------
;San Shingi no Ni-P2
[Statedef 3621]
type = A
movetype = H
physics = N

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[State 3330, ChangeAnim]
type= ChangeAnim2
trigger1 = !Time
value = 3621

[State 3330, ChangeAnim]
type= ChangeAnim
trigger1 = !Time && selfanimexist(5052)
value = 5052

[State 0, PosAdd]
type = PosAdd
trigger1 = !Time
y = 50

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -3.6
y = -7.6

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .5

[State 3230, CtrlSet]
type = CtrlSet
trigger1 = 1
value = 0

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time = 30
mul = 128, 128, 128
sinAdd = 96, 96, 96, 4

[State 0, EnvShake]
type = EnvShake
trigger1= vel y > 0
trigger1= pos y > -vel y
time = 14
freq = 120
ampl = -4

[State 820, SelfState]
type = SelfState
trigger1= vel y > 0
trigger1= pos y > -vel y
value = 5100