;---------------------------------------------------------------------------
; EX Shin Aoi Hana: Seiran
[Statedef 2005]
type = S
movetype = A
physics = S
poweradd = -1000
ctrl = 0
velset = 0,0
anim = 2005
sprpriority = 2			
facep2 = 1

[State 2005, Drive Cancel Helper]
type = Helper
triggerall = PrevStateNo = [1000,2999]
trigger1 = !Time
name = "Drive/HD Cancel"
ID = 12000
stateno = 12000
pos = 0,0
postype = p1  
facing = 1
keyctrl = 0
ownpal = 1

[State 2005, VarSet]
type = VarSet
trigger1 = !Time
var(2) = 0

[State 2005, Whiff]
type = PlaySnd 
ignorehitpause = 1
trigger1 = AnimElem = 4
value = S1005, 1
channel = 1

[State 2005, Accel]
type = VelSet
trigger1 = AnimElemTime(2) > 0 && animelemtime(6) < 0
x = (12*exp((-0.081345639453952405887342355029362)*(time-8)))

[State 2005, Vel]
type = VelSet
trigger1 = animelem = 6
x = 0

[State 2005, VarSet]
type = VarSet
triggerall = AnimElemTime(6) >= 0
triggerall = AnimElemTime(8) < 0
trigger1 = AILevel = 0
trigger1 = command = "QCB_x" || command = "QCB_y"
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = var(16) = [1,2]
trigger2 = P2BodyDist X = [0,70]
trigger2 = IfElse(EnemyNear, StateType != A, abs(P2Bodydist Y)<=50, (abs(P2BodyDist Y) = [20,60]))
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
var(2) = 1
ignorehitpause = 1

[State 2005, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElemTime(6) >= 0
attr = S, SA			
damage = floor(30*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 0,7
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = const240p(-5.8765)
air.velocity = -4.5, -6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 50
persistent = 0
id = 2005

[State 2005, VarSet]
type = VarSet
triggerall = MoveHit
triggerall = NumTarget
triggerall = MoveType = I
trigger1 = Target, HitFall = 1
var(15) = IfElse(var(15) < 2, 2, 3)
ignorehitpause = 1

[State 2005, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 8
movetype = I

[State 2005, ChangeState]
type = ChangeState
triggerall = Var(2) > 0
trigger1 = AnimElemTime(7) >= 4
value = 2006
ctrl = 0

[State 2005, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; EX Shin Aoi Hana: Seiran
[Statedef 2006]
type = S
movetype = A
physics = S
poweradd = 0
ctrl = 0
velset = 0,0
anim = 2006
sprpriority = 2

[State 2006, VarSet]
type = VarSet
trigger1 = !Time
var(2) = 0

[State 2006, Whiff]
type = PlaySnd 
ignorehitpause = 1
trigger1 = AnimElem = 3
value = S1005, 1
channel = 1

[State -2, Accel]
type = VelSet
trigger1 = AnimElemTime(1) > 0 && animelemtime(5) < 0
x = (12*exp((-0.081345639453952405887342355029362)*(time-1)))

[State -2, Vel]
type = VelSet
trigger1 = animelem = 5
x = 0

[State 2006, VarSet]
type = VarSet
triggerall = AnimElemTime(5) >= 0
triggerall = AnimElemTime(8) < 0
trigger1 = AILevel = 0
trigger1 = command = "QCB_x" || command = "QCB_y"
;==
trigger2 = AILevel!=0 && RoundState = 2
trigger2 = var(16) = [1,2]
trigger2 = P2BodyDist X = [0,70]
trigger2 = IfElse(EnemyNear, StateType != A, abs(P2Bodydist Y)<=50, (abs(P2BodyDist Y) = [20,60]))
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
var(2) = 1
ignorehitpause = 1

[State 2006, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElemTime(5) >= 0
attr = S, SA			
damage = floor(30*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 0,7
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = -5.8765
air.velocity = -4.5, -6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 50
persistent = 0
id = 2006

[State 2006, VarSet]
type = VarSet
triggerall = MoveHit
triggerall = NumTarget
triggerall = MoveType = I
trigger1 = Target, HitFall = 1
var(15) = IfElse(var(15) < 2, 2, 3)
ignorehitpause = 1

[State 2006, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 8
movetype = I

[State 2006, ChangeState]
type = ChangeState
triggerall = Var(2) > 0
trigger1 = AnimElemTime(6) >= 3
value = 2007
ctrl = 0

[State 2006, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; EX Shin Aoi Hana: Seiran
[Statedef 2007]
type = S
movetype = A
physics = S
poweradd = 0
ctrl = 0
velset = 0,0
anim = 2007
sprpriority = 2			

[State 2007, Whiff]
type = PlaySnd 
ignorehitpause = 1
trigger1 = AnimElem = 6
value = S1007, 1
channel = 1

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(1) >= 0
x = (9.0703125*exp((-0.081345639453952405887342355029362)*(time)))

[State 2007, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 8
attr = S, SA			
damage = floor(50*fvar(20)), 5
animtype = Medium			
guardflag = HA			
hitflag = MAF
priority = 4, Hit			
pausetime = 0,11	
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 14			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = -4.5, -7.5
guard.velocity = -11.1796875
air.velocity = -4.5, -7.5
air.hittime = 20
air.animtype = Back	
fall = 1
fall.recover = 0	
yaccel = 0.5
ground.cornerpush.veloff = 0
givepower = 150
persistent = 0
id = 2007

[State 2007, VarSet]
type = VarSet
triggerall = MoveHit
triggerall = NumTarget
triggerall = Target, HitFall = 1
trigger1 = AnimElem = 9
var(15) = IfElse(var(15) < 2, 2, 3)
ignorehitpause = 1

[State 2007, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 10
movetype = I

[State 2007, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------
;Wanpyou Tokobuse/Mametsu
[Statedef 2020]
type = S
movetype = A
physics = N
poweradd = -1000
ctrl = 0
velset = 0
sprpriority = 2
facep2 = 1
anim = 2020

[State 2020, Drive Cancel Helper]
type = Helper
triggerall = PrevStateNo = [1000,2999]
trigger1 = !Time
name = "Drive/HD Cancel"
ID = 12000
stateno = 12000
pos = 0,0
postype = p1  
facing = 1
keyctrl = 0
ownpal = 1

[State 2020, Voice]
type = PlaySnd
trigger1 = AnimElem = 8
value = S1020,0
channel = 0

[State 2020, Snap]
type = PlaySnd
trigger1 = AnimElem = 8
value = S1020,2
channel = 2

[State 2020, TargetBind]
type = TargetBind
triggerall = NumTarget
triggerall = AnimElemTime(33) < 0
trigger1 = MoveHit
time = 1
id = -1
pos = 50,IfElse(Target, StateType != A, 0, -15)

[State 2020, 1]
type = HitDef
triggerall = anim = 2020
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 9
trigger2 = AnimElem = 15
trigger3 = AnimElem = 21
trigger4 = AnimElem = 27
attr = S, SA			
damage = floor(10*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 3,3	
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0
air.velocity = 0, -6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 10
air.fall = 1
fall.recovertime = 30
id = 2020

[State 2020, 2]
type = HitDef
triggerall = anim = 2020
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 11
trigger2 = AnimElem = 17
trigger3 = AnimElem = 23
trigger4 = AnimElem = 29
attr = S, SA			
damage = floor(10*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 3,3	
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -45		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0
air.velocity = 0, -6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 10
air.fall = 1
fall.recovertime = 30
id = 2020

[State 2020, 3]
type = HitDef
triggerall = anim = 2020
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 13
trigger2 = AnimElem = 19
trigger3 = AnimElem = 25
trigger4 = AnimElem = 31
attr = S, SA			
damage = floor(10*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 3,3	
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -25		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0
air.velocity = 0, -6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 10
air.fall = 1
fall.recovertime = 30
id = 2020

[State 2020, 4]
type = HitDef
triggerall = anim = 2020
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 33
attr = S, SA			
damage = floor(40*fvar(20)), 5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 3,3	
sparkno = S10011
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 13			
guardsound = S6, 1			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = -4.5, -7.5
air.velocity = -4.5, -7.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 10
fall = 1
fall.recovertime = 30
id = 2020

;== Explods ==

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 9
trigger2 = animelem = 14, = 2
trigger3 = animelem = 20, = 2
trigger4 = animelem = 26, = 2
trigger5 = animelem = 33
ProjID = 11020
projanim = 11020
projremovetime = 8
velocity = 2,-2
projsprpriority = 4
offset = 74,-107 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 13, = 2
trigger2 = animelem = 19, = 2
trigger3 = animelem = 25, = 2
trigger4 = animelem = 31, = 2
ProjID = 11020
projanim = 11020
projremovetime = 8
velocity = 2,-2
projsprpriority = 4
offset = 58,-91 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 10
trigger2 = animelem = 15, = 2
trigger3 = animelem = 21, = 2
trigger4 = animelem = 27, = 2
ProjID = 10301
projanim = 11021
projremovetime = 8
velocity = 2,2
projsprpriority = 4
offset = 58,-38 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 12, = 2
trigger2 = animelem = 18, = 2
trigger3 = animelem = 24, = 2
trigger4 = animelem = 30, = 2
ProjID = 10301
projanim = 11021
projremovetime = 8
velocity = 2,2
projsprpriority = 4
offset = 74,-22 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 10, = 2
trigger2 = animelem = 16, = 2
trigger3 = animelem = 22, = 2
trigger4 = animelem = 28, = 2
ProjID = 11020
projanim = 11022
projremovetime = 8
velocity = 4,0
projsprpriority = 4
offset = 100,-64 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

[State 2020, Projectile]
type = Projectile
triggerall = Anim = 2020
trigger1 = animelem = 11, = 2
trigger2 = animelem = 17, = 2
trigger3 = animelem = 23, = 2
trigger4 = animelem = 29, = 2
ProjID = 11020
projanim = 11022
projremovetime = 8
velocity = 4,0
projsprpriority = 4
offset = 76, -64 
afterimage.time = 999*var(20)
afterimage.length = 10
afterimage.palcolor = 256
afterimage.palbright = -10,-10,-10
afterimage.palcontrast = 255,255,255
afterimage.palpostbright = -145,-155,-115
afterimage.paladd = 0,0,0
afterimage.palmul = .4,.4,.4
afterimage.timegap = 1
afterimage.framegap = 3
afterimage.trans = add

;==

[State 2020, PlaySnd]
type = PlaySnd
triggerall = Anim = 2020
trigger1 = animelem = 9
trigger2 = animelem = 11
trigger3 = animelem = 13
trigger4 = animelem = 15
trigger5 = animelem = 17
trigger6 = animelem = 19
trigger7 = animelem = 21
trigger8 = animelem = 23
trigger9 = animelem = 25
trigger10 = animelem = 27
trigger11 = animelem = 29
trigger12 = animelem = 31
trigger13 = animelem = 33
value = S1020,1
channel = 2

[State 2020, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
trigger2 = animelem = 7
trigger3 = animelem = 9
trigger4 = animelem = 11
trigger5 = animelem = 13
trigger6 = animelem = 15
trigger7 = animelem = 17
trigger8 = animelem = 19
trigger9 = animelem = 21
trigger10 = animelem = 23
trigger11 = animelem = 25
trigger12 = animelem = 27
trigger13 = animelem = 29
value = S1020,1
channel = 2

[State 2020, PlaySnd]
type = PlaySnd
triggerall = Anim = 2020
trigger1 = animelem = 5
trigger2 = animelem = 7
trigger3 = animelem = 9
trigger4 = animelem = 11
trigger5 = animelem = 13
trigger6 = animelem = 15
trigger7 = animelem = 17
trigger8 = animelem = 19
trigger9 = animelem = 21
trigger10 = animelem = 23
trigger11 = animelem = 25
trigger12 = animelem = 27
trigger13 = animelem = 29
value = S1020,1
channel = 2

[State 2020, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 2020
trigger1 = AnimTime = 0
value = 1021
persistent = 0

[State 2020, VarSet]
type = VarSet
triggerall = MoveHit
triggerall = NumTarget
trigger1 = Target, HitFall = 1
var(15) = IfElse(var(15) < 2, 2, 3)
ignorehitpause = 1
persistent = 0

[State 2020, end]
type = ChangeState
triggerall = Anim = 1021
trigger1 = AnimTime = 0
value = 0
ctrl = 1