; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 105
velset = 0,0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 170,0+random%2

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

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


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



;---------------------------------------------------------------------------
; 191 - Vanilla Intro Decider [700-709]

;Vanilla Intro Decider [700-709]
[Statedef 191] ;new state
type = S
ctrl = 0
velset = 0,0


[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 190, Vs 18]
type = ChangeState
triggerall = numenemy
triggerall = Time = 0
triggerall = Random%5=0
trigger1 = (enemy,authorname="Team Z2")
trigger1 = (enemy,Name = "C18 Z2")
value = 789

[State 190, Vs 18]
type = null;ChangeState
triggerall = numenemy
triggerall = Time = 0
triggerall = Random%5=0
trigger1 = (enemy,authorname="Team Z2")
trigger1 = (enemy,Name = "Goku Z2")
value = 788

[State 0, ChangeState]
type = ChangeState
trigger1 = !time
value =  700+random%6
ctrl = 0

;---------------------------------------------------------------------------
; Piccolo Intro
[Statedef 700]
type = S
ctrl = 0
anim = 19100
velset = 0,0
sprpriority = 4


[state 700, playsnd]
type = playsnd
trigger1 = !time
value = 700,0
channel = 15


[State 0, Helper]
type = Helper
trigger1 = time=1
name = "Underlay"
ID = 19100
stateno = 19100
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
ignorehitpause = 0
persistent = 0

[state 700, playsnd]
type = playsnd
triggerall = anim = 19100
trigger1 = animelem = 19
value = 700,1
channel = 16

[state 700, playsnd]
type = playsnd
triggerall = anim = 19100
trigger1 = animelem = 24
value = 700,2
channel = 17

[state 700, playsnd]
type = playsnd
triggerall = anim = 19100
trigger1 = animelem = 44
value = 700,3
channel = 18

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(46) <= 2
flag = noshadow

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 19100

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nobardisplay

[state 700, playsnd]
type = playsnd
trigger1 = !time
value = 700,0
channel = 15

[State 0, Explod]
type = Explod
trigger1 = animelemtime(47) = 1
anim = 192
ID = 192
pos = 0,-70
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = -5,-5
accel = 0,0.5
removetime = 120
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;trans = 
;persistent =
;supermove = 0
;pausemove = 0


[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Let's do this
[Statedef 701]
type = S
ctrl = 0
anim = 191
velset = 0,0
sprpriority = 4

[state 700, playsnd]
type = playsnd
trigger1 = animelem = 4 || animelem = 7
value = 701,0
channel = 15

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Milk Intro
[Statedef 702]
type = S
physics = N
ctrl = 0
anim = 1
velset = 0,0
sprpriority = -4

[State 180, vs Krillin Z2]
type = ChangeState
triggerall = numenemy
trigger1 = enemy, StateNo = 702
trigger1 = (enemy,authorname="Team Z2")
trigger1 = (enemy,Name = "Krillin Z2")
value = 191

[State 0, VarSet]
type = VarSet
trigger1 = Time < 4
fvar(4) = Pos X

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 5
x = 250

[State 191, 1] 
type = ChangeAnim
trigger1 = Time = 5
value = 194;Cond(Facing = 1,194,194)

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

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(11194)
trigger1 = Anim = 194
anim = Cond(Facing = 1,11194,11195)
ID = 11194
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -3
facing = Cond(Facing = 1, 1,-1)


[State 0, VelSet]
type = VelSet
trigger1 = Anim = 194 || Anim = 11196
x = -3

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time>=240
trigger2 = Anim != 194
trigger2 = Anim != 11196
id = 11194

[State 100, steps]
type = playsnd
triggerall = Anim = 194 || Anim = 11196
trigger1 = animelemtime(2)=0 
trigger2 = animelemtime(8)=0 
value = 0,51
channel = 16

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 140
value = 1000,0
channel = 17

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 140
trigger2 = Time = 142
trigger3 = Time = 147
trigger4 = Time = 150
trigger5 = Time = 156
trigger6 = Time = 166
value = 194,10


[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 180
value = 194,0
channel = 19

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 240
value = 42

[State 0, PosSet]
type = PosSet
trigger1 = Time = 240
x = cond(Facing = 1,fVar(4) - 120,fVar(4) + 120)

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 42
x = 3
y = -10
persistent = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = Pos Y < 0
y = .5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 42
trigger1 = !AnimTime
value = 45


[State 0, VelSet]
type = VelSet
trigger1 = Anim = 45
trigger1 = Pos X = [fVar(4) -2,fVar(4) +2]
trigger2 = Anim = 47
x = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 45
trigger1 = Pos Y >= 0
value = 47

[State 0, PosSet]
type = PosSet
trigger1 = Anim = 45
trigger1 = Pos Y >= 0
trigger2 = Anim = 47
x = fvar(4)
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 47
value = 40,2
persistent = 0
channel = 15

[State 0, Explod]
type = Explod
trigger1 = Anim = 47
anim = 17100
ID = 17100
pos = 0,0
postype = p1 
sprpriority = -5
persistent = 0

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = Anim = 47
trigger1 = !AnimTime
value = 0
;---------------------------------------------------------------------------
;Pushups Intro
[statedef 703]
type = S
sprpriority = 4
anim = ifelse(random%2 = 0,701,702)

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 703, pushups]
type = playsnd
triggerall = anim = 701 || anim = 702
trigger1 = animelem = 3 || animelem = 8 || animelem = 13 || animelem = 18 
value = 5000,0+random%2
channel = 15

[State 0, Helper]
type = Helper
trigger1 = !time
name = "Yajirobe"
ID = 70300
stateno = 70300
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

;--------------------------Yajirobe thrown off----------------------------
[state 703, playsnd]
type = playsnd
triggerall = anim = 702
trigger1 = time = 163
value = 0,2
channel = 16



[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 702
trigger1 = AnimElemTime(28)=1
trigger2 = AnimElemTime(31)=1
value = 5,0
channel = 17
;--------------------------Hits Head----------------------------

[State 0, Explod]
type = Explod
triggerall = anim = 701
trigger1 = time = 171
anim = 7020
ID = 7020
pos = 5,-60
postype = p1 
sprpriority = 5
persistent = 0

[state 703, playsnd]
type = playsnd
triggerall = anim = 701
trigger1 = time = 171
value = 5,2
channel = 16

[state 703, envshake]
type = envshake
triggerall = anim = 701
trigger1 = time = 171
ampl = 5
freq = 60
time = 15

[state 703, playsnd]
type = playsnd
triggerall = anim = 701
trigger1 = animelemtime(24) = 0
value = 5000,21+random%3 
channel = 17

[state 703, playsnd]
type = playsnd
triggerall = anim = 701
trigger1 = animelemtime(37) = 0
value = 703,1+random%3
channel = 18

[state 703, changestate]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1
;----------------------------------------------------------------------------
;Yajirobe Helper
[statedef 70300]
type = A
physics = N
anim = 70100
sprpriority = 3


;---------------------Thrown off-----------------------------

[state 70300, velset]
type = velset
triggerall = root,anim = 702
trigger1 = time = 163
x = -6
y = -9

[state 70300, veladd]
type = veladd
triggerall = root,anim = 702
trigger1 = pos y < 0
y = .4

[state 70300, land]
type = envshake
trigger1 = pos y >= 0 && vel y > 0
ampl = 6
freq = 60
time = 10

[state 70300, playsnd]
type = playsnd
trigger1 = pos y >= 0 && vel y > 0
value = 15000, 2
channel = 19
;----------------------Gets Hit------------------------------
[state 70300, velset]
type = velset
triggerall = root,anim = 701
trigger1 = time = 163
x = -3
y = -3

[state 70300, velset]
type = velset
triggerall = root,anim = 701
trigger1 = time = 171
x = 0
y = 0

[state 70300, velset]
type = velset
triggerall = root,anim = 701
trigger1 = time = 173
x = -4
y = -9


[state 70300, destroyself]
type = destroyself
trigger1 = root,anim = 701 && pos x!=[-240,240]  
trigger2 = pos y >= 0 && vel y > 0 && root,anim = 702

;---------------------------------------------------------------------------
;Dark Kinton Cloud
[Statedef 704]
type = S
ctrl = 0
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

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

[State 3000, Kinton Cloud]
type = helper
trigger1 = time = 0
helpertype = normal
stateno = 70400
ID = 70400
name = "cloud"
postype = p1
pos = 0,0
ownpal = 1

[State 4003, X set]
type = posadd
trigger1 = time=0
x = -300
y = - 60 - random%80

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

[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 703 

[State 181, cloud sound]
type = PlaySnd
trigger1 = time = 80
value = 704, 0
channel = 16

[State 4003, velset run]
type = velset
trigger1 = time=180
x = 10

[State 4003, velset run]
type = velset
trigger1 = time=200
y = 1

[State 4003, velset run]
type = velAdd
trigger1 = time>=198 && time<220
x = -.395

[State 4003, run stop vel]
type = velset
trigger1 = time = 220
x = 0
y = 0

[State 190, 4] ;crouch to stance
type = ChangeAnim
triggerall = anim = 194
trigger1 = time = 256
value = 12

[State 190, 4] ;Change to jump state
type = ChangeState
trigger1 = time = 260
value = ifelse(random%2 = 0,70401,70403)
ctrl = 0

;Dark Kinton, Jump
[Statedef 70401]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
facep2 = 1
[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1
channel = 17


[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = 0
y = const(velocity.jump.y) 

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

[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

; Jump Up
[Statedef 70402]
type    = A
physics = A


[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

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

[State 50, 2]
type = ChangeAnim
trigger1 = time = 0
value = 41

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3
;-----------------------------------------------------------------------
;Dark Kinton, Thrown Off
[Statedef 70403]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
facep2 = 1

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 100, jump SND]
type = null
trigger1 = !time
value = 40,1
channel = 9


[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = 0
y = const(velocity.jump.y) / 3

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

[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

;---------------------------------------------------------------------------
;Dark Kinton, Falling
[Statedef 70404]
type = A
physics = N
anim = 5070


[state 70403, stopsnd]
type = stopsnd
trigger1 = !time
channel = 9

[state 70404, oh crap]
type = playsnd
trigger1 = !time
value = 704,3+random%2
channel = 15

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 70403, veladd]
type = veladd
trigger1 = pos y < 0
y = .55

[state 70403, changestate]
type = changestate
trigger1 = pos y >= 0 && vel y > 0
value = 70405

;------------------------------------------------------------------------------
;Hits ground
[Statedef 70405]
type = L
physics = N
velset = 0,0
anim = 5080

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 70405, changeanim]
type = playsnd
trigger1 = !time
value = 15000,1
channel = 19

[state 70404, changeanim]
type = changeanim
triggerall = anim = 5080
trigger1 = animelemtime(3) = 0
value = 5120


[state 70404, posset]
type = posset
trigger1 = pos y > 0
y = 0

[state 70404, changestate]
type = changestate
triggerall = anim = 5120
trigger1 = !animtime
value = 0
;---------------------------------------------------------------------------
;Police Car
[Statedef 705]
type = S
physics = N
anim = 704
sprpriority = -4

[state 705, Save position]
type = varset
trigger1 = !time
fvar(14) = pos X

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 705, turn]
type = turn
trigger1 = time = 1

[State 70500, body]
type = explod
trigger1 = time = 1
anim = 70402
id = 70402
pos = 0,0
postype = p1
sprpriority = 3
ownpal = 1
bindtime = -1
removetime = -1

[state 795, playsnd]
type = playsnd
trigger1 = time = 1
value = 705,0
channel = 15

[state 705, camera]
type = ScreenBound
trigger1 = anim = 704 || anim = 70401
value = 0

[state 705, posadd]
type = posadd
trigger1 = time = 1
x = -600

[state 705, velset]
type = velset
trigger1 = time = 100
x = 11

[State 3101, dust FX]
type = helper
trigger1 = pos X = [-240,240]
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[state 705, changeanim]
type = changeanim
triggerall = anim = 704
trigger1 = p2dist X <= 0
value = 70401

[state 705, removeexplod]
type = removeexplod
triggerall = NumExplod(70402)
trigger1 = p2dist X <= 0
id = 70402

[State 70500, body]
type = explod
triggerall = !NumExplod(70403)
trigger1 =  p2dist X <= 0
anim = 70403
id = 70403
pos = 0,0
postype = p1
sprpriority = 3
ownpal = 1
bindtime = -1
removetime = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 =  p2dist X <= 0
value = 1400,1
channel = 17
persistent  = 0

[state 705, removeexplod]
type = removeexplod
trigger1 = pos X != [-240,240]
id = 70403


[state 705, changestate]
type = changestate
trigger1 = anim = 70401 || time >= 200
trigger1 = pos X != [-240,240]
value = 70501
;-------------------------------------------------
;Police Car Jump
[Statedef 70501]
type = A
physics = N
velset = 0,0
sprpriority = -4

[state 70501, stop]
type = playsnd
trigger1 = time = 10
value = 5,8
channel = 15

[state 70501, stop]
type = playsnd
trigger1 = time = 30
value = 40,1
channel = 16


[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 705, camera]
type = ScreenBound
trigger1 = 1
value = 0

[state 705, nothitby]
type = nothitby
trigger1 = 1
value = SCA

[state 705, playerpush]
type = playerpush
trigger1 = 1 
value = 0

[state 70501, turn]
type = turn
trigger1 = !time

[state 70501, posset]
type = posset
trigger1 = !time
x = floor(fvar(14)) - (facing*147)

[state 70501, changeanim]
type = changeanim
trigger1 = time = 30
value = 42

[state 70501, changeanim]
type = changeanim
triggerall = anim = 42
trigger1 = !animtime
value = 45

[state 70501, velset]
type = velset
trigger1 = time = 30
x = 4
y = -6

[state 70501, veladd]
type = veladd
trigger1 = pos y < 0
y = .35


;-------------Land------------------------------
[state 705, changeanim]
type = changeanim
triggerall = anim = 42 || anim = 45
trigger1 = pos y >= 0 && vel y > 0
value = 47

[state 705, velset]
type = velset
trigger1 = anim = 47 && animelem = 1
y = 0

[state 705, posset]
type = posset
trigger1 = pos y > 0
y = 0

[state 705, velmul]
type = velmul
trigger1 = anim = 47
x = .50

[state 705, velset]
type = velset
triggerall = anim = 47
trigger1 = Pos X >= facing*floor(fvar(14))
x = 0

[state 705, velset]
type = posset
triggerall = anim = 47
trigger1 = Pos X > facing*floor(fvar(14))
x = floor(fvar(14))

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 47
value = 40,2
persistent = 0
channel = 15

[State 0, Explod]
type = Explod
trigger1 = Anim = 47
anim = 17100
ID = 17100
pos = 0,0
postype = p1 
sprpriority = -5
persistent = 0

[state 705, changestate]
type = changestate
triggerall = anim = 47
trigger1 = !animtime
value = 0

;---------------------------------------------------------------------------
; Vanilla DB intro
[Statedef 788]
type = S
ctrl = 0
anim = 0
velset = 0,0
sprpriority = 3

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

;krillin small port
[State 0, Explod]
type = null;Explod
trigger1 = !Time
anim = 19604
ID = 19604
pos = 3,14
postype = left  ;p2,front,back,left,right
facing = 1
bindtime = 1
sprpriority = 5

;goku small port
[State 0, Explod]
type = null;Explod
trigger1 = !Time
anim = 19605
ID = 19605
pos = 316,14
postype = left  ;p2,front,back,left,right
facing = -1
bindtime = 1
sprpriority = 5

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19601
ID = 19601
pos = 0,0
postype = back  ;p2,front,back,left,right
facing = Cond(Facing = 1,1,-1)
bindtime = -1
sprpriority = 4
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19601
ID = 19601
pos = -320,0
postype = back  ;p2,front,back,left,right
facing = Cond(Facing = 1,1,-1)
bindtime = -1
sprpriority = 4
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19601
ID = 19601
pos = 320,0
postype = back  ;p2,front,back,left,right
facing = Cond(Facing = 1,1,-1)
bindtime = -1
sprpriority = 4
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19601
ID = 19601
pos = 640,0
postype = back  ;p2,front,back,left,right
facing = Cond(Facing = 1,1,-1)
bindtime = -1
sprpriority = 4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19602
ID = 196
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
sprpriority = 5
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19603
ID = 19600
pos = 0,0
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
sprpriority = 5
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 196
ID = 196
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
sprpriority = 5
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19600
ID = 19600
pos = 0,0
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
sprpriority = 5
ownpal = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = Time >= 250
value = 0



;---------------------------------------------------------------------------
; Introduction VS 18
[Statedef 789]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro
ignorehitpause = 1
persistent = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemynear,anim = 709 && enemy,animelemtime(7)=0
value = 709
ignorehitpause = 1
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemy,NumHelper(7902)
trigger1 = anim = 709 && animelemtime(2)>=0
value = 709
elem = 2
ignorehitpause = 1

[State 0, Explod] ;blush
type = Explod
trigger1 = anim = 709 && animelemtime(4) = 0
anim = 7098
ID = 7098
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
sprpriority = 5
ontop = 1
shadow = 0,0,0
ownpal = 0

[State 0, Explod] ;sweat 1
type = Explod
triggerall = !NumExplod(7095)
trigger1 = anim = 709 && animelemtime(1) = 0
anim = 7095
ID = 7095
pos = 0,0
postype = p1
bindtime = 1
removetime = -1
sprpriority = 6
ontop = 1
shadow = 0,0,0
ownpal = 0

[State 0, Explod] ;sweat 2
type = Explod
triggerall = !NumExplod(7096)
trigger1 = anim = 709 && animelemtime(2) = 0
anim = 7096
ID = 7096
pos = 7,-13
postype = p1
bindtime = 1
removetime = -1
sprpriority = 6
ontop = 1
shadow = 0,0,0
ownpal = 0

[State 0, Explod] ;sweat 3
type = Explod
triggerall = !NumExplod(7097)
trigger1 = anim = 709 && animelemtime(3) = 0
anim = 7097
ID = 7097
pos = -12,-2
postype = p1
bindtime = 1
removetime = -1
sprpriority = 6
ontop = 1
shadow = 0,0,0
ownpal = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim = 709 && animelemtime(2)=0
id = 7095
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim = 709 &&  animelemtime(3)=0
id = 7096
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = anim = 709 && AnimTime = 0
id = 7097

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = anim = 709 && AnimTime = 0
value = 0
;----------------------------------------------------
;C18 Winpose
[Statedef 790]
type = S
ctrl = 0
;anim = 187
velset = 0,0
sprpriority = 1

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

[State 0]
Type=ChangeAnim
Trigger1=!Time
Value=710

[State 0]
Type=ChangeAnim
Trigger1=Anim=710&&Enemy,Anim=20
Value=711
Elem=1
Persistent=0

[State 0]
Type=PlaySND
Trigger1=Enemy,Anim=20&&Enemy,Time=1
Value=5000,11+Random%3
Channel=-1
VolumeScale=200
Persistent=0

[State 0]
Type=null;ChangeAnim
Trigger1=P2BodyDist X < 20
Value=18701
Elem=2

[State 0]
Type=ChangeAnim
Trigger1=Anim=711&&AnimElemTime(7)=0
Trigger1=!(Enemy,Anim=195&&Enemy,AnimElemTime(8)=0)
Value=711
Elem=6

[State 0]
Type=ChangeAnim
Trigger1=Anim=711
Trigger1=Enemy,Anim=195&&Enemy,AnimElemTime(8)=0
Value=711
Elem=7

;================================================
;Goku helps out Krillin
[Statedef 18502]
type = L
ctrl = 0
anim = 197
velset = 0,0
sprpriority = 2

[State 181,3]
type = AssertSpecial
trigger1 = Time < 200
flag = RoundNotOver

[State 0]
Type=ChangeAnim
Trigger1=!AnimTime
Value=Anim
Elem=12

;-----------------------------------------------------
;[Redacted] C18 Winpose custom state
[Statedef 7900]
type = S
ctrl = 0
anim = 5120


[state 7900, nothitby]
type = nothitby
trigger1 = 1
value = SCA


[state 7900, changeanim]
type = changeanim
trigger1 = anim = 5120 && !animtime
value = 20

;-------------------------------------------------------Turn Code
[state 790, turn anim]
type = changeanim
trigger1 = anim = 20 && facing = enemy,facing
value = 5

[state 7900, velset]
type = velset
trigger1 = anim = 5
x = 0

[state 7900, turn]
type = turn
trigger1 = anim = 5 && animelemtime(1) = 0

[state 7900, changeanim]
type = changeanim
trigger1 = anim = 5 && !animtime
value = 20
;----------------------------------------------------------------

[state 7900, velset]
type = velset
trigger1 = anim = 20
x = const(velocity.walk.fwd.x)

[State 100, steps] ;Steps A
type = playsnd
trigger1 = animelemtime(21)=0 && Anim=20
value = 20,0
volumescale = 255

[State 100, steps]  ;Steps B
type = playsnd
trigger1 = animelemtime(47)=0 && Anim=20
value = 20,1
volumescale = 255

[state 7900, changeanim]
type = changeanim
trigger1 = Anim = 20
trigger1 = vel x > 0
trigger1 = Enemy, P2Dist X <= 22 && (Enemy, P2Dist X >= -8)
value = 709

[state 7900, changeanim]
type = changeanim
triggerall = anim = 709
trigger1 = animelemtime(8) >= 20
value = 7901


[state 7900, changeanim]
type = changeanim
triggerall = anim = 7901
trigger1 = animelemtime(3) = 1
value = anim
elem = animelemno(0)


[state 7900, velset]
type = velset
trigger1 = Vel X != 0
trigger1 = anim = 709
x = 0

;===========================================================================
; WIN STATE DECIDER
[Statedef 180]
type = S
ctrl = 0

[State 180, VictoryQuote]
type = victoryquote
trigger1 = !time
value = 58+(random%14)

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

[State 0, VarRandom]
type = VarRandom
triggerall = Var(29)=0
triggerall = sysvar(3)>=1
triggerall = NumHelper(20000)
trigger1 = helper(20000), Var(5)>0
v = 9
range = 0,2

[State 180, oolong]
type = Helper
triggerall = !NumHelper(18000)
trigger1 =  time = 0 && random%5 = 0
stateno = 18000
ID = 18000
name = "oolong"
postype = left
pos = -10, 0


 [State 0] 
Type=ChangeState 
TriggerAll=Random<=200&&(!Time&&MatchOver=1) 
Trigger1=Enemy,Name = "C18 Z2" && Enemy,AuthorName = "Team Z2" 
Value = 790

[State 180, winposes]
type = changestate
trigger1 = !time
value = 181+random%8



;---------------------------------------------------------------------------
; WINPOSE 1 - Shake Head
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0
sprpriority = 1

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

;---------------------------------------------------------------------------
; WINPOSE 2 - fall over
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0
sprpriority = 1

[State -3, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 11
value		= 15000, 0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 16
value = 182,0+random%7

[state 181, 1]
type = assertspecial
trigger1 = time < 400
flag = roundnotover

;---------------------------------------------------------------------------
; WINPOSE 3 - whipe sweat
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0
sprpriority = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 13
value = 183,0 +random%4

[state 181, 1]
type = assertspecial
trigger1 = time < 250
flag = roundnotover

;---------------------------------------------------------------------------
; WINPOSE 4 - wife made me do it
[Statedef 184]
type = S
ctrl = 0
anim = 184 
velset = 0,0
sprpriority = 1

[State 180, vs 18 Z2]
type = ChangeState
triggerall = numenemy
trigger1 = (enemy,authorname="Team Z2")
trigger1 = (enemy,Name = "C18 Z2")
value = 180

[State 0, VarRandom]
type = VarRandom
trigger1 = !Time
v = 9
range = 0,3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9) = 1
value = 11184
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9) = 2
value = 12184
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9) = 3
value = 13184

;184 = 0,1
;11184 = 2
;12184 = 3,4
;13184 = 5

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 184
trigger1 = AnimElem = 13
value = 184,0+random%2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 11184
trigger1 = AnimElem = 13
value = 184,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 12184
trigger1 = AnimElem = 13
value = 184,3+random%2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 13184
trigger1 = AnimElem = 13
value = 184,4

[state 181, 1]
type = assertspecial
trigger1 = time < 250
flag = roundnotover

;---------------------------------------------------------------------------
; WINPOSE 5 - Krillin Kidnapping
[Statedef 185]
type = S
ctrl = 0
anim = 185
velset = 0,0
sprpriority = 1



[State 0, Helper]
type = Helper
trigger1 = time = 36
name = "Tentacle"
ID = 18500
stateno = 18500
pos = -150,7
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 185
trigger1 = AnimElem = 13
value = 184,0+random%2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 185
trigger1 = AnimElem = 20
value = 704,4+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = pos X != [-240,240]
value = 185,0+random%2
channel = 0
persistent = 0

[state 18500, veladd]
type = velset
trigger1 = time >= 109
x = -20

[state 18500, camera]
type = screenbound
trigger1 = time >= 99
value = 0


[state 181, 1]
type = assertspecial
trigger1 = time < 250
flag = roundnotover

;-----------------------------------------------------------------------------
;Tentacle Helper
[Statedef 18500]
type = S
anim = 18500
sprpriority = -1

[state 18500, snarl]
type = playsnd
trigger1 = animelem = 1
value = 185,4

[state 18500, snatch]
type = playsnd
trigger1 = animelem = 14
value = 185,3

[state 18500, snack]
type = playsnd
trigger1 = time = 73
value = 185,2

[state 18500, veladd]
type = velset
trigger1 = time >= 73
x = -20

[State 18500, front]
type = Explod
trigger1 = !time
Anim = 18501
postype = P1
pos = 0,0
bindtime = -1
sprpriority = 2
ownpal = 1
removetime = -2


[State 18500, end]
type = null
trigger1 = time = 63
Anim = 18502
postype = P1
pos = 0,0
bindtime = -1
sprpriority = 2
ownpal = 1
removetime = -2


;-----------------------------------------------------------------------------
;WINPOSE 6 - Marron Hug
[Statedef 186]
type = S
anim = 186
sprpriority = 1

[State 0, Helper]
type = Helper
trigger1 = !time
name = "Child"
ID = 18600
stateno = 18600
pos = -30,0
postype = back   ;p2,front,back,left,right
ownpal = 1

[state 186, changeanim]
type = changeanim
triggerall = anim = 186
triggerall = NumHelper(18600)
trigger1 = helper(18600), rootdist X <= 0
value = 1861

[state 186, hahaha]
type = playsnd
triggerall = anim = 1861
trigger1 = animelemtime(1) = 0
value = 186,0+random%2
channel = 0

[state 181, 1]
type = assertspecial
trigger1 = anim != 1861
trigger2 = animelemtime(5) <= 80
flag = roundnotover

;-----------------------------------------------------------------------------
;Marron Helper
[statedef 18600]
type = S
anim = 18600
physics = N
sprpriority = 2
velset = 4,0

[state 18600, changeanim]
type = changeanim
triggerall = anim = 18600
trigger1 = rootdist X <= 0
value = 186100

[state 18600, posset]
type = posset
trigger1 = rootdist X <= 0
trigger2 = anim = 186100
x = root,pos X

[state 18600, steps]
type = playsnd
triggerall = anim = 18600
trigger1 = animelemtime(2) = 0 || animelemtime(4) = 0
value = 40,0

[state 18600, velset]
type = velset
trigger1 = rootdist X <= 0
trigger2 = anim = 186100
x = 0
;-----------------------------------------------------------------------------
;WINPOSE 7 - Frost Kidnapping
[Statedef 187]
type = S
anim = 187
sprpriority = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = !Time
v = 9
range = 0,3

[State 0, ChangeState]
type = ChangeState
trigger1 = Var(9) >= 1
value = 18001

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 13
value = 183,0 +random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 91
value = 5000,20 +random%3
channel = 0

[State 0, Helper]
type = Helper
trigger1 = time = 78
name = "Frost"
ID = 18700
stateno = 18700
pos = -190,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 18700, explod]
type = explod
trigger1 = time = 91
anim = 7020
id = 7020
pos = 0,0
postype = p1
sprpriority = 3
ownpal = 1
removetime = -2


[state 187, assertspecial]
type = AssertSpecial
trigger1 = time >= 135
flag = invisible


[state 187, roundnotover]
type = AssertSpecial
trigger1 = time < 210
flag = roundnotover
;-----------------------------------------------------------------------------
;Frost Helper
[Statedef 18700]
type = S
anim = 18700
sprpriority = 2

[state 187000, playsnd]
type = playsnd
trigger1 = !time
value = 40,1

[state 18700, playsnd]
type = playsnd
trigger1 = animelem = 3
value = 0,2

[state 18700, playsnd]
type = playsnd
trigger1 = animelem = 4
value = 5,2

[state 18700, playsnd]
type = playsnd
trigger1 = animelem = 14
value = 18700,0

;-----------------------------------------------------------------------------
;WINPOSE 8 - Clothes Beam
[Statedef 188]
type = S
anim = 188
sprpriority = 1

[state 188, little green!]
type = playsnd
trigger1 = animelem = 3
value = 188,1
channel = 0

[State 0, Helper]
type = Helper
trigger1 = time = 130
name = "Clothes"
ID = 18800
stateno = 18800
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1


[state 18800,changeanim]
type = changeanim
trigger1 = anim = 188 && !animtime
value = 18801+random%9

[state 187, roundnotover]
type = AssertSpecial
trigger1 = time < 200
flag = roundnotover
;---------------------------------------------
;Beam Helper
[Statedef 18800]
type = A
anim = 18800
sprpriority = 2

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1

[State 0, lightning sound]
type = playsnd
trigger1 = !time
value = 2400,3

[State 18800, 0]
type = Explod
triggerall = !NumExplod(18800)
trigger1 = root, anim != 188
Anim = root,anim+9
id = 18800
postype = P1
pos = 0,0
sprpriority = 2
ownpal = 1
removetime = -1

;-----------------------------------------------------------------------------
;WINPOSE 9 - EVIL CLONES
[Statedef 18001]
type = S
physics = S
anim = 18001
sprpriority = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = !Time
v = 9
range = 0,2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
value = 18110
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 13
value = 183,0 +random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 21
value = 18,1 +random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 18001
trigger1 = AnimElem = 26
value = 100,0
persistent = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 18110
trigger1 = AnimElem = 32
value = 100,0
persistent = 0

[State 10231, Superjump Sound]
type = PlaySnd
trigger1 = Anim = 18110
trigger1 = AnimElem = 21
value = 0,24


[State 41, Train]
type = AfterImage
trigger1 = Anim = 18110
trigger1 = AnimElem = 32
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1
persistent = 0

[State 100, 7]
type = Explod
trigger1 = Anim = 18110
trigger1 = AnimElem = 32
Anim = 8050
postype = P1
pos = -10,-20
scale = 1,.8
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1
persistent = 0


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Anim = 18001
trigger1 = AnimElem = 26
trigger2 = Anim = 18110
trigger2 = AnimElem = 21
physics = N

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 18001
trigger1 = AnimElem = 26
x = 10

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 18110
trigger1 = AnimElem = 21
y = -14

[State 0, VelAdd]
type = VelAdd
trigger1 = Anim = 18110
trigger1 = AnimElemTime(21)>= 0 && AnimElemTime(32)<0
y = .73

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 18110
trigger1 = AnimElemTime(32)>=0
y = 0

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

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 18110
trigger1 = AnimElem = 32
x = -9

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 20
name = "clones"
ID = 18100
stateno = 18100
pos = -190,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[state 187, roundnotover]
type = AssertSpecial
trigger1 = time < 210
flag = roundnotover

;-----------------------------------------------------------------------------
;Evil Clones Helper
[Statedef 18100]
type = S
anim = -1
sprpriority = 2
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State 0, VarRandom]
type = VarRandom
trigger1 = !Time
v = 9
range = 0,3

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18100
ID = 18100
pos = -44,-80
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18101
ID = 18100
pos = -54,-102
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18102
ID = 18100
pos = -237,-162
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18103
ID = 18100
pos = -186,-202
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18104
ID = 18100
pos = -124,-183
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18105
ID = 18100
pos = -280,-72
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18106
ID = 18100
pos = -157,-112
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18100
ID = 18100
pos = -344,-100
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18101
ID = 18100
pos = -54,-102
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18102
ID = 18100
pos = -437,-82
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18103
ID = 18100
pos = -386,-150
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18104
ID = 18100
pos = -324,-183
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18105
ID = 18100
pos = -480,-72
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) = 0
trigger1 = !Time
anim = 18106
ID = 18100
pos = -357,-172
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 8,0
removetime = -1
sprpriority = 4
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) > 0
trigger1 = Var(9) = 0
trigger1 = Time = 1
anim = 18107
ID = 18100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 9,0
removetime = -1
sprpriority = 0
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) > 0
trigger1 = Var(9) = 1
trigger1 = Time = 1
anim = 18108
ID = 18100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 9,0
removetime = -1
sprpriority = 0
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) > 0
trigger1 = Var(9) = 2
trigger1 = Time = 1
anim = 18109
ID = 18100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 9,0
removetime = -1
sprpriority = 0
shadow = 175,175,175

[State 0, Explod]
type = Explod
triggerall = root, Var(9) > 0
trigger1 = Var(9) = 3
trigger1 = Time = 1
anim = 18111
ID = 18100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 9,0
removetime = -1
sprpriority = 0
shadow = 175,175,175

;===========================================================================
; <<<<< SUPER JUMP >>>>>
; SJ after c.SP : 10230
; SJ Straight : 10231
; SJ Forward : 10232
; SJ Backward : 10233
; LJ West : 10240
;===========================================================================

;SUPER JUMP AFTER C.SP
[Statedef 10230]
type    = S
physics = S
anim = 40
ctrl = 0
velset = 0,0
facep2 = 1

[State 10230, Superjump Sound]
type = PlaySnd
trigger1 = Time = 0
value = 0,24

[State 10230, Superjump Var]
type = varset
trigger1 = Time = 0
var(22) = 1

[State 890, 2];FX
type = Explod
trigger1 = !time
Anim = 8051
postype = P1
pos = 0,-20
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 10230, 11]
type = VelSet
trigger1 = AnimTime = 0
x = 0.85 * Const(velocity.jump.fwd.x)
y = Const(velocity.jump.y) - 2

[State 10230, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; SUPER JUMP STRAIGHT UP
[Statedef 10231]
type    = S
physics = S
anim = 40
ctrl = 0
velset = 0,0
facep2 = 1

[State 8000, flash]
type = PalFX
trigger1 = prevstateno= 1300
trigger2 = prevstateno= 1301
time = 0

[State 10230, Superjump Var]
type = varset
trigger1 = Time = 0
var(22) = 1

[State 890, 2]
type = Explod
trigger1 = !time
Anim = 8051
postype = P1
pos = 0,-20
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

[State 10231, Superjump Sound]
type = PlaySnd
trigger1 = Time = 0
value = 0,24

[State 10231, Give Player control]
type = ctrlset
trigger1 = Time = 20
value = 1

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 10231, 11]
type = VelSet
trigger1 = AnimTime = 0
x = Const(velocity.jump.neu.x)
y = Const(velocity.jump.y) - 2.5

[State 10231, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; SUPER JUMP FORWARD
[Statedef 10232]
type    = S
physics = S
anim = 40
ctrl = 0
velset = 0,0
facep2 = 1

[State 8000, flash]
type = PalFX
trigger1 = prevstateno= 1300
trigger2 = prevstateno= 1301
time = 0

[State 890, 2]
type = Explod
trigger1 = !time
Anim = 8051
postype = P1
pos = 0,-20
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

[State 10230, Superjump Var]
type = varset
trigger1 = Time = 0
var(22) = 1

[State 10232, Superjump Sound]
type = PlaySnd
trigger1 = Time = 0
value = 0,24

[State 10232, Give Player control]
type = ctrlset
trigger1 = Time = 20
value = 1

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 10232, 11]
type = VelSet
trigger1 = AnimTime = 0
x = Const(velocity.jump.fwd.x)
y = Const(velocity.jump.y) - 2.2

[State 10232, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; SUPER JUMP BACKWARD
[Statedef 10233]
type    = S
physics = S
anim = 40
ctrl = 0
velset = 0,0
facep2 = 1

[State 8000, flash]
type = PalFX
trigger1 = prevstateno= 1300
trigger2 = prevstateno= 1301
time = 0

[State 890, 2]
type = Explod
trigger1 = !time
Anim = 8051
postype = P1
pos = 0,-20
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

[State 10230, Superjump Var]
type = varset
trigger1 = Time = 0
var(22) = 1

[State 10233, Superjump Sound]
type = PlaySnd
trigger1 = Time = 0
value = 0,24

[State 10233, Give Player control]
type = ctrlset
trigger1 = Time = 20
value = 1

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 10233, 11]
type = VelSet
trigger1 = AnimTime = 0
x = Const(velocity.jump.back.x)
y = Const(velocity.jump.y) - 2.2

[State 10233, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;===========================================================================
;POWER CHARGE
;===========================================================================
[StateDef 900]
type = S
movetype = I
physics = S
anim = 900
velset = 0,0
ctrl = 0

[State 1000, Power]
type = PowerAdd
triggerall = (Anim = 900) && (power < 3000)
triggerall = Time >= 12
trigger1 = (AILevel<=0) && (command = "holdb") && (command = "holdy")
trigger2 = AILevel>0
value = Cond(NumHelper(3311),1,5) + ((time-12)/20)

[State 4500, 1];Small sound
type = PlaySnd
trigger1 = animelemtime(4)=0
value = 8,1
volumescale = 255

[State 4500, 2];long sound
type = PlaySnd
trigger1 = animelemtime(5)=0
value = 8,0
loop = 1
pan = 1
volumescale = 25
channel = 3
[State 4500, 2];long sound
type = PlaySnd
trigger1 = time=130
value = 8,0
loop = 1
pan = 1
volumescale = 25
channel = 3

[State 4500, 1];Scream
type = PlaySnd		
trigger1 = animelemtime(4)=0
value = 8,2
volumescale = 255
channel = 4

[State 1000, shake]
type = EnvShake
triggerall = anim=900 && animelemtime(5)>=0
trigger1 = !(time%4)
time=4
freq=80
ampl=1+0.02*time

[State 1000, flash]
type = PalFX
trigger1 = Anim = 900 && !(time%10) && animelemtime(5)>=0
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[State 1900, Aura helper]
type = Helper
trigger1 = animelemtime(5)=0
id = 905
name = "Charge"
pos = -24,-2
postype = P1
stateno = 905
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
size.xscale = 1.1
size.yscale = 1.1

[State 1900, dust]
type = explod
trigger1 = animelemtime(5)=0
anim = 908
id = 908
pos = 17,5
sprpriority = 4
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1
facing = -1
removetime = -1

[State 1001, stopsnd]
type = stopsnd
trigger1 = !AILEVEL
trigger1 = (command != "holdb") || (command != "holdy")
trigger2 = anim != 900
trigger3 = Power >= const(data.power) || Power >= PowerMax || RoundState != 2
channel = 3
persistent = 0

[State 1000, PC-End]
type = ChangeState
triggerall = anim = 900
trigger1 = (AILevel<=0)
trigger1 = (command != "holdb") || (command != "holdy")
trigger2 = Power >= const(data.power) || Power >= PowerMax || RoundState != 2
trigger3 = AILevel>0
trigger3 = enemynear,movetype=A || enemy, Vel X >4
trigger3 = Time >=20
value = 901
Ctrl = 1

; End of Power Charge
[StateDef 901] 
type = S
movetype = I
physics = S
ctrl = 0
anim = 901

[State 1001, stopsnd]
type = stopsnd
trigger1 = 1
channel = 3
persistent = 0

[State 1001, full power]
type = playsnd
trigger1 = anim = 901 && power >= 3000
value = 8,3
channel = 1
persistent = 0

[State 1001, EndByPowMax]
type = PalFX
trigger1 = Power = 3000
time = 1
add = 255-(20*Time), 255-(20*Time), 255-(20*Time)

[State 1001, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;===========================================================================
;AIR DASH
;===========================================================================
[Statedef 110]
type = A
physics = N
anim = 110
velset = 0,0
ctrl = 0

[State 110, var]
type = VarSet
trigger1 = time=0
var(10)=1

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

;------------------------------------------
; DASH FORWARD
[Statedef 111]
type = A
physics = N
anim = 102
ctrl = 0
velset = 0,0

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Var(51)>0 && Var(53)=0
trigger1 = !NumExplod(110)
trigger2 = Var(51)=0
trigger2 = Vel Y != 0
value = 1

[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "x"
anim = 15999
ID = 90000200
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "y"
anim = 15999
ID = 90000210
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "z"
anim = 15999
ID = 90000220
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "a"
anim = 15999
ID = 90000230
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "b"
anim = 15999
ID = 90000240
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "c"
anim = 15999
ID = 90000250
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "start"
anim = 15999
ID = 90000195
removetime = 5
pausemovetime = 5
supermovetime = 5

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 100, 7]
type = Explod
trigger1 = Time = 0
Anim = 8050
postype = P1
pos = -10,-20
scale = 1,.8
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

[State 111, 1]
type = VelSet
trigger1 = time=0
x = 9

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 111, 1]
type = VelAdd
trigger1 = time>=5 && vel X>=0
x = -0.3

[State 111, 1]
type = StateTypeSet
trigger1 = time >= 7
trigger2 = Var(51)>0 && Var(53)=0
trigger2 = time >= 5
physics = A

[State 111, 1]
type = ChangeState
trigger1 = time > 7
;trigger1 = ((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && !NumExplod(90000006)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && !NumExplod(90000004)))
value = 50

[State 111, end]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 112

;------------------------------------------
;LAND FROM AERIAL DASH FORWARD
[Statedef 112]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 103

[State 115, 1]
type = VelSet
trigger1 = Time = 0
x = 15
y = 0

[State 115, 3]
type = VelAdd
trigger1 = Time > 0
x = .15

[state 115, 2]
type = posset
trigger1 = time = 0
y = 0

[State 115, Landing Sound]
type = PlaySnd
trigger1 = animelem = 2
value = 52,0

[State 115, e]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-----------------------------------------
;AIR DASH BACK
[Statedef 115]
type = A
movetype = I
physics = N
anim = 115
ctrl = 0
velset = 0,0

[State 110, var]
type = VarSet
trigger1 = time=0
var(10)=1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = !NumExplod(110)
value = 1

[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "x"
anim = 15999
ID = 90000200
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "y"
anim = 15999
ID = 90000210
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "z"
anim = 15999
ID = 90000220
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "a"
anim = 15999
ID = 90000230
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "b"
anim = 15999
ID = 90000240
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "c"
anim = 15999
ID = 90000250
removetime = 5
pausemovetime = 5
supermovetime = 5
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "start"
anim = 15999
ID = 90000195
removetime = 5
pausemovetime = 5
supermovetime = 5

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = !Time
y = -30

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 100, 7]
type = Explod
trigger1 = Time = 0
Anim = 8050
postype = P1
pos = 0,-20
scale = 1,.8
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1
facing = -1

[State 111, 1]
type = VelSet
trigger1 = time=0
x = -7

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 111, 1]
type = VelAdd
trigger1 = time>=5 && vel X<=0
x = 0.2

[State 111, 1]
type = StateTypeSet
trigger1 = time >= 5
physics = A

[State 111, 1]
type = ChangeState
trigger1 = time > 7
;trigger1 = ((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && !NumExplod(90000004)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && !NumExplod(90000006))) || time = 15
value = 116

[State 112, end]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52

;---------------------------------------------------------------------------
; Back Dash in air - modified state 50
[Statedef 116]
type    = A
physics = A

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

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


;===================<GUARD>================
;Guard Start
[StateDef 120]
type = U
physics = U
anim = 120 + (StateType = C) + (StateType = A) * 2

[State 120, StateTypeSet: Standing]
type = StateTypeSet
trigger1 = !Time && StateType = S
physics = S

[State 120, StateTypeSet: Crouching]
type = StateTypeSet
trigger1 = !Time && StateType = C
physics = C

[State 120, StateTypeSet: Jumping]
type = StateTypeSet
trigger1 = !Time && StateType = A
physics = A

[State 120, VelSet]
type = VelSet
trigger1 = !Time && StateType != A
x = 0
y = 0

[State 120, Stand to Crouching]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = S && command = "holdup"
trigger3 = AILevel && StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 120, Crouching to Stand]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = C && command != "holdup"
trigger3 = AILevel && StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 120, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 120, Change to Guard State]
type = ChangeState
trigger1 = !AnimTime || AILevel
value = 130 + (StateType = C) + (StateType = A) * 2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = !AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command != "holdfwd", command != "holdback"), ifElse(P2dist x < 0, command != "holdback", command != "holdfwd")))
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Standing Guard
[StateDef 130]
type = S
physics = S

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

[State 130, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 130, Standing to Crouch]
type = ChangeState
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = S && command = "holdup"
trigger3 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger3 = (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = !AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command != "holdfwd", command != "holdback"), ifElse(P2dist x < 0, command != "holdback", command != "holdfwd")))
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140

[State 130, Landing Sound]
type = PlaySnd
trigger1 = !Time
trigger1 = PrevStateNo = 132 || (PrevStateNo = [154,155])
value = 52,0

[State 130, Landing Dust Expod]
type = Explod
trigger1 = !Time
trigger1 = PrevStateNo = 132 || (PrevStateNo = [154,155])
anim = 8102
sprpriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1


;Crouch Guarding
[StateDef 131]
type = C
physics = C

[State 131, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 131
value = 131

[State 131, Crouching to Standing]
type = ChangeState
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = C && command != "holdup"
trigger3 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger3 = (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
value = 130

[State 131, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 131, Stop Guarding]
type = ChangeState
trigger1 = !AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command != "holdfwd", command != "holdback"), ifElse(P2dist x < 0, command != "holdback", command != "holdfwd")))
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Air Guard
[StateDef 132]
type = A
physics = N

[State 132, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 132
value = 132

[State 132, VelAdd]
type = VelAdd
trigger1 = 1
y = const(movement.yAccel)

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

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

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

[State 132, AI Fix]
type = CtrlSet
trigger1 = AILevel && NumEnemy
value = (EnemyNear, Time >= 120 || Time >= 180)

[State 132, Jumping to Standing]
type = ChangeState
trigger1 = sysvar(0) && InGuardDist
trigger1 = (!AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command = "holdfwd", command = "holdback"), ifElse(P2dist x < 0, command = "holdback", command = "holdfwd")))) || AILevel
value = 130

[State 132, Change to Falling]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = !AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command != "holdfwd", command != "holdback"), ifElse(P2dist x < 0, command != "holdback", command != "holdfwd")))
trigger2 = !InGuardDist
trigger3 = AILevel && NumEnemy
trigger3 = EnemyNear, HitDefAttr = SCA, AT
value = 140


;Guard End
[StateDef 140]
type = U
physics = U
ctrl = 1

[State 140, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 140 + (StateType = C) + (StateType = A) * 2

[State 140, StateTypeSet: Standing]
type = StateTypeSet
trigger1 = !Time && StateType = S
physics = S

[State 140, StateTypeSet: Crouching]
type = StateTypeSet
trigger1 = !Time && StateType = C
physics = C

[State 140, StateTypeSet: Jumping]
type = StateTypeSet
trigger1 = !Time && StateType = A
physics = A

[State 140, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && (NumExplod(90000002) || NumExplod(90000001) || NumExplod(90000003))
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 140, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && (!NumExplod(90000002) && !NumExplod(90000001) && !NumExplod(90000003))
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

[State 140, End]
type = ChangeState
trigger1 = !AnimTime
value = (StateType = C) * 11 + (StateType = A) * 51


;Hit while Guarding (Standing)
[StateDef 150]
type = S
movetype = H
physics = N
velSet = 0,0

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

[State 150, End]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2 * ((!AILevel && (NumExplod(90000002) || NumExplod(90000001) || NumExplod(90000003))) || (AILevel && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)))

[State 150, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && (NumExplod(90000002) || NumExplod(90000001) || NumExplod(90000003))
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
stateType = C
physics = C

[State 150, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && (!NumExplod(90000002) && !NumExplod(90000001) && !NumExplod(90000003))
trigger2 = AIlevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S


;Knocked Back while Guarding (Standing)
[StateDef 151]
type = S
moveType = H
physics = S
anim = 150

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

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

[State 151, CtrlSet]
type = CtrlSet
trigger1 = time = GetHitVar(CtrlTime)
value = 1

[State 151, Standing to Crouching]
type = StateTypeSet
trigger1 = !AILevel && StateType = S && (NumExplod(90000002) || NumExplod(90000001) || NumExplod(90000003))
trigger2 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger2 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 151, Crouching to Standing]
type = StateTypeSet
trigger1 = !AILevel && StateType = C && (!NumExplod(90000002) && !NumExplod(90000001) && !NumExplod(90000003))
trigger2 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger2 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

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


;Hit while Guarding (Crouching)
[StateDef 152]
type = C
moveType = H
physics = N
velSet = 0,0

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

[State 152, End]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2 * ((!AILevel && ((!enemy, NumExplod(92828282) && !enemy, NumExplod(92468246) && command = "holddown") || ((enemy, NumExplod(92828282) || enemy, NumExplod(92468246)) && command = "holdup"))) || (AILevel && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)))

[State 152, Standing to Crouching]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = S && command = "holdup"
trigger3 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger3 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 152, Crouching to Standing]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = C && command != "holdup"
trigger3 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger3 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S


;Knocked Back while Guarding (Crouching)
[StateDef 153]
type = C
moveType = H
physics = C
anim = 151

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

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

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

[State 153, Standing to Crouching]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = S && command = "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = S && command = "holdup"
trigger3 = AILevel && Random < (250 * (AILevel ** 2 / 64.0))
trigger3 = StateType = S && (EnemyNear, MoveType = A) && (EnemyNear, StateType = C)
stateType = C
physics = C

[State 153, Crouching to Standing]
type = StateTypeSet
trigger1 = !enemy, NumExplod(92828282) && !enemy, NumExplod(92468246)
trigger1 = !AILevel && StateType = C && command != "holddown"
trigger2 = enemy, NumExplod(92828282) || enemy, NumExplod(92468246)
trigger2 = !AILevel && StateType = C && command != "holdup"
trigger3 = AILevel && Random < (125 * (AILevel ** 2 / 64.0))
trigger3 = StateType = C && (EnemyNear, MoveType = A) && (EnemyNear, StateType != C)
stateType = S
physics = S

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


;Hit while Guarding (Jumping)
[StateDef 154]
type = A
moveType = H
physics = N
velSet = 0,0

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

[State 154, End]
type = ChangeState
trigger1 = HitShakeOver
value = 155


;Knocked Back while Guarding (Jumping)
[StateDef 155]
type = A
moveType = H
physics = N
anim = 152

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

[State 155, VelAdd]
type = VelAdd
trigger1 = 1
y = const(movement.yAccel)

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

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

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

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

[State 155, End]
type = ChangeState
trigger1 = sysvar(0) && InGuardDist
trigger1 = (!AILevel && (ifElse(!enemy, NumExplod(94646464) && !enemy, NumExplod(92468246), ifElse(P2dist x < 0, command != "holdfwd", command != "holdback"), ifElse(P2dist x < 0, command != "holdback", command != "holdfwd")))) || AILevel
value = 130

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

;===========================================================================
; ZETTO COUNTER (that's how Balthazar wants to call them ¯\_('-')_/¯ )
; counter state : 750
; Punch counter - Backspin Elbow Smash : 751
; Kick Counter : 752
; Lightning anim : 753
;===========================================================================

;Z Counter
[Statedef 750]
type		= S
physics		= S
movetype		= I
anim		= 750
ctrl		= 0
velset		= 0,0
poweradd		= -1000
sprpriority	= 2
facep2		= 1

[State 750, Punches or Kicks?]
type		= VarSet
trigger1		= !Time && !AILevel
var(17)		= IfElse(((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && NumExplod(90000006)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && NumExplod(90000004))) && ((ifElse(NumExplod(90000200), 1, 0) + ifElse(NumExplod(90000210), 1, 0) + ifElse(NumExplod(90000220), 1, 0) >= 2) || (ifElse(NumExplod(90000205), 1, 0) + ifElse(NumExplod(90000215), 1, 0) + ifElse(NumExplod(90000225), 1, 0) >= 2)),1,2)
ignorehitpause	= 1

[State 750, VoiceJPN]
type		= PlaySnd
trigger1		= !Time
value		= 3,10
channel		= 0

[State 750, NotHitBy]
type		= NotHitBy
trigger1		= 1
value		= SCA
[State 750, ECreset]
type		= PalFX
trigger1		= !Time
time		= 1
[State 750, EnvColor]
type		= EnvColor
trigger1		= !Time
value		= 240,240,240 
time		= 1
[State 750, SuperPause]
type		= SuperPause
trigger1		= !Time
time		= 20
movetime		= 20
anim		= -1
sound		= s750,0
p2defmul		= 1
darken		= 0



[State 750, Explod] ;Counter Lightning
type		= Explod
trigger1		= !Time
anim		= 753
sprpriority	= 10
pos		= 40, Floor(-ScreenPos Y)
postype		= P1
persistent	= 0
pausemovetime	= -1
supermove		= 1
ownpal		= 1

[State 750, end]
type		= ChangeState
trigger1		= !AnimTime
value		= IfElse(var(17)=1,751,752)



;---------------------------------
;Z Counter - Punch - Roll
[StateDef 751]
type = C
movetype = I
physics = N
ctrl = 0
anim = 751
velset = 8,0

[State 1302, voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 17,1+random%3
channel = 0
persistent = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10)<0
value = ,AP,AT,AP
time = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 10
statetype = S       ;S,A,C,L
physics = S        ;A,C,S,N

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 17,0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 10
x = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = AnimElemTime(10) <0
value = 0

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

;---------------------------------
;Z Counter - Kick Fireball
[Statedef 752]
type = A
movetype = A
physics = A
velset = -9,-6
anim = 1402
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, Helper]
type = Helper
triggerall = !IsHelper
trigger1 = AnimElem = 3
name = "Diag Ki Blast"
ID = 1420
stateno = 1420
pos = 0,-55
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 10

[State 0, Velset]
type = Velset
trigger1 = AnimElem = 3
x = -1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6)<0
value = SCA,AP
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 10,0
channel = -1


;===========================================================================
; AERIAL ZETTO COUNTER
; counter state : 760
; smash punch : 761
; Smash Kick : 762
; Lightning anim : 753
;===========================================================================

;Air Z Counter
[Statedef 760]
type = A
physics = N
movetype = I
anim = 760
ctrl = 0
;velset = 0,0
poweradd = -1000
sprpriority = 2
facep2 = 1

[State 2302, pause]
type = pause
trigger1 = !time
time = 7
movetime = 7
ignorehitpause = 1

[State 750, Punches or Kicks?]
type		= VarSet
trigger1		= !Time && !AILevel
var(17)		= IfElse(((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && NumExplod(90000006)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && NumExplod(90000004))) && ((ifElse(NumExplod(90000200), 1, 0) + ifElse(NumExplod(90000210), 1, 0) + ifElse(NumExplod(90000220), 1, 0) >= 2) || (ifElse(NumExplod(90000205), 1, 0) + ifElse(NumExplod(90000215), 1, 0) + ifElse(NumExplod(90000225), 1, 0) >= 2)),1,2)
ignorehitpause	= 1

[State 750, snd];Voice
type = PlaySnd
trigger1 = !time
value = 3,11
channel = 0

[State 750, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 750, ECreset]
type = palfx
trigger1 = !time
time = 1

[State 900, 2]
type = EnvColor
trigger1 = !Time
value = 240,240,240 
time = 1

[State 900, 3] ;Counter Lightning
type = Explod
trigger1 = !Time
anim = 753
sprpriority = 10
pos = 40, Floor(-ScreenPos Y)
postype = P1
persistent = 0
pausemovetime = -1
supermove = 1
ownpal = 1

[State 750, superpause]
type = superpause
trigger1 = !time
time = 20
movetime = 20
anim = -1
sound = s750,0
p2defmul = 1
darken = 0

[State 750, end]
type = changestate
trigger1 = !animtime
value = IfElse(var(17)=1,761,762)

;---------------------------------
;Z Counter - Punch - Roll
[StateDef 761]
type = A
movetype = I
physics = N
ctrl = 0
anim = 751
velset = 8,3

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 15

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = AnimElemTime(9)>=3
trigger1 = StateType = A
trigger2 = StateType = C
trigger2 = Var(9) >0
value = 751

[State 0, VarAdd]
type = VarAdd
trigger1 = Pos Y <=0
var(9) = -1

[State 1302, voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 17,1+random%3
channel = 0
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = Pos Y >0
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y >=0
y = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >=0
statetype = C  

[State 0, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10)<0
value = ,AP,AT,AP
time = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 10
statetype = S       ;S,A,C,L
physics = S        ;A,C,S,N

[State 0, PlaySnd]
type = PlaySnd
trigger1 = 1
value = 17,0
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 10
x = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = AnimElemTime(10) <0
value = 0

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

;---------------------------------
;Z Counter - Kick Fireball
[Statedef 762]
type = A
movetype = A
physics = A
velset = -9,-8
anim = 1402
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, Helper]
type = Helper
triggerall = !IsHelper
trigger1 = AnimElem = 3
name = "Diag Ki Blast"
ID = 1420
stateno = 1420
pos = 0,-55
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 10

[State 0, Velset]
type = Velset
trigger1 = AnimElem = 3
x = -1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6)<0
value = SCA,AP
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 10,0
channel = -1

;===========================================================================
; DASH COLLISION
; Actual collision with enemy:	950
; Grabbing enemy:			951
; Returning to state 0:		952
;===========================================================================

;Dash collision
[Statedef 950]
type		= S
physics		= S
movetype		= A
anim		= 950
ctrl		= 0
velset		= 0,0
sprpriority	= 2

[State 950, Smoke Explod]; Smoke FX
type		= Explod
trigger1		= Time = 5 && NumExplod(956)=0 && TeamSide = 1
anim		= 956
pos		= 45,0
postype		= p1
removetime	= -2
scale		= 1,1
sprpriority	= 0
id		= 956
bindtime		= -1
ownpal		= 1
ignorehitpause	= 1
pausemovetime	= -1
;[State 950, Collision Explod solid]; Collision FX
;type		= Explod
;triggerall	= var(2) = 0 ;solid
;trigger1		= Time = 5 && NumExplod(955)=0 && TeamSide = 1
;anim		= 955
;pos		= 45,-56
;postype		= p1
;removetime	= 80
;supermove		= 1
;sprpriority	= 0
;id		= 955
;bindtime		= -1
;ontop		= 1
;ownpal		= 1
;ignorehitpause	= 1
;pausemovetime	= -1
;[State 950,  Collision Explod transparent]; Collision FX
;type		= Explod
;triggerall	= var(2) = 1 ;transparent
;trigger1		= Time = 5 && NumExplod(955)=0 && TeamSide = 1
;anim		= 958
;pos		= 45,-56
;postype		= p1
;removetime	= 80
;supermove		= 1
;sprpriority	= 0
;id		= 955
;bindtime		= -1
;ontop		= 1
;ownpal		= 1
;ignorehitpause	= 1
;pausemovetime	= -1
;
;[state 950, scale FX]
;type		= ModifyExplod
;trigger1		= NumExplod(955)
;scale		= 0.9+0.1*sin(0.1*time),0.9+0.1*sin(0.1*time)
;id		= 955

[State 950, Explod]; White FG
type		= Explod
trigger1		= Time = 5 && NumExplod(957)=0 && TeamSide = 1
anim		= 957
pos		= 0,0
postype		= left
removetime	= 3
scale		= 1,1
sprpriority	= 7
id		= 957
bindtime		= -1
ontop		= 1
ownpal		= 1
ignorehitpause	= 1
pausemovetime	= -1

[State 950, Notification]
type		= helper
trigger1		= Time = 5 && numhelper(13200)=0 && TeamSide = 1
stateno		= 13200
ID		= 13200
name		= "notif-col"
postype		= p1
pos		= 45,-57
ownpal		= 1
pausemovetime	= 65535
supermovetime	= 65535
ignorehitpause	= 1
facing		= -1

[State 950, PosAdd 1]
type		= PosAdd
trigger1		= P2bodydist X < 10
X		= -8
[State 950, PosAdd 2]
type		= PosAdd
trigger1		= P2bodydist X < 25
X		= -5
[State 950, PosAdd 3]
type		= PosAdd
trigger1		= P2bodydist X < 35
X		= -2
[State 950, PosAdd 4]
type		= PosAdd
trigger1		= P2bodydist X < 40
X		= -1

[State 950, Width]
type		= Width
trigger1		= 1
edge		= 50,40

[State 950, Grab SND]
type		= PlaySnd
trigger1		= Time = 5
value		= 800,1

[State 950, Voice];Scream
type		= PlaySnd
trigger1		= Time = 5
value		= 18,2
volumescale		= 255

[State 950, Explosion SND]
type		= PlaySnd
trigger1		= Time = 5 && TeamSide = 1
value		= 950,0

[State 950, 1];Scream
type		= PlaySnd
trigger1		= Time = 5
value		= 3,11
volumescale		= 255

[State 950, shake]
type		= EnvShake
trigger1		= !(time%4)
time		= 8
freq		= 20
ampl		= 1+0.1*time

[State 950, count]
type		= VarSet
trigger1		= !time
var(30)		= 0
[State 950, count]
type		= VarAdd
triggerall	= time < 75
trigger1		= command="x" || command="y" || command="z" || command="a" || command="b" || command="c" || command="start"
trigger2		= command = "up" || command = "down" || command = "back" || command = "fwd"
var(30)		= 1

[State 950, ChangeState - Winning]
type		= Changestate
triggerall	= time = 80
trigger1		= var(30) > enemy,var(30)
value		= 951

[State 950, ChangeState - Losing]
type		= Changestate
triggerall	= time = 80
trigger1		= var(30) < enemy,var(30)
value		= 0
ctrl		= 0	;so you don't get away with the punishment >:)

[State 950, ChangeState - Draw]
type		= Changestate
triggerall	= time = 80
trigger1		= var(30) = enemy, var(30)
value		= 107
ctrl		= 0

[State 950, ChangeState - ABORT];this was missing from the HDBZ engine tweaks/fixes topic. Copied from GotenksZ2.
type		= Changestate
trigger1		= P2StateNo != 950 && P2StateNo != 951 && Time>=4 && Time<50
value		= 952
ctrl		= 1

;-----------------------------------------
;Grabbing
[Statedef 951]
type		= S
movetype		= A
physics		= S
juggle		= 15
velset		= 0,0
ctrl		= 0
anim		= 951
sprpriority	= 1
facep2		= 1
poweradd		= 20

[State 800, Don't Guard]
type		= attackdist
trigger1		= 1
value		= 0

[State 800, hit]
type		= HitDef
trigger1		= AnimElem = 1
attr		= S,NT
hitflag		= M- 
priority		= 1,Miss 
sparkno		= -1
p1facing		= 1
p2facing		= 1
;p1stateno		= 801
guard.dist	= 0
fall		= 1
fall.recover	= 0

[State 0, ChangeState]
type = ChangeState
trigger1 = MoveHit=1
value = 804
ignorehitpause = 1
persistent = 0

[State 951, Abort]
type		= ChangeState
trigger1		= time=5;2
value		= 952
ctrl		= 0
ignorehitpause	= 1

;-----------------------------------------
;Abort Dash Collision
[Statedef 952];to avoid bugs
type		= S
physics		= N
movetype		= A
ctrl		= 1
velset		= 0,0
sprpriority	= 2

[State 952, RemoveExplod]
type		= RemoveExplod
trigger1		= 1
id		= 955
[State 952, RemoveExplod]
type		= RemoveExplod
trigger1		= 1
id		= 956
[State 952, RemoveExplod]
type		= RemoveExplod
trigger1		= 1
id		= 957

[State 952, ChangeState]
type		= ChangeState
trigger1		= 1
value		= 0
ctrl		= 1

;===========================================================================
; CHEAP KO
;===========================================================================

[Statedef 5950]
physics = S
movetype = H
ctrl = 0
velset = 0,0

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

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

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

[State 5950, 4]
type = ChangeAnim
trigger1 = !HitOver
value = IfElse(FVar(1)=0,5000,5020)

[State 190, 4]
type = ChangeAnim
trigger1 = HitOver
value = 5950
persistent = 0


[state 5950, velset]
type = velset
triggerall = anim = 5950
trigger1 = animelemtime(12) >= 0
x = -4

[state 5950, playerpush]
type = playerpush
triggerall = anim = 5950
trigger1 = animelemtime(12) >= 0
value = 0


[state 5950, ScreenBound]
type = ScreenBound
triggerall = anim = 5950
trigger1 = animelemtime(12) >= 0
value = 0

[State 1100, ChangeState]
type = ChangeState
triggerall = anim = 5950
trigger1 = pos X != [-240,240]
value = 5150

;================================================
;Killed by Chou Kamehameha (Fatality)

[Statedef 5941]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 7

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 10000, Explod]; White BG
type = Explod
trigger1 = time = 0
anim = 2763
id = 19875
pos =  160,120
postype = left
sprpriority = 7
bindtime = -1
ownpal = 1
removetime = -2
pausemovetime = 999999
supermovetime = 999999
scale = 1.50,1.50
ignorehitpause = 1
persistent = 0

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 3000, invisibleanim]
type = ChangeAnim
trigger1 = !time
Value = 15999
ignorehitpause = 1

[State 3000, shaking]
type = PosAdd
trigger1 = time<30
X = IfElse(time%4=0,-2,IfElse(time%4=2,2,0))
ignorehitpause = 1

[State 3000, Killed sound]
type = PlaySnd
trigger1 = !time
value = 11,0

[State 1315, Vegeta]
type = explod
trigger1 = !time
anim = 5941
ID = 5941
sprpriority=7
postype = p1
pos = 0,-15
removetime=-2
ownpal=0
ignorehitpause=1
bindtime = -1
ontop = 1

[State 13300, Fadeout no selfanim]
type = PalFX
triggerall = !SelfAnimExist(5942)
trigger1 = Time = [0,30]
time = 1
add = -4*(Time),-4*(Time),-4*(Time)

[State 1315, fadeout selfanim]
type = explod
triggerall = SelfAnimExist(5942)
trigger1 = !time
anim = 5942
ID = 5942
sprpriority=7
postype = p1
pos = 0,-15
removetime=-2
ownpal=0
ignorehitpause=1
bindtime = -1
ontop = 1

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

;This prevent freeze game
[State 49999, 5]
type = ChangeState
trigger1 = time >130
value = 5942

;---------------------------------------------------------------------------------------
;Prevent Freezing from Chou Kmh Kill
[Statedef 5942]
type = S
movetype= H
physics = N
velset = 0,0

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 49999, 1]
type = LifeSet
trigger1 = 1
value = 0

[State 49999, 1]
type = PosSet
trigger1 = 1
y = 9000

[State 49999, 5]
type = ChangeAnim2
trigger1 = !time
value = 15999

[State 444, 0]
type = Changestate
trigger1 = time >=60
value = 5150

;================================================
;Killed by Chou Kamehameha (Fatality) - FULL SCREEN WALT VERSION

[Statedef 5943]
type    = S
movetype= H
physics = N
ctrl = 0
sprpriority = 7
facep2 = 1

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 3000, hit anim]
type = ChangeAnim2
trigger1 = Anim!=5943
value = 5943
ignorehitpause = 1

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,30]
time = 1
add = -8*(Time),-8*(Time),-8*(Time)

[State 13300, Fadeout]
type = PalFX
trigger1 = Time >= 30
time = 1
add = -256,-256,-256

[State 3000, shaking]
type = PosAdd
trigger1 = time<30
X = IfElse(time%4=0,-2,IfElse(time%4=2,2,0))
ignorehitpause = 1

[State 3000, moving back]
type = Velset
trigger1 = 1
X = -0.2
ignorehitpause = 1

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

[State 4500, 1];Dissolve SFX
type = null; PlaySnd
trigger1 = time=30
value = 2950,3
volumescale = 355

;This prevent freeze game
[State 49999, 5]
type = ChangeState
trigger1 = time >99
value = 5942

;================================================
;Killed by Chou Kamehameha (Fatality) - FULL SCREEN WALT VERSION DIAGONAL UP

[Statedef 5944]
type    = S
movetype= H
physics = N
ctrl = 0
sprpriority = 7
facep2 = 1

[State 3000, put up]
type = PosAdd
trigger1 = !time
Y = -15
X = -20
ignorehitpause = 1

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 3000, hit anim]
type = ChangeAnim2
trigger1 = Anim!=5943
value = 5943
ignorehitpause = 1

[State 3000, rotate]
type = AngleDraw
trigger1 = Anim=5943
value = -30
ignorehitpause = 1

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,30]
time = 1
add = -8*(Time),-8*(Time),-8*(Time)

[State 13300, Fadeout]
type = PalFX
trigger1 = Time >= 30
time = 1
add = -256,-256,-256

[State 3000, shaking]
type = PosAdd
trigger1 = time<30
X = IfElse(time%4=0,-2,IfElse(time%4=2,2,0))
ignorehitpause = 1

[State 3000, moving back]
type = Velset
trigger1 = 1
X = -0.2
Y = -0.2
ignorehitpause = 1

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

[State 4500, 1];Dissolve SFX
type = null; PlaySnd
trigger1 = time=30
value = 2950,3
volumescale = 355

;This prevent freeze game
[State 49999, 5]
type = ChangeState
trigger1 = time >99
value = 5942

;================================================
;Killed by Chou Kamehameha (Fatality) - FULL SCREEN WALT VERSION DIAGONAL DOWN

[Statedef 5946]
type    = S
movetype= H
physics = N
ctrl = 0
sprpriority = 7
facep2 = 1

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 3000, hit anim]
type = ChangeAnim2
trigger1 = Anim!=5943
value = 5943
ignorehitpause = 1

[State 3000, rotate]
type = AngleDraw
trigger1 = Anim=5943
value = 30
ignorehitpause = 1

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,30]
time = 1
add = -8*(Time),-8*(Time),-8*(Time)

[State 13300, Fadeout]
type = PalFX
trigger1 = Time >= 30
time = 1
add = -256,-256,-256

[State 3000, shaking]
type = PosAdd
trigger1 = time<30
X = IfElse(time%4=0,-2,IfElse(time%4=2,2,0))
ignorehitpause = 1

[State 3000, moving back]
type = Velset
trigger1 = 1
X = -0.2
Y = 0.2
ignorehitpause = 1

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

;This prevent freeze game
[State 49999, 5]
type = ChangeState
trigger1 = time >99
value = 5942

;---------------------------------------------------------------------------
;P2 going to the ground from a.SP
[Statedef 651]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = -1
velset = 0,0

[State 3020, 2]
type = changeanim2
trigger1 = !time && anim !=651
value = 651

[State 4005, vel Y]
type = velset
trigger1 = Time = 15;animelemtime(2)=0
y = 8
x = -4
ignorehitpause = 1

[State 3052, Land]
type = changestate
trigger1 = Pos Y >= 0
trigger1 = Vel Y > 0
value = 652

;---------------------------------------------------------------------------
;P2 bouncing on the ground from a.SP
[Statedef 652]
type    = L
movetype= H
physics = N
velset = 0,0

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

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

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

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

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

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

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

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

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

[State 5100, 5]
type = VelSet
trigger1 = AnimTime = 0
y = -9
x = -2

[State 111, 1]
type = StateTypeSet
trigger1 = AnimTime = 0
physics = A

[State 5100, 12]
type = SelfState
trigger1 = AnimTime = 0
value = 5050


;===========================================================================
; SHOCKED - DIZZY (Code by POTS)
;===========================================================================
[Statedef 7696]
type = U
physics = N
movetype = H
ctrl = 0
velset = 0, 0

[State 7696, sts]
type = statetypeset
trigger1 = !time
trigger1 = pos y < 0
statetype = A
[State 7696, sts]
type = statetypeset
trigger1 = !time
trigger1 = pos y >= 0
statetype = S

[State 7696, Pos]
type = posset
trigger1 = pos y >= 0
y = 0

;Dizzy start
[Statedef 7695]
type = U
physics = N
movetype = H
ctrl = 0
velset = 0, 0
 
[State 7695, Pos]
type = posset
trigger1 = pos y >= 0
y = 0

[State 7695, Anim]
type = changeanim
trigger1 = !time
value = 5002
 
[State 7695, End]
type = changestate
trigger1 = alive && hitshakeover
value = 1115020
[State 7695, End]
type = selfstate
trigger1 = !alive && hitshakeover
value = 5030

;========================< HIT BACK, then dizzy >=============================
;Hit back, then dizzy
[Statedef 1115020]
type = A
movetype = H
physics = N
velset = 0, 0
[State 1115020, Anim]
type = changeanim
trigger1 = 1
value = 5030
[State 1115020, End]
type = changestate
trigger1 = hitshakeover
value = 1115030


[Statedef 1115030]
type = A
movetype = H
physics = N
ctrl = 0
[State 1115030, Accel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)
[State 1115030, 1] ;Fix by Zzyzzyxx
type = VelSet
trigger1 = !Time
x = GetHitVar(xvel) * facing
y = gethitvar(yvel)
[State 1115030, End]
type = changestate
trigger1 = hitover
trigger2 = vel y > 0 && pos y >= 10
value = 1115050
[State 1115030, End]
type = changestate
trigger1 = !animtime
value = 1115035

;Stand/air hit transition
[Statedef 1115035]
type = A
movetype = H
physics = N
[State 1115035, Anim]
type = changeanim
trigger1 = !time && selfanimexist(5035)
value = 5035
[State 1115035, Accel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)
[State 1115035, End]
type = changestate
trigger1 = hitover
trigger2 = !animtime
trigger3 = vel y > 0 && pos y >= 10
trigger4 = !time && anim != 5035
value = 1115050

;Air fall
[Statedef 1115050]
type = A
movetype = H
physics = N
[State 1115050, Anim]
type = changeanim
trigger1 = anim = 5035 && !animtime
trigger2 = anim != 5035 && !time
value = 5050
[State 1115050, Anim]
type = changeanim
trigger1 = anim = [5050, 5059]
trigger1 = vel y >= IfElse(anim = 5050, 1, -2)
trigger1 = selfanimexist(anim + 10)
value = anim + 10
persistent = 0
[State 1115050, Accel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)
[State 1115050, End]
type = changestate
trigger1 = vel y > 0
trigger1 = pos y >= IfElse((anim = [5051, 5059]) || (anim = [5061, 5069]), 0, 25)
value = 1115100

;Hit ground 1
[Statedef 1115100]
type = L
movetype = H
physics = N
[State 1115100, 1]
type = velset
trigger1 = !time && gethitvar(fall.yvel) = 0 && vel x > 1
x = 1
[State 1115100, Shake]
type = fallenvshake
trigger1 = !time
[State 1115100, Var]
type = varset
trigger1 = !time
sysvar(1) = floor(vel y)
[State 1115100, Anim]
type = ChangeAnim
trigger1 = !time
value = 5100
[State 1115100, Pos]
type = posset
trigger1 = !time
y = 0
[State 1115100, Vel]
type = velset
trigger1 = !time
y = 0
[State 1115100, Vel]
type = velmul
trigger1 = !time
x = 0.75
[State 1115100, End]
type = changestate
trigger1 = !time
trigger1 = gethitvar(fall.yvel) = 0
value = 1115110

[State 1115100, hurt]
type = hitfalldamage
trigger1 = time = 3
[State 1115100, freeze]
type = posfreeze
trigger1 = 1
[State 1115100, End]
type = changestate
trigger1 = !animtime
value = 1115101

;Bounce into air
[Statedef 1115101]
type = L
movetype = H
physics = N
[State 1115101, Anim]
type = changeanim
trigger1 = !time
value = 5160
[State 1115101, Vel]
type = hitfallvel
trigger1 = !time
[State 1115101, Pos]
type = posset
trigger1 = !time
y = 20
[State 1115101, accel]
type = veladd
trigger1 = 1
y = 0.4
[State 1115101, End]
type = changestate
trigger1 = vel y > 0 && pos y >= 12
value = 1115110

;Hit ground 2, Liedown
[Statedef 1115110]
type = L
movetype = H
physics = N
[State 1115110, Shake]
type = fallenvshake
trigger1 = !time

[State 1115110, 2]
type = changeanim
trigger1 = !time
value = 5170
[State 1115110, hurt]
type = hitfalldamage
trigger1 = !time
[State 1115110, Pos]
type = posset
trigger1 = !time
y = 0
[State 1115110, Var]
type = varset
trigger1 = !time
trigger1 = gethitvar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 1115110, Vel]
type = velset
trigger1 = !time
y = 0
[State 1115110, Anim]
type = changeanim
persistent = 0
triggerall = anim != [5111, 5119]
trigger1 = !animtime
trigger2 = sysvar(0)
value = 5110

[State 1115110, ko]
type = selfstate
triggerall = !alive
trigger1 = !animtime
trigger2 = sysvar(0)
trigger3 = anim = [5110, 5119]
value = 5150
[State 1115110, Var]
type = varset
trigger1 = sysvar(0)
trigger1 = !time
sysvar(0) = 0
[State 1115110, Vel]
type = velmul
trigger1 = 1
x = 0.85
[State 1115110, getup]
type = changestate
trigger1 = alive && time >= 9;const(data.liedown.time)
value = 1115120
persistent = 0

;Getting up
[Statedef 1115120]
type = L
movetype = H
physics = N
[State 1115120, Anim]
type = changeanim
trigger1 = !time
value = 5120
[State 1115120, Vel]
type = velset
trigger1 = !time
x = 0
[State 1115120, NHB]
type = nothitby
trigger1 = 1
value = SCA
time = 1
[State 1115120, hitfall]
type = hitfallset
trigger1 = !animtime
value = 0   ;1
[State 1115120, NHB]
type = nothitby
trigger1 = 1
value = SCA
time = 1
[State 1115120, dizzy]
type = changestate
trigger1 = !animtime
value = 5300

;Dizzy
[Statedef 5300]
type = S
movetype = I
physics = S
velset = 0, 0
anim = 5300
 
[State 5300, Skip]
type = changeanim
trigger1 = animelemtime(animelemno(0)) > 0 && animelemtime(animelemno(0) + 1) < 0
trigger1 = animelemtime(animelemno(0) + 1) >= -enemy,sysvar(2)
value = 5300
elem = animelemno(0) + 1
 
[State 5300, End]
type = selfstate
trigger1 = enemy,sysvar(3) <= 0 || time >= 300 || roundstate != 2
value = 0
ctrl = 1

;========================< THROW ESCAPE >=============================
;Throw Escape
[Statedef 5940]
type = S
movetype = H
physics = S
velset = 0, 0

[State 0, SelfState]
type = SelfState
trigger1 = !Time
value = Cond(Var(0)=1,950,5949)
ignorehitpause = 1

[Statedef 5949]
type = S
movetype = H
physics = S
velset = 0, 0
anim = 5940


[State 950, PosAdd 1]
type		= PosAdd
trigger1            = Time <=10
trigger1		= P2bodydist X < 10
X		= -8
[State 950, PosAdd 2]
type		= PosAdd
trigger1            = Time <=10
trigger1		= P2bodydist X < 25
X		= -5
[State 950, PosAdd 3]
type		= PosAdd
trigger1            = Time <=10
trigger1		= P2bodydist X < 35
X		= -2
[State 950, PosAdd 4]
type		= PosAdd
trigger1            = Time <=10
trigger1		= P2bodydist X < 40
X		= -1

[State 950, Width]
type		= Width
trigger1            = Time <=10
edge		= 50,40
 
[State 41, Train]
type = AfterImage
trigger1 = Time = 10
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 111, 1]
type = VelSet
trigger1 = time>=11 
x = -7

[State 111, 1]
type = StateTypeSet
trigger1 = time > 20
movetype = I

[State 111, 1]
type = SelfState
trigger1 = time =20
value = 0
ctrl = 1