
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

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

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
y = const(velocity.jump.y)
[State 40, 4]
type = VelSet
triggerall = abs(vel x) < ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
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)))

[state ]
type=velmul
trigger1 = abs(vel x) > 10
trigger1 = animtime=0
x=0.8

[state ]
type=playsnd
trigger1 = AnimTime = 0
value= s10000,8
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1 = AnimTime = 0
value= s10000,8
freqmul=1.1
volume=255
[state ]
type=playsnd
trigger1=sysvar(1) = 0
trigger1 = AnimTime = 0
value= s10000,4
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1=sysvar(1) != 0
trigger1 = AnimTime = 0
value= s10000,5
freqmul=0.9
volume=255
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10002
pos=0,floor(pos y-vel y)
scale=1.2,1.2
sprpriority=-6
ownpal=1
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10004
pos=0,5+floor(pos y-vel y)
scale=1.6,1.6
trans=add1
sprpriority=-6
ownpal=1
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10003
pos=0,floor(pos y-vel y)
scale=1,1
sprpriority=6
ownpal=1


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


;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[state ]
type=playsnd
trigger1 = Time = 0
value= s10000,6
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1 = Time = 0
value= s10000,7
freqmul=0.75
volume=-255
[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 = 3
value = 1
[state ]
type= explod
trigger1 = time =0
anim=10005
pos=0,0
scale=1*0.8,0.25*0.8
sprpriority=-7
ownpal=1
[state ]
type= explod
trigger1 = time =0
anim=10005
pos=0,0
scale=1*0.4,0.25*0.4
sprpriority=-7
ownpal=1
[state ]
type= explod
trigger1 = time =0
anim=10006
pos=0,0
scale=1*0.7,0.25*0.7
sprpriority=-6
ownpal=1
[state ]
type= explod
trigger1 = time =0
anim=110004
trans=add1
pos=0,0
scale=1,1
sprpriority=6
ownpal=1

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




;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1

[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,3
freqmul=1.2
volume=255


[State 100, 1]
type = VelSet
trigger1 = time = 0
x = 45

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

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

[state ]
type= explod
trigger1=time=0
anim=10000
pos=floor(vel x),0
scale=0.5,0.5
sprpriority=6
ownpal=1

[state ]
type= explod
trigger1=time=0
anim=10001
trans=sub
pos=floor(2.5*vel x),0
scale=1.25,1
sprpriority=6
ownpal=1


[state ]
Type = AfterImage
trigger1 = time=0
Time = 15
length = 8
framegap = 1
PalBright = 0,0,0
PalContrast = 256,256,256
Paladd = -16,-16,-16
PalMul = 1,1,1
PalInvertAll =0
Trans = add1
[state ]
type=envshake
trigger1=time=0
time=3
ampl=5
freq=165



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

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
trigger1= animelemtime(4)>=0
trigger2 = abs(vel x)<5
value = 0


;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = S
anim = 105
sprpriority = 1


[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,3
freqmul=1.2
volume=255

[State 100, 1]
type = VelSet
trigger1 = time = 0
x = -45

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

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

[state ]
type= explod
trigger1=time=0
facing=-1
anim=10000
pos=floor(vel x),0
scale=0.5,0.5
sprpriority=6
ownpal=1

[state ]
type= explod
trigger1=time=0
facing=-1
anim=10001
trans=sub
pos=floor(2.5*vel x),0
scale=1.25,1
sprpriority=6
ownpal=1


[state ]
Type = AfterImage
trigger1 = time=0
Time = 15
length = 8
framegap = 1
PalBright = 0,0,0
PalContrast = 256,256,256
Paladd = -16,-16,-16
PalMul = 1,1,1
PalInvertAll =0
Trans = add1
[state ]
type=envshake
trigger1=time=0
time=3
ampl=5
freq=165



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

[State 100, 4]
type = ChangeState
trigger1 = command != "holdback"
trigger1= animelemtime(4)>=0
trigger2 = abs(vel x)<5
value = 0





;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 110]
type    = a
physics = n
anim = 110
sprpriority = 1


[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,3
freqmul=1.2
volume=255

[State 100, 1]
type = VelSet
trigger1 = time = 0
x = 35
y=0

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


[state ]
Type = AfterImage
trigger1 = time=0
Time = 15
length = 8
framegap = 1
PalBright = 0,0,0
PalContrast = 256,256,256
Paladd = -16,-16,-16
PalMul = 1,1,1
PalInvertAll =0
Trans = add1
[state ]
type=envshake
trigger1=time=0
time=3
ampl=5
freq=165

[state ]
type= explod
trigger1 = time =0
anim=10007
pos=floor(const(size.mid.pos.x)+3*vel x),const(size.mid.pos.y)
vel = 0.2*vel x
accel =-0.02*vel x
scale=0.8,0.8
sprpriority=8
ownpal=1


[state ]
type= explod
trigger1 = time <=3
anim=10005
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.35*0.05*(17-time),0.7*0.35*0.05*(17-time)
sprpriority=6
ownpal=1
[state ]
type= explod
trigger1 = time <=3
anim=10005
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.85*0.05*(17-time),0.7*0.85*0.05*(17-time)
sprpriority=6
ownpal=1
[state ]
type= explod
trigger1 = time <=3
anim=10006
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.05*(17-time),0.7*0.05*(17-time)
sprpriority=7
ownpal=1


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

[State ]
type = velset
trigger1 = command != "holdfwd"
trigger1= animelemtime(4)>=0
trigger2 = time>10
trigger3 = frontedgedist < 10
x=-1
y=-5
[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
trigger1= animelemtime(4)>=0
trigger2 = time>10
value = 50


;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 115]
type    = a
physics = n
anim = 115
sprpriority = 1


[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,2
freqmul=1.0
volume=255
[state ]
type=playsnd
trigger1 = time =0
value= s10000,3
freqmul=1.2
volume=255

[State 100, 1]
type = VelSet
trigger1 = time = 0
x = -35
y=0

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


[state ]
Type = AfterImage
trigger1 = time=0
Time = 15
length = 8
framegap = 1
PalBright = 0,0,0
PalContrast = 256,256,256
Paladd = -16,-16,-16
PalMul = 1,1,1
PalInvertAll =0
Trans = add1
[state ]
type=envshake
trigger1=time=0
time=3
ampl=5
freq=165

[state ]
type= explod
trigger1 = time =0
anim=10007
pos=floor(const(size.mid.pos.x)+3*vel x),const(size.mid.pos.y)
vel = 0.2*vel x
accel =-0.02*vel x
scale=0.8,0.8
sprpriority=8
ownpal=1


[state ]
type= explod
trigger1 = time <=3
anim=10005
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.35*0.05*(17-time),0.7*0.35*0.05*(17-time)
sprpriority=6
ownpal=1
[state ]
type= explod
trigger1 = time <=3
anim=10005
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.85*0.05*(17-time),0.7*0.85*0.05*(17-time)
sprpriority=6
ownpal=1
[state ]
type= explod
trigger1 = time <=3
anim=10006
pos=const(size.mid.pos.x),const(size.mid.pos.y)
scale=0.25*0.05*(17-time),0.7*0.05*(17-time)
sprpriority=7
ownpal=1


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

[State ]
type = velset
trigger1 = command != "holdback"
trigger1= animelemtime(4)>=0
trigger2 = time>10
trigger3 = backedgedist < 10
x=1
y=-5
[State 100, 4]
type = ChangeState
trigger1 = command != "holdback"
trigger1= animelemtime(4)>=0
trigger2 = time>10
value = 50





[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

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

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
y = const(velocity.jump.y)
[State 40, 4]
type = VelSet
triggerall = abs(vel x) < ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
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)))

[state ]
type=velmul
trigger1 = abs(vel x) > 10
trigger1 = animtime=0
x=0.8

[state ]
type=playsnd
trigger1 = AnimTime = 0
value= s10000,8
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1 = AnimTime = 0
value= s10000,8
freqmul=1.1
volume=255
[state ]
type=playsnd
trigger1=sysvar(1) = 0
trigger1 = AnimTime = 0
value= s10000,4
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1=sysvar(1) != 0
trigger1 = AnimTime = 0
value= s10000,5
freqmul=0.9
volume=255
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10002
pos=0,floor(pos y-vel y)
scale=1.2,1.2
sprpriority=-6
ownpal=1
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10004
pos=0,5+floor(pos y-vel y)
scale=1.6,1.6
trans=add1
sprpriority=-6
ownpal=1
[state ]
type= explod
trigger1 = AnimTime = 0
anim=10003
pos=0,floor(pos y-vel y)
scale=1,1
sprpriority=6
ownpal=1


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














[Statedef 190]
type    = s
physics = s
anim = 190
sprpriority = 1

[state ]
type=assertspecial
trigger1=1
flag=intro

[state ]
type=assertspecial
trigger1=animelemtime(15)<0
flag=nobardisplay

[state ]
type=playsnd
trigger1=animelemtime(3)=0
trigger2=animelemtime(7)=0
trigger3=animelemtime(11)=0
trigger4=animelemtime(15)=0
value= s10000,6
freqmul=0.9
volume=255
[state ]
type=playsnd
trigger1=animelemtime(3)=0
trigger2=animelemtime(7)=0
trigger3=animelemtime(11)=0
trigger4=animelemtime(15)=0
value= s10000,7
freqmul=0.75
volume=-255
[state ]
type=envshake
trigger1=animelemtime(3)=0-1
trigger2=animelemtime(7)=0-1
trigger3=animelemtime(11)=0-1
trigger4=animelemtime(15)=0-1
time=8
ampl=7
freq=165

[state ]
type=bgpalfx
triggerall=1||var(1):=floor(256*16)
trigger1=animelemtime(3)=[0,2]
trigger2=animelemtime(7)=[0,2]
trigger3=animelemtime(11)=[0,2]
trigger4=animelemtime(15)=[0,2]
add=floor(-128+(32768/var(1))+64),floor(-128+(32768/var(1))-64),floor(-128+(32768/var(1))-64)
mul=var(1),floor(var(1)*0.5),floor(var(1)*0.5)
time=1
[state ]
type= envcolor
trigger1=animelemtime(15)=0
value=192,0,0
[state ]
type= explod
triggerall=animelemtime(15)<=3
trigger1=animelemtime(3)!=[2,3]
trigger1=animelemtime(7)!=[2,3]
trigger1=animelemtime(11)!=[2,3]
trigger1=animelemtime(15)!=[2,3]
anim=10011
trans=addalpha
alpha=0,128
pos=0,0
postype=left
bindtime=-1
scale=1,1
removetime=1
sprpriority=-2147483648
ownpal=1

[state ]
type=offset
trigger1=1
x=facing*(-120+time)


[State 100, 4]
type = ChangeState
trigger1 = animtime=0
value = 0


[Statedef 180]
type    = s
physics = s
anim = 180
sprpriority = 1

[state ]
type=playsnd
trigger1=animelemtime(3)=0
value= s10000,40
freqmul=0.3
volume=255
[state ]
type=playsnd
trigger1=animelemtime(3)=0
value= s10000,40
freqmul=0.3
volume=255
[state ]
type=playsnd
trigger1=animelemtime(3)=0
value= s10000,40
freqmul=0.3
volume=255
[state ]
type=playsnd
trigger1=animelemtime(3)=0
value= s10000,40
freqmul=0.3+0.002
volume=255

[state ]
type=assertspecial
trigger1=animelemtime(3)<=209
flag=roundnotover
[state ]
type=envshake
trigger1=animelemtime(3)=0
time=12
ampl=18
freq=165
[state ]
type=envshake
trigger1=animelemtime(3)=12
time=48
ampl=3
freq=165

[state ]
type=trans
trigger1=animelemtime(3)=[0,59]
trans=addalpha
alpha=floor(256*cos((pi/2/60)*(animelemtime(3)))),floor(256*sin((pi/2/60)*(animelemtime(3))))
[state ]
type=trans
trigger1=animelemtime(3)>=60
trans=addalpha
alpha=0,256

[state ]
type= explod
triggerall=var(0):=random
trigger1=animelemtime(3)=[0,59]
anim=10018
pos=const(size.mid.pos.x)-10,const(size.mid.pos.y)
random=30,90
scale=0.25,0.25
vel=10*cos(random)*cos(var(0)),10*sin(random)*cos(var(0))
sprpriority=6
ownpal=1


[state ]
type= explod
trigger1=animelemtime(3)=[3,4]
anim=10011
trans=addalpha
alpha=0,64
pos=0,0
postype=left
bindtime=-1
scale=1,1
removetime=1
sprpriority=-2147483648

[state ]
type= envcolor
trigger1=animelemtime(3)=[-1,0]
value=128,0,0
[state ]
type=assertspecial
trigger1=animelemtime(3)>=0
flag=nobardisplay
[state ]
type=bgpalfx
triggerall=1||var(1):=floor(256*16)
trigger1=animelemtime(3)>=0
add=floor(-128+(32768/var(1))+64),floor(-128+(32768/var(1))-64),floor(-128+(32768/var(1))-64)
mul=var(1),floor(var(1)*0.5),floor(var(1)*0.5)
time=1











