;Ghost Bros
[Statedef 3000]
type = S
movetype = A
physics = S
anim = 3000
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = !Time
var(9) = Cond((((ifElse(NumExplod(90000230), 1, 0) + ifElse(NumExplod(90000240), 1, 0) + ifElse(NumExplod(90000250), 1, 0) >= 2) || (ifElse(NumExplod(90000235), 1, 0) + ifElse(NumExplod(90000245), 1, 0) + ifElse(NumExplod(90000255), 1, 0) >= 2)) && (Power>=2000 || Power>=1000 && Power<=1999 && Var(51)>=1000 || Var(51)>=2000)),1,0)

[State 0, VarSet]
type = VarSet
triggerall = AILEVEL
trigger1 = !Time
var(9) = Cond(Var(53)=0 && (Power > 2000 || Var(51) > 2000 || (Power >1000 && Var(51)>1000)) ,1,0)

[State 0, VarAdd]
type = VarAdd
trigger1 = !Time
trigger1 = Var(9)=0 && Power<1000 && Var(51)>=1000
var(51) = -1000

[State 0, PowerAdd]
type = PowerAdd
trigger1 = !Time
trigger1 = Var(9)=0 && Power>=1000 
value = -1000

[State 0, VarAdd]
type = VarAdd
trigger1 = !Time
var(51) = Cond((Var(9)=1 && Power<1000 && Var(51)>=2000),-2000,(Cond((Var(9)=1 && Power>=1000 && Power<=1999 && Var(51)>=1000),-1000,0)))

[State 0, PowerAdd]
type = PowerAdd
trigger1 = !Time
value = Cond((Var(9)=1 && Power>=2000),-2000,(Cond((Var(9)=1 && Power>=1000 && Power<=1999 && Var(51)>=1000),-1000,0)))

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = Var(53)=4
value = 3000
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = Var(9) = 0
trigger1 = Var(53)>=0 && Var(53)<=3
trigger2 = Var(9) = 1
trigger2 = Var(53)=3
value = 3001
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = Var(9) = 1
trigger1 = Var(53)=2
value = 3002
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = Var(9) = 1
trigger1 = Var(53)=1
value = 3003
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = Var(9) = 1
trigger1 = Var(53)=0
value = 3004

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Anim = 3000
trigger1 = time = [6,49]
trigger2 = Anim = 3001
trigger2 = time = [6,75]
trigger3 = Anim = 3002
trigger3 = time = [6,112]
trigger4 = Anim = 3003
trigger4 = time = [6,129]
trigger5 = Anim = 3004
trigger5 = time = [6,147]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = Anim = [3000,3001]
trigger1 = !(time%4)
time=4
freq=80
ampl=1.5+0.02*time
[State 1000, shake]
type = EnvShake
trigger1 = Anim = [3002,3004]
trigger1 = !(time%4)
time=4
freq=85
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = Anim = [3000,3001]
trigger1 = time=5
time = Cond(Anim=3000,54,70)
p2defmul = 1
unhittable = 1
anim = -1
sound = s5,100
darken = 0
movetime = Cond(Anim=3000,54,70)

[State 3000, superpause]
type = superpause
trigger1 = Anim = [3002,3004]
trigger1 = time=5
time = Cond(Anim=3002,107,Cond(Anim=3003,124,142))
p2defmul = 1
unhittable = 1
anim = -1
;sound = s5,100
darken = 0
movetime = Cond(Anim=3002,107,Cond(Anim=3003,124,142))

[State 0, Super FX]
type = Explod
trigger1 = Anim = [3000,3001]
trigger1 = time = 5
anim = 10200
id = 10200
pos = -25,-65
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 200, Superpause charge sound]
type = PlaySnd
trigger1 = Anim = [3002,3004]
trigger1 = time = 5
value = 2350,0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = Anim = [3002,3004]
trigger1 = time = 5
anim = 10201
id = 10201
pos = -25,-65
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = Anim = [3002,3004]
trigger1 = !time
time = 70
color=0
mul=0,0,0


;--------------------------------

[State 0, VarAdd]
type = VarAdd
trigger1 = AnimElem = 7
trigger2 = AnimElem = 10
trigger3 = AnimElem = 15
trigger4 = AnimElem = 19
trigger5 = AnimElem = 22
var(53) = 1

[State 0, Explod]
type = Explod
triggerall = !NumExplod(3000)
trigger1 = Time = 8
anim = 1606
ID = 3000
bindtime = -1
removetime = -1

;talk trash
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim =3001
trigger1 = AnimElemTime(12) = 5
trigger2 = Anim =3002
trigger2 = AnimElemTime(16) = 5
trigger3 = Anim =3003
trigger3 = AnimElemTime(20) = 5
trigger4 = Anim =3004
trigger4 = AnimElemTime(24) = 5
value = 3000,0+random%7
channel = 0

;talk trash
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim =3001
trigger1 = AnimElemTime(12) = 5
trigger2 = Anim =3002
trigger2 = AnimElemTime(16) = 5
trigger3 = Anim =3003
trigger3 = AnimElemTime(20) = 5
trigger4 = Anim =3004
trigger4 = AnimElemTime(24) = 5
value = 3000,12+random%4
channel = 0

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

;------------------------------------------
;Die Die Missiles Firing
[Statedef 3100]
type = A
movetype = A
physics = N
anim = 3100
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
triggerall = PrevStateNo != 3103
triggerall = !Time
trigger1 = Power<1000
trigger1 = Var(51)>=1000
var(51) = -1000

[State 0, PowerAdd]
type = PowerAdd
triggerall = PrevStateNo != 3103
triggerall = !Time
trigger1 = Power>=1000
value = -1000

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,48]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = !(time%4)
time=4
freq=80
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s5,100
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 10200
id = 10200
pos = -40,-105
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 10200
id = 10200
pos = -20,-100
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
;--------------------------------

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3111)
trigger1 = AnimElem = 3
anim = 1606
ID = 3111
bindtime = -1
removetime = -1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3110)
trigger1 = AnimElem = 3
anim = 3110
ID = 3110
bindtime = -1
removetime = -1
pausemovetime = 99999
supermovetime = 99999
sprpriority = -1
ownpal = 1
removeongethit = 1

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

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 16
trigger2 = AnimElem = 19
trigger3 = AnimElem = 22
trigger4 = AnimElem = 25
trigger5 = AnimElem = 28
trigger6 = AnimElem = 31
anim = 3101
ID = 3101
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 16
trigger2 = AnimElem = 19
trigger3 = AnimElem = 22
trigger4 = AnimElem = 25
trigger5 = AnimElem = 28
trigger6 = AnimElem = 31
anim = 3102
ID = 3101
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = AnimElem = 15
value = 3110,0+random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 15
value = 3110,10+random%2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3100,0
channel = -1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time <= 50
trigger1 = AnimElem = 17
value = 3100,1
channel = -1
[State 0, PlaySnd]
type = PlaySnd
triggerall = Time >=51
trigger1 = AnimElem = 17
trigger2 = AnimElem = 20
trigger3 = AnimElem = 23
trigger4 = AnimElem = 26
trigger5 = AnimElem = 29
trigger6 = AnimElem = 32
value = 3100,2
channel = -1

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = !Time
x = 20
y = -40
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = AnimElem = 14
id = 3110

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 17
trigger2 = AnimElem = 20
trigger3 = AnimElem = 23
trigger4 = AnimElem = 26
trigger5 = AnimElem = 29
trigger6 = AnimElem = 32
x = -1.5
y = -1
ignorehitpause = 1

[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 17
name = "Missile Highest"
ID = 3111
stateno = 3112
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 20
name = "Missile Lowest"
ID = 3112
stateno = 3114
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 23
name = "Missile High"
ID = 3113
stateno = 3111
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 26
name = "Missile Low"
ID = 3114
stateno = 3115
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 29
name = "Missile Mid"
ID = 3115
stateno = 3113
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 32
name = "Missile Random"
ID = 3116
stateno = 3111+random%5
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1

[State 221, finish]
type = ChangeState
trigger1 = Time = 120
value = 3101
ctrl = 0



;------------------------------------------
;Die Die Missiles Finished
[Statedef 3101]
type = A
movetype = A
physics = A
anim = 44
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 1038

[State 105, 3]; to landing
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52

;------------------------------------------
;Die Die Missiles Off Ground
[Statedef 3102]
type = S
movetype = A
physics = S
anim = 40
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 1000, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = !time
var(9) = ifElse((NumExplod(90000220) || NumExplod(90000225)),2,ifElse((NumExplod(90000210) || NumExplod(90000215)),1,0)) 

[State 1000, VarSet]
type = VarSet
trigger1 = AILEVEL
trigger1 = !time
var(9) = Cond(P2BodyDist X <40,0,Cond((P2BodyDist X =[41,80]),1,2))

[State 0, VarAdd]
type = VarAdd
triggerall = !Time
trigger1 = Power<1000
trigger1 = Var(51)>=1000
var(51) = -1000

[State 0, PowerAdd]
type = PowerAdd
triggerall = !Time
trigger1 = Power>=1000
value = -1000

[State 221, finish]
type = ChangeState
trigger1 = !AnimTime
value = 3103
ctrl = 0

;------------------------------------------
;Die Die Missiles Off Ground LVL2
[Statedef 3106]
type = S
movetype = A
physics = S
anim = 40
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 1000, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = !time
var(9) = ifElse(((NumExplod(90000220) && NumExplod(90000210)) || (NumExplod(90000225) && NumExplod(90000215))),2,ifElse((NumExplod(90000200) && NumExplod(90000220)) || (NumExplod(90000205) && NumExplod(90000225)),1,0)) 

[State 1000, VarSet]
type = VarSet
trigger1 = AILEVEL
trigger1 = !time
var(9) = Cond(P2BodyDist X <40,0,Cond((P2BodyDist X =[41,80]),1,2))

[State 0, VarAdd]
type = VarAdd
triggerall = !Time
trigger1 = Power<2000
trigger1 = Var(51)>=2000
var(51) = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 0, PowerAdd]
type = PowerAdd
trigger1 = !Time
value = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 221, finish]
type = ChangeState
trigger1 = !AnimTime
value = 3103
ctrl = 0


;------------------------------------------
;Die Die Missiles Jumping
[Statedef 3103]
type = A
movetype = A
physics = A
anim = 41
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = -21

[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 2
trigger1 = Time >= 4
y = 4.5
[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 1
trigger1 = Time >= 2
y = 9.5
[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 0
trigger1 = Time >= 1
y = 14.5

[State 221, finish]
type = ChangeState
trigger1 = PrevStateNo = 3102
trigger1 = Vel Y >=0
value = 3100
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = PrevStateNo = 3106
trigger1 = Vel Y >=0
value = 3105
ctrl = 0

;------------------------------------------
;Die Die Missiles Firing LVL2
[Statedef 3105]
type = A
movetype = A
physics = N
anim = 3105
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
triggerall = PrevStateNo != 3103
triggerall = !Time
trigger1 = Power<2000
trigger1 = Var(51)>=2000
var(51) = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 0, PowerAdd]
type = PowerAdd
triggerall = PrevStateNo != 3103
trigger1 = !Time
value = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,53]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = !(time%4)
time=4
freq=85
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 45
p2defmul = 1
unhittable = 1
anim = -1
;sound = s5,100
darken = 0
movetime = 40

[State 200, Superpause charge sound]
type = PlaySnd
trigger1 = time = 5
value = 2350,0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 10201
id = 10201
pos = -40,-105
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 10201
id = 10201
pos = -20,-100
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = time = 5
time = 50
color=0
mul=0,0,0
;--------------------------------

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3112)
trigger1 = AnimElem = 3
anim = 1606
ID = 3112
bindtime = -1
removetime = -1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3110)
trigger1 = AnimElem = 3
anim = 3110
ID = 3110
bindtime = -1
removetime = -1
pausemovetime = 99999
supermovetime = 99999
sprpriority = -1
ownpal = 1
removeongethit = 1

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

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 19
trigger2 = AnimElem = 22
trigger3 = AnimElem = 25
trigger4 = AnimElem = 28
trigger5 = AnimElem = 31
trigger6 = AnimElem = 34
anim = 3101
ID = 3101
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 19
trigger2 = AnimElem = 22
trigger3 = AnimElem = 25
trigger4 = AnimElem = 28
trigger5 = AnimElem = 31
trigger6 = AnimElem = 34
anim = 3102
ID = 3101
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = AnimElem = 15
value = 3110,0+random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 15
value = 3110,10+random%2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3100,0
channel = -1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time <= 59
trigger1 = AnimElem = 20
value = 3100,1
channel = -1
[State 0, PlaySnd]
type = PlaySnd
triggerall = Time >=60
trigger1 = AnimElem = 20
trigger2 = AnimElem = 23
trigger3 = AnimElem = 26
trigger4 = AnimElem = 29
trigger5 = AnimElem = 32
trigger6 = AnimElem = 35
value = 3100,2
channel = -1

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = !Time
x = 20
y = -40
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = AnimElem = 17
id = 3110

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 20
trigger2 = AnimElem = 23
trigger3 = AnimElem = 26
trigger4 = AnimElem = 29
trigger5 = AnimElem = 32
trigger6 = AnimElem = 35
x = -1.5
y = -1
ignorehitpause = 1

[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 20
name = "Missile Highest"
ID = 3111
stateno = 3112
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 23
name = "Missile Lowest"
ID = 3111
stateno = 3114
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 26
name = "Missile High"
ID = 3111
stateno = 3111
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 29
name = "Missile Low"
ID = 3111
stateno = 3115
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 32
name = "Missile Mid"
ID = 3111
stateno = 3113
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1
[State 1030, Helper]
type = Helper
trigger1 = AnimElem = 35
name = "Missile Random"
ID = 3111
stateno = 3111+random%5
pos = 65,-50
postype = p1    ;p2,front,back,left,right
facing = 1

[State 221, finish]
type = ChangeState
trigger1 = Time = 180
value = 3101
ctrl = 0

;Volley!
[Statedef 3200]
type = S
movetype = A
physics = S
anim = 3200
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo = 1020
trigger1 = Time<=5
x = 4

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = 40,0
channel = -1

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

[State 0, VarAdd]
type = VarAdd
triggerall = PrevStateNo != 3103
triggerall = Time = 5
trigger1 = Power<1000
trigger1 = Var(51)>=1000
var(51) = -1000

[State 0, PowerAdd]
type = PowerAdd
triggerall = PrevStateNo != 3103
triggerall = Time = 5
trigger1 = Power>=1000
value = -1000

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,48]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = Time >=5 && Time <=48
trigger1 = !(time%4)
time=4
freq=80
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s5,100
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 10200
id = 10200
pos = 0,-74
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
;--------------------------------

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(4) >= 1 && AnimElemTime(7) <= 0
x = 1

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

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,15 - (55 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

[State 225, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = A, HA
damage = ceil(ifElse(fvar(11) * 75 < 38, 38, fvar(11) * 75)), 12
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 15,15
guard.pausetime = 15,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -1,-12
guard.velocity = -9
air.velocity = -1,-10
fall = 1
fall.recover = 0
air.animtype = back
getpower = 0,0
givepower = 35,35
yaccel = 0.45
p2facing = 1
kill = 0
id=3200

[State 0, Projectile]
type = Projectile
trigger1 = MoveHit = 1
ProjID = 3001
projanim = 15999
projremovetime = 1
ignorehitpause=1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6) >= 0
value = 0 

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = NumTarget(3200)
trigger1 = enemy,BackEdgeBodyDist <= 100
trigger1 = Anim = 3200
trigger1 = AnimElem = 9
trigger1 = !target,IsHelper
value = 3202

[State 0, TargetState]
type = TargetState
trigger1 = !NumHelper(3410)
trigger1 = NumTarget(3200)
trigger1 = MoveHit = 1
trigger1 = !target,IsHelper
value = 3205

[State 0, TargetBind]
type = TargetBind
trigger1 = !NumHelper(3410)
trigger1 = MoveHit = 1
time = 1
id = 3200
pos = 50,0

[State 0, VarSet]
type = VarSet
trigger1 = !NumHelper(3410)
triggerall = NumTarget
trigger1 = !target,IsHelper
trigger1 = MoveHit = 1
var(9) = 1
ignorehitpause = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = !NumHelper(3410)
triggerall = NumTarget
trigger1 = !target,IsHelper
trigger1 = Var(9) = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 52, 4]
type = ChangeState
triggerall = Var(9) = 1
triggerall = NumTarget(3200)
trigger1 = Anim = 3202
trigger1 = !AnimTime
trigger2 = AnimElem = 8
value = 3201
ctrl = 0

[State 0, VarSet]
type = VarSet
trigger1 = NumHelper(3410)
trigger1 = MoveHit = 1
var(9) = 2
ignorehitpause = 1

[State 52, 4]
type = ChangeState
triggerall = Var(9) = 2
triggerall = NumHelper(3410)
trigger1 = Anim = 3202
trigger1 = !AnimTime
trigger2 = AnimElem = 8
value = 3201
ctrl = 0


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

;P2 Hit Rising!
[Statedef 3205]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3205

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time>=0
value = SCA
time = 1

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = 0
y = -12

[State 0, VelAdd]
type = VelAdd
trigger1 = Time >= 15
x = 0
y = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, Anim = 3201 || enemy, Anim = 3211
trigger1 = enemynear, AnimElem = 6
value = 3206
ctrl = 0

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

[State 3052, Land]
type = selfstate
trigger1 = Vel Y + Pos Y >= 0
value = 5110

;SPIKE!
[Statedef 3201]
type = A
movetype = A
physics = A
anim = 3201
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = !Time
trigger1 = NumHelper(3410)
trigger2 = NumHelper(20000)
trigger2 = helper(20000),Var(5)>0
value = 3211

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(9)<=6
trigger1 = !Time
value = 3200,0+random%5
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(9)=7
trigger1 = !Time
value = 3200,6
channel = -1

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Push"
ID = 3210
stateno = 3210

[State 0, PosSet]
type = PosSet
triggerall = enemy,BackEdgeBodyDist <= 100
trigger1 = Time = 2
trigger1 = !NumHelper(3410)
trigger2 = NumHelper(3410)
trigger2 = Time<25
x = Cond(enemy, Facing = -1,enemy, Pos X +60,enemy, Pos X -60)

[State 0, PosSet]
type = PosSet
triggerall = enemy,BackEdgeBodyDist > 100
trigger1 = Time = 2
trigger1 = !NumHelper(3410)
trigger2 = NumHelper(3410)
trigger2 = Time<25
x = Cond(enemy, Facing = -1,enemy, Pos X -60,enemy, Pos X +60)

[State 0, Turn]
type = Turn
trigger1 = P2Dist X <0
persistent = 0

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

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

[State 225, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = A, HA
damage = ceil(ifElse(fvar(11) * 100 < 75, 75, fvar(11) * 100))
hitflag = MAF
priority = 4, Hit
pausetime = 15,25
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -16,10
guard.velocity = -9
air.velocity = -16,10
fall = 1
fall.recover = 0
air.animtype = back
getpower = 0,0
givepower = 35,35
yaccel = 0.45
p2facing = 1

[State 0, Projectile]
type = Projectile
trigger1 = MoveHit = 1
trigger2 = AnimElem = 7
ProjID = 3001
projanim = 15999
projremovetime = 1
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1 = NumTarget(3200)
trigger1 = AnimElem = 7
anim = 7030
ID = 7030
pos = 20,-65
postype = p1  ;p2,front,back,left,right
sprpriority = 10

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumTarget(3200)
trigger1 = AnimElem = 7
value = 5,2

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = NumTarget(3200)
trigger1 = AnimElem = 7
value = ceil(ifElse(fvar(11) * -150 < -75, -75, fvar(11) * -150))
ID = 3200
kill = 1

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

[State 0, HitAdd]
type = HitAdd
trigger1 = NumTarget(3200)
trigger1 = AnimElem = 7
value = 1

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

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim != 3211
trigger1 = AnimElem = 12
value = 2302,0
channel = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim != 3211
trigger1 = NumHelper(20000)
trigger1 = helper(20000),Var(5)=0
trigger1 = !AnimTime
value = 3203
ctrl = 0

;P2 Hit Frame
[Statedef 3206]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3206

[State 0, Turn]
type = Turn
trigger1 = Facing = enemy, Facing

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = 0
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 15
value = 3207
ctrl = 0

;P2 SPIKED
[Statedef 3207]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3207

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -10
y = 10

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

;P2 bounce miss
[Statedef 3208]
type = L
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3208

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

[State 0, VelAdd]
type = VelAdd
trigger1 = Time >=9
x = 0
y = 1

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

;P2 final bounce
[Statedef 3209]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3209

[State 0, VelSet]
type = VelSet
trigger1 = Time = 3
x = -1
y = -2

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Time = 6
physics = A         ;A,C,S,N

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

[State 3052, Land]
type = selfstate
trigger1 = Vel Y + Pos Y >= 0
value = 5110

;Receive!
[Statedef 3203]
type = S
movetype = I
physics = S
anim = 3203
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(9)=7
trigger1 = !AnimTime
value = 3200,7
channel = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, Pause]
type = Pause
trigger1 = !Time
time = 15
movetime = 15

[State 0, Turn]
type = Turn
trigger1 = !Time

[State 0, Explod]
type = Explod
trigger1 = !NumHelper(3410)
trigger1 = !Time
anim = 3204
ID = 3204
removetime = -2
removeongethit = 1
pausemovetime = 99999

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(enemy, Facing = -1,enemy, Pos X -40,enemy, Pos X +40)
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !NumHelper(3410)
trigger1 = !AnimTime
trigger2 = NumHelper(3410)
trigger2 = !Time
value = 0
ctrl = 1

;===========================================================================
;Galactic Donutaaaa
[Statedef 3300]
type = S
movetype = A
physics = S
anim = 3300
ctrl = 0
velset = 0,0
sprpriority = 1

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

[State 0, VarAdd]
type = VarAdd
triggerall = PrevStateNo != 3103
triggerall = Time = 5
trigger1 = Power<1000
trigger1 = Var(51)>=1000
var(51) = -1000

[State 0, PowerAdd]
type = PowerAdd
triggerall = PrevStateNo != 3103
triggerall = Time = 5
trigger1 = Power>=1000
value = -1000

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,48]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = Time >=5 && Time <=48
trigger1 = !(time%4)
time=4
freq=80
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s5,100
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 10200
id = 10200
pos = 26,-108
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
;--------------------------------

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
value = 3300,0+random%3
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
value = 3300,5+random%2
channel = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(3) = 1
name = "Donut"
ID = 3310
stateno = 3310
pos = -20,10
postype = p1    ;p2,front,back,left,right
supermovetime = 40
pausemovetime = 40

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

;------------------------------------------
;Die Die Missiles Off Ground LVL2
[Statedef 3106]
type = S
movetype = A
physics = S
anim = 40
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 1000, VarSet]
type = VarSet
trigger1 = !time
var(9) = ifElse(((NumExplod(90000220) && NumExplod(90000210)) || (NumExplod(90000225) && NumExplod(90000215))),2,ifElse((NumExplod(90000200) && NumExplod(90000220)) || (NumExplod(90000205) && NumExplod(90000225)),1,0)) 

[State 0, VarAdd]
type = VarAdd
triggerall = !Time
trigger1 = Power<2000
trigger1 = Var(51)>=2000
var(51) = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 0, PowerAdd]
type = PowerAdd
trigger1 = !Time
value = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 221, finish]
type = ChangeState
trigger1 = !AnimTime
value = 3103
ctrl = 0


;------------------------------------------
;Die Die Missiles Jumping
[Statedef 3103]
type = A
movetype = A
physics = A
anim = 41
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = -21

[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 2
trigger1 = Time >= 4
y = 4.5
[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 1
trigger1 = Time >= 2
y = 9.5
[State 0, VelAdd]
type = VelAdd
trigger1 = Var(9) = 0
trigger1 = Time >= 1
y = 14.5

[State 221, finish]
type = ChangeState
trigger1 = PrevStateNo = 3102
trigger1 = Vel Y >=0
value = 3100
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = PrevStateNo = 3106
trigger1 = Vel Y >=0
value = 3105
ctrl = 0

;------------------------------------------
;Volley Ball Hyper
[Statedef 3400]
type = S
movetype = A
physics = S
anim = 3400
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
triggerall = PrevStateNo != 3103
triggerall = !Time
trigger1 = Power<2000
trigger1 = Var(51)>=2000
var(51) = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

[State 0, PowerAdd]
type = PowerAdd
triggerall = PrevStateNo != 3103
trigger1 = !Time
value = Cond((Power >=1000 && Power <=1999 && Var(51)>=1000),-1000,-2000)

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,53]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = !(time%4)
time=4
freq=85
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 45
p2defmul = 1
unhittable = 1
anim = -1
;sound = s5,100
darken = 0
movetime = 40

[State 200, Superpause charge sound]
type = PlaySnd
trigger1 = time = 5
value = 2350,0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 10201
id = 10201
pos = 10,-50
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = time = 5
time = 50
color=0
mul=0,0,0
;--------------------------------

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
value = 3400,0+random%2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
value = 3400,10
channel = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem=7
anim = 3410
ID = 3410
bindtime = -1

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(7) = 1
name = "RINGS"
ID = 3410
stateno = 3410
pos = -20,10
postype = p1    ;p2,front,back,left,right
supermovetime = 0
pausemovetime = 0

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

;===========================================================================
; <<<<< SSJ2 MODE >>>>>
; SSJ2 Activation = 2700
;===========================================================================

;SSJ2 Mode
[Statedef 2700]
type = S
movetype = I
physics = S
anim = 2700
ctrl = 0
velset = 0,0
sprpriority = 1

[State 2800, PowerAdd]
type		= PowerAdd
trigger1		= AnimElemTime(3)=0
value		= Cond(Power=2000,-1999,-2000)



[State 200, BGPalFX]
type = BGPalFX
trigger1 = animelemtime(3)>=0 && time<150
time = 1
add	= -100,-100,-100
mul	= 100,100,256
invertall = 0
color = 256

[State 3000, SuperPause]
type = SuperPause
trigger1 = animelemtime(3)=0
time = 92
p2defmul = 1
unhittable = 1
anim = -1
sound = s2700,0;s2350,0
darken = 0
movetime = 92

[State 3000, nhb]
type = NotHitBy
trigger1 = animelemtime(3)>=0 && time<=97
time = 1
value = SCA

[State 1000, shake]
type = EnvShake
trigger1 = animelemtime(3)>=0
trigger1 = !(time%12)
time=12
freq=100
ampl=3+0.02*time


[State 3000, Buffer var]
type = varset
trigger1 = animelemtime(3)=0
var(50) = 1000

[State 3000, Flame var]
type = varset
trigger1 = animelemtime(3)=0
var(51) = 0

[State 1000, Power]
type = PowerAdd
triggerall = Time >=97
triggerall = (Anim = 2700) && (power < 3000)
trigger1 = (command = "holdb") && (command = "holdy")
value = Cond((NumHelper(1110)||NumHelper(1116)),5 + (time/80),5 + (time/20))

[State 0, VarAdd]
type = VarAdd
triggerall = Time >=97
triggerall = (Anim = 2700) && (Var(50) >0)
triggerall = (command = "holdb") && (command = "holdy")
trigger1 = Var(51) < 3000 && Power >=3000
var(51) = Cond((NumHelper(1110)||NumHelper(1116)),5 + (time/80),5 + (time/20))

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

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0
trigger1 = time=135
value = 3,19
volumescale = 555
channel = 0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2
trigger1 = time=135
value = 3,141
volumescale = 555
channel = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=1
anim = 2701
ID = 2701
bindtime = -1
pausemovetime = 2
supermovetime = 2
sprpriority = 2
scale = 2,2

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=1
anim = 2702
ID = 2702
bindtime = -1
pausemovetime = 2
supermovetime = 2
sprpriority = 5

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(1)=0
name = "Shield"
ID = 2705
stateno = 2705
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 999999
pausemovetime = 999999

[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElemTime(5)=1
time = 2
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,2
invertall = 0
color = 256

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

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

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

[State 0, RemapPal]
type = RemapPal
trigger1 = AnimElemTime(5)=2
source = 1,1
dest = 2,Var(58)


[State 0, Explod]
type = Explod
trigger1 = animelemtime(1)>=0
trigger1 = gametime%(6) = 0
anim = 2805+random%2
ID = 2804
pos = 20-(random%40),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = 5
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(1)>=0
trigger1 = gametime%(8) = 0
anim = 2807+random%2
ID = 2804
pos = 20-(random%40),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = -5
ownpal = 1
removeongethit = 1

[State 2800, lightning aura]
type = explod
trigger1 = animelemtime(3)>=0
trigger1 = gametime%(4) = 0
anim = 2810+(random%12);2805+(random%4)
id = 2805
pos = 38-(random%76),-105+(Random%80);10-5*(random%5),-55
sprpriority = 4
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1
facing = IfElse(random%2=0,1,-1)
removetime = -2
scale = 0.5+0.1*(random%4), 0.5+0.1*(random%4)
pausemovetime = 99999
supermovetime = 99999

[State 200, You are done for]
type = playsnd
triggerall = var(55)=0
trigger1 = !time
value = 2710,0
channel = 0

[State 200, Super Gotenks]
type = playsnd
triggerall = var(55)=2
trigger1 = !time
value = 2710,10
channel = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time =0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 10

[State 1001, stopsnd]
type = stopsnd
trigger1 = (command != "holdb") || (command != "holdy")
trigger2 = anim != 2700
trigger3 = (Power >= PowerMax && Var(50)<=0) ||  Var(51)>=3000 || RoundState != 2
channel = 3
persistent = 0

[State 1000, PC-End]
type = ChangeState
triggerall = Time >=97
triggerall = anim = 2700
trigger1 = (command != "holdb") || (command != "holdy")
trigger2 = (Power >= PowerMax && Var(50)<=0) || Var(51)>=3000 || RoundState != 2
trigger3 = NumHelper(3310)
trigger4 = NumHelper(3410)
value = 903
Ctrl = 1

;===========================================================================
; <<<<< SSJ2 MODE >>>>>
; SSJ2 Activation = 2700
;===========================================================================

;Air SSJ2 Mode
[Statedef 2710]
type = A
movetype = I
physics = N
anim = 2720
ctrl = 0
velset = 0,0
sprpriority = 1

[State 2800, PowerAdd]
type		= PowerAdd
trigger1		= AnimElemTime(3)=0
value		= Cond(Power=2000,-1999,-2000)



[State 200, BGPalFX]
type = BGPalFX
trigger1 = animelemtime(3)>=0 && time<150
time = 1
add	= -100,-100,-100
mul	= 100,100,256
invertall = 0
color = 256

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3)=0
x = 0
y = 0

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

[State 0, VarSet]
type = VarSet
trigger1 = Time = 4
fvar(4) = Vel Y

[State 3000, SuperPause]
type = SuperPause
trigger1 = animelemtime(3)=0
time = 92
p2defmul = 1
unhittable = 1
anim = -1
sound = s2700,0;s2350,0
darken = 0
movetime = 92

[State 3000, nhb]
type = NotHitBy
trigger1 = animelemtime(3)>=0 && time<=97
time = 1
value = SCA

[State 1000, shake]
type = EnvShake
trigger1 = animelemtime(3)>=0
trigger1 = !(time%12)
time=12
freq=100
ampl=3+0.02*time


[State 3000, Buffer var]
type = varset
trigger1 = animelemtime(3)=0
var(50) = 1000

[State 3000, Flame var]
type = varset
trigger1 = animelemtime(3)=0
var(51) = 0

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

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=1
anim = 2701
ID = 2701
bindtime = -1
pausemovetime = 2
supermovetime = 2
sprpriority = 2
scale = 2,2

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=1
anim = 2702
ID = 2702
bindtime = -1
pausemovetime = 2
supermovetime = 2
sprpriority = 5

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(1)=0
name = "Shield"
ID = 2705
stateno = 2705
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 99999
pausemovetime = 99999

[State 0, PalFXWiz]
type = PalFX
trigger1 = AnimElemTime(5)=1
time = 2
add = 256,256,256
mul = 256,256,256
sinadd = 0,0,0,2
invertall = 0
color = 256

[State 730, Explod]
type = Explod
trigger1 = !NumExplod(735)
trigger1 = animelemtime(8)=0
anim =  735
ID =  735
pos = -15,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 99
pausemovetime = 999999
supermovetime = 999999
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, RemapPal]
type = RemapPal
trigger1 = AnimElemTime(5)=2
source = 1,1
dest = 2,Var(58)

[State 0, Explod]
type = Explod
trigger1 = animelemtime(1)>=0
trigger1 = gametime%(6) = 0
anim = 2805+random%2
ID = 2804
pos = 20-(random%40),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = 5
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(1)>=0
trigger1 = gametime%(8) = 0
anim = 2807+random%2
ID = 2804
pos = 20-(random%40),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = -5
ownpal = 1
removeongethit = 1

[State 2800, lightning aura]
type = explod
trigger1 = animelemtime(3)>=0
trigger1 = gametime%(4) = 0
anim = 2810+(random%12);2805+(random%4)
id = 2805
pos = 38-(random%76),-105+(Random%80);10-5*(random%5),-55
sprpriority = 4
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1
facing = IfElse(random%2=0,1,-1)
removetime = -2
scale = 0.5+0.1*(random%4), 0.5+0.1*(random%4)
pausemovetime = 99999
supermovetime = 99999

[State 200, You are done for]
type = playsnd
triggerall = var(55)=0
trigger1 = !time
value = 2710,0
channel = 0

[State 200, Super Gotenks]
type = playsnd
triggerall = var(55)=2
trigger1 = !time
value = 2710,10
channel = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(50) = 1 
x = fvar(3)
Y = fvar(4)

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(50) = 1 
physics = A         ;A,C,S,N

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time = 0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;value2 = S,NA
time = 10

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

[State 1000, PC-End]
type = ChangeState
trigger1 = !AnimTime
value = 50
Ctrl = 1

;===========================================================================
;Exit SSJ2 Mode
[Statedef 2790]
type = S
movetype = I
physics = S
anim = 2790
ctrl = 0
velset = 0,0
sprpriority = 1

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [1,201]
flag = noBG
flag2 = noFG

[State 1000, shake]
type = EnvShake
trigger1 = Time >=1 && Time <=201
trigger1 = !(time%4)
time=4
freq=80
ampl=1.5+0.02*time

[State 3000, superpause]
type = superpause
trigger1 = time=1
time = 201
p2defmul = 1
unhittable = 1
anim = -1
sound = s5,100
darken = 0
movetime = 201

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElemTime(16)=0
trigger2 = AnimElemTime(26)=0
trigger3 = AnimElemTime(41)=0
trigger4 = AnimElemTime(56)=0
trigger5 = AnimElemTime(76)=0
value = 5,100

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
value = 195,10+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = AnimElemTime(26)=0
trigger2 = AnimElemTime(41)=0
trigger3 = AnimElemTime(56)=0
value = 3,0+random%4
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = AnimElemTime(79)=0
value = 660,0
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
value = 195,22+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElemTime(26)=0
trigger2 = AnimElemTime(41)=0
trigger3 = AnimElemTime(56)=0
value = 3,100+random%4
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElemTime(79)=0
value = 660,10
channel = 0

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

[State 0, Super FX]
type = Explod
trigger1 = time = 1
anim = 10200
id = 10200
pos = 25,-72
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Super FX]
type = Explod
trigger1 = AnimElemTime(16)=0
anim = 10200
id = 10200
pos = 15,-40
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = -8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Super FX]
type = Explod
trigger1 = AnimElemTime(26)=0
anim = 10200
id = 10200
pos = 46,-45
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = -8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
[State 0, Super FX]
type = Explod
trigger1 = AnimElemTime(41)=0
anim = 10200
id = 10200
pos = 46,-45
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = -8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
[State 0, Super FX]
type = Explod
trigger1 = AnimElemTime(56)=0
anim = 10200
id = 10200
pos = 46,-45
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = -8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Super FX]
type = Explod
trigger1 = AnimElemTime(76)=0
anim = 10200
id = 10200
pos = 0,-70
postype = p1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0


;--------------------------------

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(41)=0
trigger2 = AnimElemTime(56)=0
trigger3 = AnimElemTime(71)=0
x = 40

[State 100, jump SND]
type = playsnd
trigger1 = AnimElemTime(71)=0
value = 40,1
channel = 11

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(72)=0
statetype = A       ;S,A,C,L
physics = A         ;A,C,S,N

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

[State 0, PowerAdd]
type = PowerAdd
trigger1 = AnimElemTime(81)=0
value = Var(52)

[State 0, VarSet]
type = VarSet
trigger1 = AnimElemTime(82)=0
var(50) = 0



;===========================================================================
; <<<<< SSJ3 MODE >>>>>
; SSJ3 Activation = 3601
;===========================================================================

;SSJ3 Mode
[Statedef 3601]
type = S
movetype = I
physics = S
anim = 3601
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0, VarSet]
type = VarSet
trigger1 = !Time
fvar(37)= power -2000

[State 0, VarSet]
type = VarSet
trigger1 = !Time
trigger1 = Var(50)>0
trigger1 = power >2000
fvar(38)= 1000-fvar(37)

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time> 5
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Var(50)>0
triggerall = Time=3
trigger1 = Power<2000
var(51) =-2000+power

[State 0, PowerSet]
type = PowerSet
trigger1 = Time=5
value = 3000

[State 0, VarSet]
type = VarSet
trigger1 = Time = 5
var(29)=1

;----Common Superpause Effects ------------
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [5,205]
flag = noBG
flag2 = noFG

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

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 300
p2defmul = 1
unhittable = 1
anim = -1
;sound = s5,100
darken = 0
movetime = 300

[State 200, Superpause charge sound]
type = PlaySnd
trigger1 = time = 5
value = 2350,0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 10201
id = 10201
pos = 10,-50
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = Time = 5
time = 125
color=0
mul=0,0,0
;--------------------------------

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

;ssj3 port
[State 0, Explod]
type = Explod
trigger1 = Time = 300
trigger1 = Var(2)=1
trigger1 = !NumExplod(9000)
trigger1 = teamside = 1
anim = 9000
ID = 9000
pos = Ceil(3+(fvar(14))),Ceil(14-(fvar(15)))
postype = left  ;p2,front,back,left,right
facing = 1
removetime = -1
bindtime = -1
sprpriority = -9

[State 0, Explod]
type = Explod
trigger1 = Time = 300
trigger1 = Var(2)=1
trigger1 = !NumExplod(9000)
trigger1 = teamside = 2
anim = 9000
ID = 9000
pos = Ceil(316+(fvar(16))),Ceil(14-(fvar(15)))
postype = left  ;p2,front,back,left,right
facing = -1
removetime = -1
bindtime = -1
sprpriority = -9

[State 1000, flash]
type = PalFX
trigger1 = GameTime%20 = 0
trigger1 = animelemtime(4)>=0 
add = 80, 80, 80
sinadd = 80,80,80,10
time = 2

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelemtime(1)=0
value = 3600,0+random%4
channel = 0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0
trigger1 = Time = 200
value = 3600,10+random%5
channel = 0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelemtime(1)=0
value = 3600,40
channel = 0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2
trigger1 = Time = 200
value = 3600,41+random%5
channel = 0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(4)>=0
trigger1 = gametime%(3) = 0
trigger1 = Time <200
anim = 2805+random%2
ID = 2804
pos = 40-(random%80),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = 5
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = animelemtime(4)>=0
trigger1 = gametime%(4) = 0
trigger1 = Time <200
anim = 2807+random%2
ID = 2804
pos = 40-(random%80),-80
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
pausemovetime = 99999
supermovetime = 99999
scale = 1,1
sprpriority = -5
ownpal = 1
removeongethit = 1

[State 0,from sky lightning]
type = explod
triggerall = animelemtime(4)>=0
trigger1 = gametime%(100-100/4) = 0
trigger1 = Time <300
anim = 2450+random%6
sprpriority = 7
postype = p1
pos = -50+random%100,ceil(pos y)
facing = ifelse(random<500,-1,1)
random = 160,0
scale = 1,2
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 0, lightning sound]
type = playsnd
triggerall = animelemtime(4)>=0
trigger1 = gametime%(100-100/4) = 0
trigger1 = Time <300
value = 2400,3
volume = -170-(32*numexplod)
;freqmul = .9 + (random/5000.0)
channel = 20

[State 1900, SSJ white circle]
type = explod
trigger1 = time = 108
anim = 90200
id = 90200
pos = 0,-40
sprpriority = 7
ontop = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
removetime = -2
scale = .005,.005
pausemovetime = 999999
supermovetime = 999999

[State 1900, SSJ white circle]
type = modifyexplod
trigger1 = numexplod(90200) && time<158
scale = .12*(time-108),.12*(time-108)
ID = 90200

[State 4500, 1];transform SND
type = PlaySnd
trigger1 = time = 113
value = 3601,0
channel = 1

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

[State 4500, 2];long sound
type = PlaySnd
trigger1 = AnimElemTime(4)=0
value = 8,0
loop = 1
pan = 1
volumescale = 15
channel = 3
[State 0, StopSnd]
type = StopSnd
trigger1 = !AnimTime
channel = 3

[State 1900, dust]
type = explod
trigger1 = !NumExplod(909)
trigger1 = AnimElemTime(4)>=0
trigger1 = Time <200
anim = 909
id = 909
pos = 10,15
sprpriority = 4
bindtime = -1
ownpal = 1
facing = -1
removetime = -2
pausemovetime = 999999
supermovetime = 999999

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >=300
value = 3600
ctrl = 1

;==========================================
; SSJ3 Common
;==========================================

;===========================================================================
; Stand
;===========================================================================
[Statedef 3600]
type = S
physics = S
sprpriority = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 3600 && Anim != 3605
trigger2 = Anim = 3605 && AnimTime = 0 ;Turn anim over
value = 3600

[State 20, 1]
type = VelSet
trigger1 = !AILEVEL
trigger1 = ((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && NumExplod(90000006)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && NumExplod(90000004))) 
trigger2 = AILEVEL
trigger2 = random < 350*(AIlevel ** 2 / 64.0)
trigger2 = NumHelper(916)
trigger2 = helper(916), StateNo != 920
trigger2 = P2BodyDist X >50
x = 2

[State 20, 2]
type = VelSet
trigger1 = !AILEVEL
trigger1 = ((ifElse(P2DisT x < -12, Facing = -1, Facing = 1) && NumExplod(90000004)) || (ifElse(P2DisT x < -12, Facing = 1, Facing = -1) && NumExplod(90000006))) 
trigger2 = AILEVEL
trigger2 = random < 350*(AIlevel ** 2 / 64.0)
trigger2 = NumHelper(916)
trigger2 = helper(916), StateNo = 920
trigger2 = P2BodyDist X <70
x = -2

[State 0, 2]
type = VelSet
trigger1 = Time = 0
trigger2 = !AILEVEL
trigger2 = !NumExplod(90000001)&&!NumExplod(90000002)&&!NumExplod(90000003)&&!NumExplod(90000007)&&!NumExplod(90000008)&&!NumExplod(90000009)
y = 0
[State 0, 2]
type = VelSet
trigger1 = Time = 0
trigger2 = !AILEVEL
trigger2 = !NumExplod(90000001)&&!NumExplod(90000003)&&!NumExplod(90000004)&&!NumExplod(90000006)&&!NumExplod(90000007)&&!NumExplod(90000009)
trigger3 = AILEVEL
trigger3 = random < 999*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = NumHelper(916)
trigger4 = helper(916), StateNo != 920
trigger4 = P2BodyDist X = [10,50]
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
ctrl = 0

;===========================================================================
;JUMP START OVERRIDE
[Statedef 3640]
type    = S
physics = S
anim = 3640
ctrl = 0
sprpriority = 1
facep2 = 1

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

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

[State 40, 2]
type = VarSet
trigger1 = ifelse(Facing = 1, (NumExplod(90000009) || NumExplod(90000006) || NumExplod(90000003)),(NumExplod(90000007) || NumExplod(90000004) || NumExplod(90000001)))
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = ifelse(Facing = 1,(NumExplod(90000007) || NumExplod(90000004) || NumExplod(90000001)), (NumExplod(90000009) || NumExplod(90000006) || NumExplod(90000003)))
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 3620 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

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

;===========================================================================
;JUMP UP OVERRIDE (taking into account super jump commands)
;===========================================================================

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

;jump link infinite prevention on tall chars--see -2 for removeexplod
[State 0, Explod]
type = Explod
trigger1 = NumExplod(52)<4
trigger1 = P2StateType != A
trigger1 = Time = 0
anim = 15999
ID = 52
removetime = -1
removeongethit = 1

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

[State 50, 2]
type = ChangeAnim
trigger1 = PrevStateNo != [3660,3669]
trigger1 = time = 0
value = ifelse((vel x)=0, 3641, ifelse((vel x)>0, 3642, 3643))

[State 50, 2]
type = ChangeAnim
trigger1 = PrevStateNo = [3660,3669]
trigger1 = time = 0
value = 3644

[State 50, 3]
type = ChangeAnim
triggerall = anim = 3642
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = 3645  ;ifelse(var(4)=1,45,44)

;===========================================================================
;JUMP LAND NO FRICTION
;===========================================================================
[Statedef 3652]
type    = S
physics = S
ctrl = 0
anim = 3647
velset = 0,0

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

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

[State 52, 3]
type = CtrlSet
trigger1 = Time = 1
value = 1

[State 52, Assert: NoWalk]
type = AssertSpecial
trigger1 = Anim = 3605
flag = NoWalk
ignoreHitPause = 1

[State 52, ChangeAnim to Turning]
type = ChangeAnim
trigger1 = ctrl && P2Dist x < -12
trigger1 = Anim != 3605
value = 3605

[State 52, Turn]
type = Turn
trigger1 = Anim = 3605 && AnimElem = 1

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

;===========================================================================
;Hit State
[Statedef 3610]
type    = S
physics = S
movetype = H
ctrl = 0
anim = 3610
velset = 0,0

[State 0, Turn]
type = Turn
trigger1 = Facing = enemy,Facing
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = Cond(facing=1,GetHitVar(XVel),-GetHitVar(XVel))

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Anim = 3611
trigger1 = GetHitVar(HitShakeTime)
value = 3610
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(21)=GetHitVar(SlideTime)

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(21)>0
var(21)=-1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(21)=0
value = 3611
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 3611
trigger1 = GetHitVar(hittime) < 0
trigger1 = Time >30
value = 3600
ctrl = 1

;===========================================================================
;Air Hit State
[Statedef 3611]
type    = A
physics = A
movetype = H
ctrl = 0
anim = 3612
velset = 0,0

[State 0, Turn]
type = Turn
trigger1 = Facing = enemy,Facing
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = Cond(facing=1,GetHitVar(XVel),-GetHitVar(XVel))

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = GetHitVar(YVel)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Anim = 3613
trigger1 = GetHitVar(HitShakeTime)
value = 3612
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = !Time
var(21)=GetHitVar(SlideTime)

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(21)>0
var(21)=-1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(21)=0
value = 3613
persistent = 0

;===========================================================================
; Fall Down
[Statedef 3615]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 3615

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time>=0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 5030, 1]
type = VelAdd
trigger1 = time > 0  ;Vans Fix !!!
y = .5

[State 5030, 2]
type = VelSet
trigger1 = !Time
x = -5 
y = -6

[State 5030, 3]
type = ChangeState
trigger1 = Vel Y + Pos Y >= 0
value = 3616 

;===========================================================================
; Hit Ground
[Statedef 3616]
type    = L
movetype= H
physics = N
velset = 0
ctrl = 0
anim = 3616

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time>=0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

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

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(3)<0
x = -10

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(3)=0
x = 0

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
value = 15000,0

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

;===========================================================================
; Get Up
[Statedef 3617]
type    = S
movetype= H
physics = S
ctrl = 0
anim = 3617

[State 0, NotHitBy]
type = NotHitBy
trigger1 = Time>=0
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, VarSet]
type = VarSet
trigger1 = !AnimTime
var(26) = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = !AnimTime
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 10

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


;===========================================================================
; Dash
[Statedef 3620]
type    = S
physics = S
anim = 3620
sprpriority = 1
velset = 0,0
ctrl = 0

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

[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 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 100, 4 jump start]
type = ChangeState
trigger1 = Time >=7
trigger1 = ifelse(Facing = 1,(NumExplod(90000009) || NumExplod(90000008)), (NumExplod(90000007) || NumExplod(90000008)))
value = 3640

[State 100, 1]
type = VelSet
trigger1 = time > 2
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4 Run Stop]
type = ChangeState
triggerall = time > 15
trigger1 = ifelse(Facing = 1,!NumExplod(90000006), !NumExplod(90000004)) && ifelse(Facing = 1,!NumExplod(90000003), !NumExplod(90000001))
value = 3600
ctrl = 1

;===========================================================================
; Dash Back
[Statedef 3621]
type    = S
physics = S
anim = 3621
sprpriority = 1
velset = 0,0
ctrl = 0

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

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Push Screen"
ID = 3673
stateno = 3673
pos = 0,0
postype = p1    ;p2,front,back,left,right

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem=4
x = -100

[State 100, 4 Run Stop]
type = ChangeState
trigger1 = !AnimTime
value = 3600
ctrl = 1

;===========================================================================
; Air Dash
[Statedef 3622]
type = A
physics = N
anim = 3620
ctrl = 0
velset = 0,0

[State 110, var]
type = VarSet
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 = -10,-20
scale = 1,.8
bindtime = 15
sprpriority = 2
ownpal = 1
removetime = -2
removeongethit = 1

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

[State 100, 1]
type = VelSet
trigger1 = time > 2
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4 Run Stop]
type = ChangeState
triggerall = time > 15
trigger1 = ifelse(Facing = 1,!NumExplod(90000006), !NumExplod(90000004)) && ifelse(Facing = 1,!NumExplod(90000003), !NumExplod(90000001))
trigger2 = Time >=40
value = 3650
ctrl = 1

;===========================================================================
; Air Dash Back
[Statedef 3623]
type    = A
physics = N
anim = 3621
sprpriority = 1
velset = 0,0
ctrl = 0

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

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

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "Push Screen"
ID = 3673
stateno = 3673
pos = 0,0
postype = p1    ;p2,front,back,left,right

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem=4
x = -100

[State 100, 4 Run Stop]
type = ChangeState
trigger1 = !AnimTime
value = 3650
ctrl = 1

;---------------------------------------------------------------------------
; SSJ3 Taunt
[Statedef 3625]
type = S
ctrl = 0
anim = 3630
velset = 0,0
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 30
value = 3600
ctrl = 1

;---------------------------------------------------------------------------
; SSJ3 Air Taunt
[Statedef 3626]
type = A
physics = A
ctrl = 0
anim = 3630
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 30
value = 3650
ctrl = 1

;---------------------------------------------------------------------------
; STAND LIGHT PUNCH
[Statedef 3648]
type = S
movetype = A
physics = S
anim = 3650
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1
juggle = 7

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,0  + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
channel = 1

;[State 0, Explod]
;type = Explod
;trigger1 = AnimElemTime(2)=0
;anim = 3672
;ID = 3672
;pos = 86,-50
;postype = p1  ;p2,front,back,left,right
;ownpal = 1
;scale = .5,.5

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
damage = ceil(ifElse(fvar(11) * 12 < 7, 7, fvar(11) * 12)), 2
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
guard.slidetime = 12
guard.hittime  = 12
guard.ctrltime = 4
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------------------
; Air LIGHT PUNCH
[Statedef 3660]
type = A
movetype = A
physics = A
anim = 3650
ctrl = 0
poweradd = 0
sprpriority = 1
juggle = 2

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,0  + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
channel = 1

;[State 0, Explod]
;type = Explod
;trigger1 = AnimElemTime(2)=0
;anim = 3672
;ID = 3672
;pos = 86,-50
;postype = p1  ;p2,front,back,left,right
;ownpal = 1
;scale = .5,.5

[State 200, HitDef]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = S, SA
damage = ceil(ifElse(fvar(11) * 12 < 7, 7, fvar(11) * 12)), 2
animtype = Medium
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
guard.slidetime = 12
guard.hittime  = 12
guard.ctrltime = 4
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

[State 200, HitDef]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = S, SA
damage = ceil(ifElse(fvar(11) * 12 < 7, 7, fvar(11) * 12)), 2
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
guard.slidetime = 12
guard.hittime  = 12
guard.ctrltime = 12
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 3650
ctrl = 1

;---------------------------------------------------------------------------
 ;MP Loop
 [Statedef 3649]
type = S
movetype = A
physics = S
anim = 3651
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 7

[State 211, VelSet]
type = VelSet
trigger1 = AnimElemTime(2) >=0&&AnimElemTime(8)<0
x = Cond(PrevStateNo=3620,6,4)
y = 0
persistent = 1
 
[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1= (animelemtime(1)=1)||(animelemtime(2)=1)
trigger2= (animelemtime(3)=1)||(animelemtime(4)=1)
value=3,0 + (random%4)
channel = -1

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1= (animelemtime(1)=1)
value=3,120 + (random%2)
channel = -1
 
[State 211, 1]
type = PlaySnd
trigger1= (animelem=3 && random<350)||(animelem=4 && random<350)
trigger2= (animelem=5 && random<350)||(animelem=6 && random<350)
value = 0, 1
channel = 1

[State 0, Explod]
type = null;Explod
trigger1 = AnimElemTime(4)=0
anim = 3672
ID = 3672
pos = -30,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .8,.8
facing = -1
[State 0, Explod]
type = null;Explod
trigger1 = AnimElemTime(5)=0
anim = 3672
ID = 3672
pos = -46,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .65,.65
facing = -1
[State 0, Explod]
type = null;Explod
trigger1 = AnimElemTime(6)=0
anim = 3672
ID = 3672
pos = -56,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .5,.5
facing = -1
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
fall = NumExplod(1000)
yaccel = 0.5
 
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -10,-70
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
yaccel = 0.5
fall = NumExplod(1000)
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 6
attr = S, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -23,-57
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
yaccel = 0.5
fall = NumExplod(1000)

[State 221, hit]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 5
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 19
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 22
guard.hittime  = 24
guard.ctrltime = 18
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(8)=0
x = 0

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(9)>=0
value = 0
 
[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 3600
ctrl = 1
 
;---------------------------------------------------------------------------
 ;JMP Loop
 [Statedef 3661]
type = A
movetype = A
physics = A
anim = 3651
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 2

[State 211, VelSet]
type = VelSet
trigger1 = AnimElemTime(2) >=0&&AnimElemTime(8)<0
x = Cond(PrevStateNo=3622,6,4)
y = 0
persistent = 1
 
[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1= (animelemtime(1)=1)||(animelemtime(2)=1)
trigger2= (animelemtime(3)=1)||(animelemtime(4)=1)
value=3,0 + (random%4)
channel = -1

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = (animelemtime(1)=1)
value=3,120 + (random%2)
channel = -1
 
[State 211, 1]
type = PlaySnd
trigger1= (animelem=3 && random<350)||(animelem=4 && random<350)
trigger2= (animelem=5 && random<350)||(animelem=6 && random<350)
value = 0, 1
channel = 1

[State 0, Explod]
type = null;Explod
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElemTime(4)=0
anim = 3672
ID = 3672
pos = -30,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .8,.8
facing = -1
[State 0, Explod]
type = null;Explod
trigger1 = AnimElemTime(5)=0
anim = 3672
ID = 3672
pos = -46,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .65,.65
facing = -1
[State 0, Explod]
type = null;Explod
trigger1 = AnimElemTime(6)=0
anim = 3672
ID = 3672
pos = -56,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
scale = .5,.5
facing = -1
 
[State 211, HitDef]
type = HitDef
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = HA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
fall = NumExplod(52)=3
yaccel = 0.5
 
 
[State 211, HitDef]
type = HitDef
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 5
attr = A, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = HA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -10,-70
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
yaccel = 0.5
fall = NumExplod(1000)
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 6
attr = A, SA
damage = ceil(ifElse(fvar(11) * 9 < 5, 5, fvar(11) * 9)), 1
animtype = Medium
guardflag = HA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -23,-57
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0
givepower = 5,5
yaccel = 0.5
fall = NumExplod(1000)

[State 221, hit]
type = HitDef
trigger1 = AnimElem = 7
attr = A, SA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 5
animtype = Hard	
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 19
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 22
guard.hittime  = 24
guard.ctrltime = 18
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(8)>=0
x = 0
y = .5

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 

[State 221, Idle]
type= statetypeset
trigger1= animelemtime(9)>=0
movetype= I
 
[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 3650
ctrl = 1

;---------------------------------------------------------------
;Stand Hard Punch
[Statedef 3651]
type    = S
movetype= A
physics = S
juggle  = 7
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3652

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 
value = 3651,0
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 
value = 3651,10
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 221, hit]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
damage = ceil(ifElse(fvar(11) * 57 < 7, 7, fvar(11) * 57)), 10
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -16,-3
guard.velocity = -19
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -16,-3
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = MoveHit = 1
value = 3653
;ignorehitpause = 1

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1




 ;---------------------------------------------------------------
;J Hard Punch
[Statedef 3662]
type    = A
movetype= A
physics = N
juggle  = 2
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3652

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 
value = 3651,0
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 
value = 3651,10
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 221, hit]
type = HitDef
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 57 < 7, 7, fvar(11) * 57)), 10
animtype = Hard	
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -16,-3
guard.velocity = -19
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -16,-3
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = MoveHit = 1
value = 3653
;ignorehitpause = 1

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;Ground Punch
[Statedef 3658]
type    = S
movetype= A
physics = S
juggle  = 7
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3658

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=4 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=4 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 7
value = 3659,0

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(7)=0
anim = 3675
ID = 3675
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = 3
ownpal = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElemTime(7)=0
time = 20
freq = 60
ampl = -4
phase = 90
ignorehitpause = 1

[State 221, hit]
type = HitDef
trigger1 = AnimElem = 7
attr = C, SA
damage = ceil(ifElse(fvar(11) * 50 < 7, 7, fvar(11) * 50)), 10
animtype = Hard	
guardflag = L
hitflag = MF
priority = 4, Hit
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s7030
guard.sparkno = s7000
sparkxy = 0,0
hitsound = s5, 2
guardsound = S6,1
ground.type = Trip
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = 0,-16
guard.velocity = -8
guard.ctrltime = 34
airguard.velocity = -8,-1.3
air.type = High	
air.velocity = 0,-16
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;Jump Ground Punch
[Statedef 3680]
type    = A
movetype= A
physics = N
juggle  = 7
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3680

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0
;trigger1 = Anim = 3680
trigger1 = animelem=4 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2
;trigger1 = Anim = 3680
trigger1 = animelem=4 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
;trigger1 = Anim = 3680
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(6)>=0&&AnimElemTime(7)<0
y = 14

[State 0, ChangeState]
type = ChangeState
trigger1 = Pos Y >=-10
value = 3659

;---------------------------------------------------------------
;Jump Ground Punch
[Statedef 3659]
type    = S
movetype= A
physics = S
juggle  = 7
poweradd= 0
ctrl = 0
velset = 0,0
anim = 3659

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 


[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 2
statetype = S       ;S,A,C,L
movetype = I        ;I,A,H
physics = S         ;A,C,S,N

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(2) >= 0
value =0

[State 200, 1]
type = PlaySnd
trigger1 = !Time
value = 3659,0

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 3675
ID = 3675
pos = 0,0
postype = p1  ;p2,front,back,left,right
sprpriority = 3
ownpal = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !Time
time = 20
freq = 60
ampl = -4
phase = 90
ignorehitpause = 1

[State 221, hit]
type = HitDef
trigger1 = AnimElem = 1
attr = C, SA
damage = ceil(ifElse(fvar(11) * 50 < 7, 7, fvar(11) * 50)), 10
animtype = Hard	
guardflag = L
hitflag = MF
priority = 4, Hit
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s7030
guard.sparkno = s7000
sparkxy = 0,0
hitsound = s5, 2
guardsound = S6,1
ground.type = Trip
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = 0,-16
guard.velocity = -8
guard.ctrltime = 34
airguard.velocity = -8,-1.3
air.type = High	
air.velocity = 0,-16
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

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

[State 221, finish]
type = ChangeState
;trigger1 = Anim = 3681
trigger1 = AnimTime = 0
value = 3600
ctrl = 1


;---------------------------------------------------------------
;STAND LIGHT KICK
[Statedef 3654]
type = S
movetype = A
physics = S
anim = 3654
ctrl = 0
velset = 0,0
poweradd= 0
sprpriority = 1
juggle = 7

[State 230, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 230, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=2  && random<=300
value = 3,100 + (random%4)
channel = 0

[State 230, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3
channel = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 2
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 3
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 10
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;J LIGHT KICK
[Statedef 3664]
type = A
movetype = A
physics = A
anim = 3654
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 2

[State 230, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 230, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=2  && random<=300
value = 3,100 + (random%4)
channel = 0

[State 230, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3
channel = 1

[State 200, HitDef]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, SA
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 2
animtype = Medium
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 3
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 10
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

[State 200, HitDef]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, SA
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 2
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 3
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 12
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;STAND MEDIUM KICK
[Statedef 3655]
type = S
movetype = A
physics = S
anim = 3655
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 7

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = PrevStateNo = 3620
physics = N

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1  && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
damage = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 5
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10, 10
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 17;8
ground.velocity = -8 ;-3
guard.velocity = -6
guard.ctrltime=15
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

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

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;J MEDIUM KICK
[Statedef 3665]
type = A
movetype = A
physics = A
anim = 3655
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 2

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = PrevStateNo = 3622
physics = N

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1  && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

[State 200, HitDef]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 5
animtype = Hard
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 10, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 17;8
ground.velocity = -8 ;-3
guard.velocity = -6
guard.ctrltime=17
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

[State 200, HitDef]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 5
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 16;8
ground.velocity = -8 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(52)=3

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;STAND STRONG KICK 
[Statedef 3656]
type = S
movetype = A
physics = S
anim = 3656
ctrl = 0
velset = 0,0
poweradd= 0
sprpriority = 1
juggle = 7

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 40, 1
channel = 1

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3656, 0
channel = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(3)>=0
trigger2 = PrevStateNo=3620
trigger2 = Time>=0
x = Cond(PrevStateNo=3620,7,2)
y = 0

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 6
trigger2 = AnimElem = 7
attr = S, SA
damage = ceil(ifElse(fvar(11) * 27 < 7, 7, fvar(11) * 27)), 7
animtype = Back
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s250, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 18
guard.hittime = 19
guard.ctrltime = 19
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

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

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 15 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 15
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(8)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;J STRONG KICK 
[Statedef 3666]
type = A
movetype = A
physics = A
anim = 3656
ctrl = 0
poweradd= 0
sprpriority = 1
juggle = 2

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 40, 1
channel = 1

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 3656, 0
channel = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(3)>=0
trigger2 = PrevStateNo=3622
trigger2 = Time>=0
x = Cond(PrevStateNo=3622,10,4)
y = 6

[State 200, HitDef]
type = HitDef
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 6
trigger2 = AnimElem = 7
attr = A, SA
damage = ceil(ifElse(fvar(11) * 27 < 7, 7, fvar(11) * 27)), 7
animtype = Back
guardflag = HA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s250, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 18
guard.hittime = 19
guard.ctrltime = 19
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.animtype = back
fall.recover = 0
getpower= 0,0
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1

;juggle limit LVL2
[State 0, VarAdd]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 15 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 15
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(8)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;MOUF BEAN
[Statedef 3657]
type = S
movetype = A
physics = S
anim = 3657
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 
value = 3657,0
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 
value = 1001,40
channel = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = 1
value =99999
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=0
anim = 3670
ID = 3670
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(6)=2
anim = 3671
ID = 3670
pos = -1530,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 5
ownpal = 1
removeongethit = 1
scale = 40,1

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(6)=2
name = "Mouf Bean"
ID = 3670
stateno = 3670
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;JMOUF BEAN
[Statedef 3667]
type = A
movetype = A
physics = A
anim = 3657
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 
value = 3657,0
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=Funi
trigger1 = animelem=1 
value = 1001,40
channel = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = 1
value =99999
ignorehitpause = 1

[State 211, VelSet]
type = VelSet
trigger1 = AnimElemTime(0) >=0&&AnimElemTime(13)<0
y = 0
persistent = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(6)>=0
x = -8

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(6)>=0
x = 4
[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(9)>=0
x = 2

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(5)=0
anim = 3670
ID = 3670
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
trigger1 = AnimElemTime(6)=2
anim = 3671
ID = 3670
pos = -1530,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -2
sprpriority = 5
ownpal = 1
removeongethit = 1
scale = 40,1

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(6)=2
name = "Mouf Bean"
ID = 3670
stateno = 3670
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1


;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;Spit Ghost
[Statedef 3682]
type = S
movetype = A
physics = S
anim = 3682
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
var(9) = cond((NumExplod(90000230) || NumExplod(90000235)), 0, Cond((NumExplod(90000240) || NumExplod(90000245)), 1, 2))

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = P2StateType = L
var(9) = 2
[State 0, VarRandom]
type = VarRandom
trigger1 = !Time && AILevel
trigger1 = P2StateType != L
v = 9
range = 0,2

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(6)=2
name = "Ghost Spit"
ID = 3674
stateno = 3674
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;Air Spit Ghost
[Statedef 3683]
type = A
movetype = A
physics = A
anim = 3682
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

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

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(6)=2
name = "Ghost Spit"
ID = 3674
stateno = 3674
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
var(9) = cond((NumExplod(90000230) || NumExplod(90000235)), 0, Cond((NumExplod(90000240) || NumExplod(90000245)), 1, 2))

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = P2StateType = L
var(9) = 2
[State 0, VarRandom]
type = VarRandom
trigger1 = !Time && AILevel
trigger1 = P2StateType != L
v = 9
range = 0,2

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;Portal Scream
[Statedef 3684]
type = S
movetype = A
physics = S
anim = 3683
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElemTime(1)=0
value = 3684,1+random%2
channel = 0

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

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(4)=0
name = "Portal"
ID = 3677
stateno = 3677
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
var(9) = cond((NumExplod(90000200) || NumExplod(90000205)), 0, Cond((NumExplod(90000210) || NumExplod(90000215)), 1, 2))

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x <20) && P2MoveType = H
var(9) = 0
[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x = [21,40]) && P2MoveType = H
var(9) = 1
[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x >40) && P2MoveType = H
var(9) = 2
[State 0, VarRandom]
type = VarRandom
trigger1 = !Time && AILevel
trigger1 = P2MoveType != H
v = 9
range = 0,2


[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3600
ctrl = 1

;---------------------------------------------------------------
;Air Portal Scream
[Statedef 3685]
type = A
movetype = A
physics = N
velset = 0,0
anim = 3683
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElemTime(1)=0
value = 3684,0+random%3
channel = 0

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

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(4)=0
name = "Portal"
ID = 3677
stateno = 3677
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
var(9) = cond((NumExplod(90000200) || NumExplod(90000205)), 0, Cond((NumExplod(90000210) || NumExplod(90000215)), 1, 2))

[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x <20) && P2MoveType = H
var(9) = 0
[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x = [21,40]) && P2MoveType = H
var(9) = 1
[State 1030, Button Detect]
type = VarSet
trigger1 = !Time && AILevel
trigger1 = (P2BodyDist x >40) && P2MoveType = H
var(9) = 2
[State 0, VarRandom]
type = VarRandom
trigger1 = !Time && AILevel
trigger1 = P2MoveType != H
v = 9
range = 0,2

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 3650
ctrl = 1

;---------------------------------------------------------------
;Exit SSJ3 Attempt
[Statedef 3690]
type = S
movetype = A
physics = S
anim = 3690
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 0, Helper]
type = Helper
trigger1 = AnimElemTime(3)=0
name = "ShockWave"
ID = 3691
stateno = 3691
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 221, finish]
type = ChangeState
trigger1 = !NumProjID(3701)
trigger1 = AnimElemTime(11)>=0
;trigger1 = Pos Y < 0
value = 3693
ctrl = 0

;---------------------------------------------------------------
;Exit SSJ3 Grounded
[Statedef 3692]
type = S
movetype = I
physics = S
anim = 3692
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

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

;---------------------------------------------------------------
;Exit SSJ3 Air
[Statedef 3693]
type = A
movetype = I
physics = A
anim = 3693
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 0, VarSet]
type = VarSet
trigger1 = !NumProjID(3701)
trigger1 = !Time
var(52)=0

[State 0, Explod]
type = Explod
trigger1 = !Time
trigger1 = fVar(17)=1
anim = 1
ID = 3607
removetime = -1

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

;---------------------------------------------------------------
;Finisher Starter
[Statedef 3700]
type = A
movetype = I
physics = N
anim = 3694
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
trigger2 = Time = 60
value = 3700,0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Var(52)<1000
trigger1 = Time = 120
value = 3701,0

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(991901)
trigger1 = !Time 
anim = 5939
ID = 991901
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
removeongethit = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = !Time
ID = 9000
scale = 0,0

[State 0, Turn]
type = Turn
trigger1 = !Time
trigger1 = Facing = enemy, Facing

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = enemy, Pos X
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing = 1,-100,100)
y = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <=2
flag = invisible

[State BG, Explod]
type = Explod
trigger1 = !Time
anim = 3695
ID = 3695
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime =-1
sprpriority = 7
ownpal = 1
[State FG, Explod]
type = Explod
trigger1 = !Time
anim = 3696
ID = 3696
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime =-1
sprpriority = 9
ownpal = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = Time =10
ID = 3695
sprpriority = -9

[State 0, SprPriority]
type = SprPriority
trigger1 = Time>=10
value = -8

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 2
x = -100
y = 0

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

[State 0, VelSet]
type = VelSet
trigger1 = Time >=60 
x = 16

[State 0, Explod]
type = Explod
trigger1 = Time = 75
anim = 7030
ID = 7030
pos = 50,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 75
value = 5,2

[State FG, Explod]
type = Explod
trigger1 = Time=70
anim = 3697
ID = 3697
pos = 100,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime =-1
sprpriority = -6
ownpal = 1
vel = -7,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time>=95
flag = noBG

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time>=95
id = 3695
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time>=80
id = 3696

[State 0, HitAdd]
type = HitAdd
trigger1 = Time = 75
value = 1

[state 3250, speedlines]
type = explod
trigger1 = time = 85
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[state 3250, speedlines2]
type = explod
trigger1 = time = 85
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

;LVL0 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(52)<1000
trigger1 = Time >= 155
value = 3710

;LVL1 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(52)>=1000 && Var(52)<2000
trigger1 = Time >= 155
value = 3800

;LVL2 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(52)>=2000 && Var(52)<3000
trigger1 = Time >= 155
value = 3850

;LVL3 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(52)>=3000
trigger1 = Time >= 155
value = 3900

;---------------------------------------------------------------
;Activate LVL0
[Statedef 3710]
type = A
movetype = I
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -8

[State 0, PowerSet]
type = PowerSet
trigger1 = !Time
value = 0

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

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = enemy, StateNo = 3741
ID = 2923

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time
ID = 3695

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, StateNo = 3742
trigger1 = enemy, Time = 10 
value = 3741,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, StateNo = 3741
trigger1 = enemy, Time = 1
value = 3743,0

[State 0, Explod]
type = Explod
trigger1 = enemy, StateNo = 3741
anim = 3749
ID = 3750
pos = Cond(Facing=-1,57,-263),85
postype = front  ;p2,front,back,left,right
facing = Cond(Facing=1,1,1)
bindtime = -1
removetime = -2
scale = .5,.5
sprpriority = -4
ownpal = 1
persistent = 45

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3750)
trigger1 = enemy, StateNo = 3741
anim = 3750+random%42
ID = 3750
pos = Cond(Facing=-1,57,-263),85
postype = front  ;p2,front,back,left,right
facing = Cond(Facing=1,1,1)
bindtime = -1
removetime = -1
scale = .5,.5
sprpriority = -5
ownpal = 1
[State 800, remove BG]
type = RemoveExplod
trigger1 = enemy, StateNo != 3741
ID = 3750

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3740)
trigger1 = enemy, StateNo = 3742
anim = 3740
ID = 3740
pos = Cond(Facing=-1,0,-320),0
postype = front  ;p2,front,back,left,right
facing = Cond(Facing=1,1,1)
bindtime = -1
removetime = -1
sprpriority = -5
ownpal = 1
[State 800, remove BG]
type = RemoveExplod
trigger1 = enemy, StateNo != 3742
ID = 3740

[State -2, P2 Hit Wall Spark (front)]
type = Explod
trigger1 = enemy, Anim = 3742
trigger1 = enemy, AnimElemTime(1)=1
ID		= 8402
anim		= 8402
pos		= -20, -50
postype		= p2
velocity	= 0, 0
accel		= 0, 0
removetime	=-2
sprpriority	= 3
ignorehitpause	= 1
persistent	= 0
facing		=-1
[State -2, P2 Hit Wall Spark (back)]
type		= Explod
trigger1 = enemy, Anim = 3742
trigger1 = enemy, AnimElemTime(1)=1
ID		= 8403
anim		= 8403
pos		= -20, -50
postype		= p2
velocity	= 0, 0
accel		= 0, 0
removetime	=-2
sprpriority	=-3
ignorehitpause	= 1
persistent	= 0
facing		=-1

[State -2, Hitting wall/ground sound effect]
type = PlaySnd
trigger1 = enemy, Anim = 3742
trigger1 = enemy, AnimElemTime(1)=1
value = 15000, 2
channel	= 23

[State -2, Hitting wall/ground sound effect]
type = PlaySnd
trigger1 = enemy, Anim = 3742
trigger1 = enemy, AnimElemTime(1)=1
value = 3742, 0

[State 0, HitAdd]
type = HitAdd
trigger1 = enemy, Anim = 3742
trigger1 = enemy, AnimElemTime(1)=1
value = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, StateNo = 3742
trigger1 = enemy, Time = 138 
value = 3740,0

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3742
trigger1 = enemy, Time = 220
value = 3711

;---------------------------------------------------------------
;Waiting
[Statedef 3711]
type = A
movetype = I
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 800, remove BG]
type = RemoveExplod
trigger1 = !Time
ID = 3740

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !AnimTime
trigger1 = enemy, Alive
id = 991901

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

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing = 1,-200,200)
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 3711+random%4

[State 0, Helper]
type = Helper
trigger1 = !Time
trigger1 = enemy, Alive
name = "Portal2"
ID = 3745
stateno = 3745
pos = 250,-150
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3714
trigger1 = !Time
value = 660,0
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3714
trigger1 = !Time
value = 660,10
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3711
trigger1 = !Time
value = 3711,0
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3711
trigger1 = !Time
value = 3711,10
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
trigger1 = Anim = 3712
value = 196,0+random%2
channel = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, StateNo = 3743
value = 3700,0
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !AnimTime
trigger2 = !enemy, Alive
trigger2 = Time = 1
value = 0
ctrl = 1



;---------------------------------------------------------------
;Starter Custom State
[Statedef 3701]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = -5,0
sprpriority = 8

[State 0, SprPriority]
type = SprPriority
trigger1 = Time>=10
value = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing = -1,-100,100)
y = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = Anim = 3701
trigger1 = Vel X <0
x = .06

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3701

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 75
value = 3702

[State 0, VelSet]
type = VelSet
trigger1 = Time >= 85 && Time < 95
x = -15

[State 0, ScreenBound]
type = ScreenBound
trigger1 = Time >=75
value = 0
movecamera = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = Time = 105
x = Cond(Facing=1,300,-300)
y = -30

[State 0, VelSet]
type = VelSet
trigger1 = Time >= 125
x = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy, StateNo = 3900
flag = invisible

;LVL0 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3710
value = 3740

;LVL1 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3800
value = 3810

;LVL1 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3850
value = 3870

;LVL3 Finisher
[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3910
trigger1 = enemy, Time = 100
value = 4100

;---------------------------------------------------------------
;Fly off screen
[Statedef 3740]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = -15,0
sprpriority = 0

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

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 30
value = 3741

;---------------------------------------------------------------
;Fly through random BG
[Statedef 3741]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = -15,0
sprpriority = 0

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

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing=1,300,-300)
y = -30

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 100
value = 3742

;---------------------------------------------------------------
;Fly into intro
[Statedef 3742]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

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

[State 0, LifeAdd]
type = LifeAdd
trigger1 = Time = 153
value = ceil(ifElse(enemy, fvar(11) * -250 > -125, -125, enemy, fvar(11) * -250))
kill = 1
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing=1,300,-300)
y = -30

[State 0, VelSet]
type = VelSet
trigger1 = Time = 125
x = -15

[State 0, VelSet]
type = VelSet
trigger1 = Time = 140
x = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 140
value = 3742

[State 0, EnvShake]
type = EnvShake
trigger1 = Time = 140
time = 30
freq = 60
ampl = -4
phase = 90

[State 0, VelSet]
type = VelSet
trigger1 = Time >= 153
y = 4

[State 0, ChangeState]
type = ChangeState
trigger1 = Alive
trigger1 = enemy, StateNo = 3711
value = 3743

[State 0, ChangeState]
type = ChangeState
trigger1 = !Alive
trigger1 = enemy, StateNo = 3711
value = 3744

;---------------------------------------------------------------
;Fall out of portal
[Statedef 3743]
type = A
movetype = H
physics = A
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <=20
flag = noshadow
flag2 = invisible

[State 0, PosSet]
type = PosSet
trigger1 = Time <=20
x = 0
y = -100

[State 0, ChangeState]
type = SelfState
trigger1 = Time =20
value = 5050
ctrl = 0

;---------------------------------------------------------------
;DEAD
[Statedef 3744]
type = A
physics = N
movetype = H
ctrl = 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 1

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = 0
y = 800

[State 0, SelfState]
type = SelfState
trigger1 = Time = 1
value = 5150

;---------------------------------------------------------------
;Activate LVL1
[Statedef 3800]
type = A
movetype = I
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, PowerSet]
type = PowerSet
trigger1 = !Time
value = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy,StateNo != [3811,3820]
flag = nomusic
flag2 = noBG
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <=40
flag = invisible

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time
ID = 3695

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = enemy, StateNo = 3720
ID = 2923

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing = 1,-80,80)
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 41
value = 3800

[State 0, Explod]
type = Explod
trigger1 = Anim = 3800
trigger1 = AnimElemTime(3)=1
anim = 2400
ID = 2404
pos = -10,-14
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 3800
trigger1 = AnimElemTime(29)=1
id = 2404

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3800
trigger1 = !AnimTime 
value = 3803

[State 0, Offset]
type = Offset
trigger1 = Anim = 3803
x = 26
y = 19

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 3803
trigger1 = AnimElemTime(1)=1
trigger2 = Anim = 3801
trigger2 = AnimElemTime(2)=1
trigger3 = Anim = 3805
trigger3 = AnimElemTime(1)=1
value = 2302,0
channel = -1

[State 4500, 1];Big Finale
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3800
trigger1 = AnimElemTime(3)=1
value = 3800,0

[State 4500, 1];Kamehame!
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3800
trigger1 = AnimElemTime(3)=1
value = 3800,10

[State 4500, 1];Uh Oh
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3800
trigger1 = AnimElemTime(40)=1
value = 3800,1

[State 4500, 1];What the!
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3800
trigger1 = AnimElemTime(40)=1
value = 3800,11

[State 4500, 1];Let's Do This
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3800
trigger1 = AnimElemTime(40)=30
value = 3600,10

[State 4500, 1];Uh..Dadada!
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3800
trigger1 = AnimElemTime(40)=30
value = 3600,47

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3805
trigger1 = AnimElemTime(2)=1
value = 3,19

[State 4500, 1];Finish Buster! Super Kamekameha!
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3805
trigger1 = AnimElemTime(2)=1
value = 3600,48

[State 4500, 1];Charge1
type = PlaySnd
trigger1 = Anim = 3800
trigger1 = AnimElemTime(3)=1
value = 3810,1
loop = 1
channel = 10
[State 0, StopSnd]
type = StopSnd
trigger1 = Anim = 3800
trigger1 = AnimElemTime(30)=1
channel = 10

[State 4500, 1];failed
type = PlaySnd
trigger1 = Anim = 3800
trigger1 = AnimElemTime(30)=1
value = 3810,2

[State 4500, 1];Charge2
type = PlaySnd
trigger1 = Anim = 3805
trigger1 = AnimElemTime(2)=1
value = 3810,3
loop = 1
channel = 11
[State 0, StopSnd]
type = StopSnd
trigger1 = Anim = 3805
trigger1 = AnimElemTime(22)=1
channel = 11

[State 4500, 1];Charge2
type = PlaySnd
trigger1 = Anim = 3805
trigger1 = AnimElemTime(22)=1
value = 3810,4


[State 0, Explod]
type = Explod
trigger1 = Anim = 3803
anim = 3804
ID = 3804
pos = -45,0
postype = p1  ;p2,front,back,left,right
removetime = -2
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3803
trigger1 = !AnimTime 
value = 3801

[State 0, Explod]
type = Explod
trigger1 = Anim = 3801
anim = 3802
ID = 3802
pos = -60,0
postype = p2  ;p2,front,back,left,right
removetime = -1
facing = -1
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = Anim = 3801
trigger1 = AnimElemTime(1)=0
x = Cond(Facing=1,enemy, Pos X -60,enemy, Pos X +60)
y = enemy, Pos Y
persistent = 0

[State 0, HitAdd]
type = HitAdd
triggerall = Anim = 3801
trigger1 = AnimElemTime(4)=1
trigger2 = AnimElemTime(6)=1
trigger3 = AnimElemTime(9)=1
trigger4 = AnimElemTime(11)=1
value = 2

[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(4)=1
anim = 7010
ID = 7010
pos = 60,-65
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(6)=1
anim = 7020
ID = 7010
pos = 60,-50
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(9)=1
anim = 7010
ID = 7010
pos = 60,-30
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(11)=1
anim = 7030
ID = 7010
pos = 60,-70
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5

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

[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(4)=1
anim = 7010
ID = 7010
pos = -20,-70
postype = p2  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(5)=1
anim = 7020
ID = 7010
pos = -20,-55
postype = p2  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(9)=1
anim = 7010
ID = 7010
pos = -20,-30
postype = p2  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5
[State 0, Explod]
type = Explod
triggerall = Anim = 3801
trigger1 = AnimElemTime(11)=1
anim = 7030
ID = 7010
pos = -20,-75
postype = p2  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5

[State 0, PlaySnd]
type = PlaySnd
triggerall = Anim = 3801
trigger1 = AnimElemTime(4)=1
trigger2 = AnimElemTime(6)=1
trigger3 = AnimElemTime(9)=1
trigger4 = AnimElemTime(11)=1
value = 5,0+random%6

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time>=350
id = 3802

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time >= 350
value = 3805
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = Time >= 350
anim = 3806
ID = 2403
pos = -120,0
postype = p2  ;p2,front,back,left,right
removetime = -1
facing = 1
persistent = 0
[State 0, Explod]
type = Explod
trigger1 = Time >= 350
anim = 3807
ID = 2403
pos = -120,0
postype = p2  ;p2,front,back,left,right
removetime = -1
facing = 1
persistent = 0
sprpriority = 2

[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 3805
x = -60
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
anim = 2400
ID = 2404
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1
persistent = 0
[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
trigger1 = AnimElemTime(23)=1
anim = 2403
ID = 2403
pos = 41,-35
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
trigger1 = AnimElemTime(23)=1
anim = 2404
ID = 2403
pos = 20,-35
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 6
ownpal = 1


[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
anim = 2401
ID = 2404
pos = -120,0
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 1
persistent = 0
[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
anim = 2402
ID = 2404
pos = -120,0
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
persistent = 0
[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
trigger1 = AnimElemTime(23)=1
anim = 2405
ID = 2403
pos = -80,-35
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 5
ownpal = 1
[State 0, Explod]
type = Explod
trigger1 = Anim = 3805
trigger1 = AnimElemTime(23)=1
anim = 2406
ID = 2403
pos = -100,-35
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = -1
removetime = -1
sprpriority = 6
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 3805
trigger1 = AnimElemTime(22)=1
id = 2404

[State 0, Explod]
type = Explod
trigger1 = enemy, Anim = 3821
anim = 7030
ID = 7010
pos = 0,-35
postype = p2  ;p2,front,back,left,right
ownpal = 1
sprpriority = 7
persistent = 10

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, Anim = 3821
value = 3810,0
persistent = 3

[State 0, HitAdd]
type = HitAdd
trigger1 = enemy, Anim = 3821
value = 1
persistent = 3

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,StateNo >= 3811
id = 7010
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = enemy,StateNo >= 3811
id = 2403

[State 0, Helper]
type = Helper
trigger1 = !NumHelper(3906)
trigger1 = enemy, StateNo = 3811
name = "Portal Finisher"
ID = 3906
stateno = 3906
pos = 0,0
postype = p1    ;p2,front,back,left,right

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy,StateNo >= 3811
flag = invisible

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy,StateNo = 3811
value = 3700,0
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 540
value = 3801

;---------------------------------------------------------------
;Hit by LVL1
[Statedef 3810]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy, Anim = 3800
trigger2 = enemy, Anim = 3803
flag = invisible

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy, anim = 3801
value = 3820
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy, anim = 3805
trigger1 = enemy, AnimElemTime(23)<=0
value = 3820

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = enemy, anim = 3805
trigger1 = enemy, AnimElemTime(23)=1
value = 3821
persistent = 0

[State 0, PalFX]
type = PalFX
trigger1 = Anim = 3821
time = 100
mul = 128,128,128
sinadd = 64,64,64,4

[State 0, LifeAdd]
type = LifeAdd
trigger1 = Time = 440
value = ceil(ifElse(enemy, fvar(11) * -340 > -170, -170, enemy, fvar(11) * -340))
kill = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 460
value = 3811

;---------------------------------------------------------------
;Exit Portal
[Statedef 3801]
type = A
movetype = I
physics = A
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 991901

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

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

[State 0, Turn]
type = null;Turn
trigger1 = !Time

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = -50

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
value = 3801,0
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
value = 3801,10
channel = 0

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

[State 4500, 1];transform SND
type = PlaySnd
trigger1 = !Time
value = 194,0

[State 221, finish]
type = ChangeState
trigger1 = !Time
value = 111
ctrl = 0

;Blasted from Portal
;-----------------------------
[Statedef 3811]
type = A
physics = N
movetype = H
ctrl = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <30
flag = invisible
flag2 = noshadow

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time=25
value = 5061

[State 0, PalFXWiz]
type = PalFX
trigger1 = Time = 30
trigger1 = enemy, Var(52)>=2000&& enemy, Var(52)<3000
time = 40
add = 240,50,0
mul = 250,224,120
sinadd = 110,55,85,10
invertall = 0
color = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

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

[State 0, VelSet]
type = VelSet
trigger1 = Time > 30
x = -10
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = Time = 30
x = -5
y = -10

[State 0, VelAdd]
type = VelAdd
trigger1 = Time > 30
y = 3.25

[State 1224, Hit ground]
type = ChangeState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 3812

;Lay Down
;------------------------------------------
[Statedef 3812]
type    = L
movetype= H
physics = N

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 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.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

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

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 3813

;Bounce
;----------------------------------------
[Statedef 3813]
type    = L
movetype= H
physics = N

[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
type = ChangeState
trigger1 = Alive
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
value = 3814

[State 5101, 6] ;Hit ground
type = SelfState
Trigger1 = !Alive
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
value = 5110

;Lie Down
;-----------------------------------------
[Statedef 3814]
type    = L
movetype= H
physics = N
velset = 0

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

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[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, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[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, 10] ;For normal
type = ChangeAnim2
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 3822

[State 5110, 11] 
type = SelfState
trigger1 = AnimTime = 0
value = 5120

;---------------------------------------------------------------
;Activate LVL2
[Statedef 3850]
type = A
movetype = I
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, PowerSet]
type = PowerSet
trigger1 = !Time
value = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Anim != 15999
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Anim != 15999
flag = nomusic
flag2 = noBG
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time <=40
flag = invisible

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time 
ID = 3695

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = Time = 40
trigger2 = Anim = 15999
ID = 2923

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing = 1,-60,60)
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 41
value = 3849

[State 0, Explod]
type = Explod
trigger1 = Anim = 3849
trigger1 = AnimElemTime(7)=1
anim = 3851
ID = 3851
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
sprpriority = 2
persistent = 0
removetime = -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 3849
trigger1 = !AnimTime
id = 3851

[State 1900, SSJ white circle]
type = explod
trigger1 = Anim = 3849
trigger1 = !AnimTime
anim = 90200
id = 90200
pos = 0,-40
sprpriority = 7
ontop = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
removetime = -2
scale = 25,25
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3849
trigger1 = !AnimTime
value = 3850

;Universal
[State 0, Explod]
type = Explod
trigger1 = Anim = 3850
trigger1 = enemy,AuthorName !="Team Z2"
anim = 3860
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
ownpal = 1
persistent = 0

;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Goku Z2"
trigger2 = Enemy, Name = "Goku" || Enemy, Name = "Songoku" || Enemy, Name = "Son Goku" || Enemy, Name = "GokuHR"
trigger3 = Enemy, Name = "Goku-n-hd by EmuBoarding" || Enemy, Name = "SFXVI Goku" || Enemy, Name = "Goku by Komodo"
trigger4 = Enemy, Name = "Another Goku by HyperionX & Iron Mask"
trigger5 = enemy,authorname="Da_Maverik"		;LOL Jerk
trigger6 = enemy,name="Goku from Dragon Ball Z"
trigger7 = enemy,name="Goku JUS"
trigger8 = enemy,name="Goku Transform"
trigger9 = enemy,name="Black GokuZ2" || enemy,name="SSJ God Goku" || enemy,name="SSJ Goku Black" ;MK ninjas
anim = Cond(Facing=1,3861,3881)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "SSJ Goku Z2"
trigger2 = enemy,name = "SSJ God Goku Z2"
trigger3 = Enemy, Name = "SSJ Goku" || Enemy, Name = "Goku SSJ" || Enemy, Name = "SSJ2 Goku"
trigger4 = Enemy, Name = "Goku Super Sayajin 2 by ribeiro" || Enemy, Name = "[Necromancer's] Goku" || Enemy, Name = "Goku-SSJ2"
trigger5 = Enemy, Name = "SSJ Goku by Ryon" || Enemy, Name = "Sup. Goku" || Enemy, Name = "Sup.Goku" || Enemy, Name = "Goku Super Sayajin by Roken"
trigger6 = Enemy, Name = "NeoKakaroto" || Enemy, Name = "Son Goku by Duende Macabro" || Enemy, Name = "SSJ2 Goku Hyper Demension"
trigger7 = Enemy, Name = "Goku By Hyper" || Enemy, Name = "SSJ2-GOKU by BARDOCK" || Enemy, Name = "Goku Legend" || Enemy, Name = "Goku by ynvaser"
trigger8 = Enemy, Name = "Goku Super Saiyajin" || Enemy, Name = "SSJ3 Goku" || Enemy, Name = "ss3goku" || Enemy, Name = "Son-Goku-SSJ3"
trigger9 = Enemy, Name = "Super Sayan 3" || Enemy, Name = "GokuSSJ3"
trigger10 = Enemy, Name = "super ssj3 goku v2"
trigger11 = Enemy, Name = "Goku SSJ4 by _Vision and MRP" || Enemy, Name = "Goku Type-Z" || Enemy, Name = "Ultra SSj4 Goku by Princevegeta"
trigger12 = enemy,name="UB22 Goku"
trigger13 = enemy,name="False SSJ Goku Z2" || enemy,name="SSJ4 Goku Z2" || enemy,name="SSJB Kaioken Goku Z2" || enemy,name="SSJR Goku Black" ;MK ninjas
anim = Cond(Facing=1,3862,3882)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Vegeta Z2" && (enemy,palno = [1,6])
trigger2 = enemy,name = "Normal Vegeta Z2"
trigger3 = enemy,name = "SSJ God Vegeta Z2"
trigger4 = Enemy, Name = "vegeta-n-3 by EmuBoarding"
trigger5 = Enemy, Name = "Vegeta" || Enemy, Name = "SSJ Vegeta"
trigger6 = Enemy, Name = "Vegeta Normal 2 by EB" || Enemy, Name = "Vegeta Super Sayjin 4 by EB and BS" || Enemy, Name = "SSJ Vegeta by Ryon"
trigger7 = Enemy, Name = "Prince Vegeta" || Enemy, Name = "Bebi Vegeta" || Enemy, Name = "Bejita" || Enemy, Name = "BAYJEETA?!"
trigger8 = Enemy, Name = "Vegeta-Type-R" || Enemy, Name = "KiKi's Vegeta" || Enemy, Name = "Vegeta-GT-SSJ2" || Enemy, Name = "Vegita" || Enemy, Name = "Vegeta Saiyan BY franciynaldo"
trigger9 = Enemy, Name = "VEGETA GT BY NICO" || Enemy, Name = "Practice Vegeta by Detah" || Enemy, Name = "DK-Super Vegeta " || Enemy, Name = "Bejiita by Seifer Firehart"
trigger10 = Enemy, Name = "BebiVegeta by Princevegeta" || Enemy, Name = "Vegeta by DM" || Enemy, Name = "Vegeta Alpha" || Enemy, Name = "EvilFighter Vegeta"
trigger11 = Enemy, Name = "Supa Saiyajin Tsu Bejiita" || Enemy, Name = "OS USSJ Vegeta" || Enemy, Name = "=El Principe Saiyajin Vegeta= By Team OS"
trigger12 = Enemy, Name = "VegetaSsj4" || Enemy, Name = "vegeta_ssj4"
trigger13 = enemy,name="Vegeta by OverMind" || enemy,name="ESF Vegeta By Ninja_Naruto,3D Model By Unknown ESF Modeller"
trigger14 = enemy,name="Vegita" || enemy,name="Vegeta Transform"
trigger15 = enemy,name="baby vegeta 3D by stopmotiontoys"
trigger16 = enemy,name="Vegeth@ by Nemesis82 & Biohazard82"
trigger17 = enemy,name="SSJ God Vegeta" || enemy,name="SSJ VegetaZ2" ;MK ninjas
anim = Cond(Facing=1,3863,3883)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Vegeta Z2" && (enemy,palno = [7,12])
trigger2 = enemy,name = "Majin Vegeta Z2"
trigger3 = Enemy, Name = "Mystiq Vegeta" || Enemy, Name = "Majin Vegeta" || Enemy, Name = "MajinVedita"
trigger4 = Enemy, Name = "Majin Vedita by Bacteria" || Enemy, Name = "Majin Vegeta by Komodo" || Enemy, Name = "MAJIN-VEGETA by BARDOCK"
trigger5 = enemy,name="SSJ2 Majin Vegeta Hyper Demension"
anim = Cond(Facing=1,3864,3884)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Gohan Z2"
trigger2 = enemy,name="Gohan" || Enemy, Name = "Son Gohan by EmuBoarding" || Enemy, Name = "SSJ Gohan" || Enemy, Name = "SSJ Gohan By Kamekaze"
trigger3 = Enemy, Name = "Gohan Movie 9 2.00" || Enemy, Name = "Messy hair Gohan" || Enemy, Name = "Movie 9 Gohan" || Enemy, Name = "Super 2 Gohan"
trigger4 = Enemy, Name = "PGohanSSJ2" || Enemy, Name = "Gohan" || Enemy, Name = "SSJ Gohan by Ryon" || Enemy, Name = "Mystic Gohan"
trigger5 = Enemy, Name = "Mystic_Gohan" || Enemy, Name = "Mystic Gohan by Zero_X" || Enemy, Name = "GohanZ" || Enemy, Name = "Mystic Gohan Hyper Demension"
trigger6 = Enemy, Name = "||>(Zerberus-:-Dante)<|| Gohan Sword`s User"
trigger7 = Enemy, Name = "great saiyaman by Franciynaldo" || Enemy, Name = "Mistico gohan by franciynaldo"
trigger8 = enemy,name="Great Saiyaman By Tomo"  || enemy,name="Ultimate Gohan" || enemy,name="Ultimate Gohan (edit by Tomo)"
trigger9 = enemy,name="Future Gohan Z2" || enemy,name="SSJ Future Gohan Z2" || enemy,name="SSJ Gohan Z2" ;MK ninjas
anim = Cond(Facing=1,3873,3893)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Freeza Z2"
trigger2 = Enemy,Name = "Freeza UB22" || Enemy, Name = "Freeza" || Enemy, Name = "Freiza" || Enemy, Name = "Freezer" || enemy,name="Frieza"
trigger3 = Enemy,Name = "Freeza by OverMind" || Enemy, Name = "Disciple's Freeza" || Enemy, Name = "Freezer 4th Form OS" || Enemy, Name = "frz"
trigger4 = enemy,name = "CS-Freezer'AS" || enemy,name="Final Form Frieza Hyper Demension"
trigger5 = Enemy,Name = "Coola" || Enemy, Name = "Cooler" || Enemy, Name = "M-Kooler" || Enemy, Name = "coola by Franciynaldo"
trigger6 = enemy,name = "Golden Freeza" || enemy,name = "GFreeza"
anim = Cond(Facing=1,3867,3887)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Piccolo Z2"
trigger2 = enemy,name="Piccolo" || Enemy, Name = "Piccolo Daimao"
trigger3 = enemy,name="Piccolo por Ssonic" || enemy,name="DK-Piccolo Com Capa 1.0" || enemy,name="Piccolo Daimao Jr"
trigger4 = enemy,name="[FlowaGirl's] Piccolo" || enemy,name="Piccolo by Ryon" || enemy,name="Piccolo Hyper Demension"
anim = Cond(Facing=1,3868,3888)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,Name ="Babidi Z2"
anim = Cond(Facing=1,3871,3891)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Satan Z2"
trigger2 = enemy,name = "Shin Satan Z2"
trigger3 = enemy,name="Mr Satan" || enemy,name="Mr.Satan"
anim = Cond(Facing=1,3870,3890)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Buu Z2"
trigger2 = Enemy, Name = "Buu" || Enemy, Name = "Super Buu" || Enemy, Name = "Majin Buu" || Enemy, Name = "Fat Buu"
trigger3 = Enemy, Name = "Pocket-Mr.Buu_SS"
trigger4 = Enemy, Name = "Ultimate Bu by Sniper85" || Enemy, Name = "PexBuu" || Enemy, Name = "Kid Buu"
trigger5 = enemy,name="Mister Buu Hyper Demension"
trigger6 = enemy,name="Kid Buu" || enemy,name="Kid Buu Hyper Demension"
trigger7 = enemy,name="Uub"
anim = Cond(Facing=1,3869,3889)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0
;Char
[State 0, Explod]
type = Explod
triggerall = Anim = 3850
trigger1 = enemy,name = "Gotenks Z2"
trigger2 = Enemy,Name = "Gotenks"
trigger3 = Enemy,Name = "SSJ3 Gotenks Hyper Demension" || Enemy, Name = "Gotenks by Pextin" || Enemy, Name = "Gotenks SSJ4 HD by Orochi Koe"
trigger4 = enemy,name = "Super Gotenks"
anim = Cond(Facing=1,3872,3892)
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -1
facing = Cond(Facing=1,1,-1)
ownpal = 1
persistent = 0

;White Board
[State 0, Explod]
type = Explod
trigger1 = Anim = 3850
anim = 3853
ID = 3853
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -2
ownpal = 1
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim != 3850
id = 3853

[State 0, Helper]
type = Helper
trigger1 = Anim = 3850
trigger1 = AnimElemTime(1)=30
name = "Ghost Army"
ID = 3851
stateno = 3851
pos = 0,0
postype = p1    ;p2,front,back,left,right
persistent = 0

[State 0, PlaySnd];blow1
type = PlaySnd
trigger1 = Anim = 3849
trigger1 = AnimElemTime(6) = 1
value = 3860,3
[State 0, PlaySnd];blow2
type = PlaySnd
trigger1 = Anim = 3850
trigger1 = !Time
value = 3860,8

[State 0, PlaySnd];serious enemy
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3850
trigger1 = AnimElemTime(10) = 1
value = 3000,6

[State 0, PlaySnd];Weak spot
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3850
trigger1 = AnimElemTime(10) = 1
value = 3000,10

[State 0, PlaySnd];music
type = PlaySnd
trigger1 = Anim = 3850
trigger1 = AnimElemTime(1) = 80
value = 3860,7

[State 0, PlaySnd];tap
type = PlaySnd
trigger1 = Anim = 3850
trigger1 = AnimElemTime(80) = 1
value = 3860,4

[State 0, PlaySnd];salute
type = PlaySnd
trigger1 = Anim = 3850
trigger1 = AnimElemTime(89) = 1
value = 3860,5

[State 0, PlaySnd];stop slacking
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3850
trigger1 = AnimElemTime(49) = 1
value = 3000,4

[State 0, PlaySnd];Eyes forward
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3850
trigger1 = AnimElemTime(49) = 1
value = 3000,11

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=620
value = 1

[state 3250, speedlines]
type = explod
trigger1 = Anim = 1
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224
persistent = 0

[state 3250, speedlines2]
type = explod
trigger1 = Anim = 1
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=670
anim = 3852
ID = 3852
pos = 160,180
postype = left  ;p2,front,back,left,right
bindtime = -1
ontop = 1
removetime = -1

[State 0, HitAdd]
type = HitAdd
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time>=670
value = 1
persistent = 5

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim = 15999
id = 3852

[State 0, Explod]
type = Explod
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=790
anim = 3856
ID = 3856
pos = 0,0
postype = p2  ;p2,front,back,left,right
bindtime = -1
ontop = 1
scale = 15,15

[State 0, PlaySnd]
type = PlaySnd
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=790
value = 30000,2+random%4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=870
value = 15999

[State 0, Helper]
type = Helper
trigger1 = !NumHelper(3906)
trigger1 = Anim = 15999
name = "Portal Finisher"
ID = 3906
stateno = 3906
pos = 0,0
postype = p1    ;p2,front,back,left,right
persistent = 0

[State 6050, Explod]
type = Explod
trigger1 = enemy, Time = 29
trigger1 = enemy, StateNo = 3811
anim = 8601
ID = 8600
pos = 15,-50   
postype = p2
sprpriority = 2
bindtime = -1
ownpal = 1
facing = -1

[State 6050, Explod]
type = Explod
trigger1 = enemy, Time = 29
trigger1 = enemy, StateNo = 3811
anim = 8601
ID = 8600
pos = -15,-70   
postype = p2
sprpriority = 3
bindtime = -1
ownpal = 1
facing = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = NumHelper(3851)
trigger1 = helper(3851),Time=950
value = 3801


;---------------------------------------------------------------
;Hit by LVL2
[Statedef 3870]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy, Anim = [3849,3850]
flag = invisible

[State 0, LifeAdd]
type = LifeAdd
trigger1 = enemy, Anim = 15999
value = ceil(ifElse(enemy, fvar(11) * -440 > -220, -220, enemy, fvar(11) * -440))
kill = 1
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, Anim = 15999
value = 3811



;---------------------------------------------------------------
;Finisher LVL3 transform
[Statedef 3900]
type = A
movetype = I
physics = N
anim = 3900
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, PowerSet]
type = PowerSet
trigger1 = !Time
value = 0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time
ID = 2923

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(facing=1, -100,100)
y = 0

[State 1000, flash]
type = PalFX
trigger1 = Time = 22
add = 256,256,256
sinadd = 0,0,0,1
time = 10

[State 1900, SSJ white circle]
type = explod
trigger1 = time = 22
anim = 90201
id = 90200
pos = 0,-40
sprpriority = 3
;ontop = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
removetime = -2
scale = .005,.005

[State 1900, SSJ white circle]
type = modifyexplod
trigger1 = numexplod(90200) 
scale = .12*(time-22),.12*(time-22)
ID = 90200

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3900
trigger1 = animelemtime(2)=0
value = 3,19
channel = 0

[State 4500, 1];Scream
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3900
trigger1 = animelemtime(2)=0
value = 3,141
channel = 0

[State 4500, 1];transform SND
type = PlaySnd
trigger1 = time = 22
value = 194,0
channel = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9)=0
trigger1 = Anim = 3900
trigger1 = !AnimTime
value = 4020

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9)=1
trigger1 = Anim = 3900
trigger1 = !AnimTime
value = 4021

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9)=2
trigger1 = Anim = 3900
trigger1 = !AnimTime
value = 4022

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9)=3
trigger1 = Anim = 3900
trigger1 = !AnimTime
value = 4023

[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 4023
time = 2
add = 200,100,256
mul = 120,224,150
sinadd = 0,0,0,1
invertall = 0
color = 0
persistent = 15

[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 4023
time = 2
add = 0,50,240
mul = 120,224,150
sinadd = 0,0,0,1
invertall = 0
color = 0
persistent = 20

[State 0, Helper]
type = Helper
trigger1 = Anim = 3900
trigger1 = AnimElemTime(3)=0
name = "ShockWave"
ID = 3691
stateno = 3691
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3907)
trigger1 = Anim = 4020
anim = 4005
ID = 3907
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3907)
trigger1 = Anim = 4021
anim = 4006
ID = 3907
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3907)
trigger1 = Anim = 4022
anim = 4004
ID = 3907
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3907)
trigger1 = Anim = 4023
anim = 4007
ID = 3907
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = 1
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Time = 110
value = 196,23
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Time = 110
value = 196,25
persistent = 0

[State 0, RemapPal]
type = RemapPal
trigger1 = Anim = 3900
trigger1 = AnimElemTime(8)=6
source = 1,1
dest = 1,Var(58)
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Anim != [4020,4023]
id = 3907

[State 0, StopSnd]
type = StopSnd
trigger1 = Anim != 3900
channel = 3

[state 3250, speedlines]
type = explod
trigger1 = Anim = 3621
trigger1 = !AnimTime 
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[state 3250, speedlines2]
type = explod
trigger1 = Anim = 3621
trigger1 = !AnimTime 
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 230
value = 2302,0
channel = -1

[State 0, PalFXWiz]
type = PalFX
trigger1 = Var(9)=0
trigger1 = Anim = 3621
time = 1
add = 256,256,256
mul = 0,100,256
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 0, PalFXWiz]
type = PalFX
trigger1 = Var(9)=1
trigger1 = Anim = 3621
time = 1
add = 256,256,256
mul = 175,0,0
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 0, PalFXWiz]
type = PalFX
trigger1 = Var(9)=2
trigger1 = Anim = 3621
time = 1
add = 256,256,256
mul = 175,175,0
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 0, PalFXWiz]
type = PalFX
trigger1 = Var(9)=3
trigger1 = Anim = 3621
time = 1
add = 0,-200,0
mul = 256,256,256
sinadd = 40,80,40,10
invertall = 1
color = 0

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

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 3621
trigger1 = !AnimTime 
value = 3900,0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 3621
trigger1 = !AnimTime 
value = 3900,10
channel = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 230
value = 3621

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 3621
trigger1 = !AnimTime 
value = 3910


;---------------------------------------------------------------
;Attack 1
[Statedef 3910]
type = A
movetype = I
physics = N
anim = 3910
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 80
value = 3910,0


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9)=0
value = 3911
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9)=1
value = 3912
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9)=2
value = 3910
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9)=3
value = 3913

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time<=100
flag = invisible

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = Time =100
ID = 2923

[state 3250, speedlines]
type = explod
trigger1 = time = 140
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[state 3250, speedlines2]
type = explod
trigger1 = time = 140
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[State 0, HitAdd]
type = HitAdd
trigger1 = Time = 100
value = 1

[State 0, Explod]
type = Explod
trigger1 = Time = 100
anim = 7030
ID = 7030
pos = -30,-40
postype = p1  ;p2,front,back,left,right
ownpal = 1
sprpriority = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 100
value = 3910,2;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 100
value = 3910,2;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 100
value = 3910,2;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 100
value = 3910,2;5,2

[State FG, Explod]
type = Explod
trigger1 = Time=80
anim = 3697
ID = 3697
pos = -200,0
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime =-1
sprpriority = -3
ownpal = 1
vel = 7,0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing=1,enemy, Pos X +60,enemy, Pos X -60)
y = enemy, Pos Y

[State 0, Explod]
type = Explod
trigger1 = Var(9)=0
trigger1 = !NumExplod(3911)
trigger1 = Time = 100
anim = 4034
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = Var(9)=1
trigger1 = !NumExplod(3911)
trigger1 = Time = 100
anim = 4009
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = Var(9)=2
trigger1 = !NumExplod(3911)
trigger1 = Time = 100
anim = 4012
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = Var(9)=3
trigger1 = !NumExplod(3911)
trigger1 = Time = 100
anim = 4008
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 4008
time = 2
add = 200,100,256
mul = 120,224,150
sinadd = 0,0,0,1
invertall = 0
color = 0
persistent = 15

[State 0, PalFXWiz]
type = PalFX
trigger1 = Anim = 4008
time = 2
add = 0,50,240
mul = 120,224,150
sinadd = 0,0,0,1
invertall = 0
color = 0
persistent = 20

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 140
id = 3911

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time>=140
flag = invisible

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Time=130
value = 3900,1
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Time=130
value = 3900,11
channel = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 180
value = 3920

;---------------------------------------------------------------
;Hit 1 Custom State
[Statedef 4100]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 4100

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

[State 0, Turn]
type = Turn
trigger1 = !Time
trigger2 = AnimElemTime(2)=0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(2)=0
x = 15

[State 0, PosSet]
type = PosSet
trigger1 = enemy, StateNo = 3910
trigger1 = enemy, Time = 160
x = Cond(Facing=-1,300,-300)
y = -30

[State 0, VelSet]
type = VelSet
trigger1 = enemy, StateNo = 3910
trigger1 = enemy, Time = 180
x = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3920
trigger1 = enemy, Time = 1
value = 4101


;---------------------------------------------------------------
;Attack 2
[Statedef 3920]
type = A
movetype = I
physics = N
anim = 3920
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 3920+random%6

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time 
ID = 2923

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3920
anim = 4030
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3921
anim = 4031
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3922
anim = 4032
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3924
anim = 4035
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[state 3250, speedlines]
type = explod
trigger1 = time = 50
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
facing = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[state 3250, speedlines2]
type = explod
trigger1 = time = 50
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 224
sprpriority = -1
facing = -1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = 224

[State 1000, flash]
type = PalFX
trigger1 = !Time 
add = 256,256,256
sinadd = 0,0,0,1
time = 10

[State 1900, SSJ white circle]
type = explod
trigger1 = !Time 
anim = 90201
id = 90200
pos = 0,-40
sprpriority = 3
;ontop = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
removetime = -2
scale = .005,.005

[State 1900, SSJ white circle]
type = modifyexplod
trigger1 = numexplod(90200) 
scale = .12*(time),.12*(time)
ID = 90200

[State 4500, 1];transform SND
type = PlaySnd
trigger1 = !Time 
value = 194,0
channel = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = !Time 
value = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,3;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,3;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,3;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,3;5,2

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing=-1,enemy, Pos X +60,enemy, Pos X -60)
y = enemy, Pos Y

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time<=5
trigger2 = Time>=50
flag = invisible

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time<=5
trigger2 = Time>=50
id = 3911

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 80
value = 3930

;---------------------------------------------------------------
;Hit 2 Custom State
[Statedef 4101]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 4101

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

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

[State 0, PosSet]
type = PosSet
trigger1 = enemy, StateNo = 3920
trigger1 = enemy, Time = 40
x = Cond(Facing=1,300,-300)
y = -30

[State 0, VelSet]
type = VelSet
trigger1 = enemy, StateNo = 3920
trigger1 = enemy, Time = 60
x = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3930
trigger1 = enemy, Time = 20
value = 4102

;---------------------------------------------------------------
;Attack 3
[Statedef 3930]
type = A
movetype = I
physics = N
anim = 3930
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 3930+random%6

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3935
anim = 4039+random%4
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
sprpriority = -4
ownpal = 1
removetime = -1

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time 
ID = 2923

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3930
anim = 4013
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3931
anim = 4014
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3932
anim = 4017
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3933
anim = 4036
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(3911)
trigger1 = Anim = 3934
anim = 4037
ID = 3911
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
sprpriority = -4
ownpal = 1

[state 3250, speedlines]
type = explod
trigger1 = time = 40
anim = 12773
ID = 2773
postype = back
pos = 10,0
bindtime = -1
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[state 3250, speedlines2]
type = explod
trigger1 = time = 40
anim = 12773
ID = 2773
postype = back
pos = 240,0
bindtime = -1
sprpriority = -1
ontop = 0
ownpal = 1
facing = 1
ignorehitpause = 1
;pausemovetime = 145
removetime = -1

[State 1000, flash]
type = PalFX
trigger1 = !Time 
add = 256,256,256
sinadd = 0,0,0,1
time = 10

[State 1900, SSJ white circle]
type = explod
trigger1 = !Time 
anim = 90201
id = 90200
pos = 0,-40
sprpriority = 3
;ontop = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
removetime = -2
scale = .005,.005

[State 1900, SSJ white circle]
type = modifyexplod
trigger1 = numexplod(90200) 
scale = .12*(time),.12*(time)
ID = 90200

[State 4500, 1];transform SND
type = PlaySnd
trigger1 = !Time 
value = 194,0
channel = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = !Time 
value = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,4;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,4;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,4;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,4;5,2
[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time 
value = 3910,4;5,2

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(Facing=1,enemy, Pos X +60,enemy, Pos X -60)
y = enemy, Pos Y +60

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Time=40
value = 3900,2
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Time=40
value = 3900,12
channel = -1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time<=5
trigger2 = Time>=40
flag = invisible

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time<=5
trigger2 = Time>=40
id = 3911

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 80
value = 3901

;---------------------------------------------------------------
;Hit 3 Rising Custom State
[Statedef 4102]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 4102

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

[State 0, Turn]
type = Turn
trigger1 = !Time

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(2)=0
y = -15

[State 0, PosSet]
type = PosSet
trigger1 = enemy, StateNo = 3930
trigger1 = enemy, Time = 40
y = 60

[State 0, VelSet]
type = VelSet
trigger1 = Time = 25
y = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy, StateNo = 3901
flag = invisible

[State 0, ChangeState]
type = ChangeState
trigger1 = enemy, StateNo = 3901
trigger1 = enemy, Time = 100
value = 4103


;---------------------------------------------------------------
;DayDream
[Statedef 3901]
type = S
movetype = I
physics = N
anim = 3902
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -5

[State 0, RemapPal]
type = RemapPal
trigger1 = !Time
trigger1 = Var(50)>0
source = 1,1
dest = 2,Var(58)

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Enemy, Anim != 4100
flag = nobardisplay
flag2 = noFG
flag3 = timerfreeze
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = enemy, Anim != 4100
flag = noBG

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = !Time 
ID = 2773

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(facing=1, -100,100)
y = 0

[State 0, Helper]
type = Helper
trigger1 = !Time
name = "DayDream"
ID = 3940
stateno = 3940
pos = 60,0
postype = p1    ;p2,front,back,left,right
supermovetime = 9999999999
pausemovetime = 9999999999
ownpal = 1

[State 1000, shake]
type = EnvShake
trigger1 = Time = 50
time = 60
freq = 80
ampl = 30

[State 200, Superpause charge sound]
type = PlaySnd
trigger1 = Time = 10
value = 2350,0

[State 0, Hyper Charge FX]
type = Explod
trigger1 = Time = 10
anim = 10201
id = 10201
pos = 60,-90
postype = p1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1.5,1.5
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = Facing = 1
trigger1 = Time = 100
anim = 2209
ID = 2208
pos = 50,enemy,Const(Size.Head.Pos.Y)-30
postype = p2
removetime = -1
scale = 1,1
sprpriority = -6
facing = -1

[State 0, Explod]
type = Explod
trigger1 = Facing = -1
trigger1 = Time = 100
anim = 2208
ID = 2208
pos = 50,enemy,Const(Size.Head.Pos.Y)-30
postype = p2
removetime = -1
scale = 1,1
sprpriority = -6
facing = 1

[State 800, remove speedlines WIN]
type = RemoveExplod
trigger1 = enemy, Anim = 100
ID = 2208

[State 0, HitAdd]
type = HitAdd
trigger1 = Time = 180
value = -3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = enemy, Anim = 100
value = 3903
persistent = 0
;girly scream
[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, Anim = 100
value = 30020,0+random%5
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, Anim = 4100
value = 5,0+random%6
persistent = 20

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, Anim = 4100
value = 5,0+random%6
persistent = 32

[State 0, PlaySnd]
type = PlaySnd
trigger1 = enemy, Anim = 4100
value = 10,0
persistent = 55

[State 0, HitAdd]
type = HitAdd
trigger1 = Enemy, Anim = 4100
value = -5+random%10
persistent = 20

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time<100
trigger2 = Enemy, Anim = 4100
flag = invisible

[State 0, Helper]
type = Helper
trigger1 = !NumHelper(3906)
trigger1 = enemy, Anim = 4100
name = "Portal Finisher"
ID = 3906
stateno = 3906
pos = 0,0
postype = p1    ;p2,front,back,left,right

[State 0, Explod]
type = Explod
trigger1 = fVar(17)=1
trigger1 = Time = 410
anim = 1
ID = 3607
removetime = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 410
value = 3607

;---------------------------------------------------------------
;Exit Portal
[Statedef 3607]
type = A
movetype = I
physics = A
anim = 3693
ctrl = 0
poweradd= 0
velset = 6,0
sprpriority = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 991901

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

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

[State 0, Turn]
type = Turn
trigger1 = !Time

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = -50

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

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

;---------------------------------------------------------------
;Confusion then run after Gotenks
[Statedef 4103]
type = A
movetype = H
physics = N
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = -6

[State 0, Turn]
type = Turn
trigger1 = !Time

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(facing=1, enemy, Pos X -200, enemy, Pos X +200)
y = 0

[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = !Time
value = 0

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

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 100
x = 5

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 4100
x = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Anim = 4100
flag = invisible

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time=225
value = 4100

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 290
value = 4104

;---------------------------------------------------------------
;Out of there!
[Statedef 4104]
type = A
movetype = H
physics = A
ctrl = 0
poweradd= 0
velset = 0,0
sprpriority = 0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !Time
value = ceil(ifElse(enemy, fvar(11) * -540 > -300, -300, enemy, fvar(11) * -540))
kill = 1
persistent = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = -50

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