
;---------------------------------------------------------------------------
; CH/Burst Mode Helper
[StateDef 10010]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 9000

[State 10010, Explod]
type = Explod
triggerall = Root, StateNo != [700,701]
triggerall = TeamSide = 1
trigger1 = !Time
anim = 10010
ID = 10010 
pos = 75,60
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.5,0.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
persistent = 0

[State 10010, Explod]
type = Explod
triggerall = Root, StateNo != [700,701]
triggerall = TeamSide != 1
trigger1 = !Time
anim = 10011
ID = 10011
pos = -75,60
postype = right  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.5,0.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
persistent = 0

[State 10010, Explod]
type = Explod
triggerall = Root, StateNo = [700,701]
triggerall = TeamSide = 1
trigger1 = !Time
anim = 10012
ID = 10012 
pos = 75,100
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.5,0.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
persistent = 0

[State 10010, Explod]
type = Explod
triggerall = Root, StateNo = [700,701]
triggerall = TeamSide != 1
trigger1 = !Time
anim = 10013
ID = 10013
pos = -75,100
postype = right  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.5,0.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
persistent = 0

[State 10010, DestroySelf]
type = DestroySelf
trigger1 = IsHelper(10010) && Time = 30
trigger2 = IsHelper(10012) && Time = 60

;---------------------------------------------------------------------------
;Dust Helper
[StateDef 10040]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 9000

[State 10040, PosSet]
type = PosSet
trigger1 = 1
y = 0

[State 10040, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 10040, Jump Dust Base]
type = Explod
triggerall = Root, StateNo = 50 || Root, StateNo = 100 || Root, StateNo = 105 || (Root, StateNo = [1000,3999])
triggerall = NumExplod(10040) = 0
triggerall = Root, Pos Y < 0
trigger1 = Time = 0
anim = 10040
ID = 10040
pos = 0,0
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 1]
type = Explod
triggerall = Root, StateNo = 50
triggerall = Root, Vel X = 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = Time = 1
anim = 10041
ID = 10041
pos = 0,-20
vel = 0,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 2]
type = Explod
triggerall = Root, StateNo = 50 || (Root, StateNo = [1000,3999])
triggerall = Root, Vel X = 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = Time = 1
anim = 10041
ID = 10041
pos = 0,-40
vel = 0,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 3]
type = Explod
triggerall = Root, StateNo = 50 || (Root, StateNo = [1000,3999])
triggerall = Root, Vel X > 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = !Time
anim = 10041
ID = 10041
pos = 10,-40
vel = 1.5,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 4]
type = Explod
triggerall = Root, StateNo = 50 || (Root, StateNo = [1000,3999])
triggerall = Root, Vel X > 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = !Time
anim = 10041
ID = 10041
pos = 5,-20
vel = 1.5,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 5]
type = Explod
triggerall = Root, StateNo = 50 || (Root, StateNo = [1000,3999])
triggerall = Root, Vel X < 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = Time = 1
anim = 10041
ID = 10041
pos = -10,-40
vel = -1.5,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Jump Dust 6]
type = Explod
triggerall = Root, StateNo = 50 || (Root, StateNo = [1000,3999])
triggerall = Root, Vel X < 0
triggerall = Root, Pos Y < 0
triggerall = NumExplod(10041) < 2
trigger1 = Time = 1
anim = 10041
ID = 10041
pos = -5,-20
vel = -1.5,-1.5
scale = 0.5,0.5
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Landing Dust 1]
type = Explod
triggerall = Root,StateNo = 52 || (Root, StateNo = 101 || Root, Stateno = 106) || Root, Anim = 3011
triggerall = NumExplod(10052) = 0
triggerall = Root, Pos Y = 0
trigger1 = Time = 0
anim = 10052
ID = 10052
pos = 0,0
scale = 0.5, 0.5
postype = p1
removetime = -2
sprpriority = 1
ownpal = 1
persistent = 0

[State 10040, Landing Dust 2]
type = Explod
triggerall = Root,StateNo = 52 || (Root, StateNo = 101 || Root, Stateno = 106) || Root, Anim = 3011
triggerall = NumExplod(10053) = 0
triggerall = Root, Pos Y = 0
trigger1 = Time = 0
anim = 10053
ID = 10053
pos = 0,0
scale = 0.5, 0.5
postype = p1
removetime = -2
sprpriority = 0
ownpal = 1
persistent = 0

[State 10040, Dash Dust 1]
type = Explod
triggerall = Root,StateNo = 100
triggerall = NumExplod(10100) = 0
trigger1 = Time = 0
anim = 10100
ID = 10100
pos = -20,0
scale = 0.7,0.7
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, Dash Dust 2]
type = Explod
triggerall = Root,StateNo = 101
triggerall = NumExplod(10101) = 0
trigger1 = Time = 0
anim = 10100
ID = 10100
pos = 0,0
scale = 0.7,0.7
postype = p1
removetime = -2
sprpriority = 3
ownpal = 1
persistent = 0

[State 10040, DestroySelf]
type = DestroySelf
trigger1 = Time = 1

;---------------------------------------------------------------------------
; Burst Mode 
[StateDef 10700]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 9000
poweradd = 0
sprpriority = 4
movehitpersist = 1

[State 10700, VarSet]
type = VarSet
trigger1 = !Time
var(1) = Power

[State 10700, PowerAdd]
type = PowerAdd
triggerall = Root,var(59) = 1
trigger1 = Root,StateNo != 700
value = -5
ignorehitpause = 1
persistent = 1

[State 10700, PowerSet]
type = PowerSet
triggerall = Root,var(59) = 1
trigger1 = Power > var(1) + (-5*Time) 
value = var(1) + (-5*Time) 
ignorehitpause = 1
persistent = 1

[State 10700, PowerSet]
type = PowerSet
trigger1 = Root, Var(59) = 1
trigger1 = Root, StateNo = [3015,3021]
trigger2 = Root,var(59) = 2
value = 0
ignorehitpause = 1
persistent = 1

[State 10700, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
pos = 0,0

[State 10700, VarSet]
type = VarSet
triggerall = var(0) = 0
trigger1 = Root, Var(59) = 2
var(0) = 1

[State 10700, VarAdd]
type = VarAdd
triggerall = var(0) < 601
trigger1 = Root, Var(59) = 2
var(0) = 1

[State 10700, ParentVarSet]
type = ParentVarSet
triggerall = Var(0) = 600
trigger1 = Root, Var(59) = 2
var(59) = 0

[State 10700, ParentVarSet]
type = ParentVarSet
trigger1 = 1
var(58) = var(0)

[State 10700, DestroySelf]
type = DestroySelf
triggerall = Var(0) = 600
trigger1 = Root, Var(59) = 0

;---------------------------------------------------------------------------
; Intro 1
[StateDef 10191]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 10191
poweradd = 0
sprpriority = 4
movehitpersist = 1

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

[State 10191, VarAdd]
type = VarAdd
triggerall = var(0) < 256
trigger1 = Time > 10
var(0) = 16

[State 10191, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256 - var(0), var(0) 

[State 10191, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0


;---------------------------------------------------------------------------
; God Speed Dash Helper 
[StateDef 10230]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9000
sprpriority = 4
velset = 0,0

[State -2, Debug]
type = DisplayToClipboard
trigger1 = 1
text = "var(0) = %d, MoveHit = %d"
params = var(0), var(1)

[State 10230, VarSet]
type = VarSet
triggerall = Root, Var(25) > 0
trigger1 = Root, StateNo < 200
var(0) = 1

[State 10230, VarAdd]
type = VarAdd
triggerall = var(0) = 1
triggerall = P2MoveType != H
trigger1 = var(1) < 75
var(1) = 1

[State 10230, ParentVarSet]
type = ParentVarSet
trigger1 = var(1) = 75
var(25) = 0

[State 10230, Explod]
type = Explod
triggerall = Root,TeamSide = 1
trigger1 = var(1) = 75
anim = 10230
ID = 10230
pos = 10,210
postype = left 
facing = 1
vfacing = 1
bindtime = -1
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.25,0.25
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause = 1

[State 10230, Explod]
type = Explod
triggerall = Root, TeamSide = 2
trigger1 = var(1) = 75
anim = 10231
ID = 10231
pos = 250,210
postype = left
facing = 1
vfacing = 1
bindtime = 1
random = 0,0
removetime = -2
pausemovetime = 999
scale = 0.25,0.25
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 1
ignorehitpause = 1

[State 10230, VarRangeSet]
type = VarRangeSet
trigger1 = var(1) = 75
first = 0
last = 1
value = 0

;---------------------------------------------------------------------------
; Super FX
[StateDef 30000]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 9000;IfElse(IsHelper(30000), 30000, IfElse(IsHelper(30001), 30001, 30002))
poweradd = IfElse(IsHelper(30000), -1000, IfElse(IsHelper(30001), -2000, -3000))
sprpriority = IfElse(!IsHelper(30002), 5, 1)

[State 30000, Helper]
type = Helper
trigger1 = !Time && Root, Facing = 1
name = "Portrait"
ID = 30005 
stateno = 30005
pos = -150,-140
postype = left    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime = 999
size.xscale = 0.5
size.yscale = 0.5

[State 30000, Helper]
type = Helper
trigger1 = !Time && Root, Facing = -1
name = "Portrait"
ID = 30006 
stateno = 30005
pos = 150,-140
postype = right    ;p2,front,back,left,right
facing = -1
keyctrl = 0
ownpal = 1
pausemovetime = 999
size.xscale = 0.5
size.yscale = 0.5

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

[State 30000, ParentVarSet]
type = ParentVarSet
trigger1 = 1
var(17) = 0

[State 30000, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 32
flag = globalnoshadow
flag2 = nobardisplay
flag3 = nofg

[State 30000, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S30000,0
volumescale = 100

[State 30000, VarAdd]
type = VarAdd
trigger1 = Time < 8
var(0) = -32

[State 30000, VarAdd]
type = VarAdd
triggerall = Var(0) < 256
trigger1 = IfElse(!IsHelper(30001), Time > 32, Time > IfElse((Root, StateNo = [3011,3012]), 125, 150))
trigger2 = Root, MoveType = H
var(0) = 16

[State 30000, BGPalFX]
type = BGPalFX
trigger1 = 1
time = 1
add = 0,0,0
mul = var(0), var(0), var(0) 
sinadd = 0,0,0,10
color = 256
invertall = 0
persistent = 1

[State 30000, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 32
flag = noFG
flag2 = nobardisplay

[State 30000, end]
type = DestroySelf
trigger1 = IsHelper(30000) && Time > 32 && var(0) = 256
trigger2 = IsHelper(30001) && Time > IfElse((Root, StateNo = [3011,3012]), 125, 150) && var(0) = 256
trigger3 = IsHelper(30002) && Time > 32 && var(0) = 256
;---------------------------------------------------------------------------
; Super Portrait
[StateDef 30005]
type = S
movetype = I
physics = N
velset = 2,0
ctrl = 0
anim = 30005
poweradd = 0
sprpriority = 1

[State 30005, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 30005, VarAdd]
type = VarAdd
trigger1 = Time > 24
trigger1 = var(0) < 256
var(0) = 16

[State 30005, VarSet]
type = VarSet
trigger1 = !Time
fvar(0) = 0.1

[State 30005, VarAdd]
type = VarAdd
trigger1 = Time < 8
trigger1 = fvar(0) < 1.0
trigger2 = Time > 24
trigger2 = fvar(0) < 2.0
fvar(0) = 0.1

[State 30005, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-var(0), var(0)

[State 30005, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = fvar(0), fvar(0)

[State 30005, end]
type = DestroySelf
trigger1 = Time = 48

;---------------------------------------------------------------------------
; Blackout
[StateDef 33020]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 9000
poweradd = 0
sprpriority = 1

[State 33020, AssertSpecial]
type = AssertSpecial
trigger1 = Root, var(56)
flag = nomusic 

[State 33020, PlaySnd]
type = PlaySnd
trigger1 = Root, var(56)
value = S30000, IfElse(Root,PalNo != 10, 1, random%2+2)
volumescale = 100
channel = 5
freqmul = 1.0
persistent = 0 

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

[State 33020, VarAdd]
type = VarAdd
triggerall = Time < 32
trigger1 = var(0) > 0
var(0) = -8

[State 33020, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nofg
flag2 = nobardisplay
flag3 = globalnoshadow

[State 33020, BGPalFX]
type = BGPalFX
trigger1 = 1
time = 1
add = 0,0,0
mul = var(0), var(0), var(0)

[State 33020, VarAdd]
type = VarAdd
triggerall = var(0) < 256
trigger1 = Time > 180
trigger2 = Root, MoveType = H
var(0) = 8

[State 33020, StopSnd]
type = StopSnd
triggerall = Time = 210
trigger1 = RoundState = 2 
channel = 5

[State 33020, end]
type = DestroySelf
trigger1 = Time > 180 && var(0) = 256
