;---------------------------------------------------------------------------
;EX Hakki Shou
[StateDef 2000]
type = S
movetype = A
physics = S
juggle = 0
anim = 2000
ctrl = 0
velset = 0,0
facep2 = 1
poweradd = -1000
sprpriority = 2

[State 2000, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 21000 

[State 2000, 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 2000, Explod]
type = Explod
trigger1 = AnimElem = 1
anim = 22004
ID = 21000
pos = 0,0
postype = p1  
bindtime = -1
removetime = -2
sprpriority = 3
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 2000, Helper]
type = Helper
trigger1 = AnimElem = 7,=0
ID = 22000
pos = 60, -65
postype = p1
stateno = 11000
helpertype = normal
name = "Hakki Shou"
keyctrl = 0
ownpal = 1
supermovetime = 1
size.xscale = 1
size.yscale = 1

[State 2000, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 7,=1
movetype = I

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

;---------------------------------------------------------------------------
; EX Sousou Shin 
[StateDef 2005]
type = S
movetype = A
physics = N
juggle = 0
anim = 2005
ctrl = 0
velset = 0,0
facep2 = 1
poweradd = -1000
sprpriority = 2

[State 2005, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 21000 

[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, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y != 0
statetype = A
ignorehitpause = 1

[State 2005, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y = 0
statetype = S
ignorehitpause = 1

[State 2005, VelSet]
type = VelSet
trigger1 = AnimElem = 5
x = 8
ignorehitpause = 1

[State 2005, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(5) = [0,4]
y = -6

[State 2005, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(6)>=0 && AnimElemTime(7) < 2
y = 6

[State 2005, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10) < 1
value = SCA

[State 2005, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 6
trigger2 = AnimElem = 7
trigger3 = AnimElem = 8
trigger4 = AnimElem = 9
attr = S, SA			
damage = floor(30*fvar(20)),5
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 5,7	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 1			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 20
ground.velocity = -2.58765
air.velocity = -4.5,-6.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 150

[State 2005, VelSet]
type = VelSet
trigger1 = AnimElem = 9
x = 3
ignorehitpause = 1

[State 2005, VelSet]
type = VelSet
trigger1 = AnimElem = 11
x = 6
ignorehitpause = 1

[State 2005, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(11) = [0,4]
y = -6

[State 2005, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(12) = [0,4]
trigger2 = AnimElemTime(13) = [0,1]
y = 6

[State 2005, 2]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 15
attr = S, SA			
damage = 35,15
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 7,11
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 2		
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 14
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 = 150
fall = 1
fall.recover = 0

[State 2005, VelSet]
type = VelSet
trigger1 = AnimElem = 15
x = 1
ignorehitpause = 1

[State 2005, VelSet]
type = VelMul
trigger1 = AnimElemTime(15) >= 0
x = 0.9
ignorehitpause = 1

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

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

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

;---------------------------------------------------------------------------
; EX Kobi Kyaku 
[StateDef 2010]
type = S
movetype = A
physics = N
juggle = 0
anim = 2010
ctrl = 0
velset = 0,0
facep2 = 1
poweradd = -1000	
sprpriority = 2

[State 2010, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 21000 

[State 2010, 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 2010, Projectile Killer]
type = Helper
trigger1 = AnimElem = 4
name = "Kobi Kyaku Shield"
ID = 21010
stateno = 11010
pos = 0,0
postype = p1  
facing = 1
keyctrl = 0
ownpal = 1
ignorehitpause = 1

[State 2010, VarSet]
type = VarSet
trigger1 = !Time
var(1) = 0

[State 2010, VarSet]
type = VarSet
triggerall = AnimElemTime(1) > 1 && AnimElemTime(6) < 0
trigger1 = command = "brake"
trigger2 = AILevel != 0 && MoveHit
;trigger2 = (random<250*(AILevel**2/32.0))
var(1) = 1
persistent = 0

[State 2010, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 4
attr = S, SA			
damage = floor(50*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 11,11	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 5			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 16
ground.velocity = 0,0
guard.velocity = -5.8765
air.velocity = 0,0
air.hittime = 20
air.animtype = Back		
yaccel = 0.6
ground.cornerpush.veloff = 0
getpower = 0
givepower = 150

[State 2010, 2]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem =  5
attr = S, SA			
damage = floor(60*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 11,11	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 5			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 16
ground.velocity = -2.5,-10.8
guard.velocity = -11.18765
air.velocity = -2.5,-10.8
air.hittime = 20
air.animtype = Back		
yaccel = 0.6
ground.cornerpush.veloff = 0
getpower = 0
givepower = 150
fall = 1
fall.recover = 0

[State 2010, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = StateNo && var(1) = 1
trigger1 = AnimElemTime(5) >= 2
value = 1012
elem = 1
persistent = 0

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

[State 2010, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 7
movetype = I

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

;---------------------------------------------------------------------------
; EX Tenshin Shou
[StateDef 2015]
type = S
movetype = A
physics = N
juggle = 0
anim = 2015
ctrl = 0
velset = 0,0
facep2 = 1
poweradd = -1000
sprpriority = 2

[State 2015, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 21000 

[State 2015, 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 2015, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6) < 1
value = SCA

[State 2015, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 2
attr = S, SA			
damage = floor(10*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 5, Hit			
pausetime = 11,11	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 4			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0;-2.5,-10.8
air.velocity = -2.5,-10.8
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = IfElse(var(31) = 0, 60, 0)
givepower = 50
air.fall = 1
fall.recovertime = 60
persistent = 0

[State 2015, VelSet]
type = VelSet
trigger1 = AnimElem = 3
x = 4
y = -5
ignorehitpause = 1

[State 2015, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 3
statetype = A   
ignorehitpause = 1

[State 2015, 2]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 3
trigger2 = AnimElem = 4
trigger3 = AnimElem = 5
trigger4 = AnimElem = 6
trigger5 = AnimElem = 7
trigger6 = AnimElem = 8
trigger7 = AnimElem = 9
attr = S, SA			
damage = floor(15*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 5, Hit			
pausetime = 2,2
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 4			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = -2.5,-4.5
air.velocity = -2.5,-4.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = IfElse(var(31) = 0, 60, 0)
givepower = 50
fall = 1
fall.recover = 0

[State 2015, 3]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 10
attr = S, SA			
damage = 35,10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 5, Hit			
pausetime = 2,2	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -75		
hitsound = S5, 5			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = -2.5,-10.8
air.velocity = -2.5,-10.8
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = IfElse(var(31) = 0, 60, 0)
givepower = 50
fall = 1
fall.recover = 0


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

[State 2015, VelSet]
type = VelSet
trigger1 = AnimElem = 15
x = 0
y = 0

[State 2015, VelSet]
type = VelAdd
trigger1 = AnimElemTime(15)>=0
y = 0.5

[State 2015, end]
type = ChangeState
trigger1 = Vel Y > 0 && Vel Y >= -Pos Y
value = 1017
ctrl = 0
;---------------------------------------------------------------------------
; EX Shinjou Tai
[Statedef 2020]
type = S
movetype = A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 2020
poweradd = -1000

[State 2020, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(3) < 0
value = SCA

[State 2020, 1]
type = HitDef
triggerall = var(0) = 0
Trigger1 = AnimElem = 2
attr = S, NT
hitflag = M-
priority = 5, Miss
sparkno = S10800
sparkxy = -10, -75
hitsound = S1020,0
p1facing = 1
p2facing = 1
p1stateno = 2021
id = 2020

[State 2020, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Shinjou Tai Hit
[Statedef 2021]
type = S
movetype = A
physics = N
velset = 0,0
ctrl = 0
anim = 1021

[State 2021, ScreenBound]
type = ScreenBound
trigger1 = AnimElemTime(6) < 0
value = 1
movecamera = 1,0

[State 2021, TargetBind]
type = TargetBind
triggerall = NumTarget(PrevStateNo) = 1
trigger1 = !Time
time = 1
id = PrevStateNo
pos = 50,0

[State 2021, PosAdd]
type = PosAdd
trigger1 = AnimElem = 8
x = 30
y = -25

[State 2021, TargetState]
type = TargetState
triggerall = NumTarget(PrevStateNo) = 1
trigger1 = !Time
value = 51021
ID = PrevStateNo

[State 2021, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 2
trigger2 = AnimElem = 5
attr = A, ST			
damage = 20,5
animtype = Heavy			
guardflag = MA			
hitflag = MAF
priority = 5, Hit			
pausetime = 0,0	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -25		
hitsound = S5, 4			
guardsound = S6, 0			
ground.type = Low
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
kill = 0
givepower = 25
p2stateno = 51022

[State 2021, 2]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = AnimElem = 9
attr = A, ST			
damage = IfElse(PrevStateNo = 1020, 60, IfElse(PrevStateNo = 1022, 70, 90)),10
animtype = Heavy			
guardflag = MA			
hitflag = MAF
priority = 5, Hit			
pausetime = 11,11	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -25		
hitsound = S5, 5			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 24
guard.hittime = 18
ground.velocity = -11
air.velocity = -4.5, -7.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = 0
givepower = 150
persistent = 0

[State 2021, VelSet]
type = VelSet
trigger1 = AnimElem = 9 = 0
x = -0.5
y = -8
persistent = 0

[State 2021, VarSet]
type = VarSet
trigger1 = AnimElem = 9
var(15) = 2

[State 2021, VarSet]
type = VarSet
trigger1 = AnimElem = 9
var(17) = 2

[State 2021, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(9) >=0
y = 0.4
persistent = 1

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

[State 2021, VarSet]
type = VarSet
trigger1 = AnimElem = 14
var(17) = 0

[State 2021, end]
type = ChangeState
trigger1 = Vel Y > 0 && Vel Y > -Pos Y
value = 1017
ctrl = 0
;---------------------------------------------------------------------------
; EX Rengeki Shou
[StateDef 2025]
type = A
movetype = A
physics = N
juggle = 0
anim = 2025
ctrl = 0
velset = 0,0
poweradd = -1000
sprpriority = 2

[State 2025, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 21000 

[State 2025, 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 2025, VelSet]
type = VelSet
triggerall = Anim = 2025
trigger1 = AnimElem = 9
x = 12
y = 5

[State 2025, 1]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = Anim = 2025
trigger1 = AnimElem = 9
attr = A, SA			
damage = floor(20*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 7,7	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -45		
hitsound = S5, 4			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0,0
air.velocity = 0,-4.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = IfElse(var(31) = 0, 60, 0)
givepower = 50
persistent = 0
kill = 0

[State 2025, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 2025
trigger1 = MoveContact
trigger1 = HitShakeOver = 1
value = 2026
elem = 1
persistent = 0

[State 2025, VelSet]
type = VelSet
triggerall = Anim = 2026
trigger1 = AnimElem = 1
x = 0
y = 0

[State 2025, 2]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger1 = Anim = 2026
trigger1 = AnimElem = 2
attr = A, SA			
damage = floor(20*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 7,7	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -45		
hitsound = S5, 4			
guardsound = S6, 0			
ground.type = High	
ground.slidetime = 20
ground.hittime = 20
guard.hittime = 18
ground.velocity = 0,0
air.velocity = 0,-4.5
air.hittime = 20
air.animtype = Back		
yaccel = 0.5
ground.cornerpush.veloff = 0
getpower = IfElse(var(31) = 0, 60, 0)
givepower = 50
persistent = 0
kill = 0

[State 2025, 3]
type = HitDef
triggerall = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
triggerall = Anim = 2026
trigger1 = AnimElem = 6
attr = A, SA			
damage = floor(75*fvar(20)),10
animtype = Medium			
guardflag = MA			
hitflag = MAF
priority = 4, Hit			
pausetime = 7,7	
sparkno = S10001
guard.sparkno = S10131				
sparkxy = -10, -45		
hitsound = S5, 5			
guardsound = S6, 0			
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 = IfElse(var(31) = 0, 60, 0)
givepower = 50
persistent = 0
fall = 1
fall.recover = 0

[State 2025, VelSet]
type = VelSet
triggerall = Anim = 2026
trigger1 = AnimElem = 8
x = -2
y = -7

[State 2025, VelAdd]
type = VelAdd
triggerall = Anim = 2026
trigger1 = AnimElemTime(8) >= 0
y = 0.4

[State 2025, end]
type = ChangeState
trigger1 = Vel Y > 0 && Vel Y > -Pos Y
value = 1017
ctrl = 0