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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 170,0
volumescale = 200
channel = -1

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

; WIN STATE DECIDER
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Var(9) = 9999
value = 3418
[State 180, 1]
type = ChangeState
trigger1 = Var(9) = 9998
value = 3650
[State 180, 1]
type = ChangeState
trigger1 = Var(9) = 9997
value = 3830

[State 180, 1]
type = ChangeState
trigger1 = 1
value = 181+random%9

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

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

[State 181, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = 181,20

[State 181, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = animelem = 11
value = 181,0+random%7

[State 181, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = animelem = 11
value = 181,30+random%7

[State 181, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = animelem = 11
value = 181,40+random%7

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

;---------------------------------------------------------------------------
; Win 2 Back to the dark side
[Statedef 182]
type = S
ctrl = 0
anim = 183
velset = 0,0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 182,0

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

[State 0, Explod]
type = Explod
trigger1 = Time = 50
anim = 18301
ID = 18301
sprpriority = 5
ownpal = 1
removetime = -1
bindtime = -1

[State 0, Helper]
type = Helper
trigger1 = Time = 80
name = "Darkness my old friend"
ID = 18300
stateno = 18300
ownpal = 1

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

;---------------------------------------------------------------------------
; Win 3 Meditate
[Statedef 183]
type = S
ctrl = 0
anim = 184
velset = 0,0
sprpriority = 1

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

[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 184
trigger1 = AnimElemTime(4)=27
trigger2 = Anim = 18403
trigger2 = AnimElemTime(2)=3
trigger3 = Anim = 18404
trigger3 = AnimElemTime(2)=3
time = 2
add = 180,180,180
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 184
trigger1 = AnimElemTime(4)=29
trigger2 = Anim = 18403
trigger2 = AnimElemTime(2)=1
trigger3 = Anim = 18404
trigger3 = AnimElemTime(2)=1
time = 2
add = 230,230,230
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 0, PosSet]
type = PosSet
trigger1 = Anim = 18403
trigger2 = Anim = 18404
x = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 184
trigger1 = AnimElemTime(4)=27
value = 183,0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 18404
trigger1 = AnimElem = 2
value = 183,1
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 18403
trigger1 = AnimElem = 5
value = 183,2
channel = -1

[State 0, Explod]
type = Explod
trigger1 = Anim = 184
trigger1 = AnimElemTime(4)=27
anim = 18401
ID = 18401
sprpriority = 5
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = Anim = 18403
trigger1 = AnimElemTime(1)=5
trigger2 = Anim = 18404
trigger2 = AnimElemTime(1)=5
anim = 18402
ID = 18402
sprpriority = 5
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 184
trigger1 = !AnimTime
value = 18403+random%2

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

;---------------------------------------------------------------------------
; Win 4 JoJo
[Statedef 184]
type = S
ctrl = 0
anim = 185
velset = 0,0
sprpriority = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 185+random%2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = 184,0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 186
trigger1 = Time = 14
value = 184,1
channel = -1

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

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

;---------------------------------------------------------------------------
; Win 5 Nail
[Statedef 185]
type = S
ctrl = 0
anim = 18600
velset = 0,0
sprpriority = 1

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

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


;---------------------------------------------------------------------------
; Win 6 Clones Train and Leave
[Statedef 186]
type = S
ctrl = 0
anim = 187
velset = 0,0
sprpriority = 1

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

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 8
anim = 18700
ID = 18700
sprpriority = 5
ownpal = 1


[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElemTime(7)=2
time = 8
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElem = 10
time = 3
add = 236,236,236
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElem = 11
time = 3
add = 206,206,206
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElem = 12
time = 3
add = 176,176,176
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElem = 13
time = 3
add = 106,106,106
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElem = 14
time = 3
add = 56,56,56
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256


[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = 186,0

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

;---------------------------------------------------------------------------
; Win 7 Nail floats off
[Statedef 187]
type = S
ctrl = 0
anim = 18600
velset = 0,0
sprpriority = 1

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

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(3)>=0
y = -.01

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 50
value = 187,0+random%3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 50
value = 187,10+random%3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 50
value = 187,20+random%3

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


;---------------------------------------------------------------------------
; Win 8 Dende
[Statedef 188]
type = S
ctrl = 0
anim = 0
velset = 0,0
sprpriority = 1

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

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Faded Glory"
ID = 19302
stateno = 19302
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 9
name = "Crystal Ball"
ID = 19400
stateno = 19400
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = Time = 10
anim = 18809
ID = 18809
pos = Cond(BackEdgeBodyDist < 90,150,-100),0
postype = p1  ;p2,front,back,left,right
sprpriority = 9
ownpal = 1
Facing = Cond(BackEdgeBodyDist < 90,-1,1)
bindtime = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 8
value = 18800+random%4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 22
value = 188,0+random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 22
value = 188,10+random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 22
value = 188,20+random%4
channel = 0

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

;---------------------------------------------------------------------------
; Win 9 Cool Cape
[Statedef 189]
type = S
ctrl = 0
anim = 196
velset = 0,0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 11
value = 189,0
channel = 1
loop = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = AnimElem = 11
value = 196,0+random%10
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = AnimElem = 11
value = 196,10+random%10
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = AnimElem = 11
value = 196,20+random%10
channel = 0

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

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

;---------------------------------------------------------------------------
; HellZone Finish
[Statedef 3418]
type = S
ctrl = 0
anim = 3414
velset = 0,0
sprpriority = 1

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

[State 0, Explod]
type = Explod
trigger1 = Time = 50
anim = 3415
ID = 3415
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 30
value = 3415,0
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 30
value = 3415,1
channel = 3

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

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

;---------------------------------------------------------------------------
; HellZone Finish LVL1 & 2
[Statedef 3650]
type = S
ctrl = 0
anim = 3650
velset = 0,0
sprpriority = 1

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

[State 0, Explod]
type = Explod
trigger1 = Time = 18
anim = 3415
ID = 3415
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 18
value = 3415,0
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 18
value = 3415,1
channel = 3

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

;---------------------------------------------------------------------------
; HellZone Finish LVL3
[Statedef 3830]
type = S
ctrl = 0
anim = 3830
velset = 0,0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = invisible

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 5

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

;---------------------------------------------------------------------------
; 191 - Vanilla Intro Decider [700-709]
;---- 700 - V - Intro V1 - My name is Piccolo (cape gone) You shouldn't have come to this planet : 191
;---- 701 - V - Intro V2 - Demon Crash : 192
;---- 702 - V - Intro V3 - Eating : 705
;---- 703 - V - Intro V4 - Oozaru intro
;---- 704 - V - Intro V5 - Luffy stomp : 710
;---- 705 - V - Intro V6 - Sonic stomp : 715
;---- 706 - V - Intro V7 - Burta stomp : 730
;---- 707 - V - Intro V8 - Bike stomp : 720
;---- 708 - V - Intro V9 - Goomba stomp : 725

;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 0, ChangeState]
type = ChangeState
trigger1 = !time
value = 700+random%9
ctrl = 0

;---------------------------------------------------------------------------
; INTRO 1 - Cape vanish
[Statedef 701]
type = S
ctrl = 0
velset = 0,0
anim = 191

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

[State 0, VarRandom]
type = VarRandom
triggerall = numenemy
trigger1 = enemy,name="Gotenks Z2"
trigger1 = Enemy,Authorname="Team Z2"
trigger1 = !Time
v = 41
range = 0,1

[State 0, ChangeState]
type = ChangeState
trigger1 = Var(41)=1
value = 70613

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 701
trigger2 = P2Name = "Piccolo Z2"
trigger2 = enemy, StateNo = [70600,70603]
value = 707

[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 191, PalFX]
type = PalFX
trigger1 = animelemtime(3) >= 0 && animelemtime(6) < 0 
time = 1
add = 0,0,0
mul = 0,0,0
invertall = 0
color = 256

[State 181, PlaySnd]
type = PlaySnd
trigger1 = Anim != 0
trigger1 = animelem = 3
value = 191,10
channel = 1

[State 0, Explod]
type = Explod
trigger1 = Time = 100 && Anim = 191
anim = 19111
ID = 19111
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 17100, Voice Sound]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = RoundState != 0
value = 191,0 +random%6
persistent = 0
channel = 0

[State 17100, Voice Sound]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = RoundState != 0
value = 191,20 +random%6
persistent = 0
channel = 0

[State 17100, Voice Sound]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = RoundState != 0
value = 191,30 +random%6
persistent = 0
channel = 0

[State 170, Explod]
type = Explod
trigger1 = Anim = 191
trigger1 = animelem = 3
anim = 20191
ID = 20191
pos = 32,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 2 - Demon Crash
[Statedef 702]
type = S
ctrl = 0
velset = 0,0
anim = 192
sprpriority = 0

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, VarRandom]
type = VarRandom
triggerall = numenemy
trigger1 = enemy,name="Gotenks Z2"
trigger1 = Enemy,Authorname="Team Z2"
trigger1 = !Time
v = 41
range = 0,1

[State 0, ChangeState]
type = ChangeState
trigger1 = Var(41)=1
value = 70613

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

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

[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 0, PosSet]
type = PosSet
trigger1 = !Time
y = -300

[State 0, VelSet]
type = VelSet
trigger1 = Time = 60 && (Pos y < 0)
x = 0
y = 20

[State 0, VelSet]
type = VelSet
trigger1 = Time >= 60 && (Pos y >= 0)
x = 0
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time > 61
trigger1 = Vel Y = 0
trigger1 = anim != 19201
trigger1 = Anim != 0
value = 19201

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 40
value = 192,0
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 19201
trigger1 = AnimElem = 1
value = 192,1
channel = 2

[State 0, PalFXWiz]
type = PalFX
triggerall = Anim = 19201
trigger1 = AnimElemTime(1) >= 1 && AnimElemTime(1) <= 3
trigger2 = AnimElemTime(1) >= 5 && AnimElemTime(1) <= 7
trigger3 = AnimElemTime(1) >= 9 && AnimElemTime(1) <= 11
time = 1
add = 0,0,0
mul = 0,0,0
sinadd = 0,0,0,20
invertall = 0
color = 0

[State 0, Helper]
type = Helper
trigger1 = Anim = 19201
trigger1 = AnimElemTime(1) = 1
trigger1 = !NumHelper(19202)
name = "Demon"
ID = 19202
stateno = 19202
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = Anim = 19201
trigger1 = AnimElemTime(1) = 1
trigger1 = !NumHelper(19200)
name = "Crash Dust"
ID = 19200
stateno = 19200

[state 52, Land FX]
type = helper
trigger1 = Anim = 19201
trigger1 = AnimElemTime(1) = 1
trigger1 = !NumHelper(17100)
name = "LandFX"
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim = 19201
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

; INTRO 3 - Darkness becomes LIGHT
[Statedef 703]
type = S
ctrl = 0
velset = 0,0
anim = 193

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, VarRandom]
type = VarRandom
triggerall = numenemy
trigger1 = enemy,name="Gotenks Z2"
trigger1 = Enemy,Authorname="Team Z2"
trigger1 = !Time
v = 41
range = 0,1

[State 0, ChangeState]
type = ChangeState
trigger1 = Var(41)=1
value = 70613

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

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

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Faded Glory"
ID = 19302
stateno = 19302
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 19301
ID = 19301
sprpriority = 5
ownpal = 1
bindtime = -1

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

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 200
value = 19300

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim = 19300
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = Anim = 19300
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

; INTRO 4 - Dende
[Statedef 700]
type = S
ctrl = 0
velset = 0,0
anim = 194

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, ChangeState]
type = ChangeState
triggerall = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 700
trigger2 = enemy, StateNo = 701
value = 702

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

[State 0, VarSet]
type = VarSet
trigger1 = Time = 3
fvar(3) = pos X

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 190
value = 194,0+random%3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 190
value = 194,20+random%3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 190
value = 194,30+random%3

[State 0, SprPriority]
type = SprPriority
trigger1 = Time < 220
value = 9

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

[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 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Crystal Ball"
ID = 19400
stateno = 19400
pos = 110,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, VelSet]
type = VelSet
trigger1 = Time = 200 
x = -8

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

[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 20
trigger1 = AnimElem = 1
x = 150

[State 0, VelSet]
type = VelSet
trigger1 = Time = 246
trigger2 = Anim = 20
trigger2 = Pos X <= FVar(3)
trigger2 = Facing = -1
trigger3 = Anim = 20
trigger3 = Pos X >= FVar(3)
trigger3 = Facing = 1
x = 0

[State 100, steps]
type = playsnd
triggerall = anim = 20
trigger1 = animelemtime(8)=0 
trigger2 = animelemtime(11)=0 
value = 40,0
volumescale = 200

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 239
x = -20

[State 0, VelSet]
type = VelSet
trigger1 = Time = 246
x = Const(velocity.walk.fwd.x)

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 20
trigger1 = Vel X = 0
value = 19401

[State 0, PosSet]
type = PosSet
trigger1 = Anim = 19401
trigger1 = AnimElem = 1
x = fVar(3)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim = 19401
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = Anim = 19401
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

; INTRO 5 - Clone Collision
[Statedef 704]
type = S
ctrl = 0
velset = 0,0
anim = 19500
sprpriority = 4

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

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

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

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

[State 0, EnvShake]
type = EnvShake
triggerall = Anim = 19500
trigger1 = AnimElem = 10
trigger2 = AnimElemTime(14) = 3
trigger3 = AnimElemTime(19) = 1
trigger4 = AnimElemTime(23) = 1
trigger5 = AnimElemTime(28) = 1
trigger6 = AnimElemTime(33) = 1
trigger7 = AnimElemTime(38) = 1
trigger8 = AnimElemTime(43) = 1
trigger9 = AnimElemTime(48) = 1
time = 10
freq = 80
ampl = -6
phase = 90

[State 0, Explod]
type = Explod
trigger1 = Anim = 19500
trigger1 = AnimElem = 14
anim = 19502
ID = 19502
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = Anim = 19500
trigger1 = AnimElem = 15
anim = 19503
ID = 19503
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = Anim = 19500
trigger1 = AnimElem = 47
anim = 19601
ID = 19601
sprpriority = 9
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 19500
trigger1 = !AnimTime
id = 19502
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 19500
trigger1 = !AnimTime
id = 19503

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 19500
trigger1 = AnimElem = 47
value = 3501,1
channel = 2

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 19500
trigger1 = !AnimTime
value = 19501

[State 100, steps]
type = playsnd
triggerall = anim = 19501
trigger1 = animelem = 12
value = 40,0
volumescale = 200

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim = 19501
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = Anim = 19501
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

; INTRO 6 - Clones Brawl 2
[Statedef 705]
type = S
ctrl = 0
velset = 0,0
anim = 19600

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, VarSet]
type = VarSet
trigger1 = Time = 3
fvar(3) = pos X

[State 191, 1]
type = ChangeAnim
trigger1 = RoundState = 0
value = anim

[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 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 40
value = 705,0
channel = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 4
x = -300

[State 0, VelSet]
type = VelSet
trigger1 = Time = 10
x = 3

[State 0, VelSet]
type = VelSet
triggerall = Time >= 21
trigger1 = Pos X <= FVar(3)
trigger1 = Facing = -1
trigger2 = Pos X >= FVar(3)
trigger2 = Facing = 1
x = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 19600
trigger1 = !AnimTime
value = 19501

[State 0, Explod]
type = Explod
trigger1 = Anim = 19600
trigger1 = AnimElem = 44
anim = 19601
ID = 19601
sprpriority = 9
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Anim = 19501
trigger1 = AnimElem = 1
value = 705,1
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Anim = 19501
trigger1 = AnimElem = 1
value = 705,10
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Anim = 19501
trigger1 = AnimElem = 1
value = 705,20
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 19600
trigger1 = AnimElem = 44
value = 3501,1
channel = 2

[State 100, steps]
type = playsnd
triggerall = anim = 19501
trigger1 = animelem = 12
value = 40,0
volumescale = 200

[State 0, PosSet]
type = PosSet
trigger1 = Anim = 19501
x = fVar(3)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim = 19501
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = Anim = 19501
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 7 Skitzo
[Statedef 706]
type = S
ctrl = 0
anim = 189
velset = 0,0
sprpriority = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !Time
value = 70600+random%4


;---------------------------------------------------------------------------
; INTRO 8 Absorb Nail to DEATH
[Statedef 707]
type = S
ctrl = 0
anim = 190
velset = 0,0
sprpriority = 1

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 181, 1]
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 0, Explod]
type = Explod
trigger1 = !Time
anim = 19001
ID = 19001
sprpriority = 5
ownpal = 1
bindtime = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 100
value = 707,0
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 144
value = 707,1
channel = 2

[State 0, PalFXWiz]
type = PalFX
trigger1 = Time = 141
time = 4
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = Time = 148
time = 2
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256
[State 0, PalFXWiz]
type = PalFX
trigger1 = Time = 152
time = 1
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256

[state 1215, Smoke FX]
type = explod
trigger1 = time = 144
anim = 10100
id = 10100
pos = 120,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 0, Super FX]
type = Explod
trigger1 = time = 140
anim = 10200
id = 10200
pos = 20,-50
postype = p1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 9 Demon Buster
[Statedef 708]
type = S
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !Time
value = 70610+random%3

;---------------------------------------------------------------------------
; INTRO 7 Skitzo
[Statedef 70600]
type = S
ctrl = 0
anim = 189
velset = 0,0
sprpriority = 1

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 701
trigger2 = P2Name = "Piccolo Z2"
trigger2 = enemy, StateNo = [70600,70603]
value = 703

[State 181, 1]
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 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 10
value = 706,0+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 10
value = 706,100+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 10
value = 706,200+random%3
channel = 0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Daimao"
ID = 18900
stateno = 18900
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1
[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Nail"
ID = 18901
stateno = 18901
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1
[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Kami"
ID = 18902
stateno = 18902
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 7 Skitzo Daimao
[Statedef 70601]
type = S
ctrl = 0
anim = 189
velset = 0,0
sprpriority = 1

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 701
trigger2 = P2Name = "Piccolo Z2"
trigger2 = enemy, StateNo = [70600,70603]
value = 703

[State 181, 1]
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 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 10
value = 706,12+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 10
value = 706,112+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 10
value = 706,212+random%3
channel = 0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Daimao"
ID = 18900
stateno = 18900
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 7 Skitzo Nail
[Statedef 70602]
type = S
ctrl = 0
anim = 189
velset = 0,0
sprpriority = 1

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 701
trigger2 = P2Name = "Piccolo Z2"
trigger2 = enemy, StateNo = [70600,70603]
value = 703

[State 181, 1]
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 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 10
value = 706,4+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 10
value = 706,104+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 10
value = 706,204+random%3
channel = 0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Nail"
ID = 18901
stateno = 18901
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 7 Skitzo Kami
[Statedef 70603]
type = S
ctrl = 0
anim = 189
velset = 0,0
sprpriority = 1

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = 701
trigger2 = P2Name = "Piccolo Z2"
trigger2 = enemy, StateNo = [70600,70603]
value = 703

[State 181, 1]
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 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Time = 10
value = 706,8+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = Time = 10
value = 706,108+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = Time = 10
value = 706,208+random%3
channel = 0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Kami"
ID = 18902
stateno = 18902
pos = 130,15
postype = p1    ;p2,front,back,left,right
ownpal =1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 9 Demon Buster - Start with no arm
[Statedef 70610]
type = S
ctrl = 0
anim = 182
velset = 0,0
sprpriority = 3

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = AnimElem = 31
value = 18500,0+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = AnimElem = 31
value = 18500,10+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = AnimElem = 31
value = 18500,20+random%7
channel = 0

[State 181, 1]
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 0, VarSet]
type = VarSet
trigger1 = Time = 3
fvar(3) = pos X

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = [70610,70699]
value = 702

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 16
anim = 18202
ID = 18202
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 17
anim = 18203
ID = 18203
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 4
ownpal = 1


[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 23
x = 1
y = -5
[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(25) >= 0 && AnimElemTime(40) < 0
x = 0
y = .15

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 15
value = 3500,0
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 42
value = 185,0
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 50
value = 185,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 54
value = 185,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 55
value = 185,3
channel = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 75
trigger2 = AnimElem = 80
value = 2302,0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18204
ID = 18204
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18205
ID = 18205
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 50
anim = 18206
ID = 18206
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 51
anim = 18207
ID = 18207
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -30,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -90,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -90,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, PosSet]
type = PosSet
trigger1 = AnimElem = 79
x = fvar(3)
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18222
trigger1 = helper(18220),AnimElem = 5
value = 185,7
channel = 5
[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18222
trigger1 = helper(18220),AnimElem = 10
value = 185,8
channel = 6

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18220
trigger1 = helper(18220),Time = 229
value = 185,5
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18221
trigger1 = helper(18220),Time = 229
value = 185,6
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18224
trigger1 = helper(18220),Time = 229
value = 185,9
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18250
trigger1 = helper(18220),Time = 229
value = 185,10
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18251
trigger1 = helper(18220),Time = 229
value = 185,11
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18253
trigger1 = helper(18220),Time = 229
value = 185,12
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18254
trigger1 = helper(18220),Time = 229
value = 185,12
channel = 4

[State 0, PlaySnd]
type = PlaySnd
triggerall = NumHelper(18220)
triggerall = helper(18220),Time = 229
trigger1 = helper(18220),Anim = 18255
trigger2 = helper(18220),Anim = 18256
trigger3 = helper(18220),Anim = 18257
trigger4 = helper(18220),Anim = 18258
trigger5 = helper(18220),Anim = 18259
trigger6 = helper(18220),Anim = 18260
trigger7 = helper(18220),Anim = 18263
trigger8 = helper(18220),Anim = 18267
trigger9 = helper(18220),Anim = 18270
trigger10 = helper(18220),Anim = 18274
trigger11 = helper(18220),Anim = 18261
trigger12 = helper(18220),Anim = 18262
trigger13 = helper(18220),Anim = 18269
value = 185,4
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18226
trigger1 = helper(18220),Time = 229
value = 185,15
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18233
trigger1 = helper(18220),Time = 229
value = 185,19
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18236
trigger1 = helper(18220),Time = 229
value = 185,21
channel = 4

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Demon1"
ID = 18220
stateno = 18220+random%17
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0


;---------------------------------------------------------------------------
; INTRO 9 Demon Buster - Start with arms
[Statedef 70611]
type = S
ctrl = 0
anim = 18200
velset = 0,0
sprpriority = 3

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = AnimElem = 31
value = 18500,0+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = AnimElem = 31
value = 18500,10+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = AnimElem = 31
value = 18500,20+random%7
channel = 0

[State 181, 1]
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 0, VarSet]
type = VarSet
trigger1 = Time = 3
fvar(3) = pos X

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = [70610,70699]
value = 702

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 23
x = 1
y = -5
[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(25) >= 0 && AnimElemTime(40) < 0
x = 0
y = .15

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 42
value = 185,0
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 50
value = 185,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 54
value = 185,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 55
value = 185,3
channel = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 75
trigger2 = AnimElem = 80
value = 2302,0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18204
ID = 18204
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18205
ID = 18205
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 50
anim = 18206
ID = 18206
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 51
anim = 18207
ID = 18207
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -30,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -90,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -90,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, PosSet]
type = PosSet
trigger1 = AnimElem = 79
x = fvar(3)
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18226
trigger1 = helper(18220),Time = 1
value = 185,13
channel = 5
[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18226
trigger1 = helper(18220),Time = 1
value = 185,14
channel = 6
loop = 1
[State 0, StopSnd]
type = StopSnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18226
trigger1 = helper(18220),Time = 229
channel = 6

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18230
trigger1 = helper(18220),Time = 1
value = 185,16
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18231
trigger1 = helper(18220),Time >= 23
value = 185,17
persistent = 56
channel = 4
[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18231
trigger1 = helper(18220),Time >= 52
value = 185,17
persistent = 56
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18236
trigger1 = helper(18220),Time = 1
value = 185,20
channel = 5
loop = 1

[State 0, StopSnd]
type = StopSnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18240
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18231
trigger1 = helper(18220),Time >= 20
value = 185,17
persistent = 48
channel = 6
[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18231
trigger1 = helper(18220),Time >= 44
value = 185,17
persistent = 48
channel = 7

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18231
trigger1 = helper(18220),Time = 220
value = 185,18
channel = 8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18228
trigger1 = helper(18220),Time = 1
value = 185,16
volumescale = 1200
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18268
;trigger1 = helper(18220), Time = 1
value = 185,22
loop = 1
channel = 6
volumescale = 5200
persistent = 0
[State 0, StopSnd]
type = StopSnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18268
trigger1 = helper(18220), AnimElem = 61
channel = 6

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18268
trigger1 = helper(18220), AnimElem = 67
value = 185,26
channel = 7
[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18268
trigger1 = helper(18220), AnimElem = 90
value = 185,27
channel = 8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18220
trigger1 = helper(18220),Time = 229
value = 185,5
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18221
trigger1 = helper(18220),Time = 229
value = 185,6
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18224
trigger1 = helper(18220),Time = 229
value = 185,9
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18250
trigger1 = helper(18220),Time = 229
value = 185,10
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18251
trigger1 = helper(18220),Time = 229
value = 185,11
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18253
trigger1 = helper(18220),Time = 229
value = 185,12
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18254
trigger1 = helper(18220),Time = 229
value = 185,12
channel = 4

[State 0, PlaySnd]
type = PlaySnd
triggerall = NumHelper(18220)
triggerall = helper(18220),Time = 229
trigger1 = helper(18220),Anim = 18255
trigger2 = helper(18220),Anim = 18256
trigger3 = helper(18220),Anim = 18257
trigger4 = helper(18220),Anim = 18258
trigger5 = helper(18220),Anim = 18259
trigger6 = helper(18220),Anim = 18260
trigger7 = helper(18220),Anim = 18263
trigger8 = helper(18220),Anim = 18267
trigger9 = helper(18220),Anim = 18270
trigger10 = helper(18220),Anim = 18274
trigger11 = helper(18220),Anim = 18261
trigger12 = helper(18220),Anim = 18262
trigger13 = helper(18220),Anim = 18269
trigger14 = helper(18220),Anim = 18240
trigger15 = helper(18220),Anim = 18275
trigger16 = helper(18220),Anim = 18276
value = 185,4
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18226
trigger1 = helper(18220),Time = 229
value = 185,15
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18233
trigger1 = helper(18220),Time = 229
value = 185,19
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(18220)
trigger1 = helper(18220),Anim = 18236
trigger1 = helper(18220),Time = 229
value = 185,21
channel = 4

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Demon1"
ID = 18220
stateno = 18250+random%11
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 9 Demon Buster - Sans
[Statedef 70612]
type = S
ctrl = 0
anim = 18201
velset = 0,0
sprpriority = 3

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

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

[State 0, ChangeState]
type = ChangeState
trigger1 = Var(9) = 1
value = 70610
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(9) = 2
value = 70611

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 3

[State 181, 1]
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 0, VarSet]
type = VarSet
trigger1 = Time = 3
fvar(3) = pos X

[State 0, ChangeState]
type = ChangeState
triggerall = Facing = -1
trigger1 = P2Name = "Piccolo Z2"
trigger1 = enemy, StateNo = [70610,70699]
value = 702

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 5
trigger2 = AnimElem = 33
trigger3 = AnimElem = 61
x = 1
y = -5
[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(22) < 0
trigger2 = AnimElemTime(35) >= 0 && AnimElemTime(50) < 0
trigger3 = AnimElemTime(63) >= 0 && AnimElemTime(78) < 0
x = 0
y = .15

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 22
trigger2 = AnimElem = 50
trigger3 = AnimElem = 78
x = 0
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 24
trigger2 = AnimElem = 52
trigger3 = AnimElem = 80
value = 185,0
channel = 2
[State 0, StopSnd]
type = StopSnd
trigger1 = AnimElem = 29
trigger2 = AnimElem = 57
trigger3 = AnimElem = 85
channel = 2

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 24
trigger2 = AnimElem = 52
trigger3 = AnimElem = 80
anim = 18204
ID = 18204
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 15
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 24
trigger2 = AnimElem = 52
trigger3 = AnimElem = 80
anim = 18205
ID = 18205
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 15
sprpriority = 2
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = NumHelper(18220)
triggerall = helper(18220),Anim = 18266
trigger1 = helper(18220),Time = 182
trigger2 = helper(18220),Time = 324
value = 185,23
[State 0, PlaySnd]
type = PlaySnd
triggerall = NumHelper(18220)
triggerall = helper(18220),Anim = 18266
trigger1 = helper(18220),Time = 404
value = 185,25
channel = 5

[State 0, PlaySnd]
type = PlaySnd
triggerall = NumHelper(18220)
triggerall = helper(18220),Anim = 18266
trigger1 = helper(18220),AnimElem = 23
value = 185,24
channel = 6

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Demon1"
ID = 18220
stateno = 18299
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1

[State 0, PosSet]
type = PosSet
trigger1 = AnimElem = 29
trigger2 = AnimElem = 57
trigger3 = AnimElem = 85
x = fvar(3)
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0

;---------------------------------------------------------------------------
; INTRO 9 Demon Buster - Gotenks
[Statedef 70613]
type = S
ctrl = 0
anim = 18200
velset = 0,0
sprpriority = 3

[State 5900, Apply Pal]
type = RemapPal
triggerall = var(5) = 1
trigger1 = var(58)
source = 1,1
dest = 1,var(58)

[State 0, VarSet]
type = VarSet
trigger1 = !Time 
fvar(3) = pos X

[State 0, PosAdd]
type = PosAdd
trigger1 = !Time
x = 90

[State 0, Turn]
type = Turn
trigger1 = !Time
trigger2 = AnimElem = 78

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = AnimElem = 31
value = 18500,0+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = AnimElem = 31
value = 18500,10+random%7
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = AnimElem = 31
value = 18500,20+random%7
channel = 0

[State 181, 1]
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 0, VelSet]
type = VelSet
trigger1 = AnimElem = 23
x = 1
y = -5
[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(25) >= 0 && AnimElemTime(40) < 0
x = 0
y = .15

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 42
value = 185,0
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 50
value = 185,1
channel = 2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 54
value = 185,2
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 55
value = 185,3
channel = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 75
trigger2 = AnimElem = 80
value = 2302,0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18204
ID = 18204
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 42
anim = 18205
ID = 18205
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = 24
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 50
anim = 18206
ID = 18206
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 51
anim = 18207
ID = 18207
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -30,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -30,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -60,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18209
ID = 18209
pos = -90,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18208
ID = 18208
pos = -90,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 0
ownpal = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18210
ID = 18210
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18211
ID = 18211
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 54
anim = 18212
ID = 18212
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 2
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 55
anim = 2301
ID = 2301
pos = -120,100
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
sprpriority = 1
ownpal = 1

[State 0, PosSet]
type = PosSet
trigger1 = AnimElem = 79
x = fvar(3)
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(5) > 0
trigger1 = Anim != 0
trigger1 = AnimTime = 0
value = 0

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Var(5) = 0
trigger1 = AnimTime = 0
trigger2 = Var(5) > 0
trigger2 = Anim = 0
trigger2 = NumExplod(21) || enemy, command = "s"
trigger2 = AILevel=0
trigger3 = Var(5) > 0
trigger3 = Anim = 0
trigger3 = AILevel>0
value = 0


;===========================================================================
; <<<<< SUPER JUMP >>>>>
; SJ after c.SP : 10230 (old Goku replace with Gotenks launcher
; SJ Straight : 10231
; SJ Forward : 10232
; SJ Backward : 10233
;===========================================================================

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

[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 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 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 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)
trigger1 = (command = "hold_b") && (command = "hold_y")
value = 5 + (time/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
volume = 25
channel = 3
[State 4500, 2];long sound
type = PlaySnd
trigger1 = time=130
value = 8,0
loop = 1
pan = 1
volume = 25
channel = 3

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0		
trigger1 = animelemtime(4)=0
value = 900,1
volumescale = 255
channel = 4

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=1		
trigger1 = animelemtime(4)=0
value = 900,11
volumescale = 255
channel = 4

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2		
trigger1 = animelemtime(4)=0
value = 900,21
volumescale = 100
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+(var(2)=0)
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 = (command != "hold_b") || (command != "hold_y")
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 = (command != "hold_b") || (command != "hold_y")
trigger2 = Power >= const(data.power) || Power >= PowerMax || RoundState != 2
value = 901
Ctrl = 1

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

[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 = !NumExplod(110)
value = 1

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

[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 = 7

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

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

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

[State 111, 1]
type = ChangeState
triggerall = time > 7
trigger1 = command != "holdfwd" || time = 15
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 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 = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "y"
anim = 15999
ID = 90000210
removetime = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "z"
anim = 15999
ID = 90000220
removetime = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "a"
anim = 15999
ID = 90000230
removetime = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "b"
anim = 15999
ID = 90000240
removetime = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "c"
anim = 15999
ID = 90000250
removetime = 3
pausemovetime = 3
supermovetime = 3
[State 0, Explod]
type = Explod
trigger1 = NumExplod(110)
trigger1 = command = "s"
anim = 15999
ID = 90000195
removetime = 3
pausemovetime = 3
supermovetime = 3

[State 110, var]
type = VarAdd
trigger1 = time=0
var(10)=-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 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 = -6-1.5*(var(10)=0)

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

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

[State 115, VelAdd]
type = VelAdd
trigger1 = time >= 10 
y = const(movement.yaccel)*sin(4/3*pi)

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

[State 111, 1]
type = ChangeState
triggerall = time > 7
trigger1 = command != "holdback" || 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 = ifelse(Vel X >= 0, 45,46)


;-------------------------------------------------------------------------------
;GUARD
[Statedef 120]
type=U
physics=U
anim=120+(statetype=C)+(statetype=A)*2

[State 120]
Type=CtrlSet
Trigger1=AILevel>=1
value=0

[State 120, Type]
type=statetypeset
trigger1= !time && statetype=S
physics=S
[State 120, Type]
type=statetypeset
trigger1= !time && statetype=C
physics=C
[State 120, Type]
type=statetypeset
trigger1= !time && statetype=A
physics=A
[State 120, Vel]
type=velset
trigger1= !time && statetype!=A
x=0
y=0
[State 120, High to Low]
type=statetypeset
triggerall = statetype!=A & !IsHelper
trigger1= AILevel<=0 && statetype=S && command="holddown" 
trigger2= AILevel>=1 && statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 120, Low to High]
type=statetypeset
triggerall = statetype!=A & !IsHelper
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && statetype=C && (enemynear,movetype=A) && (enemynear,statetype!=C)
statetype=S
physics=S
[State 120, AI fix]
type=ctrlset
triggerall = !IsHelper
trigger1= AILevel>=1 && numenemy
value= (enemynear,time>=120 || time>=180)
[State 120, End]
type=changestate
trigger1= !animtime || AILevel>=1
value=130+(statetype=C)+(statetype=A)*2
[State 120, Stop]
type=changestate
trigger1= (AILevel<=0 && command!="holdback") & (!IsHelper) || ishelper & !inguarddist
trigger2= !inguarddist 
trigger3= AILevel>=1 && numenemy
trigger3= enemynear,hitdefattr=SCA,AT
value=140


;-------------------------------------------------------------------------------
;STAND GUARD (guarding)
[Statedef 130]
type=S
physics=S

[State 120]
Type=CtrlSet
Trigger1=AILevel>0
value=0
[State 130, Anim]
type=changeanim
trigger1= anim!=130
value=130
[State 130, AI fix]
type=ctrlset
trigger1= AILevel>=1 && numenemy
value= (enemynear,time>=120 || time>=180)
[State 130, High to Low]
type=changestate
trigger1= AILevel<=0 && command="holddown" & !IsHelper
trigger2= AILevel>=1 && random<250
trigger2= (enemynear,movetype=A) && (enemynear,statetype=C)
value=131
[State 130, Stop Guarding]
type=changestate
trigger1= (AILevel<=0 && command!="holdback") & !IsHelper || ishelper & !inguarddist
trigger2= !inguarddist
trigger3= AILevel>=1 && numenemy
trigger3= enemynear,hitdefattr=SCA,AT
value=140


;-------------------------------------------------------------------------------
;CROUCH GUARD (guarding)
[Statedef 131]
type=C
physics=C
[State 120]
Type=CtrlSet
Trigger1=AILevel>0
value=0
[State 131, Anim]
type=changeanim
trigger1= anim!=131
value=131
[State 131, Low to High]
type=changestate
trigger1= AILevel<=0 && command!="holddown"
trigger2= AILevel>=1 && random<125
trigger2= (enemynear,movetype=A) && (enemynear,statetype!=C)
value=130
[State 131, AI fix]
type=ctrlset
trigger1= AILevel>=1 && numenemy
value= (enemynear,time>=120 || time>=180)
[State 131, Stop Guarding]
type=changestate
trigger1= (AILevel<=0 && command!="holdback")
trigger2= !inguarddist
trigger3= AILevel>=1 && numenemy
trigger3= enemynear,hitdefattr=SCA,AT
value=140

;-------------------------------------------------------------------------------
;AIR GUARD (guarding)
[Statedef 132]
type=A
physics=N
[State 120]
Type=CtrlSet
Trigger1=AILevel>0
value=0
[State 132, Anim]
type=changeanim
trigger1= anim!=132
value=132
[State 132, Grav]
type=veladd
trigger1= 1
y=const(movement.yaccel)
[State 132, Var]
type=varset
trigger1= 1
sysvar(0)=(pos y>=0 && vel y>0)
[State 132, Vel]
type=velset
trigger1= sysvar(0)
y=0
[State 132, Pos]
type=posset
trigger1= sysvar(0)
y=0
[State 132, AI fix]
type=ctrlset
trigger1= AILevel>=1 && numenemy
value= (enemynear,time>=120 || time>=180)
[State 132, End]
type=changestate
trigger1= sysvar(0) && inguarddist
trigger1= (AILevel<=0 && command="holdback") || AILevel>=1
value=130
[State 132, End]
type=changestate
triggerall = !IsHelper
trigger1= sysvar(0)
value=52
[State 132, End]
type=changestate
triggerall = IsHelper
trigger1= sysvar(0)
value=35052
[State 132, stop guarding]
type=changestate
trigger1= (AILevel<=0 && command!="holdback")
trigger2= !inguarddist
trigger3= AILevel>=1 && numenemy
trigger3= enemynear,hitdefattr=SCA,AT
value=140

;-------------------------------------------------------------------------------
;GUARD (end)
[Statedef 140]
type=U
physics=U
ctrl=Cond(IsHelper,0,1)

[State 140, Anim]
type=changeanim
trigger1= !time
value=140+(statetype=C)+(statetype=A)*2
[State 140, Type]
type=statetypeset
trigger1= !time && statetype=S
physics=S
[State 140, Type]
type=statetypeset
trigger1= !time && statetype=C
physics=C
[State 140, Type]
type=statetypeset
trigger1= !time && statetype=A
physics=A
[State 140, High to Low]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=S && command="holddown"
trigger2= AILevel>=1 && random<250
trigger2= statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 140, Low to High]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && random<125
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

;-------------------------------------------------------------------------------
;SGUARDHIT (shaking)
[Statedef 150]
type=S
movetype=H
physics=N
velset=0,0
[State 150, Anim]
type=changeanim
trigger1= 1
value=150
[State 150, End]
type=changestate
triggerall = !IsHelper
trigger1= hitshakeover
value=151+2*((AILevel<=0 && command="holddown") || (AILevel>=1 && (enemynear,movetype=A) && (enemynear,statetype=C)))
[State 150, End]
type=changestate
triggerall = IsHelper
trigger1= hitshakeover
value=151
[State 150, High to Low]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=S && command="holddown"
trigger2= AILevel>=1 && random<250
trigger2= statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 150, Low to High]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && random<125
trigger2= statetype=C && (enemynear,movetype=A) && (enemynear,statetype!=C)
statetype=S
physics=S

;-------------------------------------------------------------------------------
;SGUARDHIT2 (knocked back)
[Statedef 151]
type=S
movetype=H
physics=S
anim=150

[State 151, Vel]
type=hitvelset
trigger1= !time
x=1
[State 151, Vel]
type=velset
trigger1= time=gethitvar(slidetime)
trigger2= hitover
x=0
[State 151, Ctrl]
type=ctrlset
triggerall = !IsHelper
trigger1= time=gethitvar(ctrltime)
value=1
[State 151, High to Low]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=S && command="holddown"
trigger2= AILevel>=1 && random<250
trigger2= statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 151, Low to High]
type=statetypeset
triggerall = !IsHelper
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && random<125
trigger2= statetype=C && (enemynear,movetype=A) && (enemynear,statetype!=C)
statetype=S
physics=S
[State 151, End]
type=changestate
trigger1= hitover
value=130
ctrl=Cond(IsHelper,0,1)

;-------------------------------------------------------------------------------
;CGUARDHIT (shaking)
[Statedef 152]
type=C
movetype=H
physics=N
velset=0,0
[State 152, Anim]
type=changeanim
trigger1= 1
value=151
[State 152, End]
type=changestate
trigger1= hitshakeover
value=151+2*((AILevel<=0 && command="holddown") || (AILevel>=1 && (enemynear,movetype=A) && (enemynear,statetype=C)))
[State 152, High to Low]
type=statetypeset
trigger1= AILevel<=0 && statetype=S && command="holddown"
trigger2= AILevel>=1 && random<250
trigger2= statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 152, Low to High]
type=statetypeset
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && random<125
trigger2= statetype=C && (enemynear,movetype=A) && (enemynear,statetype!=C)
statetype=S
physics=S

;-------------------------------------------------------------------------------
;CGUARDHIT2 (knocked back)
[Statedef 153]
type=C
movetype=H
physics=C
anim=151
[State 153, Vel]
type=hitvelset
trigger1= !time
x=1
[State 153, Vel]
type=velset
trigger1= time=gethitvar(slidetime)
trigger2= hitover
x=0
[State 153, Ctrl]
type=ctrlset
trigger1= time=gethitvar(ctrltime)
value=1
[State 153, High to Low]
type=statetypeset
trigger1= AILevel<=0 && statetype=S && command="holddown"
trigger2= AILevel>=1 && random<250
trigger2= statetype=S && (enemynear,movetype=A) && (enemynear,statetype=C)
statetype=C
physics=C
[State 153, Low to High]
type=statetypeset
trigger1= AILevel<=0 && statetype=C && command!="holddown"
trigger2= AILevel>=1 && random<125
trigger2= statetype=C && (enemynear,movetype=A) && (enemynear,statetype!=C)
statetype=S
physics=S
[State 153, End]
type=changestate
trigger1= hitover
value=131
ctrl=1

;-------------------------------------------------------------------------------
;AGUARDHIT (shaking)
[Statedef 154]
type=A
movetype=H
physics=N
velset=0,0
[State 154, Anim]
type=changeanim
trigger1= 1
value=152
[State 154, End]
type=changestate
trigger1= hitshakeover
value=155

;-------------------------------------------------------------------------------
;AGUARDHIT2
[Statedef 155]
type=A
movetype=H
physics=N
anim=152
[State 155, Vel]
type=hitvelset
trigger1= !time
x=1
y=1
[State 155, Vel]
type=veladd
trigger1= 1
y=const(movement.yaccel)
[State 155, Ctrl]
type=ctrlset
trigger1= time=gethitvar(ctrltime)
value=1
[State 155, Var]
type=varset
trigger1= 1
sysvar(0)=(pos y>=0 && vel y>0)
[State 155, Vel]
type=velset
trigger1= sysvar(0)
y=0
[State 155, Pos]
type=posset
trigger1= sysvar(0)
y=0
[State 155, End]
type=changestate
trigger1= sysvar(0) && inguarddist
trigger1= (AILevel<=0 && command="holdback") || AILevel>=1
value=130
[State 155, End]
type=changestate
trigger1= sysvar(0)
value=52

;===========================================================================
; ZERO COUNTER
; counter state : 750
; Boot! (f+2p) : 751
; Rising Knee (f+2k) : 755
; Lightning anim : 753
;===========================================================================

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

[State 750, strengthvar]
type = varset
trigger1 = !time && AILevel<=0
var(17) = Cond(command="f2p",1,Cond(command="f2k",2,3))
ignorehitpause = 1

[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 ;time>=20
value = Cond(var(17)=1,751,Cond(var(17)=2,755,756))

;---------------------------------
;Boot Counter
[StateDef 751]
type = S
physics = S
movetype = A
ctrl = 0
anim = 751
velset = 0,0
sprpriority = -5

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

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

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 5,15

[State 1200, 2]
type = HitDef
triggerall = Var(18) <= 15
trigger1 = AnimElem = 6
attr = S, SA
animtype  = Hard
pausetime = 10,10
damage    = 50, 11
sparkno = s10030
guard.sparkno = s10000
priority  = 5
guardflag = MA
sparkxy = -8,-69
hitsound   = S5, 5
guardsound = S5,21
ground.type = Low
ground.slidetime = 16
ground.hittime  = 18
nochainid = 3000
ground.velocity = -8, -3
ground.cornerpush.veloff = -12 ;To push far away when p2 is in corner
guard.velocity = 0
air.velocity = -12, -2
airguard.velocity = -3.5,-4.5
p2facing = 1
persistent = 0
fall.recover = 0
fall = 1
kill = 0
ID = 1676

[State 0, VarSet]
type = VarSet
trigger1 = MoveHit = 1
fvar(19) = 1.50

[State 1500]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------
; Rising Knee (f+2k)
[Statedef 755]
type = S
movetype = A
physics = N
anim = 755
ctrl = 0
poweradd = 20
sprpriority = 3
juggle = 15

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemynear,HitPauseTime!=0
value = 755

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

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

[State 1402, VelSet]
type = VelSet
trigger1 = animelem = 6
x = 3.25
y = -4
[State 1402, VelSet]
type = PosAdd
trigger1 = animelem = 6
x = 16
[State -2, VelAdd]
type = VelAdd
trigger1 = animelemtime(6) > 0 
y = 0.4875

[State 260, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 6 
statetype = A       ;S,A,C,L

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

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = animelem=5
value = 260,0
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = animelem=5
value = 260,1
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = animelem=5
value = 260,2
channel = 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelem = 6
anim = 10101
id = 260
pos = -10,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 250, 2]
type = HitDef
triggerall = Var(18) <= 15
trigger1 = AnimElem = 4
attr = S, NA
animtype  = Hard
damage    = 44,0
priority = 4, Hit
guardflag = MA
pausetime = 15,15
guard.pausetime = 15,15
sparkno = s10030
guard.sparkno = s10000
sparkxy = -20,-80
hitsound   = s5,5
guardsound = S5,21
ground.type = high
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -1,-11.5
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.45
ID = 1098
envshake.time = 20
envshake.freq = 180
envshake.ampl = -6 
fall = 1
fall.recover = 0
kill = 0

[State 0, VarSet]
type = VarSet
trigger1 = MoveHit = 1
fvar(19) = 1.50

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1
persistent = 0

[State 250, 3]
type = ChangeState
trigger1 = statetype = A
trigger1 = Vel Y + Pos Y >= 0
value = 52
ctrl = 0

;---------------------------------
;Jump Counter
[StateDef 756]
type = S
physics = S
movetype = I
ctrl = 0
velset = 0,0
sprpriority = -5

[State 0, ChangeState]
type = ChangeState
trigger1 = !Time
value = 40
ctrl = 0

;===========================================================================
; AERIAL ZERO COUNTER
; counter state : 760
; Zerou Counter Punch - a.SP : 761
; Zero Counter Kick - a.SK : 762
; Lightning anim : 753
;===========================================================================

[Statedef 760]
type = A
physics = N
movetype = I
anim = 122
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, strengthvar]
type = varset
trigger1 = !time && AILevel<=0
var(17) = ifelse(command="f2p",1,2)
ignorehitpause = 1

[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 = time >= 10 ;!animtime
value = ifelse(var(17)=1,761,762)

;---------------------------------------------------------------------------
; Zero Counter Punch 
[Statedef 761]
type = A
movetype = A
physics = A
anim = 761
ctrl = 0
sprpriority = 2
juggle = ifelse(p2statetype=A,3,15)

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

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

[State 620, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 2,0 ;Piccolo only

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = animelem=2 && random<350
value = 220,(random%2)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = animelem=2 && random<350
value = 220,(4+random%2)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = animelem=2 && random<350
value = 220,(8+random%2)
channel = 0



[State 650, 3];Opponent in air sent to custom bounce state
type = HitDef
triggerall = Var(18) <= 15
;triggerall = p2statetype = A && var(7)=0
trigger1 = AnimElem = 4
attr = A, NA
damage = 38,0
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 12,12
sparkno = s10030
guard.sparkno = s10000
sparkxy = -30,-55
hitsound   = s2,1 ;Piccolo only
guardsound = S5,21
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -12*cos(pi/4),12*sin(pi/4) ;45 degree fall. Speed of 12
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = 3
fall = 1
fall.recover = 0
p2facing = 1
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.35
;p2stateno = 621
id = 621

[State 0, TargetState]  ;New state
type = TargetState
trigger1 = Numtarget(621)
trigger1 = movehit = 1
value = 621
ID = 621
ignorehitpause = 1
persistent = 0

[State varset]
type = VarSet
trigger1 = p2stateno = 621
trigger1 = P2MoveType = H
var(6) = 1

[State 0, VarSet]
type = VarSet
trigger1 = MoveHit = 1
fvar(19) = 1.50

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 0

;---------------------------------------------------------------------------
; Zero Counter Kick 
[Statedef 762]
type = A
movetype = A
physics = A
anim = 762 ;650
ctrl = 0
sprpriority = 2
juggle = ifelse(p2statetype=A,3,15)

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

[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 5,15

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = animelem=2 && random<350
value = 220,(random%2)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 1
trigger1 = animelem=2 && random<350
value = 220,(4+random%2)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = Var(55) = 2
trigger1 = animelem=2 && random<350
value = 220,(8+random%2)
channel = 0

[State 250, 2]
type = HitDef
triggerall = Var(18) <= 15
trigger1 = AnimElem = 4
trigger2 = animelem = 6 
attr = A, NA
animtype  = Hard
damage    = 64,0
priority = 4, Hit
guardflag = MA
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s10030
guard.sparkno = s10000
sparkxy = -20,-74
hitsound   = s5,5
guardsound = S5,21
ground.type = low
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -9
air.velocity = -4,-4
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
persistent = 0
kill = 0
fall = 1
fall.recover = 0

[State 205, Time Offset]
type = VarSet
trigger1 = moveContact = 1
var(50) = Time
ignorehitpause = 1
persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = MoveHit = 1
fvar(19) = 1.50

[State 205, Play Anim]
type = ChangeAnim
triggerall = anim = 650
triggerall = AnimElemTime(5) <= 0
trigger1 = hitPauseTime = [1,12 - (1 - Var(50))]
value = anim
elem = 5
ignorehitpause = 1

[State 205, Play Anim]
type = ChangeAnim
triggerall = anim = 650
triggerall = animelemtime(6) >= 0 && AnimElemTime(7) <= 0
trigger1 = hitPauseTime = [1,12 - (1 - Var(50))]
value = anim
elem = 7
ignorehitpause = 1

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 0

;===========================================================================
; 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

[State 7696, Anim]
type = changeanim
trigger1 = !time
trigger1 = anim != 7696 && selfanimexist(7696)
value = 7696
[State 7696, Anim]
type = changeanim
trigger1 = !time
trigger1 = anim != 9010 && !selfanimexist(7696) && selfanimexist(9010)
value = 9010
[State 7696, Anim]
type = changeanim
trigger1 = !time
trigger1 = !selfanimexist(7696) && !selfanimexist(9010)
value = ifelse(statetype != A, 5002, 5030)

[State 7696, Var]
type = varset
trigger1 = !time
trigger1 = gethitvar(hitcount) <=2
sysfvar(4) = 0
ignorehitpause = 1
[State 7696, Var]
type = varadd
trigger1 = !time
sysfvar(4) = 150
ignorehitpause = 1

[State 7696, nopalfx]
type = palfx
trigger1 = !time
trigger1 = (anim = 7696 || anim = 9010)
add = 0, 0, 0
time = 1

[State 7696, End]
type = changestate
trigger1 = alive && (anim = 7696 || anim = 9010) && hitshakeover
trigger2 = alive && (anim != 7696 && anim != 9010) && hitshakeover
value = ifelse(statetype = A, 1115020, 5300)
[State 7696, End]
type = selfstate
trigger1 = !alive && (anim != 7696 || anim != 9010) && hitshakeover
value = 5030



;========================< 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

[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

[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

[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, FX]
type = explod
trigger1 = time = 1
anim = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14
[State 1115100, hurt]
type = hitfalldamage
trigger1 = time = 3
[State 1115100, freeze]
type = posfreeze
trigger1 = 1
[State 1115100, End]
type = changestate
trigger1 = !animtime
value = 1115101

[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

[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, FX]
type = explod
trigger1 = !time && !sysvar(0)
anim = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14
[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

[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 = H
physics = S
velset = 0, 0
anim = 5300

[State 5300, Timer]
type = varadd
trigger1 = time
sysfvar(4) = -1
[State 5300, Timer]
type = varadd
trigger1 = sysfvar(4) > 0
trigger1 = command = "up" || command = "down" || command = "back" || command = "fwd"
sysfvar(4) = -2
[State 5300, Timer]
type = varadd
trigger1 = sysfvar(4) > 0
trigger1 = command = "x" || command = "y" || command = "z" || command = "a" || command = "b" || command = "c"
sysfvar(4) = -1

[State 5300, Skip]
type = varset
trigger1 = !time
sysfvar(3) = 0
[State 5300, Skip]
type = varadd
trigger1 = command = "up" || command = "down" || command = "back" || command = "fwd"
trigger2 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
sysfvar(3) = 1

[State 5300, Skip]
type = changeanim
trigger1 = animelemtime(animelemno(0)) > 0 && animelemtime(animelemno(0) + 1) < 0
trigger1 = animelemtime(animelemno(0) + 1) >= -sysfvar(3)
value = 5300
elem = animelemno(0) + 1
[State 5300, Skip]
type = varset
trigger1 = animelemtime(1) >= 0 && !animelemtime(animelemno(0))
sysfvar(3) = 0

[State 5300, End]
type = varset
trigger1 = sysfvar(4) < 0
sysfvar(4) = 0
[State 5300, End]
type = selfstate
trigger1 = sysfvar(4) <= 0 || time >= 300 || roundstate != 2
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;P2 bouncing on the ground Kaioken

[Statedef 2781]
type    = L
movetype= H
physics = N

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

[State 4005, vel Y]
type = varset
trigger1 = !time
var(6) = 1

[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, 5]
type = VelSet
trigger1 = AnimTime = 0
y = -7

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

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 2782    ;=5050 modified
;---------------------------
; HITA_FALL (knocked up, falling)
[Statedef 2782]
type    = A
movetype= H
physics = N
ctrl = 0

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

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down 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 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 2783   ;=5100 modified

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 2783]
type    = L
movetype= H
physics = N
ctrl = 0

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

[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.75

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 2784    ;=5101 modified

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 2784]
type    = L
movetype= H
physics = N

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

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

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

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 2785   ;=5110 modified

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 2785]
type    = L
movetype= H
physics = N

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

value = SCA

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

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = SelfState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 11] ;Alive
type = SelfState
triggerall = alive
trigger1 = time = 40
value = 5120

[State 5110, 12]

type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

;===========================================================================
; DASH COLLISION
;===========================================================================

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 950,0

[State -2, Explod]; Smoke FX
type = Explod
trigger1 = time=5 && numexplod(956)=0 && teamside = 1
anim = 956
pos = 45,0
postype = p1
removetime = -2
supermove = 1
scale = 1,1
sprpriority = 0
id = 956
bindtime = -1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1

[State -2, Explod]; 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 -2, Explod]; 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 17100,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 -2, Explod]; White FG
type = Explod
trigger1 = time=5 && numexplod(957)=0 && teamside = 1
anim = 957
pos = 0,0
postype = left
removetime = 3
supermove = 1
scale = 1,1
sprpriority = 7
id = 957
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = -1

[State 800, ABORT]
type = Changestate
trigger1 = p2stateno != 950 && p2stateno != 951 && time>=4 && time<50
value = 952
ctrl = 1

[State 1000]
type = PosAdd
trigger1 = P2bodydist X < 10
X = -8
[State 1000]
type = PosAdd
trigger1 = P2bodydist X < 25
X = -5
[State 1000]
type = PosAdd
trigger1 = P2bodydist X < 35
X = -2
[State 1000]
type = PosAdd
trigger1 = P2bodydist X < 40
X = -1

[State 1000]
type = width
trigger1 = 1
edge = 50,40

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

[State 800, Explosion SND]
type = PlaySnd
trigger1 = time=5 && teamside = 1
value = 950,0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0		
trigger1 = time = 5
value = 220,1
volumescale = 500
channel = 4

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=1		
trigger1 = time = 5
value = 900,11
volumescale = 500
channel = 4

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2		
trigger1 = time = 5
value = 900,21
volumescale = 500
channel = 4

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = time=5
value = 8,22
volume = 500

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

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

[State 800, count]
type = Changestate
triggerall = time = 80
trigger1 = var(30) > enemy,var(30)
value = 951

[State 800, count]
type = Changestate
triggerall = time = 80
trigger1 = var(30) < enemy,var(30)
value = 0
ctrl = 0

[State 800, count]
type = Changestate
triggerall = time = 80
trigger1 = var(30) = enemy,var(30)
value = 105
ctrl = 0

;-----------------------------------------
;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
triggerall = Var(18) <= 15
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 = 801
ignorehitpause = 1
persistent = 0

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



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

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 955

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 956

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 957

[State 0, 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 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 5950
trigger1 = AnimElem = 2
value = 40,0
volumescale = 200
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(55) = 0
trigger1 = Anim = 5950
trigger1 = AnimElem = 3
value = 5950,0+random%4
channel = 0

[State 5950, 4]
type = PosAdd
trigger1 = AnimElemTime(5) = 0 && anim=5950
X = -30

[State 110z, ChangeState]
type = ChangeState
trigger1 = !Animtime
value = 5150

;========================< 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 = 110,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