;-------------------------------------------------------------------
; Plasma Beam
[StateDef 1000]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1000
poweradd = 80
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="QCF_z",2,ifelse(command="QCF_y",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, Explod]
type = Explod
trigger1 = time = 2
anim = 7023
ID = 7023
pos = 0,-10
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = .4,.4
sprpriority = 3
ownpal = 1
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = S3,ifelse(random < 500, 0, 2)
volume = 0
channel = 5

[State 0, Helper]
type = Helper
triggerall = numhelper(1000)=0
trigger1 = AnimElem = 9
helpertype = normal ;player
name = "Plasma Beam"
ID = 1000
stateno = 1010
pos = floor(56*const(size.xscale)),floor(-78*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(1000)=0
trigger1 = Anim != 1001
trigger1 = AnimElemTime(9)>=0
value = 1001

[State 1000, end]
type = ChangeState
triggerall = anim = 1001
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------
; Air Plasma Beam
[StateDef 1005]
type = A
movetype= A
physics = N
juggle  = 1
velset = Vel X/10,Vel Y/10
ctrl = 0
anim = 1005
poweradd = 80
sprpriority = 2

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(19)=1
physics = N

[State 0, ChangeState]
type = ChangeState
triggerall = anim = 1006
trigger1 = var(19)=1
trigger1 = animelemtime(6)>=0
value = 1301
ctrl = 1

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="QCF_z",2,ifelse(command="QCF_y",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 1005
trigger1 = AnimElem = 5
value = S3,ifelse(random < 500, 0, 2)
volume = 0
channel = 5

[State 0, Helper]
type = Helper
triggerall = numhelper(1005)=0
triggerall = anim = 1005
trigger1 = AnimElem = 5
helpertype = normal ;player
name = "Plasma Beam"
ID = 1005
stateno = 1015
pos = floor(18*const(size.xscale)),floor(-45*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(1005)=0
trigger1 = Anim != 1006
trigger1 = AnimElemTime(5)>=0
value = 1006

[State 0, StateTypeSet]
type = StateTypeSet
triggerall = anim = 1006
trigger1 = var(19)=0
trigger1 = AnimElemTime(5)=0
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = A         ;A,C,S,N

[State 0, CtrlSet]
type = CtrlSet
triggerall = anim = 1006
trigger1 = AnimElemTime(6)=0
value = 1

;-------------------------------------------------------------------
; Photon Shot
[StateDef 1100]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1100
poweradd = 80
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="HCB_z",2,ifelse(command="HCB_y",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, Explod]
type = Explod
trigger1 = time = 2
anim = 7023
ID = 7023
pos = 0,-10
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = .4,.4
sprpriority = 3
ownpal = 1
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 6
value = S0,5
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = S10,7
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 8
value = S3,3
volume = 0
channel = 5

[State 0, Width]
type = Width
trigger1 = time = [18,63]
value = 47,0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 2"
ID = 1100
stateno = 1111
pos = floor(0*const(size.xscale)),floor(-125*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 3"
ID = 1100
stateno = 1112
pos = floor(-25*const(size.xscale)),floor(-120*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 4"
ID = 1100
stateno = 1113
pos = floor(-45*const(size.xscale)),floor(-110*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 5"
ID = 1100
stateno = 1114
pos = floor(-55*const(size.xscale)),floor(-95*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 7"
ID = 1100
stateno = 1116
pos = floor(-55*const(size.xscale)),floor(-75*const(size.yscale));floor(-45*const(size.xscale)),floor(-65*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 11"
ID = 1100
stateno = 1123
pos = floor(105*const(size.xscale)),floor(-100*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 12"
ID = 1100
stateno = 1124
pos = floor(120*const(size.xscale)),floor(-85*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 14"
ID = 1100
stateno = 1126
pos = floor(125*const(size.xscale)),floor(-70*const(size.yscale));floor(-45*const(size.xscale)),floor(-65*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 18"
ID = 1100
stateno = 1133
pos = floor(115*const(size.xscale)),floor(-35*const(size.yscale));floor(-45*const(size.xscale)),floor(-65*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 8
helpertype = normal ;player
name = "Photon Shot 19"
ID = 1100
stateno = 1134
pos = floor(120*const(size.xscale)),floor(-50*const(size.yscale));floor(-45*const(size.xscale)),floor(-65*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

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

;-------------------------------------------------------------------
; Air Photon Shot
[StateDef 1105]
type = A
movetype= A
physics = N
juggle  = 1
velset = Vel X/10,Vel Y/10
ctrl = 0
anim = 1105
poweradd = 80
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(19)=1
physics = N

[State 0, ChangeState]
type = ChangeState
trigger1 = var(19)=1
trigger1 = animelemtime(15)>=0
value = 1301
ctrl = 1

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="HCB_z",2,ifelse(command="HCB_y",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 2
value = S0,5
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = S3,3
volume = 0
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = S10,7
volume = 0
channel = -1

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal ;player
name = "Photon Shot 20"
ID = 1100
stateno = 1135
pos = floor(75*const(size.xscale)),floor(-40*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal ;player
name = "Photon Shot 19"
ID = 1100
stateno = 1134
pos = floor(65*const(size.xscale)),floor(-25*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal ;player
name = "Photon Shot 18"
ID = 1100
stateno = 1133
pos = floor(55*const(size.xscale)),floor(-15*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal ;player
name = "Photon Shot 17"
ID = 1100
stateno = 1132
pos = floor(45*const(size.xscale)),floor(-5*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal ;player
name = "Photon Shot 16"
ID = 1100
stateno = 1131
pos = floor(30*const(size.xscale)),floor(5*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = var(19)=0
trigger1 = AnimElemTime(13)=0
statetype = A       ;S,A,C,L
movetype = I        ;I,A,H
physics = A         ;A,C,S,N

[State 0, CtrlSet]
type = CtrlSet
trigger1 = AnimElemTime(15)=0
value = 1

;-------------------------------------------------------------------
; Molecular Sheild
[StateDef 1200]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1200
poweradd = 80
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1= !time && var(59)<=0
var(10) = ifelse(command="QCF_z",2,ifelse(command="QCF_y",1,0))

[State 1000, VarSet]
type=varset
trigger1= !time && var(59)>=1
var(10)= ifelse((p2movetype=H || random<500), 2, ifelse(random<500, 1, 0))

[State 0, Explod]
type = Explod
trigger1 = time = 2
anim = 7023
ID = 7023
pos = 0,-10
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = .4,.4
sprpriority = 3
ownpal = 1
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 1200
trigger1 = AnimElem = 3
value = S3,4
volume = 0
channel = 5

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 1200
trigger1 = NumHelper(1200)>0||Numhelper(1201)>0
value = S10,8
volume = 0
channel = -1
persistent = 0

[State 0, Helper1]
type = Helper
triggerall = anim = 1200
triggerall = numhelper(1200)<5
trigger1 = time = 3
trigger2 = time = 5
trigger3 = time = 7
trigger4 = time = 9
trigger5 = time = 11
helpertype = normal ;player
name = "Rock"
ID = 1200
stateno = 1210
pos = floor(40*const(size.xscale)),floor(-10*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper1]
type = Helper
triggerall = anim = 1200
triggerall = numhelper(1201)<5
trigger1 = time = 4
trigger2 = time = 6
trigger3 = time = 8
trigger4 = time = 10
trigger5 = time = 12
helpertype = normal ;player
name = "Rock"
ID = 1201
stateno = 1220
pos = floor(-40*const(size.xscale)),floor(-10*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = numhelper(1200)=0&&NumHelper(1201)=0
trigger1 = Anim != 1201
trigger1 = AnimElemTime(20)>=0
value = 1201

[State 1000, end]
type = ChangeState
triggerall = anim = 1201
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------
; Star Flight
[StateDef 1300]
type = S
movetype= I
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1300
poweradd = 80
sprpriority = 2

[State 0, Explod]
type = Explod
trigger1 = time = 2
anim = 7023
ID = 7023
pos = 0,-10
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = .4,.4
sprpriority = 3
ownpal = 1
removeongethit = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 2
y = -4.5

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

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

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

;-------------------------------------------------------------------
; Flight
[StateDef 1301]
type = A
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 1
anim = 1301
poweradd = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1= !time
var(19) = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 1302
trigger1 = command = "holdfwd"
value = 1302

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 1303
trigger1 = command = "holdback"
value = 1303

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 1301
trigger1 = command!="holdfwd"&&command!="holdback"
value = 1301

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = [1301,1303]
trigger1 = time = 1
value = S100,2
volume = 0
channel = 5

[State 0, VelSet]
type = VelSet
trigger1 = command!="holdfwd"&&command!="holdback"
x = 0

[State 0, VelSet]
type = VelSet
trigger1 = command!="holddown"&&command!="holdup"
y = 0

[State 0, 1]
type = VelSet
triggerall = anim = 1302
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)+3

[State 0, 2]
type = VelSet
triggerall = anim = 1303
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)-3

[State 0, 1]
type = VelSet
trigger1 = command = "holdup"
trigger1 = screenpos y = [80,240]
y = -4.5

[State 0, 1]
type = VelSet
trigger1 = command = "holddown"
y = 4.5

[State 0, VelSet]
type = VelSet
trigger1 = command = "holdup"
trigger1 = screenpos y != [80,240]
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = command = "holddown"
trigger1 = Pos Y >= -10
y = 0

[State 0, Turn]
type = Turn
trigger1 = p2dist X < -10

[State 3005, End]
type=changestate
trigger1= var(2)>=500
trigger2 = command = "Flight"
value=1310

;-------------------------------------------------------------------
; Star Flight
[StateDef 1305]
type = A
movetype= I
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1305
poweradd = 80
sprpriority = 2

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 1
y = -2.25

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 2
value = S100,3
volume = 0
channel = -1

[State 1000, end]
type = ChangeState
trigger1 = time >= 8
value = 1301
ctrl = 1

;-------------------------------------------------------------------
; Flight End
[StateDef 1310]
type = A
movetype= I
physics = A
juggle  = 1
ctrl = 0
anim = 1310
poweradd = 0
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1= !time
var(19) = 0

[State 1300, Timer]
type=varadd
trigger1= time
var(2)= 1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = AnimElem=4
value = 1
