;================================
; CNS File for Goku Z2 by Balthazar & Cybaster
; Special and EX moves
;================================

;===========================================================================
; <<<<< KI BLAST >>>>>
; 1st light = 1000
; 2nd light = 1001
; 3rd light = 1002
; 1st med = 1003
; 2nd med = 1004
; 3rd med = 1005
; 1st strong = 1006
; 2nd strong = 1007
; 3rd strong = 1008
; Light helper = 1010
; Destroyed Helper = 1013
;===========================================================================

;LIGHT KI BLAST, 1st STRIKE

[Statedef 1000]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(4)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .7,.7

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(4)=0
value = 10,0

[State 1000, lkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(4)=0
name = "kiblastL1"
postype = P1
pos = 60,-66
ownpal = 1
stateno = 1010
id = 1010

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 5
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1010)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1010)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1010)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1001
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1004
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1007
ctrl = 0

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

;------------------------------------
;LIGHT KI BLAST, 2nd STRIKE

[Statedef 1001]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1001
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 1

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .7,.7

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 1000, lkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastL2"
postype = P1
pos = 60,-60  ;-62
ownpal = 1
stateno = 1010
id = 1011

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1011)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1011)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1011)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1002
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1005
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1008
ctrl = 0

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

;------------------------------------
;LIGHT KI BLAST, 3rd STRIKE

[Statedef 1002]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1002
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .7,.7

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 1000, lkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastL3"
postype = P1
pos = 60,-68  ;-66
ownpal = 1
stateno = 1010
id = 1012

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

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

;=======================================
;MEDIUM KI BLAST, 1st STRIKE

[Statedef 1003]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(4)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=4
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(4)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(4)=0
value = 10,0

[State 1000, mkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(4)=0
name = "kiblastM1"
postype = P1
pos = 60,-66
ownpal = 1
stateno = 1011
id = 1013

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 5
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1013)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1013)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1013)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1001
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1004
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1007
ctrl = 0

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

;------------------------------------
;MEDIUM KI BLAST, 2nd STRIKE

[Statedef 1004]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1001
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 1

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 1000, mkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastM2"
postype = P1
pos = 60,-60  ;-62
ownpal = 1
stateno = 1011
id = 1014

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1014)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1014)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1014)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1002
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1005
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1008
ctrl = 0

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

;------------------------------------
;MEDIUM KI BLAST, 3rd STRIKE

[Statedef 1005]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1002
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 1000, mkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastM3"
postype = P1
pos = 60,-68  ;-66
ownpal = 1
stateno = 1011
id = 1015

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

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

;=======================================
;STRONG KI BLAST, 1st STRIKE

[Statedef 1006]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(4)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(4)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .9,.9

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 15
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(4)=0
value = 10,1

[State 1000, skb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(4)=0
name = "kiblastS1"
postype = P1
pos = 60,-66
ownpal = 1
stateno = 1012
ID = 1016

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 5
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1016)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1016)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 5, >= 10
;trigger1 = numhelper(1016)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1001
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1004
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 5, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1007
ctrl = 0

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

;------------------------------------
;STRONG KI BLAST, 2nd STRIKE

[Statedef 1007]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1001
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 1

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .9,.9

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfx"
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfy"
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = time > 14
trigger1 = command = "2qcfz"
var(3) = 6

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,1

[State 1000, skb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastS2"
postype = P1
pos = 60,-60  ;-62
ownpal = 1
stateno = 1012
id = 1017

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 4
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1017)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 5
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1017)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = Var(3) = 6
triggerall = AnimElem = 4, >= 10
;trigger1 = numhelper(1017)
trigger1 = power>=1000 && var(18)=0
value = 2000
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
trigger3 = Var(3) = 4 && var(18)=1
value = 1002
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 2
trigger2 = Var(3) = 5 && power < 1000
trigger3 = Var(3) = 5 && var(18)=1
value = 1005
ctrl = 0
[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElem = 4, >= 11
trigger1 = Var(3) = 3
trigger2 = Var(3) = 6 && power < 1000
trigger3 = Var(3) = 6 && var(18)=1
value = 1008
ctrl = 0

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

;------------------------------------
;STRONG KI BLAST, 3rd STRIKE

[Statedef 1008]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1002
ctrl = 0
sprpriority = 2
poweradd = 10

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(3)=0
var(14) = 0

[State 220, snd]
type = playsnd
trigger1 = animelem=3
value = 3,5+random%3
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .9,.9

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,1

[State 1000, mkb]
type = Helper
helpertype = normal
trigger1 = AnimElemtime(3)=0
name = "kiblastS3"
postype = P1
pos = 60,-68
ownpal = 1
stateno = 1012
id = 1018

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 4
movetype = I

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


;===========================================================================
; SLASH DOWN KICK
;===========================================================================

[Statedef 1100]
type = A
physics = N
movetype = A
anim = 1100
velset = .3*vel x,.3*vel y
ctrl = 0
poweradd = 35
sprpriority = -1

[State 282, vel];30
type = velset
triggerall = var(8) = 1
trigger1 = animelemtime(6)>0
x = 6
y = 11

[State 282, vel];45
type = velset
triggerall = var(8) = 2
trigger1 = animelemtime(6)>0
x = 8.4
y = 9.6

[State 282, vel];60
type = velset
triggerall = var(8) >= 3
trigger1 = animelemtime(6)>0
x = 10
y = 8

[State 220, snd];kuria voice
type = playsnd
trigger1 = animelem = 5
value = 3,8
channel = 1

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = AnimElem = 4
value = 1100,0

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 21,1

[State 282, hit]
type = hitdef
trigger1 = !movecontact && !movereversed
attr = A,SA
damage = 61,8
animtype = Hard
guardflag = HA
hitflag = MAFD
priority = 4,Hit
pausetime = 11,12
sparkno = s7030
guard.sparkno = s7000
sparkxy = 0,-18
hitsound = s5,5
guardsound = s6,1
ground.type = High
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -4, 0
ground.cornerpush.veloff = -8
guard.velocity = -7.5
guard.cornerpush.veloff = -10
air.type = Low
air.velocity = -5,6
down.hittime = 24
down.velocity = 0,0
air.cornerpush.veloff = 0
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = .5
airguard.velocity = -8, -1.5
airguard.cornerpush.veloff = 0
fall.recover = 0
ID = 1098

; Avoid infinites with a.LP
[State 3000, basics limiter]
type = helper
trigger1 = movehit
helpertype = normal
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 282, end]
type = changestate
trigger1 = pos y>=0
value = 52

;===========================================================================
; DRAGON FIST (multi-step combo)
; 1st part (Left Roundhouse Hook Punch) = 1200
; 2nd part (Backspin Elbow Smash) = 1201
; 3rd part (Dragon Blast Uppercut) = 1202
; 3rd part (snap kick) = 1210
; Snap Kick Custom state = 1211
; 4th part (dragon Kick) = 1215
; EX 4th part (EX Dragon Kick) = 1255
; EX 1st part (Left Roundhouse Hook Punch) = 1250 (see ex.cns)
;===========================================================================

;Dragon Fist Light - 1st part (Left Roundhouse Hook Punch)
[Statedef 1200]
type = S
movetype = A
physics = N
poweradd = 35
ctrl = 0
anim = 1200
velset = 0,0
juggle = 8
sprpriority = 2
facep2 = 1

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State -2, Width]
type = Width
trigger1 = animelemtime(2)>=0 && animelemtime(4) < 0
value = -20,20

[State 220, snd];voice
type = playsnd
trigger1 = animelem = 1
value = 3,6
channel = 1

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100,0
volume = 10

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(1)=0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,3
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(1)>=0 && animelemtime(4) < 0
x = 10*(var(5)=1)+7*(var(5)=2)+4*(var(5)=3)  ;10,7,4

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(2)=0
x = 15 ;30  ;36

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

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(7)=0
x = 20

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(11)=0
x = 20

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(13)=0
x = 16

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 7
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz")
var(4) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 7
trigger1 = (command = "qcba") || (command = "qcbb") || (command = "qcbc")
trigger1 = command != "qcb2k"
var(4) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 7
trigger1 = (command = "qcb2k")
var(4) = 3

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 20,0

[State 200, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 11
movetype = I

[State 210, 1]
type = HitDef
trigger1 = !time
attr = S, SA
damage = 28+5*(var(5)=2)+9*(var(5)=3),2+(var(5)=2)+2*(var(5)=3)
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -33
hitsound = s5,2
guardsound = s6,1
ground.type = High
pausetime = 7,9
guard.pausetime = 7,7
ground.slidetime = 15
ground.hittime = 15
guard.hittime = 15
guard.slidetime = 15
guard.ctrltime = 15
ground.velocity = -7
air.type = High
air.velocity = -4.6,-6.5
air.hittime = 13
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 1
trigger1 = AnimElem = 11, >= 1
value = 1201
ctrl = 0
[State 1000, Go to Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 2
trigger1 = AnimElem = 11, >= 1
value = 1210
ctrl = 0
[State 1000, Go to EX Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 3
trigger1 = AnimElem = 11, >= 1
value = ifelse(power >= 500, 1260, 1210)
ctrl = 0

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

;--------------------------------------------------
;Dragon fist Light - 2nd part (Backspin Elbow Smash)

[Statedef 1201]
type = S
movetype = A
physics = N
poweradd = 35
ctrl = 0
anim = 1201
velset = 0,0
sprpriority = 2

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 220, snd];voice
type = playsnd
trigger1 = animelem = 1
value = 3,9
channel = 1

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100,1
volume = 10

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(1)=0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,3
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(1)>=0 && animelemtime(3)<0
x = 10*(var(5)=1)+7*(var(5)=2)+7*(var(5)=3)

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(1)=0
x = 20

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(3)=0
x = 15

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

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(10)=0
x = -25

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(11)=0
x = -30

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz")
var(4) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcba") || (command = "qcbb") || (command = "qcbc")
trigger1 = command != "qcb2k"
var(4) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcb2k")
var(4) = 3

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 20,1

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

[State 210, 1]
type = HitDef
trigger1 = !time
attr = S, SA
damage = 28+5*(var(5)=2)+9*(var(5)=3),2+(var(5)=2)+2*(var(5)=3)
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -45
hitsound = s5,7
guardsound = s6,0
ground.type = Low  ;High
pausetime = 7,9
guard.pausetime = 7,7
ground.slidetime = 17
ground.hittime = 17
guard.hittime = 17
guard.slidetime = 17
guard.ctrltime = 24
ground.velocity = -3
air.type = High
air.velocity = -3,-3.5
air.hittime = 13
air.juggle = 0
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5
forcestand = 1

[State 1000, Go to Dragon Fist]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 1
trigger1 = AnimElem = 10, >= 1
value = 1202
ctrl = 0
[State 1000, Go to Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 2
trigger1 = AnimElem = 10, >= 1
value = 1210
ctrl = 0
[State 1000, Go to EX Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 3
trigger1 = AnimElem = 10, >= 1
value = ifelse(power >= 500, 1260, 1210)
ctrl = 0

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

;--------------------------------------------------
;Dragon fist - 3rd part (Dragon Blast Uppercut)

[StateDef 1202];On ground
type = S
movetype = A
physics = S
ctrl = 0
anim = 1202
poweradd = 35
velset = 0,0

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = !time
value = 1100,0
volume = 10

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1203
ctrl = 0

[StateDef 1203];Rising
type = A
movetype = A
physics = N
ctrl = 0
anim = 1203
velset = 8,-9

[State 220, snd];kurai voice
type = playsnd
trigger1 = !time
value = 3,8
channel = 0

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216+var(2)
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 20,2

[State 4001, Pos]
type = PosAdd
trigger1 = time=0
x = 10

[State 4001, Invincible]
type = NotHitBy
trigger1 = (Anim = 1203) && animelemtime(5)<0
value = SCA

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X != 0
X = .9

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcba") || (command = "qcbb") || (command = "qcbc")
trigger1 = command != "qcb2k"
var(4) = 1
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcb2k")
var(4) = 2
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(4) = 3
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = command != "2qcf2k"
var(4) = 4
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "2qcf2k")
var(4) = 5

[State 4001, 3rd Hit]
type = HitDef
trigger1 = Anim = 1203
trigger1 = !time
ID = 4001
attr = A, SA
hitflag = MAF
guardflag = MA
animtype = Back
priority = 7, Hit
damage = 28+5*(var(5)=2)+9*(var(5)=3),2+(var(5)=2)+2*(var(5)=3)
pausetime = 11,14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -75
hitsound = s5,6
guardsound = 6,1
p2facing = 1
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -2,-9
air.velocity = -2,-8
fall = 1
fall.recover = 0
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
yaccel = 0.5

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1203
trigger1 = Pos Y < -30
trigger2 = Anim = 1204
Y = .55

[State 1000, Go to Dragon Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = anim = 1203
trigger1 = Var(4) = 1 && movehit
trigger1 = AnimElem = 8, >= 2
value = 1215
ctrl = 0

[State 1000, Go to EX Dragon Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = anim = 1203
trigger1 = Var(4) = 2 && movehit
trigger1 = AnimElem = 8, >= 2
value = ifelse(power >= 500, 1255, 1215)
ctrl = 0

[State 1000, Go to Air Kamehameha]
type = ChangeState
triggerall = roundstate = 2
triggerall = power >= 1000
trigger1 = anim = 1203
trigger1 = Var(4) = 3 && movehit
trigger1 = AnimElem = 8, >= 2
value = 2200
ctrl = 0

[State 1000, Go to Meteor Kick]
type = ChangeState
triggerall = roundstate = 2
triggerall = power >= 1000
trigger1 = anim = 1203
trigger1 = Var(4) = 5 && movehit
trigger1 = AnimElem = 8, >= 2
value = ifelse(power >= 2000, 2601, 2301)
ctrl = 0

[State 1000, Go to Bicycle Kick]
type = ChangeState
triggerall = roundstate = 2
triggerall = power >= 1000
trigger1 = anim = 1203
trigger1 = Var(4) = 4 && movehit
trigger1 = AnimElem = 8, >= 2
value = 2301
ctrl = 0

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1203
trigger1 = Vel Y >= 0.0
trigger2 = Anim = 1204
trigger2 = Pos Y = 0
value = Anim+1

[State 4001, StopFwd]
type = VelSet
trigger1 = Vel X = (0,0.4]
X = 0

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1205
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1205
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = Anim = 1205
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1205
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;--------------------------------------------------
;Snap Kick (3rd part V2)

[Statedef 1210]
type = S
movetype = A
physics = N
poweradd = 35
ctrl = 0
anim = 1210
velset = 0,0
sprpriority = 2

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(4)=0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,3
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 220, snd];haria voice
type = playsnd
trigger1 = animelem = 3
value = 3,10
channel = 1

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 21,2

[State 4001, StopFwd]
type = VelSet
trigger1 = animelemtime(1)>=0 && animelemtime(4)<0
x = 4.5

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

[State 250, 2]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Hard
damage    = 55,11
priority = 4, Hit
guardflag = MA
pausetime = 15,16
guard.pausetime = 19,20
sparkno = s7030
guard.sparkno = s7000
sparkxy = -15,-80
hitsound   = s5,5
guardsound = S6,1
p2facing = 1
ground.type = high
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -7
air.velocity = -4,-4
air.animtype = back
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
p2stateno = 1211 ; <- Opponent sent to flying state
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
forcestand = 1

[State 240, 1]
type = PosAdd
trigger1 = animelem = 1
X = 20
[State 240, 1]
type = PosAdd
trigger1 = animelem = 8
X = -20

[State 250, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
;P2 custom state, sent away
[Statedef 1211]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5052),5052,5030)
ctrl = 0
velset = -10, -5
facep2 = 1

[State 9011, VelAdd]
type = VelAdd
trigger1 = (Pos Y < 0)
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
 
[State 9011, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;--------------------------------------------------
;Dragon fist - 4th part (Dragon Kick)

[StateDef 1215]
type = A
movetype = A
physics = A
anim = 1215
ctrl = 0
poweradd = 35
sprpriority = 2

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = !time
value = 1100,2
volume = 10

[State 220, snd];woria voice
type = playsnd
trigger1 = animelem=2
value = 3,12
channel = 1

[State 650, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 650, 3]
type = HitDef
trigger1 = animelem = 3
trigger2 = animelem = 5 && !movecontact
attr = A, SA
damage = 49,5
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 15,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s5,5
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -12,8
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
fall = 1
fall.recover = 0
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 50
ctrl = 0

;===========================================================================
; <<<<< SLASHING CHOP >>>>>
; Charge state 1 = 1300
; Charge state 2 (when hit) = 1301
; Actual attack = 1302
; Helper for repel = 1305
; Destroyed helper = 1306
; Reflect with random projectile = 1308
; Reflected projectile = 1315
; Reflected projectile explods = 1316
; Custom state when hit by slashing chop max charge = 1320
;===========================================================================

;Focus Strike - charge state 1
;This state covers the charging aspect of the Focus Strike attack at the start.
[Statedef 1300]
type = S
movetype = I
physics = S
juggle = 10
anim = 1300
ctrl = 0
poweradd = 0
velset = 0,0
 
; These next two sctrls cover initial charge value and building it up
[State 900, starting value]
type = VarSet
trigger1 = time = 1 && var(20)
fvar(9) = 0
 
[State 900, adding to value]
type = VarAdd
trigger1 = time >= 1
fv = 9
value = 1
persistent = 1

[State 8000, flash]
type = PalFX
trigger1 = time =10 
add = 40, 30, -40
sinadd = 50,50,50,16
time = 40
 
; These change states control dash cancels and moving into the attack portion
[State 900, dash cancel back]
type = ChangeState
trigger1 = time >= 8 && command = "BB"
value = 105
 
[State 900, dash cancel forward]
type = ChangeState
trigger1 = time >= 8 && command = "FF"
value = 100
 
[State 900, stopping early]
type = ChangeState
trigger1 = time >= 8 && command != "hold-c" && command !="hold-z"
value = 1302
 
[State 900, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 1302
 
;---------------------------------------------
;Focus Strike - charge state 2
;This state covers the charging aspect of the Focus Strike attack if hit
[Statedef 1301]
type = S
movetype = I
physics = S
juggle = 10
ctrl = 0
poweradd = 0
velset = 0,0
 
; This part covers the after effects of getting hit from earlier.
[state 901, no more saving hit]
type = varset
trigger1 = time = 1
var(20) = 0

[State 8000, flash]
type = PalFX
trigger1 = time =1
add = 40, 30, -40
sinadd = 50,50,50,16
time = 10
 
[State 901, life removal]
type = LifeAdd
trigger1 = time = 1 && !var(20)
value = -(gethitvar(damage))
kill = 1

[State 901, Killed]
type = ChangeState
trigger1 = life <= 0
value = 5950
 
; This ctrl changes the animframe back to the last active one
[State 901, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1300
elem = var(23)
 
; This varset is the continuation of charging
[State 901, adding to charge]
type = VarAdd
trigger1 = time >= 1
fv = 9
value = 1
persistent = 1
 
; These change states control dash cancels and moving into the attack portion
[State 901, dash cancel]
type = ChangeState
trigger1 = time >= 8 && command = "BB"
value = 105
 
[State 901, dash cancel forward]
type = ChangeState
trigger1 = time >= 8 && command = "FF"
value = 100
 
[State 901, early release]
type = ChangeState
trigger1 = time >= 8 && command != "hold-c" && command !="hold-z"
value = 1302
 
[State 901, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 1302
 
;----------------------------------------
;Focus Attack - actual attack
[Statedef 1302]
type = S
movetype = A
physics = S
juggle = 10
anim = 1301
ctrl = 0
velset = 0,0
 
;PalFX sctrls; the first removes any earlier stuff, and the second the white flash that appears if you have maxed out focus
[state 901, cancel earlier fx flash]
type = PalFx
trigger1 = time = 0
add = 0,0,0
time = 0
 
[state 901, bright flash if maxed out]
type = PalFx
triggerall = FVar(9) = 60
trigger1 = time = 1
add = 128,128,128
sinadd = -128,-128,-128,32
time = 8

[State 1302, voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 3,10
channel = 0

[State 1302, 2]
type = PlaySnd
trigger1 = AnimElem = 2 && (FVar(9) < 60)
value = 20,1

[State 1302, 2]
type = PlaySnd
trigger1 = AnimElem = 2 && (FVar(9) = 60)
value = 20,2

[State 4000, Invincible]
type = NotHitBy
trigger1 = animelemtime(2) >= 0 && animelemtime(8) < 0
value = ,NP, SP

[State 1300, repel helper]
type = helper
trigger1 = animelemtime(2) = 0
helpertype = normal
stateno = 1305
ID = 1305
name = "repel"
postype = p1
pos = 50, -40

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(2)=1
anim = 1206+(var(2)=0)
id = 1206
pos = 30,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[state 1215, Slash FX front]
type = explod
trigger1 = animelemtime(2)=0
anim = 1302
id = 1302
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1

[state 1215, Slash FX back]
type = explod
trigger1 = animelemtime(3)=0
anim = 1303
id = 1302
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
;bindtime = -1
 
; The hitdef used depends on the how long you've been charging. In case you are wondering why there are 2 versions of each lvl's
; hitdef, the second one has been refined to compensate for hitting air opponents.
; LV 1
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 2 && (FVar(9) < 60)
attr = S, NA
damage = 32,0
animtype = Hard
guardflag = M
hitflag = M
priority = 4, Hit
pausetime = 8, 9
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -8.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 2 && (FVar(9) < 60)
attr = S, NA
damage= 32,0
animtype = Hard
guardflag = A
hitflag = A
priority = 4, Hit
pausetime = 8, 9
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -6.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
; LV 2 MAX
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 2 && FVar(9) = 60
attr = S, NA
damage = 59,0
animtype = Hard
;guardflag = MA ;<-- Commented out as you will not be blocking this. This will hurt, and you will fall!
hitflag = MAF
priority = 4, Hit
pausetime = 13, 14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 6
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
p2stateno = 1320 ; <- Opponent sent to flying state
 
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 2 && FVar(9) = 60
attr = S, NA
damage = 59,0
animtype = Hard
hitflag = A
priority = 6, Hit
pausetime = 13, 14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 6
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
 
[State 902, fvar reset]
type = VarSet
trigger1 = !AnimTime
fvar(9) = 0
 
;Dash Cancels upon movecontact
[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "FF"
value = 100
 
[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "BB"
value = 105
 
[State 902, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
[Statedef 1320]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5052),5052,5030)
ctrl = 0
velset = -7, -5
facep2 = 1
 
[State 9011, VelAdd]
type = VelAdd
trigger1 = (Pos Y < 0)
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
 
[State 9011, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;===========================================================================
; <<<<< HURRICANE KICK >>>>>
; On ground : 1400
; Rising : 1401
; Following Kick : 1405
;===========================================================================

[Statedef 1400];on ground
type = S
movetype = A
physics = N
ctrl = 0
anim = 1400
velset = 0,0
sprpriority = 2
facep2 = 1

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1401
ctrl = 0

;---------------------------
[StateDef 1401];Rising
type = U
movetype = A
physics = N
ctrl = 0
anim = 1401
poweradd = 35

[State 4001, Fall]
type = VarSet
trigger1 = !time
var(12) = 0

[State 6000, VelIni]
type = VelSet
trigger1 = Time = 0
trigger1 = var(16):=(StateType != A)
X = 5
Y = -7

[State 6000, VelIni]
type = VelSet
trigger1 = Time = 0
trigger1 = !var(16)
X = (5+(var(15)=2)+2*(var(15)=3))-3*(Vel X = 0)-10*(Vel X < 0)
Y = (Vel Y)-2.5

[State 6000, ToAir]
type = StateTypeSet
trigger1 = Time = 0
statetype = A

[State 4001, Stop]
type = VelSet
trigger1 = !time
trigger1 = var(15) = 1
trigger1 = var(16)
X = 5
Y = -7

[State 4001, Stop]
type = VelSet
trigger1 = !time
trigger1 = var(15) = 2
trigger1 = var(16)
X = 6
Y = -7

[State 4001, Stop]
type = VelSet
trigger1 = !time
trigger1 = var(15) >= 3
trigger1 = var(16)
X = 7
Y = -7

[State 4001, Stop]
type = VelAdd
trigger1 = time>5 && time<10 && (vel Y > -9)
trigger1 = var(15) >= 2
trigger1 = var(16)
Y = -0.7

[state 1215, Rising Effect]
type = explod
trigger1 = !time
trigger1 = var(16)
anim = 1216+var(2)
id = 1216
pos = -50,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 220, snd];urriyaa voice
type = playsnd
trigger1 = !time
value = 1400,1
channel = 0

[State 6100, turning snd];woosh
type = playsnd
trigger1 = anim=1401 && animelem=3
value = 1400,0
volume = 10
channel = 2
persistent = 0

[State 6100, turning snd]
type = playsnd
trigger1 = anim=1401 && animelem=5
value = 21,1
channel = 1

[State 250, 2]
type = HitDef
trigger1 = anim=1401 && animelem=5
attr = S, SA
animtype  = Hard
damage    = 35 + 6*(var(15)=2) + 9*(var(15)=3),3
priority = 4, Hit
guardflag = MA
pausetime = 13,14
guard.pausetime = 14,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -15,-65
hitsound   = s5,5
guardsound = S6,1
ground.type = high
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -7,ifelse(time<9 && var(15)!=1,-1,0)
air.velocity = -4,-4
air.animtype = back
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
fall = time<9 && var(15)!=1
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5
forcestand = 1

[State 250, Go to Boomerang Kick]
type = ChangeState
trigger1 = anim=1401 && movecontact
trigger1 = (command = "qcba") || (command = "qcbb") || (command = "qcbc")
trigger1 = pos Y < -35
value = 650

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X !=0 && time%2
trigger1 = var(16)
x = 0.95

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1401 && (vel Y < 0) && var(15)<3
Y = .55
[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1401 && (vel Y < 0) && var(15)>=3
Y = .40

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0) && var(15)<3
Y = .4
[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0) && var(15)>=3
Y = .35  ;.3

[State 4001, Fall]
type = VarSet
trigger1 = Anim = 1401 && Vel Y > 0
trigger1 = prevstateno=1400 ;on ground
trigger1 = (command="qcfa") || (command="qcfb") || (command="qcfc")
var(12) = 1

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1401
trigger1 = Pos Y >= 0 && time>6
value = Anim+1

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1402
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y > 10
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1402
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1402
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1402
anim=17200
id=17200
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,0.8

[State 4001, follow up]
type = ChangeState
trigger1 = Anim = 1402 && animelemtime(3)>=1
trigger1 = var(12) = 1
value = 1405
ctrl = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1402
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; STAND STRONG KICK (BLUR KICK)

[Statedef 1405]
type = S
movetype = A
physics = S
anim = 250
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3
juggle = 0

[State 250, 1]
type = Turn
trigger1 = !time && p2Dist X < 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(5)=0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .7,.7

[State 220, snd];haria voice
type = playsnd
trigger1 = animelem = 3
value = 3,10
channel = 1

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 2

[State 250, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = S, NA
animtype  = Hard
damage    = 40,4
priority = 4, Hit
guardflag = MA
pausetime = 12,13
guard.pausetime = 12,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-80
hitsound   = s5,5
guardsound = S6,1
p2facing = 1
ground.type = high
ground.slidetime = 15
ground.hittime = 24
ground.velocity = -9
air.velocity = -4,-4
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
p2stateno = 1320 ; <- Opponent sent to flying state
forcestand = 1

[State 240, 1]
type = PosAdd
trigger1 = animelem = 2
X = 9
[State 240, 1]
type = PosAdd
trigger1 = animelem = 3
X = 15
[State 240, 1]
type = PosAdd
trigger1 = animelem = 6
X = 7
[State 240, 1]
type = PosAdd
trigger1 = animelem = 14
X = 27

[State 250, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;===========|| BEGINNING OF EX STUFF ||===========
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

;========================================================
;=====| RESUME |=====
; Ex Dragon Fist : 1250
; Ex Dragon Kick : 1255
; Ex Dragon Kick P2 stateno : 1256
; Ex Slash Down Kick : 1110
; Ex slash down kick back dash : 1111
; Ex Snap kick : 1260 > 1264
;========================================================


; EX Dragon Fist - 1st part (Left Roundhouse Hook Punch *3)

[Statedef 1250]
type = S
movetype = A
physics = N
poweradd = -500
ctrl = 0
anim = 1250
velset = 0,0
juggle = 8
sprpriority = 2
facep2 = 1

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 220, snd];taaa voice
type = playsnd
trigger1 = animelem=1
value = 3,13   ;3,11
channel = 1

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(1)=0
anim = 1206
id = 1206
pos = 0,3
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .9,.9

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 0

[State 8000, flash]
type = PalFX
trigger1 = anim=1250
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(2)=0
x = 30

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(1)>=0 && animelemtime(4) < 0
trigger2 = animelemtime(11)>=0 && animelemtime(14) < 0
trigger3 = animelemtime(20)>=0 && animelemtime(24) < 0
x = 2

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(7)=0
trigger2 = animelemtime(17)=0
trigger3 = animelemtime(27)=0
trigger4 = animelemtime(11)=0
trigger5 = animelemtime(21)=0
trigger6 = animelemtime(31)=0
x = 20

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(12)=0
trigger2 = animelemtime(22)=0
x = 15

[State -2, Accel]
type = VelSet
trigger1 = animelemtime(4)=0
trigger2 = animelemtime(14)=0
trigger3 = animelemtime(24)=0
x = 0

[State -2, Accel]
type = PosAdd
trigger1 = animelemtime(13)=0
trigger2 = animelemtime(20)=0
trigger3 = animelemtime(33)=0
x = 8

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, VarSet]
type = VarSet
trigger1 = animelemtime(27)>0
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz")
var(4) = 1
[State 800, VarSet]
type = VarSet
trigger1 = animelemtime(27)>0
trigger1 = (command = "qcba") || (command = "qcbb") || (command = "qcbc")
trigger1 = command != "qcb2k"
var(4) = 2
[State 800, VarSet]
type = VarSet
trigger1 = animelemtime(27)>0
trigger1 = (command = "qcb2k")
var(4) = 3

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
trigger2 = animelem = 15
trigger3 = animelem = 25
value = 20,1+random%2

[State 200, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 29
movetype = I

[State 210, 1]
type = HitDef
trigger1 = animelem=8
trigger2 = animelem=18
attr = S, SA
damage = 31,3
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -33
hitsound = s5,1
guardsound = s6,0
ground.type = High
pausetime = 6,7
guard.pausetime = 9,9
ground.slidetime = 10;17
ground.hittime = 10;17
guard.hittime = 10;17
guard.slidetime = 10;17
guard.ctrltime = 15;24
ground.velocity = -3
air.type = High
air.velocity = -2,-4
air.hittime = 13
air.juggle = 0
getpower = 0,0
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 12
envshake.ampl = 3
forcestand = 1

[State 210, 1]
type = HitDef
trigger1 = animelem=28
attr = S, SA
damage = 31,3
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -33
hitsound = s5,1
guardsound = s6,0
ground.type = High
pausetime = 9,11 ;12,12
guard.pausetime = 11,11
ground.slidetime = 15;17
ground.hittime = 15;17
guard.hittime = 15;17
guard.slidetime = 15;17
guard.ctrltime = 24
ground.velocity = -3
air.type = High
air.velocity = -2,-4
air.hittime = 13
air.juggle = 0
getpower = 0,0
givepower = 35,35
air.fall = 1
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5
forcestand = 1

[State 1000, 6]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 1
trigger1 = AnimElem = 29, >= 1
value = 1201
ctrl = 0
[State 1000, Go to Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 2
trigger1 = AnimElem = 29, >= 1
value = 1210
ctrl = 0
[State 1000, Go to EX Snap Kick]
type = ChangeState
triggerall = roundstate = 2
trigger1 = Var(4) = 3
trigger1 = AnimElem = 29, >= 1
value = ifelse(power >= 500, 1260, 1210)
ctrl = 0

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

;===========================================================================
; EX DRAGON KICK
;===========================================================================

[StateDef 1255]
type = A
movetype = A
physics = A
anim = 1215
ctrl = 0
sprpriority = 2
poweradd = -500

[State varset];juggle limiter
type = VarSet
trigger1 = !time && var(6)>0
var(7) = 1

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(4) = 1

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 0

[State 8000, flash]
type = PalFX
trigger1 = anim=1215
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 220, snd];woria voice
type = playsnd
trigger1 = animelem=2
value = 3,12
channel = 1

[State 650, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2

[State 650, 3]
type = HitDef
triggerall = p2statetype != A
trigger1 = animelem = 3
trigger2 = animelem = 5 && !movecontact
attr = A, SA
damage = 46,7
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 15,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s5,5
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,10
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
fall = 1
fall.recover = 0
getpower = 0,0
givepower = 35,35
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
yaccel = 0.5

[State 650, 3]
type = HitDef
triggerall = p2statetype = A && var(7)=0
trigger1 = animelem = 3
trigger2 = animelem = 5 && !movecontact
attr = A, SA
damage = 46,7
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 15,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s5,5
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,10
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
fall = 1
fall.recover = 0
getpower = 0,0
givepower = 35,35
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
yaccel = 0.35
p2stateno = 1256

[State 650, 3]
type = HitDef
triggerall = p2statetype = A && var(7)=1
trigger1 = animelem = 3
trigger2 = animelem = 5 && !movecontact
attr = A, SA
damage = 46,7
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 15,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s5,5
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,10
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
fall = 1
fall.recover = 0
getpower = 0,0
givepower = 35,35
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
yaccel = 0.5

[State varset]
type = VarSet
trigger1 = p2stateno = 1256
var(6) = 1

[State 1000, Go to Air Kamehameha]
type = ChangeState
triggerall = roundstate = 2
triggerall = power >= 1000
trigger1 = anim = 1215
trigger1 = Var(4) = 1 && var(7) = 0 && movehit
trigger1 = AnimElem = 7, >= 0
value = 2200
ctrl = 0

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 50
ctrl = 0


;===========================================================================
; EX SLASH DOWN KICK
;===========================================================================

[Statedef 1110]
type = A
physics = N
movetype = A
anim = 1110
velset = .4*vel x,.4*vel y
ctrl = 0
poweradd = -500
sprpriority = -1

[State 282, vel]
type = velset
trigger1 = animelemtime(6)>0
x = 10.92
y = 12.5

[state 1215, Slash FX front]
type = explod
trigger1 = animelemtime(7)=0
anim = 1115
id = 1115
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -1
persistent = 0
ignorehitpause = 0

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 0

[State 8000, flash]
type = PalFX
trigger1 = anim=1110
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 220, snd];kuria voice
type = playsnd
trigger1 = animelem = 5
value = 3,8
channel = 1

[State 250, 1];Dragon Roar
type = PlaySnd
trigger1 = AnimElem = 4
value = 1100,0

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 21,1

[State 282, varset]
type = varset
trigger1 = !time
var(9)=0

[State 282, varadd]
type = varadd
trigger1 = movecontact
var(9) = 1

[State 282, hit]
type = hitdef
trigger1 = var(9)<3
attr = A,SA
damage = 33,6
animtype = Hard
guardflag = HA
hitflag = MAFD
priority = 4,Hit
pausetime = 11,12
sparkno = s7020
guard.sparkno = s7000
sparkxy = 0,-18
hitsound   = s5,5
guardsound = S6,1
ground.type = High
ground.hittime = 17
ground.slidetime = 17
ground.velocity = -4, 0
ground.cornerpush.veloff = -8
guard.velocity = -7.5
guard.cornerpush.veloff = -10
air.type = Low
air.velocity = -5,6
down.hittime = 24
down.velocity = 0,0
air.cornerpush.veloff = 0
getpower = 0,0
givepower = 35,35
yaccel = .5
airguard.velocity = -8, -1.5
airguard.cornerpush.veloff = 0
fall.recover = 0

[state 52, Land FX]
type = helper
trigger1 = pos y>=0 && moveguarded
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999
pos = 100,0

[State 282, dash back when guarded]
type = changestate
trigger1 = pos y>=0 && p2dist x >=0
trigger1 = moveguarded
value = 1111

[State 282, end]
type = changestate
trigger1 = pos y>=0 && !moveguarded
trigger2 = pos y>=0 &&  moveguarded && p2dist x <0  ;Avoid jumping back when landing behind the opponent
value = 52

;---------------------------------------
;Dash back from EX dragon kick
[Statedef 1111]
type    = S
physics = S
movetype = I
ctrl = 0
anim = 47
velset = 0,0

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

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

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

;===========================================================================
; EX SNAP KICK (FLIP KICK)
;===========================================================================

[Statedef 1260];on ground
type = S
movetype = A
physics = N
poweradd = -500
ctrl = 0
anim = 1260
velset = 0,0
sprpriority = 2

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 220, snd];haria voice
type = playsnd
trigger1 = !time
value = 3,10
channel = 1

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 0

[State 8000, flash]
type = PalFX
trigger1 = anim=1260
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1261
ctrl = 0

;-------------------------
[StateDef 1261];Rising
type = A
movetype = A
physics = N
ctrl = 0
anim = 1261
velset = 8,-6   ;12,-8

[State 8000, flash]
type = PalFX
trigger1 = anim=1261
trigger2 = anim=1262
trigger3 = anim=1263
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 30
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216+var(2)
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 250, 2]
type = HitDef
trigger1 = anim=1261 && animelem=4
trigger2 = anim=1261 && animelem=5 && !movecontact
attr = S, SA
animtype  = Hard
damage    = 55
priority = 4, Hit
pausetime = 11,12
guard.pausetime = 19,20
sparkno = s7030
guard.sparkno = s7000
sparkxy = -15,-60
hitsound   = s5,6
guardsound = S6,1
p2facing = 1
ground.type = high
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -7
air.velocity = -4,-4
air.animtype = back
getpower = 0,0
givepower = 35,35
p2stateno = 1264 ; <- Opponent sent to flying state

[State 4001, AirFriction]
type = VelAdd
trigger1 = Vel X >-3
x = -1.3

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1261 && animelemtime(4)<0
trigger1 = Pos Y < -30
Y = .55

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1261 && animelemtime(4)>=0 && animelemtime(5)<0
trigger1 = Pos Y < -30
Y = .4

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1261 && animelemtime(5)>=0
trigger1 = Pos Y < -30
Y = .3

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1262
Y = .4

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1261
trigger1 = Vel Y >= 0.0
trigger2 = Anim = 1262
trigger2 = Pos Y = 0
value = Anim+1

[State 4001, StopFwd]
type = VelSet
trigger1 = Vel X = [-3,-1.7]
X = 0

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1263
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1263
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1263
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = Anim = 1263
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1263
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
;P2 custom state, sent away
[Statedef 1264]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5937),5937,ifelse(selfanimexist(5052),5052,5030))
ctrl = 0
facep2 = 1

[State 4005, vel]
type = velset
trigger1 = animelemtime(2)=0
x = -4
y = -10
persistent = 0

[State 6100, turning snd]
type = playsnd
triggerall = anim=5937
trigger1 = !time
trigger2 = time = 10
trigger3 = time = 20
trigger4 = time = 30
trigger5 = time = 40
trigger6 = time = 50
trigger7 = time = 60
trigger8 = time = 70
trigger9 = time = 80
value = 21,1
persistent = 1

[state 17100, Flip KO FX]
type=explod
trigger1 = Anim=5937 && !numexplod(59370) && animelemtime(3)=0
anim = 5938
id = 5938
pos = 0,-50
postype = P1
sprpriority = 3
ownpal = 1
;supermovetime = -1
removetime = -1
persistent = 0
bindtime = -1
ignorehitpause = 1
 
[State 9011, VelAdd]
type = VelAdd
trigger1 = Pos Y < 0
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
 
[State 9011, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100


;===========================================================================
; <<<<< EX HURRICANE KICK >>>>>
; On ground : 1410
; Rising : 1411
;===========================================================================

[Statedef 1410];on ground
type = S
movetype = A
physics = N
poweradd = -500
ctrl = 0
anim = 1400
velset = 0,0
sprpriority = 2
facep2 = 1

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 1

[State 8000, flash]
type = PalFX
trigger1 = anim=1400
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1411
ctrl = 0

;---------------------------
[StateDef 1411];Rising
type = U
movetype = A
physics = N
ctrl = 0
poweradd = ifelse(prevstateno=1410,0,-500)
anim = 1410

[State 4001, Fall]
type = VarSet
trigger1 = !time
var(12) = 0

[State 6000, VelIni]
type = Velset
trigger1 = Time = 0
trigger1 = var(16):=(StateType != A)
x = 7
y = -10

[State 6000, VelIni]
type = VelSet
trigger1 = Time = 0
trigger1 = !var(16)
X = 7-3*(Vel X = 0)-10*(Vel X < 0)
Y = (Vel Y)-3.5

[State 6000, ToAir]
type = StateTypeSet
trigger1 = Time = 0
statetype = A

[State 8000, flash]
type = PalFX
trigger1 = anim=1410
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 40
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 6100, snd]
type = playsnd
triggerall = prevstateno!=1410
trigger1 = !time
value = 7,0
channel = 1

[State 6100, snd];haria voice
type = playsnd
trigger1 = !time
value = 3,10
channel = 0

[state 1215, Rising Effect]
type = explod
triggerall = prevstateno=1410
trigger1 = !time
anim = 1216+var(2)
id = 1216
pos = -50,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[state 17100, Turning Effect front]
type=explod
trigger1 = Anim = 1410 && animelemtime(5)=0
anim = 1403
id = 1403
pos=25,-70
postype=P1
sprpriority=3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 1
bindtime = -1
ignorehitpause = 0
scale = 0.75,0.75

[state 17100, Turning Effect back]
type=explod
trigger1 = Anim = 1410 && animelemtime(5)=0
anim = 1404
id = 1404
pos=25,-70
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 1
bindtime = -1
ignorehitpause = 0
scale = 0.75,0.75

[State 6100, turning snd];woosh
type = playsnd
trigger1 = anim=1410 && animelem=4
value = 1400,0
volume = 20
channel = 2
persistent = 0

[State 6100, turning snd]
type = playsnd
trigger1 = anim=1410 && animelem=4 && time>7
value = 21,2
channel = 1

[State 250, 2]
type = HitDef
trigger1 = anim=1410 && animelem=4
trigger2 = anim=1410 && animelem=6
attr = S, SA
animtype  = Hard
damage    = 20,2
priority = 4, Hit
guardflag = MA
pausetime = 11,12
guard.pausetime = 11,12
sparkno = s7030
guard.sparkno = s7000
sparkxy = -15,-65
hitsound   = s5,5
guardsound = S6,1
ground.type = high
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -7
air.velocity = -4,-4
air.animtype = back
getpower = 0,0
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5
forcestand = 1

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X !=0 && time%2
trigger1 = var(16)
x = 0.95

[State 4001, Fall]
type = VelAdd
trigger1 = (vel Y < 0)
Y = .40

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0)
Y = .3

[State 4001, Fall]
type = VarSet
trigger1 = Anim = 1410 && Vel Y > 0
trigger1 = prevstateno=1410 ;on ground
trigger1 = (command="qcfa") || (command="qcfb") || (command="qcfc")
var(12) = 1

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1410
trigger1 = Pos Y >= 0 && time>6
value = 1402

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1402
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y > 10
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1402
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1402
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1402
anim=17200
id=17200
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,0.8

[State 4001, follow up]
type = ChangeState
trigger1 = Anim = 1402 && animelemtime(3)>=1
trigger1 = var(12) = 1
value = 1405
ctrl = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1402
trigger1 = AnimTime = 0
value = 0
ctrl = 1
